Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -ruN a/arch/arm/configs/riogrande_kumquat_defconfig b/arch/arm/configs/riogrande_kumquat_defconfig
- --- a/arch/arm/configs/riogrande_kumquat_defconfig 2012-10-27 17:12:40.107556197 +0900
- +++ b/arch/arm/configs/riogrande_kumquat_defconfig 2012-11-07 19:01:47.000000000 +0900
- @@ -1,6 +1,5 @@
- CONFIG_EXPERIMENTAL=y
- # CONFIG_LOCALVERSION_AUTO is not set
- -# CONFIG_SWAP is not set
- CONFIG_SYSVIPC=y
- CONFIG_BSD_PROCESS_ACCT=y
- CONFIG_TASKSTATS=y
- @@ -28,7 +27,6 @@
- CONFIG_MODVERSIONS=y
- CONFIG_MODULE_SRCVERSION_ALL=y
- # CONFIG_BLK_DEV_BSG is not set
- -CONFIG_DEFAULT_DEADLINE=y
- CONFIG_ARCH_U8500=y
- CONFIG_UX500_SOC_DB8500=y
- CONFIG_MACH_U8500_KUMQUAT=y
- @@ -42,6 +40,7 @@
- CONFIG_UX500_SUSPEND_MEM=y
- CONFIG_UX500_SUSPEND_DBG=y
- CONFIG_UX500_SUSPEND_DBG_WAKE_ON_UART=y
- +CONFIG_SONY_SSM=y
- CONFIG_NO_HZ=y
- CONFIG_HIGH_RES_TIMERS=y
- CONFIG_SMP=y
- @@ -351,6 +350,7 @@
- CONFIG_ANDROID_RAM_CONSOLE=y
- CONFIG_ANDROID_TIMED_GPIO=y
- CONFIG_ANDROID_LOW_MEMORY_KILLER=y
- +CONFIG_ZRAM=y
- CONFIG_CG2900=y
- CONFIG_CG2900_CHIP=y
- CONFIG_STLC2690_CHIP=y
- diff -ruN a/arch/arm/configs/riogrande_lotus_defconfig b/arch/arm/configs/riogrande_lotus_defconfig
- --- a/arch/arm/configs/riogrande_lotus_defconfig 2012-10-27 17:12:40.075555580 +0900
- +++ b/arch/arm/configs/riogrande_lotus_defconfig 2012-11-07 19:01:47.000000000 +0900
- @@ -1,6 +1,5 @@
- CONFIG_EXPERIMENTAL=y
- # CONFIG_LOCALVERSION_AUTO is not set
- -# CONFIG_SWAP is not set
- CONFIG_SYSVIPC=y
- CONFIG_BSD_PROCESS_ACCT=y
- CONFIG_TASKSTATS=y
- @@ -28,7 +27,6 @@
- CONFIG_MODVERSIONS=y
- CONFIG_MODULE_SRCVERSION_ALL=y
- # CONFIG_BLK_DEV_BSG is not set
- -CONFIG_DEFAULT_DEADLINE=y
- CONFIG_ARCH_U8500=y
- CONFIG_UX500_SOC_DB8500=y
- CONFIG_U8500_SD_MMC_CARD_SUPPORT=y
- @@ -43,6 +41,7 @@
- CONFIG_UX500_SUSPEND_MEM=y
- CONFIG_UX500_SUSPEND_DBG=y
- CONFIG_UX500_SUSPEND_DBG_WAKE_ON_UART=y
- +CONFIG_SONY_SSM=y
- CONFIG_NO_HZ=y
- CONFIG_HIGH_RES_TIMERS=y
- CONFIG_SMP=y
- @@ -353,6 +352,7 @@
- CONFIG_ANDROID_RAM_CONSOLE=y
- CONFIG_ANDROID_TIMED_GPIO=y
- CONFIG_ANDROID_LOW_MEMORY_KILLER=y
- +CONFIG_ZRAM=y
- CONFIG_CG2900=y
- CONFIG_CG2900_CHIP=y
- CONFIG_STLC2690_CHIP=y
- diff -ruN a/arch/arm/configs/riogrande_nypon_defconfig b/arch/arm/configs/riogrande_nypon_defconfig
- --- a/arch/arm/configs/riogrande_nypon_defconfig 2012-10-27 17:12:40.095555964 +0900
- +++ b/arch/arm/configs/riogrande_nypon_defconfig 2012-10-24 23:38:08.000000000 +0900
- @@ -28,7 +28,6 @@
- CONFIG_MODVERSIONS=y
- CONFIG_MODULE_SRCVERSION_ALL=y
- # CONFIG_BLK_DEV_BSG is not set
- -CONFIG_DEFAULT_DEADLINE=y
- CONFIG_ARCH_U8500=y
- CONFIG_UX500_SOC_DB8500=y
- CONFIG_MACH_U8500_NYPON=y
- diff -ruN a/arch/arm/configs/riogrande_pdp_defconfig b/arch/arm/configs/riogrande_pdp_defconfig
- --- a/arch/arm/configs/riogrande_pdp_defconfig 2012-10-27 17:12:40.079555656 +0900
- +++ b/arch/arm/configs/riogrande_pdp_defconfig 2012-10-24 23:38:08.000000000 +0900
- @@ -28,7 +28,6 @@
- CONFIG_MODVERSIONS=y
- CONFIG_MODULE_SRCVERSION_ALL=y
- # CONFIG_BLK_DEV_BSG is not set
- -CONFIG_DEFAULT_DEADLINE=y
- CONFIG_ARCH_U8500=y
- CONFIG_UX500_SOC_DB8500=y
- CONFIG_U8500_SD_MMC_CARD_SUPPORT=y
- diff -ruN a/arch/arm/configs/riogrande_pdp_r2_defconfig b/arch/arm/configs/riogrande_pdp_r2_defconfig
- --- a/arch/arm/configs/riogrande_pdp_r2_defconfig 2012-10-27 17:12:40.087555813 +0900
- +++ b/arch/arm/configs/riogrande_pdp_r2_defconfig 2012-10-24 23:38:08.000000000 +0900
- @@ -28,7 +28,6 @@
- CONFIG_MODVERSIONS=y
- CONFIG_MODULE_SRCVERSION_ALL=y
- # CONFIG_BLK_DEV_BSG is not set
- -CONFIG_DEFAULT_DEADLINE=y
- CONFIG_ARCH_U8500=y
- CONFIG_UX500_SOC_DB8500=y
- CONFIG_U8500_SD_MMC_CARD_SUPPORT=y
- diff -ruN a/arch/arm/configs/riogrande_pepper_defconfig b/arch/arm/configs/riogrande_pepper_defconfig
- --- a/arch/arm/configs/riogrande_pepper_defconfig 2012-10-27 17:12:40.103556118 +0900
- +++ b/arch/arm/configs/riogrande_pepper_defconfig 2012-11-07 19:01:47.000000000 +0900
- @@ -1,6 +1,5 @@
- CONFIG_EXPERIMENTAL=y
- # CONFIG_LOCALVERSION_AUTO is not set
- -# CONFIG_SWAP is not set
- CONFIG_SYSVIPC=y
- CONFIG_BSD_PROCESS_ACCT=y
- CONFIG_TASKSTATS=y
- @@ -28,7 +27,6 @@
- CONFIG_MODVERSIONS=y
- CONFIG_MODULE_SRCVERSION_ALL=y
- # CONFIG_BLK_DEV_BSG is not set
- -CONFIG_DEFAULT_DEADLINE=y
- CONFIG_ARCH_U8500=y
- CONFIG_UX500_SOC_DB8500=y
- CONFIG_U8500_SD_MMC_CARD_SUPPORT=y
- @@ -43,6 +41,7 @@
- CONFIG_UX500_SUSPEND_MEM=y
- CONFIG_UX500_SUSPEND_DBG=y
- CONFIG_UX500_SUSPEND_DBG_WAKE_ON_UART=y
- +CONFIG_SONY_SSM=y
- CONFIG_NO_HZ=y
- CONFIG_HIGH_RES_TIMERS=y
- CONFIG_SMP=y
- @@ -353,6 +352,7 @@
- CONFIG_ANDROID_RAM_CONSOLE=y
- CONFIG_ANDROID_TIMED_GPIO=y
- CONFIG_ANDROID_LOW_MEMORY_KILLER=y
- +CONFIG_ZRAM=y
- CONFIG_CG2900=y
- CONFIG_CG2900_CHIP=y
- CONFIG_STLC2690_CHIP=y
- diff -ruN a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
- --- a/arch/arm/mach-ux500/Makefile 2012-10-27 17:12:41.915590819 +0900
- +++ b/arch/arm/mach-ux500/Makefile 2012-10-24 23:38:08.000000000 +0900
- @@ -5,7 +5,8 @@
- obj-y := clock.o cpu.o devices.o dcache.o \
- devices-common.o id.o pins.o \
- usb.o reboot_reasons.o timer.o \
- - uart-db8500.o clock-debug.o
- + uart-db8500.o clock-debug.o \
- + irq-trigger.o
- obj-y += pm/ test/
- diff -ruN a/arch/arm/mach-ux500/board-rio-grande.c b/arch/arm/mach-ux500/board-rio-grande.c
- --- a/arch/arm/mach-ux500/board-rio-grande.c 2012-10-27 17:12:41.791588443 +0900
- +++ b/arch/arm/mach-ux500/board-rio-grande.c 2012-10-24 23:38:08.000000000 +0900
- @@ -1011,8 +1011,8 @@
- .als_name = "tsl2772_als",
- .raw_settings = NULL,
- .parameters = {
- - .prox_th_min = 500,
- - .prox_th_max = 520,
- + .prox_th_min = 255,
- + .prox_th_max = 480,
- .als_gate = 10,
- },
- .als_can_wake = false,
- diff -ruN a/arch/arm/mach-ux500/clock-db8500.c b/arch/arm/mach-ux500/clock-db8500.c
- --- a/arch/arm/mach-ux500/clock-db8500.c 2012-10-27 17:12:41.959591657 +0900
- +++ b/arch/arm/mach-ux500/clock-db8500.c 2012-10-24 23:38:08.000000000 +0900
- @@ -69,18 +69,8 @@
- static int sysclk_enable(struct clk *clk)
- {
- - static bool swat_enable;
- int r;
- - if (!swat_enable) {
- - r = ab8500_sysctrl_set(AB8500_SWATCTRL,
- - AB8500_SWATCTRL_SWATENABLE);
- - if (r)
- - return r;
- -
- - swat_enable = true;
- - }
- -
- r = request_sysclk(true);
- if (r)
- return r;
- @@ -926,6 +916,10 @@
- goto err_sysclk;
- }
- }
- + /* Disable SWAT */
- + if (ab8500_sysctrl_clear(AB8500_SWATCTRL, AB8500_SWATCTRL_SWATENABLE))
- + goto err_swat;
- +
- goto unlock_and_exit;
- err_sysclk:
- diff -ruN a/arch/arm/mach-ux500/hwmem-int.c b/arch/arm/mach-ux500/hwmem-int.c
- --- a/arch/arm/mach-ux500/hwmem-int.c 2012-10-27 17:12:41.763587914 +0900
- +++ b/arch/arm/mach-ux500/hwmem-int.c 2012-10-24 23:38:08.000000000 +0900
- @@ -23,6 +23,13 @@
- void *cona_get_alloc_kaddr(void *instance, void *alloc);
- size_t cona_get_alloc_size(void *alloc);
- +/* SCATT API */
- +void *scatt_create(const char *name);
- +void *scatt_alloc(void *instance, size_t size);
- +void scatt_free(void *instance, void *alloc);
- +size_t scatt_get_alloc_size(void *alloc);
- +struct page **scatt_get_alloc_sglist(void *alloc);
- +
- struct hwmem_mem_type_struct *hwmem_mem_types;
- unsigned int hwmem_num_mem_types;
- @@ -89,22 +96,28 @@
- return -ENOMEM;
- hwmem_mem_types[0].id = HWMEM_MEM_SCATTERED_SYS;
- - hwmem_mem_types[0].allocator_api.alloc = cona_alloc;
- - hwmem_mem_types[0].allocator_api.free = cona_free;
- - hwmem_mem_types[0].allocator_api.get_alloc_paddr =
- - cona_get_alloc_paddr;
- - hwmem_mem_types[0].allocator_api.get_alloc_kaddr =
- - cona_get_alloc_kaddr;
- - hwmem_mem_types[0].allocator_api.get_alloc_size = cona_get_alloc_size;
- - hwmem_mem_types[0].allocator_instance = cona_create("hwmem",
- - hwmem_paddr, hwmem_size);
- + hwmem_mem_types[0].allocator_api.alloc = scatt_alloc;
- + hwmem_mem_types[0].allocator_api.free = scatt_free;
- + hwmem_mem_types[0].allocator_api.get_alloc_size = scatt_get_alloc_size;
- + hwmem_mem_types[0].allocator_api.get_alloc_sglist = scatt_get_alloc_sglist;
- + hwmem_mem_types[0].allocator_instance = scatt_create("hwmem_scatt");
- if (IS_ERR(hwmem_mem_types[0].allocator_instance)) {
- ret = PTR_ERR(hwmem_mem_types[0].allocator_instance);
- goto hwmem_ima_init_failed;
- }
- - hwmem_mem_types[1] = hwmem_mem_types[0];
- hwmem_mem_types[1].id = HWMEM_MEM_CONTIGUOUS_SYS;
- + hwmem_mem_types[1].allocator_api.alloc = cona_alloc;
- + hwmem_mem_types[1].allocator_api.free = cona_free;
- + hwmem_mem_types[1].allocator_api.get_alloc_paddr = cona_get_alloc_paddr;
- + hwmem_mem_types[1].allocator_api.get_alloc_kaddr = cona_get_alloc_kaddr;
- + hwmem_mem_types[1].allocator_api.get_alloc_size = cona_get_alloc_size;
- + hwmem_mem_types[1].allocator_instance = cona_create("hwmem_cona",
- + hwmem_paddr, hwmem_size);
- + if (IS_ERR(hwmem_mem_types[1].allocator_instance)) {
- + ret = PTR_ERR(hwmem_mem_types[1].allocator_instance);
- + goto hwmem_ima_init_failed;
- + }
- hwmem_mem_types[2] = hwmem_mem_types[1];
- hwmem_mem_types[2].id = HWMEM_MEM_PROTECTED_SYS;
- diff -ruN a/arch/arm/mach-ux500/include/mach/irq-trigger.h b/arch/arm/mach-ux500/include/mach/irq-trigger.h
- --- a/arch/arm/mach-ux500/include/mach/irq-trigger.h 1970-01-01 09:00:00.000000000 +0900
- +++ b/arch/arm/mach-ux500/include/mach/irq-trigger.h 2012-10-24 23:38:08.000000000 +0900
- @@ -0,0 +1,28 @@
- +/* kernel/arch/arm/mach-ux500/include/mach/irq-trigger.h
- + *
- + * Copyright (C) 2012 Sony Mobile Communications AB.
- + *
- + * Author: Krzysztof Antonowicz <krzysztof.antonowicz@sonymobile.com>
- + *
- + * This program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License version 2, as
- + * published by the Free Software Foundation; either version 2
- + * of the License, or (at your option) any later version.
- + */
- +
- +#ifndef IRQ_TRIGGER_H
- +#define IRQ_TRIGGER_H
- +
- +/**
- + * irq_trigger_set_gic_spi_pending_interrupt(unsigned int int_id)
- + *
- + * @int_id: INTID for SPI (Shared Peripheral Interrupt).
- + * Minimum INTID for SPI is 32 and maximum 255.
- + * The Interrupt Distributor ignores writes to unused INTIDs.
- + *
- + * Set an interrupt to the pending or active-and-pending state.
- + * Returns 0 if write succeeded.
- + */
- +int irq_trigger_set_gic_spi_pending_interrupt(unsigned int int_id);
- +
- +#endif
- diff -ruN a/arch/arm/mach-ux500/irq-trigger.c b/arch/arm/mach-ux500/irq-trigger.c
- --- a/arch/arm/mach-ux500/irq-trigger.c 1970-01-01 09:00:00.000000000 +0900
- +++ b/arch/arm/mach-ux500/irq-trigger.c 2012-10-24 23:38:08.000000000 +0900
- @@ -0,0 +1,33 @@
- +/* kernel/arch/arm/mach-ux500/irq-trigger.c
- + *
- + * Copyright (C) 2012 Sony Mobile Communications AB.
- + *
- + * Author: Krzysztof Antonowicz <krzysztof.antonowicz@sonymobile.com>
- + *
- + * This program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License version 2, as
- + * published by the Free Software Foundation; either version 2
- + * of the License, or (at your option) any later version.
- + */
- +
- +#include <linux/io.h>
- +#include <linux/errno.h>
- +#include <mach/hardware.h>
- +#include <asm/hardware/gic.h>
- +
- +#define MIN_SPI_INTID (32)
- +#define MAX_SPI_INTID (255)
- +
- +int irq_trigger_set_gic_spi_pending_interrupt(unsigned int int_id)
- +{
- +
- + if (int_id < MIN_SPI_INTID || int_id > MAX_SPI_INTID)
- + return -EINVAL;
- +
- + writel_relaxed(1 << (int_id % 32),
- + __io_address(U8500_GIC_DIST_BASE) +
- + GIC_DIST_PENDING_SET + 4 * (int_id / 32));
- +
- + return 0;
- +}
- +
- diff -ruN a/drivers/gpu/mali/mali400ko/driver/src/devicedrv/mali/platform/ux500/ump_kernel_api_hwmem.c b/drivers/gpu/mali/mali400ko/driver/src/devicedrv/mali/platform/ux500/ump_kernel_api_hwmem.c
- --- a/drivers/gpu/mali/mali400ko/driver/src/devicedrv/mali/platform/ux500/ump_kernel_api_hwmem.c 2012-10-27 17:12:10.506969845 +0900
- +++ b/drivers/gpu/mali/mali400ko/driver/src/devicedrv/mali/platform/ux500/ump_kernel_api_hwmem.c 2012-10-24 23:38:10.000000000 +0900
- @@ -10,6 +10,7 @@
- #include <linux/hwmem.h>
- #include <linux/err.h>
- +#include <linux/slab.h>
- /* The UMP kernel API for hwmem has been mapped so that
- @@ -63,7 +64,14 @@
- unsigned long ump_dd_phys_block_count_get(ump_dd_handle memh)
- {
- - return 1;
- + size_t hwmem_mem_chunk_length;
- + int hwmem_result = 0;
- + struct hwmem_alloc *alloc = (struct hwmem_alloc *)memh;
- +
- + /* Call hwmem_pin with mem_chunks set to NULL to get hwmem_mem_chunk_length */
- + hwmem_result = hwmem_pin(alloc, NULL, &hwmem_mem_chunk_length);
- +
- + return hwmem_mem_chunk_length;
- }
- @@ -72,34 +80,40 @@
- ump_dd_physical_block * blocks,
- unsigned long num_blocks)
- {
- - struct hwmem_mem_chunk hwmem_mem_chunk;
- - size_t hwmem_mem_chunk_length = 1;
- + struct hwmem_mem_chunk *hwmem_mem_chunks;
- + size_t hwmem_mem_chunk_length = num_blocks;
- int hwmem_result;
- + int i;
- +
- struct hwmem_alloc *alloc = (struct hwmem_alloc *)memh;
- + hwmem_mem_chunks = (struct hwmem_mem_chunk *)kmalloc(sizeof(struct hwmem_mem_chunk)*num_blocks, GFP_KERNEL);
- +
- if (unlikely(blocks == NULL)) {
- MALI_DEBUG_PRINT(1, ("%s: blocks == NULL\n",__func__));
- return UMP_DD_INVALID;
- }
- - if (unlikely(1 != num_blocks)) {
- - MALI_DEBUG_PRINT(1, ("%s: num_blocks == %d (!= 1)\n",__func__, num_blocks));
- - return UMP_DD_INVALID;
- - }
- -
- - MALI_DEBUG_PRINT(5, ("Returning physical block information. Alloc: 0x%x\n", memh));
- + MALI_DEBUG_PRINT(5, ("Returning physical block information. Alloc: 0x%x num_blocks=%d\n", memh, num_blocks));
- /* It might not look natural to pin here, but it matches the usage by the mali kernel module */
- - hwmem_result = hwmem_pin(alloc, &hwmem_mem_chunk, &hwmem_mem_chunk_length);
- + hwmem_result = hwmem_pin(alloc, hwmem_mem_chunks, &hwmem_mem_chunk_length);
- if (unlikely(hwmem_result < 0)) {
- MALI_DEBUG_PRINT(1, ("%s: Pin failed. Alloc: 0x%x\n",__func__, memh));
- + kfree(hwmem_mem_chunks);
- return UMP_DD_INVALID;
- }
- - blocks[0].addr = hwmem_mem_chunk.paddr;
- - blocks[0].size = hwmem_mem_chunk.size;
- + /* Scattered: Currently every page is one mem chunk. It's probably more
- + efficient to create bigger mem chunks if possible when allocated pages
- + are next to each other in memory */
- + for(i = 0; i < hwmem_mem_chunk_length; i++) {
- + blocks[i].addr = hwmem_mem_chunks[i].paddr;
- + blocks[i].size = hwmem_mem_chunks[i].size;
- + }
- + kfree(hwmem_mem_chunks);
- hwmem_set_domain(alloc, HWMEM_ACCESS_READ | HWMEM_ACCESS_WRITE,
- HWMEM_DOMAIN_SYNC, NULL);
- diff -ruN a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
- --- a/drivers/mfd/ab8500-core.c 2012-10-27 17:12:10.066964721 +0900
- +++ b/drivers/mfd/ab8500-core.c 2012-10-24 23:38:12.000000000 +0900
- @@ -22,7 +22,7 @@
- #include <linux/mfd/abx500.h>
- #include <linux/mfd/ab8500.h>
- #include <linux/regulator/ab8500.h>
- -
- +#include <mach/irq-trigger.h>
- /*
- * Interrupt register offsets
- * Bank : 0x0E
- @@ -298,11 +298,14 @@
- {
- struct ab8500 *ab8500 = irq_data_get_irq_chip_data(data);
- int i;
- + bool trigger_irq = false;
- + int ret_val;
- for (i = 0; i < ab8500->mask_size; i++) {
- u8 old = ab8500->oldmask[i];
- u8 new = ab8500->mask[i];
- int reg;
- + u8 value;
- if (new == old)
- continue;
- @@ -315,11 +318,38 @@
- is_ab8500_1p1_or_earlier(ab8500))
- continue;
- + mutex_lock(&ab8500->latch_lock);
- +
- + /*
- + * Clear old latched interrupts, but remember interrupts which
- + * are still valid to handle them when interrupt will be
- + * triggered.
- + */
- + get_register_interruptible(ab8500, AB8500_INTERRUPT,
- + AB8500_IT_LATCH1_REG + ab8500_irq_regoffset[i], &value);
- +
- + ab8500->latch[i] = (ab8500->latch[i] | value) & ~old;
- +
- + if (ab8500->latch[i] && !trigger_irq)
- + trigger_irq = true;
- +
- + mutex_unlock(&ab8500->latch_lock);
- +
- ab8500->oldmask[i] = new;
- reg = AB8500_IT_MASK1_REG + ab8500->irq_reg_offset[i];
- set_register_interruptible(ab8500, AB8500_INTERRUPT, reg, new);
- }
- +
- + if (unlikely(trigger_irq)) {
- + ret_val = irq_trigger_set_gic_spi_pending_interrupt(
- + IRQ_DB8500_AB8500);
- +
- + if (ret_val)
- + dev_err(ab8500->dev, "cannot re-trigger %d interrupt!\n",
- + IRQ_DB8500_AB8500);
- + }
- +
- atomic_dec(&ab8500->transfer_ongoing);
- mutex_unlock(&ab8500->irq_lock);
- }
- @@ -436,9 +466,25 @@
- if (regoffset == 11 && is_ab8500_1p1_or_earlier(ab8500))
- continue;
- + mutex_lock(&ab8500->latch_lock);
- +
- status = get_register_interruptible(ab8500, AB8500_INTERRUPT,
- AB8500_IT_LATCH1_REG + regoffset, &value);
- - if (status < 0 || value == 0)
- +
- + if (status < 0) {
- + mutex_unlock(&ab8500->latch_lock);
- + continue;
- + }
- +
- + /*
- + * OR with cached latch register value
- + */
- + value |= ab8500->latch[i];
- + ab8500->latch[i] = 0;
- +
- + mutex_unlock(&ab8500->latch_lock);
- +
- + if (value == 0)
- continue;
- do {
- @@ -1172,6 +1218,7 @@
- ab8500->irq_base = plat->irq_base;
- mutex_init(&ab8500->lock);
- + mutex_init(&ab8500->latch_lock);
- mutex_init(&ab8500->irq_lock);
- atomic_set(&ab8500->transfer_ongoing, 0);
- @@ -1214,6 +1261,12 @@
- ret = -ENOMEM;
- goto out_freemask;
- }
- + ab8500->latch = kzalloc(ab8500->mask_size, GFP_KERNEL);
- + if (!ab8500->latch) {
- + ret = -ENOMEM;
- + goto out_freeoldmask;
- + }
- +
- /*
- * ab8500 has switched off due to (SWITCH_OFF_STATUS):
- * 0x01 Swoff bit programming
- @@ -1267,7 +1320,7 @@
- ret = abx500_register_ops(ab8500->dev, &ab8500_ops);
- if (ret)
- - goto out_freeoldmask;
- + goto out_freelatch;
- for (i = 0; i < ab8500->mask_size; i++)
- ab8500->mask[i] = ab8500->oldmask[i] = 0xff;
- @@ -1275,7 +1328,7 @@
- if (ab8500->irq_base) {
- ret = ab8500_irq_init(ab8500);
- if (ret)
- - goto out_freeoldmask;
- + goto out_freelatch;
- /* Activate this feature only in ab9540 */
- /* till tests are done on ab8500 1p2 or later*/
- @@ -1343,6 +1396,8 @@
- out_removeirq:
- if (ab8500->irq_base)
- ab8500_irq_remove(ab8500);
- +out_freelatch:
- + kfree(ab8500->latch);
- out_freeoldmask:
- kfree(ab8500->oldmask);
- out_freemask:
- @@ -1364,6 +1419,7 @@
- }
- kfree(ab8500->oldmask);
- kfree(ab8500->mask);
- + kfree(ab8500->latch);
- return 0;
- }
- diff -ruN a/drivers/misc/clonedev/clonedev.c b/drivers/misc/clonedev/clonedev.c
- --- a/drivers/misc/clonedev/clonedev.c 2012-10-27 17:12:22.971216991 +0900
- +++ b/drivers/misc/clonedev/clonedev.c 2012-10-24 23:38:12.000000000 +0900
- @@ -48,6 +48,7 @@
- struct compdev *src_compdev;
- struct compdev *dst_compdev;
- bool overlay_case;
- + struct compdev_size src_size;
- struct compdev_size dst_size;
- struct compdev_rect crop_rect;
- struct compdev_scene_info s_info;
- @@ -140,8 +141,7 @@
- return req_id;
- }
- -static void clonedev_best_fit(struct compdev_rect *src_rect,
- - struct compdev_rect *crop_rect,
- +static void clonedev_best_fit(struct compdev_rect *crop_rect,
- struct compdev_rect *dst_rect,
- enum compdev_transform transform)
- {
- @@ -201,6 +201,45 @@
- dst_rect->y += (crop_rect->height - dst_h) >> 1;
- }
- +static void clonedev_rescale_destrect(struct compdev_rect *boundary,
- + struct compdev_size *src_size,
- + struct compdev_rect *dst_rect,
- + enum compdev_transform transform)
- +{
- + uint32_t q, r, src_width;
- + uint32_t x, y, height, width;
- +
- + if (transform == COMPDEV_TRANSFORM_ROT_0) {
- + x = dst_rect->x;
- + y = dst_rect->y;
- + width = dst_rect->width;
- + height = dst_rect->height;
- + src_width = src_size->width;
- + } else if (transform == COMPDEV_TRANSFORM_ROT_90_CW) {
- + x = src_size->height - dst_rect->y - dst_rect->height;
- + y = dst_rect->x;
- + width = dst_rect->height;
- + height = dst_rect->width;
- + src_width = src_size->height;
- + } else if (transform == COMPDEV_TRANSFORM_ROT_90_CCW) {
- + x = dst_rect->y;
- + y = src_size->width - dst_rect->x - dst_rect->width;
- + width = dst_rect->height;
- + height = dst_rect->width;
- + src_width = src_size->height;
- + }
- +
- + q = (boundary->width << 6) / src_width;
- + r = (boundary->width << 6) % src_width;
- +
- + dst_rect->x = (((boundary->x << 6) + ((q * x + r * x / src_width) +
- + (0x1 << 5))) >> 6) & ~0x1;
- + dst_rect->y = ((q * y + r * y / src_width) >> 6) + boundary->y;
- + dst_rect->width = (((q * width + r * width / src_width) +
- + (0x1 << 5)) >> 6) & ~0x1;
- + dst_rect->height = (q * height + r * height / src_width) >> 6;
- +}
- +
- static int clonedev_set_mode_locked(struct clonedev *cd,
- enum clonedev_mode mode)
- {
- @@ -247,9 +286,18 @@
- static void set_transform_and_dest_rect(struct clonedev *cd,
- struct compdev_img *img)
- {
- - /* Adjust destination rect */
- - clonedev_best_fit(&img->src_rect,
- - &cd->crop_rect,
- + struct compdev_rect temp_rect = {0};
- + temp_rect.width = cd->src_size.width;
- + temp_rect.height = cd->src_size.height;
- +
- + /* First adjust src rect to crop_rect */
- + clonedev_best_fit(&cd->crop_rect,
- + &temp_rect,
- + img->transform);
- +
- + /* Now use temp_rect as the boundary */
- + clonedev_rescale_destrect(&temp_rect,
- + &cd->src_size,
- &img->dst_rect,
- img->transform);
- @@ -290,12 +338,83 @@
- case COMPDEV_FMT_YVU420_SP:
- case COMPDEV_FMT_YUV420_P:
- case COMPDEV_FMT_YVU420_P:
- + case COMPDEV_FMT_YV12:
- return COMPDEV_FMT_RGB888;
- default:
- return COMPDEV_FMT_RGBA8888;
- }
- }
- +static u32 get_b2r2_color_black(enum b2r2_blt_fmt fmt)
- +{
- + switch (fmt) {
- + case B2R2_BLT_FMT_CB_Y_CR_Y:
- + return 0x80108010;
- + case B2R2_BLT_FMT_32_BIT_ARGB8888:
- + return 0xFF000000;
- + case B2R2_BLT_FMT_24_BIT_RGB888:
- + case B2R2_BLT_FMT_16_BIT_RGB565:
- + default:
- + return 0;
- + }
- +}
- +
- +
- +static inline void clear_rect(struct clonedev *cd,
- + struct b2r2_blt_req *bltreq, int x, int y,
- + int width, int height)
- +{
- + int req_id;
- +
- + bltreq->dst_rect.x = x;
- + bltreq->dst_rect.y = y;
- + bltreq->dst_rect.width = width;
- + bltreq->dst_rect.height = height;
- + if (width != 0 && height != 0) {
- + req_id = b2r2_blt_request(cd->blt_handle, bltreq);
- + if (req_id < 0)
- + dev_err(cd->dev, "%s: Err b2r2_blt_request, id %d",
- + __func__, req_id);
- + }
- +}
- +
- +static void clonedev_clear_background(struct clonedev *cd,
- + struct compdev_img *dst_img,
- + struct compdev_rect *img_rect)
- +{
- + /* Clear the dst_img outside of the rect specified by img_rect */
- + struct b2r2_blt_req *bltreq;
- +
- + bltreq = kzalloc(sizeof(*bltreq), GFP_KERNEL);
- + if (bltreq == NULL)
- + return;
- +
- + bltreq->size = sizeof(struct b2r2_blt_req);
- + bltreq->flags = B2R2_BLT_FLAG_ASYNCH | B2R2_BLT_FLAG_SOURCE_FILL_RAW;
- + bltreq->transform = B2R2_BLT_TRANSFORM_NONE;
- + bltreq->dst_img.buf.type = B2R2_BLT_PTR_HWMEM_BUF_NAME_OFFSET;
- + bltreq->dst_img.buf.hwmem_buf_name = dst_img->buf.hwmem_buf_name;
- + bltreq->dst_img.width = dst_img->width;
- + bltreq->dst_img.height = dst_img->height;
- + bltreq->dst_img.fmt = compdev_to_blt_format(dst_img->fmt);
- + bltreq->dst_img.pitch = dst_img->pitch;
- + bltreq->src_color = get_b2r2_color_black(bltreq->dst_img.fmt);
- +
- + clear_rect(cd, bltreq,
- + 0, 0, img_rect->x, dst_img->height);
- + clear_rect(cd, bltreq, img_rect->x, 0,
- + img_rect->width, img_rect->y);
- + clear_rect(cd, bltreq, img_rect->x + img_rect->width,
- + 0, dst_img->width - img_rect->width - img_rect->x,
- + dst_img->height);
- + clear_rect(cd, bltreq, img_rect->x,
- + img_rect->y + img_rect->height, img_rect->width,
- + dst_img->height - img_rect->y - img_rect->height);
- +
- + kfree(bltreq);
- +}
- +
- +
- static void clonedev_compose_locked(struct clonedev *cd)
- {
- struct compdev_img *img0;
- @@ -367,18 +486,31 @@
- dst_img->img.flags |= img0->flags;
- dst_img->img.transform = COMPDEV_TRANSFORM_ROT_0;
- +
- + /* Clear destination buf outside of img0 */
- + clonedev_clear_background(cd, &dst_img->img,
- + &img0->dst_rect);
- +
- /* Handle the blit jobs */
- if (img1 == NULL) {
- b2r2_req_id = clonedev_blt(cd, img0, &dst_img->img,
- false, false);
- } else {
- - clonedev_blt(cd, img0, &dst_img->img, false, false);
- - b2r2_req_id = clonedev_blt(cd, img1, &dst_img->img,
- + int ret;
- + b2r2_req_id = clonedev_blt(cd, img0, &dst_img->img,
- + false, false);
- + ret = clonedev_blt(cd, img1, &dst_img->img,
- true, false);
- + if (ret >= 0)
- + b2r2_req_id = ret;
- }
- - dst_img->img.dst_rect.x += cd->crop_rect.x;
- - dst_img->img.dst_rect.y += cd->crop_rect.y;
- + dst_img->img.dst_rect = cd->crop_rect;
- + dst_img->img.src_rect.x = 0;
- + dst_img->img.src_rect.y = 0;
- + dst_img->img.src_rect.width = cd->crop_rect.width;
- + dst_img->img.src_rect.height = cd->crop_rect.height;
- +
- compdev_post_single_buffer_asynch(cd->dst_compdev,
- &dst_img->img, cd->blt_handle, b2r2_req_id);
- @@ -638,6 +770,10 @@
- if (ret < 0)
- goto fail_register_misc;
- + ret = compdev_get_size(cd->src_compdev, &cd->src_size);
- + if (ret < 0)
- + goto fail_register_misc;
- +
- ret = compdev_get_size(cd->dst_compdev, &cd->dst_size);
- if (ret < 0)
- goto fail_register_misc;
- diff -ruN a/drivers/misc/compdev/compdev.c b/drivers/misc/compdev/compdev.c
- --- a/drivers/misc/compdev/compdev.c 2012-10-27 17:12:22.959216745 +0900
- +++ b/drivers/misc/compdev/compdev.c 2012-10-24 23:38:12.000000000 +0900
- @@ -1,5 +1,6 @@
- /*
- * Copyright (C) ST-Ericsson SA 2011
- + * Copyright (C) 2012 Sony Mobile Communications AB.
- *
- * Display overlay compositer device driver
- *
- @@ -10,6 +11,9 @@
- * for ST-Ericsson.
- *
- * License terms: GNU General Public License (GPL), version 2.
- + *
- + * NOTE: This file has been modified by Sony Mobile Communications AB.
- + * Modifications are licensed under the License.
- */
- #include <linux/kernel.h>
- @@ -321,7 +325,7 @@
- }
- rgn.size = rgn.end = buffer->size;
- - ret = hwmem_set_domain(buffer->alloc, HWMEM_ACCESS_READ,
- + ret = hwmem_set_domain(buffer->alloc, access,
- HWMEM_DOMAIN_SYNC, &rgn);
- if (ret)
- dev_warn(dss_ctx->dev,
- @@ -556,6 +560,7 @@
- if ((fb_img->flags & COMPDEV_PROTECTED_FLAG) &&
- (mcde_dss_secure_output(dss_ctx->ddev) == false)) {
- disable_overlay(dss_ctx->ovly[i]);
- + update_ovly[i] = true;
- } else {
- ret = compdev_setup_ovly(fb_img,
- &dss_ctx->ovly_buffer[i],
- @@ -577,6 +582,7 @@
- if ((ovly_img->flags & COMPDEV_PROTECTED_FLAG) &&
- (mcde_dss_secure_output(dss_ctx->ddev) == false)) {
- disable_overlay(dss_ctx->ovly[i]);
- + update_ovly[i] = true;
- } else {
- ret = compdev_setup_ovly(ovly_img,
- &dss_ctx->ovly_buffer[i],
- diff -ruN a/drivers/misc/compdev/compdev_util.c b/drivers/misc/compdev/compdev_util.c
- --- a/drivers/misc/compdev/compdev_util.c 2012-10-27 17:12:22.963216827 +0900
- +++ b/drivers/misc/compdev/compdev_util.c 2012-10-24 23:38:12.000000000 +0900
- @@ -50,6 +50,8 @@
- return B2R2_BLT_FMT_YUV420_PACKED_PLANAR;
- case COMPDEV_FMT_YVU420_P:
- return B2R2_BLT_FMT_YVU420_PACKED_PLANAR;
- + case COMPDEV_FMT_YV12:
- + return B2R2_BLT_FMT_YV12;
- default:
- return B2R2_BLT_FMT_UNUSED;
- }
- @@ -104,6 +106,7 @@
- case COMPDEV_FMT_YVU420_SP:
- case COMPDEV_FMT_YUV420_P:
- case COMPDEV_FMT_YVU420_P:
- + case COMPDEV_FMT_YV12:
- stride = width;
- break;
- }
- @@ -136,12 +139,59 @@
- case COMPDEV_FMT_YVU420_SP:
- case COMPDEV_FMT_YUV420_P:
- case COMPDEV_FMT_YVU420_P:
- + case COMPDEV_FMT_YV12:
- bpp = 12;
- break;
- }
- return bpp;
- }
- +static int get_chroma_pitch(u32 luma_pitch, enum compdev_fmt fmt)
- +{
- + int chroma_pitch;
- +
- + switch (fmt) {
- + case COMPDEV_FMT_YV12:
- + chroma_pitch = ALIGN((luma_pitch >> 1), 16);
- + case COMPDEV_FMT_YUV420_SP:
- + case COMPDEV_FMT_YVU420_SP:
- + chroma_pitch = luma_pitch;
- + case COMPDEV_FMT_YCBCR42XMBN:
- + case COMPDEV_FMT_YUV420_P:
- + case COMPDEV_FMT_YVU420_P:
- + chroma_pitch = luma_pitch >> 1;
- + default:
- + chroma_pitch = 0;
- + }
- +
- + return chroma_pitch;
- +}
- +
- +static int get_chroma_size(u32 luma_pitch, u32 luma_height,
- + enum compdev_fmt fmt)
- +{
- + int chroma_pitch = get_chroma_pitch(luma_pitch, fmt);
- +
- + if (chroma_pitch <= 0)
- + return 0;
- +
- + switch (fmt) {
- + case COMPDEV_FMT_YUV420_P:
- + case COMPDEV_FMT_YVU420_P:
- + case COMPDEV_FMT_YV12:
- + return chroma_pitch *
- + ((luma_height + 1) >> 1) << 1;
- + case COMPDEV_FMT_YUV420_SP:
- + case COMPDEV_FMT_YVU420_SP:
- + return chroma_pitch *
- + ((luma_height + 1) >> 1);
- + case COMPDEV_FMT_YCBCR42XMBN:
- + return chroma_pitch * (ALIGN(luma_height, 16) >> 1);
- + default:
- + return 0;
- + }
- +}
- +
- static int alloc_comp_internal_img(enum compdev_fmt fmt,
- u16 width, u16 height, bool protected,
- struct compdev_img_internal **img_pp)
- @@ -155,6 +205,7 @@
- stride = compdev_get_stride(width, fmt);
- size = stride * height;
- + size += get_chroma_size(stride, height, fmt);
- size = PAGE_ALIGN(size);
- if (protected)
- @@ -455,6 +506,7 @@
- case COMPDEV_FMT_YVU420_SP:
- case COMPDEV_FMT_YUV420_P:
- case COMPDEV_FMT_YVU420_P:
- + case COMPDEV_FMT_YV12:
- return COMPDEV_FMT_YUV422;
- default:
- return COMPDEV_FMT_RGBA8888;
- @@ -472,6 +524,7 @@
- case COMPDEV_FMT_YVU420_SP:
- case COMPDEV_FMT_YUV420_P:
- case COMPDEV_FMT_YVU420_P:
- + case COMPDEV_FMT_YV12:
- return COMPDEV_FMT_RGB888;
- default:
- return COMPDEV_FMT_RGBA8888;
- diff -ruN a/drivers/misc/hwmem/Makefile b/drivers/misc/hwmem/Makefile
- --- a/drivers/misc/hwmem/Makefile 2012-10-27 17:12:22.923216008 +0900
- +++ b/drivers/misc/hwmem/Makefile 2012-10-24 23:38:12.000000000 +0900
- @@ -1,3 +1,3 @@
- -hwmem-objs := hwmem-main.o hwmem-ioctl.o cache_handler.o contig_alloc.o
- +hwmem-objs := hwmem-main.o hwmem-ioctl.o cache_handler.o contig_alloc.o scatt_alloc.o
- obj-$(CONFIG_HWMEM) += hwmem.o
- diff -ruN a/drivers/misc/hwmem/cache_handler.c b/drivers/misc/hwmem/cache_handler.c
- --- a/drivers/misc/hwmem/cache_handler.c 2012-10-27 17:12:22.923216008 +0900
- +++ b/drivers/misc/hwmem/cache_handler.c 2012-10-24 23:38:12.000000000 +0900
- @@ -68,13 +68,15 @@
- /*
- * Exported functions
- */
- -
- -void cach_init_buf(struct cach_buf *buf, enum hwmem_alloc_flags cache_settings,
- - u32 size)
- +void cach_init_buf(struct cach_buf *buf,
- + enum hwmem_mem_type mem_type,
- + enum hwmem_alloc_flags cache_settings,
- + u32 size)
- {
- buf->vstart = NULL;
- buf->pstart = 0;
- buf->size = size;
- + buf->mem_type = mem_type;
- buf->cache_settings = cachi_get_cache_settings(cache_settings);
- }
- @@ -339,6 +341,9 @@
- else
- shrink_range(&buf->range_dirty_in_cpu_cache,
- &intersection);
- +
- + if (buf->mem_type == HWMEM_MEM_SCATTERED_SYS)
- + outer_flush_all();
- }
- }
- diff -ruN a/drivers/misc/hwmem/cache_handler.h b/drivers/misc/hwmem/cache_handler.h
- --- a/drivers/misc/hwmem/cache_handler.h 2012-10-27 17:12:22.923216008 +0900
- +++ b/drivers/misc/hwmem/cache_handler.h 2012-10-24 23:38:12.000000000 +0900
- @@ -42,13 +42,14 @@
- /* Remaining hints are active */
- enum hwmem_alloc_flags cache_settings;
- + enum hwmem_mem_type mem_type;
- bool in_cpu_write_buf;
- struct cach_range range_in_cpu_cache;
- struct cach_range range_dirty_in_cpu_cache;
- struct cach_range range_invalid_in_cpu_cache;
- };
- -void cach_init_buf(struct cach_buf *buf,
- +void cach_init_buf(struct cach_buf *buf, enum hwmem_mem_type,
- enum hwmem_alloc_flags cache_settings, u32 size);
- void cach_set_buf_addrs(struct cach_buf *buf, void* vaddr, u32 paddr);
- diff -ruN a/drivers/misc/hwmem/contig_alloc.c b/drivers/misc/hwmem/contig_alloc.c
- --- a/drivers/misc/hwmem/contig_alloc.c 2012-10-27 17:12:22.919215926 +0900
- +++ b/drivers/misc/hwmem/contig_alloc.c 2012-10-24 23:38:12.000000000 +0900
- @@ -79,7 +79,10 @@
- {
- int ret;
- struct instance *instance;
- - struct vm_struct *vm_area;
- + struct vm_struct *vm_area = NULL;
- +#ifdef CONFIG_FLATMEM
- + phys_addr_t region_end = region_paddr + region_size;
- +#endif
- if (region_size == 0)
- return ERR_PTR(-EINVAL);
- @@ -94,14 +97,36 @@
- instance->region_paddr = region_paddr;
- instance->region_size = region_size;
- - vm_area = get_vm_area(region_size, VM_IOREMAP);
- - if (vm_area == NULL) {
- - printk(KERN_WARNING "CONA: Failed to allocate %u bytes"
- - " kernel virtual memory", region_size);
- - ret = -ENOMSG;
- - goto vmem_alloc_failed;
- +#ifdef CONFIG_FLATMEM
- + /*
- + * Map hwmem physical memory to the holes in the kernel LOMEM virtual
- + * address if LOMEM region is enough to contain the whole HWMEM.
- + * otherwise map hwmem to VMALLOC region.
- + */
- + if (__phys_to_virt(region_end) > __phys_to_virt(region_paddr)
- + && __phys_to_virt(region_end) < (unsigned long)high_memory) {
- + instance->region_kaddr = phys_to_virt(region_paddr);
- + pr_info("hwmem: %s map to LOMEM, start: 0x%p, end: 0x%p\n",
- + name,
- + phys_to_virt(region_paddr),
- + phys_to_virt(region_paddr+region_size));
- + }
- +#endif
- +
- + if (!instance->region_kaddr) {
- + vm_area = get_vm_area(region_size, VM_IOREMAP);
- + if (vm_area == NULL) {
- + pr_err("CONA: Failed to allocate %u bytes kernel virtual memory",
- + region_size);
- + ret = -ENOMSG;
- + goto vmem_alloc_failed;
- + }
- +
- + instance->region_kaddr = vm_area->addr;
- + pr_info("hwmem: %s map to VMALLOC, address: 0x%p\n",
- + name,
- + instance->region_kaddr);
- }
- - instance->region_kaddr = vm_area->addr;
- /*
- * This newly created memory area is unsused.
- @@ -121,10 +146,11 @@
- return instance;
- init_alloc_list_failed:
- - vm_area = remove_vm_area(instance->region_kaddr);
- - if (vm_area == NULL)
- - printk(KERN_ERR "CONA: Failed to free kernel virtual memory,"
- - " resource leak!\n");
- + if (vm_area) {
- + vm_area = remove_vm_area(instance->region_kaddr);
- + if (vm_area == NULL)
- + pr_err("CONA: Failed to free kernel virtual memory, resource leak!\n");
- + }
- kfree(vm_area);
- vmem_alloc_failed:
- diff -ruN a/drivers/misc/hwmem/hwmem-main.c b/drivers/misc/hwmem/hwmem-main.c
- --- a/drivers/misc/hwmem/hwmem-main.c 2012-10-27 17:12:22.919215926 +0900
- +++ b/drivers/misc/hwmem/hwmem-main.c 2012-10-24 23:38:12.000000000 +0900
- @@ -61,6 +61,10 @@
- /* Cache handling */
- struct cach_buf cach_buf;
- + /* Scattered allocation parameters */
- + struct page **sglist;
- + size_t nr_of_pages;
- +
- #ifdef CONFIG_DEBUG_FS
- /* Debug */
- void *creator;
- @@ -165,24 +169,37 @@
- int ret;
- pgprot_t pgprot;
- void *alloc_kaddr;
- + void *vmap_addr;
- - alloc_kaddr = alloc->mem_type->allocator_api.get_alloc_kaddr(
- - alloc->mem_type->allocator_instance, alloc->allocator_hndl);
- - if (IS_ERR(alloc_kaddr))
- - return PTR_ERR(alloc_kaddr);
- + if (alloc->mem_type->id != HWMEM_MEM_SCATTERED_SYS) {
- + alloc_kaddr = alloc->mem_type->allocator_api.get_alloc_kaddr(
- + alloc->mem_type->allocator_instance, alloc->allocator_hndl);
- + if (IS_ERR(alloc_kaddr))
- + return PTR_ERR(alloc_kaddr);
- + }
- pgprot = PAGE_KERNEL;
- cach_set_pgprot_cache_options(&alloc->cach_buf, &pgprot);
- - ret = ioremap_page_range((unsigned long)alloc_kaddr,
- - (unsigned long)alloc_kaddr + alloc->size, alloc->paddr, pgprot);
- - if (ret < 0) {
- - dev_warn(&hwdev->dev, "Failed to map %#x - %#x", alloc->paddr,
- - alloc->paddr + alloc->size);
- - return ret;
- - }
- + if (alloc->mem_type->id == HWMEM_MEM_SCATTERED_SYS) {
- + /* map an array of pages into virtually contiguous space */
- + vmap_addr = vmap(alloc->sglist, alloc->nr_of_pages, VM_MAP, PAGE_KERNEL);
- + if (IS_ERR_OR_NULL(vmap_addr)) {
- + dev_warn(&hwdev->dev, "Failed to vmap size %d", alloc->size);
- + return -ENOMEM;
- + }
- + alloc->kaddr = vmap_addr;
- + } else { /* contiguous or protected */
- + ret = ioremap_page_range((unsigned long)alloc_kaddr,
- + (unsigned long)alloc_kaddr + alloc->size, alloc->paddr, pgprot);
- + if (ret < 0) {
- + dev_warn(&hwdev->dev, "Failed to map %#x - %#x", alloc->paddr,
- + alloc->paddr + alloc->size);
- + return ret;
- + }
- - alloc->kaddr = alloc_kaddr;
- + alloc->kaddr = alloc_kaddr;
- + }
- return 0;
- }
- @@ -192,7 +209,10 @@
- if (alloc->kaddr == NULL)
- return;
- - unmap_kernel_range((unsigned long)alloc->kaddr, alloc->size);
- + if (alloc->mem_type->id == HWMEM_MEM_SCATTERED_SYS)
- + vunmap(alloc->kaddr); /* release virtual mapping obtained by vmap() */
- + else /* contiguous or protected */
- + unmap_kernel_range((unsigned long)alloc->kaddr, alloc->size);
- alloc->kaddr = NULL;
- }
- @@ -245,6 +265,7 @@
- alloc->creator_tgid = task_tgid_nr(current);
- #endif
- alloc->mem_type = resolve_mem_type(mem_type);
- +
- if (IS_ERR(alloc->mem_type)) {
- ret = PTR_ERR(alloc->mem_type);
- goto resolve_mem_type_failed;
- @@ -257,15 +278,29 @@
- goto allocator_failed;
- }
- - alloc->paddr = alloc->mem_type->allocator_api.get_alloc_paddr(
- - alloc->allocator_hndl);
- - alloc->size = alloc->mem_type->allocator_api.get_alloc_size(
- - alloc->allocator_hndl);
- + if (alloc->mem_type->id == HWMEM_MEM_SCATTERED_SYS) {
- + alloc->size = alloc->mem_type->allocator_api.get_alloc_size(
- + alloc->allocator_hndl);
- + alloc->nr_of_pages = alloc->size >> PAGE_SHIFT;
- + alloc->sglist = alloc->mem_type->allocator_api.get_alloc_sglist(
- + alloc->allocator_hndl);
- + alloc->paddr = 0;
- + } else { /* contiguous or protected */
- + alloc->paddr = alloc->mem_type->allocator_api.get_alloc_paddr(
- + alloc->allocator_hndl);
- + alloc->size = alloc->mem_type->allocator_api.get_alloc_size(
- + alloc->allocator_hndl);
- + }
- +
- + cach_init_buf(&alloc->cach_buf,
- + alloc->mem_type->id,
- + alloc->flags,
- + alloc->size);
- - cach_init_buf(&alloc->cach_buf, alloc->flags, alloc->size);
- ret = kmap_alloc(alloc);
- if (ret < 0)
- goto kmap_alloc_failed;
- +
- cach_set_buf_addrs(&alloc->cach_buf, alloc->kaddr, alloc->paddr);
- list_add_tail(&alloc->list, &alloc_list);
- @@ -315,16 +350,36 @@
- int hwmem_pin(struct hwmem_alloc *alloc, struct hwmem_mem_chunk *mem_chunks,
- u32 *mem_chunks_length)
- {
- + /* Calculate hwmem_mem_chunk_length */
- + if (mem_chunks == NULL) {
- + if (alloc->mem_type->id == HWMEM_MEM_SCATTERED_SYS)
- + *mem_chunks_length = alloc->nr_of_pages;
- + else
- + *mem_chunks_length = 1;
- +
- + return 0;
- + }
- +
- if (*mem_chunks_length < 1) {
- *mem_chunks_length = 1;
- + printk(KERN_ERR "HWMEM: hwmem_pin mem_chunks_length < 1\n");
- return -ENOSPC;
- }
- mutex_lock(&lock);
- - mem_chunks[0].paddr = alloc->paddr;
- - mem_chunks[0].size = alloc->size;
- - *mem_chunks_length = 1;
- + if (alloc->mem_type->id == HWMEM_MEM_SCATTERED_SYS) {
- + int i;
- + for (i = 0; i < alloc->nr_of_pages; i++) {
- + mem_chunks[i].paddr = page_to_phys(alloc->sglist[i]);
- + mem_chunks[i].size = PAGE_SIZE;
- + }
- + *mem_chunks_length = alloc->nr_of_pages;
- + } else { /* contiguous or protected */
- + mem_chunks[0].paddr = alloc->paddr;
- + mem_chunks[0].size = alloc->size;
- + *mem_chunks_length = 1;
- + }
- mutex_unlock(&lock);
- @@ -349,7 +404,9 @@
- int hwmem_mmap(struct hwmem_alloc *alloc, struct vm_area_struct *vma)
- {
- + unsigned long temp_addr;
- int ret = 0;
- + int i = 0;
- unsigned long vma_size = vma->vm_end - vma->vm_start;
- enum hwmem_access access;
- mutex_lock(&lock);
- @@ -380,11 +437,21 @@
- atomic_inc(&alloc->ref_cnt);
- vma->vm_ops = &vm_ops;
- - ret = remap_pfn_range(vma, vma->vm_start, alloc->paddr >> PAGE_SHIFT,
- - min(vma_size, (unsigned long)alloc->size), vma->vm_page_prot);
- - if (ret < 0)
- - goto map_failed;
- -
- + if (alloc->mem_type->id == HWMEM_MEM_SCATTERED_SYS) {
- + /* VM_MIXEDMAP can contain "struct page" and pure PFN pages */
- + vma->vm_flags |= VM_MIXEDMAP;
- + temp_addr = vma->vm_start;
- +
- + for (i = 0; i < alloc->nr_of_pages; i++) {
- + vm_insert_page(vma, temp_addr, alloc->sglist[i]);
- + temp_addr += PAGE_SIZE;
- + }
- + } else { /* contiguous or protected */
- + ret = remap_pfn_range(vma, vma->vm_start, alloc->paddr >> PAGE_SHIFT,
- + min(vma_size, (unsigned long)alloc->size), vma->vm_page_prot);
- + if (ret < 0)
- + goto map_failed;
- + }
- goto out;
- map_failed:
- diff -ruN a/drivers/misc/hwmem/scatt_alloc.c b/drivers/misc/hwmem/scatt_alloc.c
- --- a/drivers/misc/hwmem/scatt_alloc.c 1970-01-01 09:00:00.000000000 +0900
- +++ b/drivers/misc/hwmem/scatt_alloc.c 2012-10-24 23:38:12.000000000 +0900
- @@ -0,0 +1,120 @@
- +/*
- + * Copyright (C) ST-Ericsson SA 2012
- + *
- + * Scattered memory allocator
- + *
- + * Author: Andreas Karlsson <andreas.z.karlsson@stericsson.com> for ST-Ericsson.
- + *
- + * License terms: GNU General Public License (GPL), version 2.
- + */
- +
- +#include <linux/err.h>
- +#include <linux/slab.h>
- +
- +#define MAX_INSTANCE_NAME_LENGTH 31
- +
- +struct alloc {
- + size_t size;
- + struct page **pages;
- + size_t nr_of_pages;
- +};
- +
- +struct instance {
- + char name[MAX_INSTANCE_NAME_LENGTH + 1];
- +};
- +
- +static DEFINE_MUTEX(lock);
- +
- +void *scatt_create(const char *name)
- +{
- + struct instance *instance;
- +
- + instance = kmalloc(sizeof(*instance), GFP_KERNEL);
- + if (instance == NULL)
- + return ERR_PTR(-ENOMEM);
- +
- + memcpy(instance->name, name, MAX_INSTANCE_NAME_LENGTH + 1);
- + /* Truncate name if necessary */
- + instance->name[MAX_INSTANCE_NAME_LENGTH] = '\0';
- +
- + return instance;
- +}
- +
- +void *scatt_alloc(void *instance, size_t size)
- +{
- + struct alloc *new_alloc;
- + unsigned int array_size, i;
- +
- + new_alloc = kmalloc(sizeof(struct alloc), GFP_KERNEL);
- + if (new_alloc == NULL)
- + return ERR_PTR(-ENOMEM);
- +
- + mutex_lock(&lock);
- +
- + new_alloc->size = size;
- + new_alloc->nr_of_pages = new_alloc->size >> PAGE_SHIFT;
- +
- + array_size = (new_alloc->nr_of_pages * sizeof(struct page *));
- + new_alloc->pages = kmalloc(array_size, GFP_KERNEL);
- +
- + if (!new_alloc->pages) {
- + printk(KERN_ERR "HWMEM: Scattered alloc pages array failed\n");
- + goto alloc_failed;
- + }
- +
- + /* Alloc page and place in the sglist */
- + for (i = 0; i < new_alloc->nr_of_pages; i++) {
- + new_alloc->pages[i] = alloc_page(GFP_KERNEL);
- + if (!new_alloc->pages[i]) {
- + printk(KERN_ERR "HWMEM: Scattered alloc page failed\n");
- + goto alloc_failed;
- + }
- + }
- +
- + mutex_unlock(&lock);
- +
- + return new_alloc;
- +
- +alloc_failed:
- + kfree(new_alloc);
- + mutex_unlock(&lock);
- + return ERR_PTR(-ENOMEM);
- +}
- +
- +void scatt_free(void *instance, void *alloc)
- +{
- + int i;
- +
- + struct alloc *alloc_l = (struct alloc *)alloc;
- +
- + if (alloc == NULL)
- + return;
- +
- + mutex_lock(&lock);
- +
- + /* Free all pages in the sglist */
- + for (i = 0; i < alloc_l->nr_of_pages; i++)
- + __free_page(alloc_l->pages[i]);
- +
- + kfree(alloc_l->pages);
- + kfree(alloc_l);
- +
- + mutex_unlock(&lock);
- +}
- +
- +size_t scatt_get_alloc_size(void *alloc)
- +{
- + if (alloc == NULL)
- + return -EINVAL;
- +
- + return ((struct alloc *)alloc)->size;
- +}
- +
- +struct page **scatt_get_alloc_sglist(void *alloc)
- +{
- + if (alloc == NULL)
- + return ERR_PTR(-EINVAL);
- +
- + return ((struct alloc *)alloc)->pages;
- +}
- +
- diff -ruN a/drivers/power/ab8500_chargalg.c b/drivers/power/ab8500_chargalg.c
- --- a/drivers/power/ab8500_chargalg.c 2012-10-27 17:12:08.034941212 +0900
- +++ b/drivers/power/ab8500_chargalg.c 2012-10-24 23:38:19.000000000 +0900
- @@ -8,6 +8,9 @@
- * Author: Johan Palsson <johan.palsson@stericsson.com>
- * Author: Karl Komierowski <karl.komierowski@stericsson.com>
- * Author: Imre Sunyi <imre.sunyi@sonymobile.com>
- + *
- + * NOTE: This file has been modified by Sony Mobile Communication AB.
- + * Modification are licenced under the Licence.
- */
- #include <linux/init.h>
- @@ -1964,11 +1967,11 @@
- ab8500_chargalg_external_power_changed;
- /* Initilialize safety timer */
- - hrtimer_init(&di->safety_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS);
- + hrtimer_init(&di->safety_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
- di->safety_timer.function = ab8500_chargalg_safety_timer_expired;
- /* Initilialize maintenance timer */
- - hrtimer_init(&di->maintenance_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS);
- + hrtimer_init(&di->maintenance_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
- di->maintenance_timer.function =
- ab8500_chargalg_maintenance_timer_expired;
- diff -ruN a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c
- --- a/drivers/power/ab8500_fg.c 2012-10-27 17:12:08.030941166 +0900
- +++ b/drivers/power/ab8500_fg.c 2012-10-24 23:38:19.000000000 +0900
- @@ -36,7 +36,6 @@
- #define MILLI_TO_MICRO 1000
- #define FG_LSB_IN_MA 1627
- #define QLSB_NANO_AMP_HOURS_X10 1129
- -#define CCEOC_IRQ_SKIP_CNT 1
- #define SEC_TO_SAMPLE(S) (S * 4)
- @@ -167,13 +166,13 @@
- * struct ab8500_fg - ab8500 FG device information
- * @dev: Pointer to the structure device
- * @node: a list of AB8500 FGs, hence prepared for reentrance
- - * @irq holds the CCEOC interrupt number
- + * @irq: holds the CCEOC interrupt number
- * @cc_irq: average current irq number
- * @vbat: Battery voltage in mV
- * @vbat_nom: Nominal battery voltage in mV
- - * @inst_curr: Instantenous battery current in mA
- + * @inst_curr: Instantaneous battery current in mA
- * @avg_curr: Average battery current in mA
- - * @bat_temp battery temperature
- + * @bat_temp: battery temperature
- * @fg_samples: Number of samples used in the FG accumulation
- * @accu_charge: Accumulated charge from the last conversion
- * @missed_accu_charge: Accumulated charge that may be missed between
- @@ -181,9 +180,8 @@
- * @recovery_cnt_ms: Counter for recovery mode
- * @high_curr_cnt_ms: Counter for high current mode
- * @init_cnt: Counter for init mode
- - * @low_bat_cnt Counter for number of consecutive low battery measures
- - * @nbr_cceoc_irq_cnt Counter for number of CCEOC irqs to skip
- - * @high_curr_thr_pc Percent counter of exceeded high current threshold
- + * @low_bat_cnt: Counter for number of consecutive low battery measures
- + * @high_curr_thr_pc: Percent counter of exceeded high current threshold
- * @calculate_missed_accu:
- * Indicate if missing accu logic should be activated
- * @recovery_needed: Indicate if recovery is needed
- @@ -192,10 +190,10 @@
- * @prohibit_uncomp_voltage_replace:
- True when capacity is not allowed to be replaced with
- uncompensated voltage
- - * @calib_state State during offset calibration
- + * @calib_state: State during offset calibration
- * @discharge_state: Current discharge state
- * @charge_state: Current charge state
- - * @ab8500_fg_complete Completion struct used for the instant current reading
- + * @ab8500_fg_complete: Completion struct used for the instant current reading
- * @flags: Structure for information about events triggered
- * @bat_cap: Structure for battery capacity specific parameters
- * @avg_cap: Average capacity filter
- @@ -205,11 +203,12 @@
- * @bat: Pointer to the ab8500_bm platform data
- * @fg_psy: Structure that holds the FG specific battery properties
- * @fg_wq: Work queue for running the FG algorithm
- + * @inst_curr_wq: Work queue for running the instantaneous current calculation
- * @avg_curr_wq: Work queue for running the avg current calculation
- * @shutdown_wq: Work queue for running shutdown determination
- * @fg_periodic_work: Work to run the FG algorithm periodically
- * @fg_low_bat_work: Work to check low bat condition
- - * @fg_reinit_work Work used to reset and reinitialise the FG algorithm
- + * @fg_reinit_work: Work used to reset and reinitialise the FG algorithm
- * @fg_work: Work to run the FG algorithm instantly
- * @fg_acc_cur_work: Work to read the FG accumulator
- * @fg_check_hw_failure_work: Work for checking HW state
- @@ -237,7 +236,6 @@
- int high_curr_cnt_ms;
- int init_cnt;
- int low_bat_cnt;
- - int nbr_cceoc_irq_cnt;
- int high_curr_thr_pc;
- bool calculate_missed_accu;
- bool recovery_needed;
- @@ -258,6 +256,7 @@
- struct ab8500_bm_data *bat;
- struct power_supply fg_psy;
- struct workqueue_struct *fg_wq;
- + struct workqueue_struct *inst_curr_wq;
- struct workqueue_struct *avg_curr_wq;
- struct workqueue_struct *shutdown_wq;
- struct delayed_work fg_periodic_work;
- @@ -265,6 +264,7 @@
- struct delayed_work fg_reinit_work;
- struct work_struct fg_work;
- struct work_struct fg_acc_cur_work;
- + struct work_struct fg_cur_now_work;
- struct delayed_work fg_check_hw_failure_work;
- struct mutex cc_lock;
- struct mutex shutdown_lock;
- @@ -567,10 +567,6 @@
- di->fg_samples = samples;
- - /*
- - * how many CCEOC to skip after enabling CC
- - */
- - di->nbr_cceoc_irq_cnt = CCEOC_IRQ_SKIP_CNT;
- } else {
- if (di->flags.fg_enabled) {
- di->flags.fg_enabled = false;
- @@ -718,8 +714,9 @@
- disable_irq(di->irq);
- if (timeout == 0) {
- - dev_dbg(di->dev, "%s:%d: waiting for 'CCEOC' irq timeout, "
- - "use previous value\n", __func__, __LINE__);
- + dev_dbg(di->dev, "%s:%d: waiting for 'CCEOC' irq timeout(%d ms), "
- + "use previous value\n", __func__, __LINE__,
- + INS_CURR_TIMEOUT);
- val = di->inst_curr;
- goto leave;
- }
- @@ -2395,10 +2392,7 @@
- {
- struct ab8500_fg *di = _di;
- - if (di->nbr_cceoc_irq_cnt > 0)
- - di->nbr_cceoc_irq_cnt--;
- - else
- - complete(&di->ab8500_fg_complete);
- + complete(&di->ab8500_fg_complete);
- return IRQ_HANDLED;
- }
- @@ -2484,6 +2478,23 @@
- return IRQ_HANDLED;
- }
- + /**
- + * ab8500_fg_current_now_work() - instantaneous battery current reader work
- + * @work: pointer to the work_struct structure
- + *
- + * Reads the instantaneous battery current.
- + */
- +static void ab8500_fg_current_now_work(struct work_struct *work)
- +{
- + struct ab8500_fg *di = container_of(work, struct ab8500_fg,
- + fg_cur_now_work);
- +
- + dev_dbg(di->dev, "Start reading instantaneous battery current\n");
- + di->inst_curr = ab8500_fg_inst_curr_blocking(di);
- + dev_dbg(di->dev, "Finish reading instantaneous battery current: %d\n",
- + di->inst_curr);
- +}
- +
- /**
- * ab8500_fg_get_property() - get the fg properties
- * @psy: pointer to the power_supply structure
- @@ -2525,6 +2536,11 @@
- val->intval = di->vbat * 1000;
- break;
- case POWER_SUPPLY_PROP_CURRENT_NOW:
- + if (!di->flags.calibrate)
- + queue_work(di->inst_curr_wq, &di->fg_cur_now_work);
- + else
- + dev_dbg(di->dev, "CC not calibrated yet,"
- + "return inst_curr(%dmA)!\n", di->inst_curr);
- val->intval = di->inst_curr * 1000;
- break;
- case POWER_SUPPLY_PROP_CURRENT_AVG:
- @@ -3124,6 +3140,9 @@
- destroy_workqueue(di->fg_wq);
- destroy_workqueue(di->shutdown_wq);
- + destroy_workqueue(di->avg_curr_wq);
- + destroy_workqueue(di->inst_curr_wq);
- +
- ab8500_fg_sysfs_exit(di);
- flush_scheduled_work();
- @@ -3158,6 +3177,13 @@
- mutex_init(&di->cc_lock);
- mutex_init(&di->shutdown_lock);
- + /*
- + * Initialize completion used to notify completion and start
- + * of inst current
- + */
- + init_completion(&di->ab8500_fg_complete);
- + init_completion(&di->accu_done);
- +
- /* get parent data */
- di->dev = &pdev->dev;
- di->parent = dev_get_drvdata(pdev->dev.parent);
- @@ -3227,12 +3253,23 @@
- goto free_shutdown_wq;
- }
- + /* work for instantaneous current */
- + di->inst_curr_wq =
- + create_singlethread_workqueue("ab8500_fg_inst_curr_wq");
- + if (di->inst_curr_wq == NULL) {
- + dev_err(di->dev, "failed to create work queue\n");
- + goto free_avg_curr_wq;
- + }
- +
- /* Init work for running the fg algorithm instantly */
- INIT_WORK(&di->fg_work, ab8500_fg_instant_work);
- /* Init work for getting the battery accumulated current */
- INIT_WORK(&di->fg_acc_cur_work, ab8500_fg_acc_cur_work);
- + /* Init work for getting the battery instantaneous current */
- + INIT_WORK(&di->fg_cur_now_work, ab8500_fg_current_now_work);
- +
- /* Init work for reinitialising the fg algorithm */
- INIT_DELAYED_WORK_DEFERRABLE(&di->fg_reinit_work,
- ab8500_fg_reinit_work);
- @@ -3253,27 +3290,13 @@
- ret = ab8500_fg_init_hw_registers(di);
- if (ret) {
- dev_err(di->dev, "failed to initialize registers\n");
- - goto free_shutdown_wq;
- + goto free_inst_curr_wq;
- }
- /* Consider battery unknown until we're informed otherwise */
- di->flags.batt_unknown = true;
- di->flags.batt_id_received = false;
- - /* Register FG power supply class */
- - ret = power_supply_register(di->dev, &di->fg_psy);
- - if (ret) {
- - dev_err(di->dev, "failed to register FG psy\n");
- - goto free_shutdown_wq;
- - }
- -
- - /*
- - * Initialize completion used to notify completion and start
- - * of inst current
- - */
- - init_completion(&di->ab8500_fg_complete);
- - init_completion(&di->accu_done);
- -
- /* Register interrupts */
- for (i = 0; i < ARRAY_SIZE(ab8500_fg_irq); i++) {
- irq = platform_get_irq_byname(pdev, ab8500_fg_irq[i].name);
- @@ -3300,42 +3323,52 @@
- platform_set_drvdata(pdev, di);
- + /* Calibrate the fg first time */
- + di->flags.calibrate = true;
- + di->calib_state = AB8500_FG_CALIB_INIT;
- +
- + /* Use room temp as default value until we get an update from driver. */
- + di->bat_temp = 210;
- +
- + list_add_tail(&di->node, &ab8500_fg_list);
- +
- + /* Register FG power supply class */
- + ret = power_supply_register(di->dev, &di->fg_psy);
- + if (ret) {
- + dev_err(di->dev, "failed to register FG psy\n");
- + goto free_irq;
- + }
- +
- ret = ab8500_fg_sysfs_init(di);
- if (ret) {
- dev_err(di->dev, "failed to create sysfs entry\n");
- - goto free_irq;
- + goto free_power_supply_register;
- }
- ret = ab8500_fg_sysfs_psy_create_attrs(di->fg_psy.dev);
- if (ret) {
- dev_err(di->dev, "failed to create FG psy\n");
- ab8500_fg_sysfs_exit(di);
- - goto free_irq;
- + goto free_power_supply_register;
- }
- - /* Calibrate the fg first time */
- - di->flags.calibrate = true;
- - di->calib_state = AB8500_FG_CALIB_INIT;
- -
- - /* Use room temp as default value until we get an update from driver. */
- - di->bat_temp = 210;
- -
- /* Run the FG algorithm */
- queue_delayed_work(di->fg_wq, &di->fg_periodic_work, 0);
- - list_add_tail(&di->node, &ab8500_fg_list);
- -
- return ret;
- -free_irq:
- +free_power_supply_register:
- power_supply_unregister(&di->fg_psy);
- -
- +free_irq:
- /* We also have to free all successfully registered irqs */
- for (i = i - 1; i >= 0; i--) {
- irq = platform_get_irq_byname(pdev, ab8500_fg_irq[i].name);
- free_irq(irq, di);
- }
- +free_inst_curr_wq:
- + destroy_workqueue(di->inst_curr_wq);
- +free_avg_curr_wq:
- destroy_workqueue(di->avg_curr_wq);
- free_shutdown_wq:
- destroy_workqueue(di->shutdown_wq);
- diff -ruN a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c
- --- a/drivers/rtc/rtc-ab8500.c 2012-10-27 17:12:09.854962258 +0900
- +++ b/drivers/rtc/rtc-ab8500.c 2012-10-24 23:38:19.000000000 +0900
- @@ -48,6 +48,7 @@
- static struct rtc_device *ab8500_rtc;
- static struct delayed_work sync_work;
- +static u32 resumed;
- static const u8 ab8500_rtc_time_regs[] = {
- AB8500_RTC_WATCH_TMIN_HI_REG, AB8500_RTC_WATCH_TMIN_MID_REG,
- @@ -396,13 +397,31 @@
- {
- struct rtc_time r;
- unsigned long t;
- - struct timespec ts;
- + struct timespec ts, sys_ts;
- + struct timex adjust;
- ab8500_rtc_read_time(ab8500_rtc->dev.parent, &r);
- rtc_tm_to_time(&r, &t);
- set_normalized_timespec(&ts, (time_t) t, 0);
- - do_settimeofday(&ts);
- - rtc_hctohc(r);
- + getnstimeofday(&sys_ts);
- + /*
- + * AB8500 RTC is more accurate then u8500 system clock.
- + * Compensate for drift here but not if time differs more then 60s nor
- + * when the drift is less than a second.
- + * If diff is more then 60s then system time is considered changed
- + * but not the rtc time and they should be kept different.
- + * */
- + if ((abs(ts.tv_sec - sys_ts.tv_sec) < 60) &&
- + (ts.tv_sec != sys_ts.tv_sec) && !resumed) {
- + adjust.offset = (ts.tv_sec - sys_ts.tv_sec) * 1000000;
- + adjust.modes = ADJ_OFFSET_SINGLESHOT;
- + do_adjtimex(&adjust);
- + rtc_hctohc(r);
- + } else if (resumed) {
- + do_settimeofday(&ts);
- + resumed = 0;
- + rtc_hctohc(r);
- + }
- /* Once every minute to match calibration */
- schedule_delayed_work(&sync_work, 60 * HZ);
- }
- @@ -495,6 +514,7 @@
- static int ab8500_rtc_resume(struct platform_device *pdev)
- {
- /* Delay by 300ms to let resume finnish */
- + resumed = 1;
- schedule_delayed_work(&sync_work, 3 * HZ / 10);
- return 0;
- }
- diff -ruN a/drivers/usb/gadget/f_mtp.c b/drivers/usb/gadget/f_mtp.c
- --- a/drivers/usb/gadget/f_mtp.c 2012-10-27 17:12:25.563269691 +0900
- +++ b/drivers/usb/gadget/f_mtp.c 2012-10-24 23:38:23.000000000 +0900
- @@ -4,6 +4,7 @@
- * Copyright (C) 2010 Google, Inc.
- * Author: Mike Lockwood <lockwood@android.com>
- * Copyright (C) 2011 Sony Ericsson Mobile Communications AB.
- + * Copyright (C) 2012 Sony Mobile Communications AB.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- @@ -350,7 +351,7 @@
- struct mtp_dev *dev = _mtp_dev;
- dev->rx_done = 1;
- - if (req->status != 0)
- + if (req->status != 0 && dev->state == STATE_BUSY)
- dev->state = STATE_ERROR;
- wake_up(&dev->read_wq);
- @@ -489,8 +490,9 @@
- }
- /* wait for a request to complete */
- - ret = wait_event_interruptible(dev->read_wq, dev->rx_done);
- - if (ret < 0) {
- + ret = wait_event_interruptible(dev->read_wq,
- + dev->rx_done || dev->state != STATE_BUSY);
- + if (ret < 0 || !dev->rx_done) {
- r = ret;
- usb_ep_dequeue(dev->ep_out, req);
- goto done;
- @@ -1124,9 +1126,9 @@
- spin_lock_irqsave(&dev->lock, flags);
- /* Flushing the buffers as mentioned in MTP spec */
- usb_ep_fifo_flush(dev->ep_out);
- + dev->state = STATE_RESET;
- wake_up(&dev->read_wq);
- wake_up(&dev->write_wq);
- - dev->state = STATE_RESET;
- spin_unlock_irqrestore(&dev->lock, flags);
- /* We need to queue a request to read the remaining
- diff -ruN a/drivers/usb/gadget/storage_common.c b/drivers/usb/gadget/storage_common.c
- --- a/drivers/usb/gadget/storage_common.c 2012-10-27 17:12:25.555269529 +0900
- +++ b/drivers/usb/gadget/storage_common.c 2012-10-24 23:38:23.000000000 +0900
- @@ -227,7 +227,7 @@
- #define ASC(x) ((u8) ((x) >> 8))
- #define ASCQ(x) ((u8) (x))
- -#define RANDOM_WRITE_COUNT_TO_BE_FLUSHED (10)
- +#define RANDOM_WRITE_COUNT_TO_BE_FLUSHED (5)
- /* VPD(Vital product data) Page Name */
- #define VPD_SUPPORTED_VPD_PAGES 0x00
- diff -ruN a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
- --- a/drivers/usb/musb/musb_gadget.c 2012-10-27 17:12:25.335265075 +0900
- +++ b/drivers/usb/musb/musb_gadget.c 2012-10-24 23:38:23.000000000 +0900
- @@ -5,6 +5,7 @@
- * Copyright (C) 2005-2006 by Texas Instruments
- * Copyright (C) 2006-2007 Nokia Corporation
- * Copyright (C) 2009 MontaVista Software, Inc. <source@mvista.com>
- + * Copyright (C) 2012 Sony Mobile Communications AB
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- @@ -1361,7 +1362,7 @@
- spin_lock_irqsave(&musb->lock, lockflags);
- /* don't queue if the ep is down */
- - if (!musb_ep->desc) {
- + if (!musb_ep || !musb_ep->desc) {
- dev_dbg(musb->controller, "req %p queued to %s while ep %s\n",
- req, ep->name, "disabled");
- status = -ESHUTDOWN;
- diff -ruN a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c
- --- a/drivers/usb/musb/ux500.c 2012-10-27 17:12:25.307264511 +0900
- +++ b/drivers/usb/musb/ux500.c 2012-10-24 23:38:23.000000000 +0900
- @@ -449,18 +449,10 @@
- u8 devctl;
- unsigned long timeout = jiffies + msecs_to_jiffies(1000);
- int ret = 1;
- -#ifdef CONFIG_USB_OTG_20
- - int val = 0;
- -#endif
- /* HDRC controls CPEN, but beware current surges during device
- * connect. They can trigger transient overcurrent conditions
- * that must be ignored.
- */
- -#ifdef CONFIG_USB_OTG_20
- - val = musb_readb(musb->mregs, MUSB_MISC);
- - val |= 0x1C;
- - musb_writeb(musb->mregs, MUSB_MISC, val);
- -#endif
- devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
- if (is_on) {
- diff -ruN a/drivers/usb/musb/ux500_dma.c b/drivers/usb/musb/ux500_dma.c
- --- a/drivers/usb/musb/ux500_dma.c 2012-10-27 17:12:25.295264268 +0900
- +++ b/drivers/usb/musb/ux500_dma.c 2012-10-24 23:38:23.000000000 +0900
- @@ -9,6 +9,7 @@
- * Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
- * Praveena Nadahally <praveen.nadahally@stericsson.com>
- * Rajaram Regupathy <ragupathy.rajaram@stericsson.com>
- + * Copyright (C) 2012 Sony Mobile Communications AB
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- @@ -274,6 +275,12 @@
- if (length <= Ux500_USB_DMA_MIN_TRANSFER_SIZE)
- return 0;
- + /* In case when device has no config data
- + * (i.e. usb ep is disconnected)
- + */
- + if (!cdev || !cdev->config)
- + return 0;
- +
- list_for_each_entry(f, &cdev->config->functions, list) {
- if (!strcmp(f->name, "cdc_ethernet") ||
- !strcmp(f->name, "rndis") ||
- diff -ruN a/drivers/usb/otg/ab8500-usb.c b/drivers/usb/otg/ab8500-usb.c
- --- a/drivers/usb/otg/ab8500-usb.c 2012-10-27 17:12:25.423266858 +0900
- +++ b/drivers/usb/otg/ab8500-usb.c 2012-10-24 23:38:23.000000000 +0900
- @@ -252,8 +252,6 @@
- clk_enable(ab->sysclk);
- - ab8500_usb_regulator_ctrl(ab, sel_host, true);
- -
- prcmu_qos_update_requirement(PRCMU_QOS_APE_OPP,
- (char *)dev_name(ab->dev),
- PRCMU_QOS_APE_OPP_MAX);
- @@ -361,6 +359,7 @@
- }
- if (ab->mode == USB_IDLE) {
- ab->mode = USB_PERIPHERAL;
- + ab8500_usb_regulator_ctrl(ab, true, true);
- atomic_notifier_call_chain(&ab->otg.notifier,
- USB_EVENT_PREPARE,
- &ab->vbus_draw);
- @@ -375,6 +374,7 @@
- if (ab->mode == USB_PERIPHERAL) {
- ab->mode = USB_HOST;
- ab8500_usb_peri_phy_dis(ab);
- + ab8500_usb_regulator_ctrl(ab, true, true);
- atomic_notifier_call_chain(&ab->otg.notifier,
- USB_EVENT_PREPARE,
- &ab->vbus_draw);
- @@ -382,6 +382,7 @@
- }
- if (ab->mode == USB_IDLE) {
- ab->mode = USB_HOST;
- + ab8500_usb_regulator_ctrl(ab, true, true);
- atomic_notifier_call_chain(&ab->otg.notifier,
- USB_EVENT_PREPARE,
- &ab->vbus_draw);
- @@ -455,6 +456,7 @@
- if (ab->mode == USB_HOST) {
- ab->mode = USB_PERIPHERAL;
- ab8500_usb_host_phy_dis(ab);
- + ab8500_usb_regulator_ctrl(ab, true, true);
- atomic_notifier_call_chain(&ab->otg.notifier,
- USB_EVENT_PREPARE,
- &ab->vbus_draw);
- @@ -462,6 +464,7 @@
- }
- if (ab->mode == USB_IDLE) {
- ab->mode = USB_PERIPHERAL;
- + ab8500_usb_regulator_ctrl(ab, true, true);
- atomic_notifier_call_chain(&ab->otg.notifier,
- USB_EVENT_PREPARE,
- &ab->vbus_draw);
- @@ -477,6 +480,7 @@
- if (ab->mode == USB_PERIPHERAL) {
- ab->mode = USB_HOST;
- ab8500_usb_peri_phy_dis(ab);
- + ab8500_usb_regulator_ctrl(ab, true, true);
- atomic_notifier_call_chain(&ab->otg.notifier,
- USB_EVENT_PREPARE,
- &ab->vbus_draw);
- @@ -484,6 +488,7 @@
- }
- if (ab->mode == USB_IDLE) {
- ab->mode = USB_HOST;
- + ab8500_usb_regulator_ctrl(ab, true, true);
- atomic_notifier_call_chain(&ab->otg.notifier,
- USB_EVENT_PREPARE,
- &ab->vbus_draw);
- diff -ruN a/drivers/video/av8100/av8100.c b/drivers/video/av8100/av8100.c
- --- a/drivers/video/av8100/av8100.c 2012-10-27 17:12:06.838927480 +0900
- +++ b/drivers/video/av8100/av8100.c 2012-10-24 23:38:23.000000000 +0900
- @@ -151,9 +151,6 @@
- static DEFINE_MUTEX(av8100_usrcnt_mutex);
- #define LOCK_AV8100_USRCNT mutex_lock(&av8100_usrcnt_mutex)
- #define UNLOCK_AV8100_USRCNT mutex_unlock(&av8100_usrcnt_mutex)
- -static DEFINE_MUTEX(av8100_conf_mutex);
- -#define LOCK_AV8100_CONF mutex_lock(&av8100_conf_mutex)
- -#define UNLOCK_AV8100_CONF mutex_unlock(&av8100_conf_mutex)
- enum av8100_timer_flag {
- TIMER_UNSET,
- @@ -240,7 +237,6 @@
- bool disp_on;
- bool busy;
- u8 hdcp_state;
- - bool pwr_recover;
- };
- /**
- @@ -306,8 +302,6 @@
- u8 chip_version;
- struct early_suspend early_suspend;
- u32 usr_cnt;
- - bool usr_audio;
- - bool usr_video;
- };
- static const unsigned int waittime_retry[10] = {
- @@ -646,13 +640,9 @@
- (av8100_status_get().av8100_state > AV8100_OPMODE_SHUTDOWN);
- if (adev->params.pre_suspend_power) {
- - if (adev->usr_audio) {
- - ret = -EBUSY;
- - } else {
- - ret = av8100_powerdown();
- - if (ret)
- - dev_err(dev, "av8100_powerdown failed\n");
- - }
- + ret = av8100_powerdown();
- + if (ret)
- + dev_err(dev, "av8100_powerdown failed\n");
- }
- return ret;
- @@ -695,15 +685,9 @@
- {
- if (av8100_status_get().av8100_state <= AV8100_OPMODE_SHUTDOWN)
- return 0;
- - dev_dbg(adev->dev, "%s %d\n", __func__, adev->usr_audio);
- - if (!adev->usr_audio) {
- - av8100_powerdown();
- - set_hrtimer(adev, TIMER_POWERUP);
- - } else {
- - /* Simulate unplug in order to recover */
- - clr_plug_status(adev, AV8100_HDMI_PLUGIN);
- - adev->params.pwr_recover = true;
- - }
- + dev_dbg(adev->dev, "%s\n", __func__);
- + av8100_powerdown();
- + set_hrtimer(adev, TIMER_POWERUP);
- return 0;
- }
- @@ -778,8 +762,7 @@
- if (adev->params.pulsing_5V == false)
- set_hrtimer(adev, TIMER_1S);
- - if (av8100_status_get().av8100_state > AV8100_OPMODE_SCAN)
- - av8100_set_state(adev, AV8100_OPMODE_SCAN);
- + av8100_set_state(adev, AV8100_OPMODE_SCAN);
- }
- static int fix_cec(struct av8100_device *adev)
- @@ -964,8 +947,6 @@
- dev_dbg(adev->dev, "Thpd\n");
- - hrtimer_cancel(&adev->hrtimer);
- -
- /* Clear hpdi and cci interrupts */
- if (av8100_reg_stby_pend_int_w(
- AV8100_STANDBY_PENDING_INTERRUPT_HPDI_HIGH,
- @@ -1025,12 +1006,9 @@
- set_plug_status(adev, AV8100_HDMI_PLUGIN);
- } else {
- - if (!adev->usr_audio) {
- - av8100_powerdown();
- - usleep_range(AV8100_WAITTIME_1MS,
- - AV8100_WAITTIME_1MS_MAX);
- - av8100_powerup();
- - }
- + av8100_powerdown();
- + msleep(AV8100_WAITTIME_1MS);
- + av8100_powerup();
- if (adev->params.pulsing_5V == false)
- set_hrtimer(adev, TIMER_1S);
- av8100_set_state(adev, AV8100_OPMODE_SCAN);
- @@ -1063,8 +1041,8 @@
- {
- dev_dbg(adev->dev, "Tpwrdown\n");
- - if (!adev->usr_audio)
- - (void)av8100_powerdown();
- + (void)av8100_powerdown();
- + adev->params.busy = false;
- }
- static int cci_handle(struct av8100_device *adev, u8 hpdi)
- @@ -1292,9 +1270,6 @@
- u8 cecrx = 0;
- u8 cectx = 0;
- - if (av8100_status_get().av8100_state <= AV8100_OPMODE_SHUTDOWN)
- - return 0;
- -
- /* Get hpdi and cci */
- if (av8100_reg_stby_pend_int_r(&hpdi, NULL, NULL, &cci, NULL))
- goto av8100_int_event_handle_err;
- @@ -2785,7 +2760,7 @@
- return 0;
- }
- -int av8100_hdmi_get(enum av8100_hdmi_user user)
- +int av8100_hdmi_get(void)
- {
- struct av8100_device *adev;
- int usr_cnt;
- @@ -2793,42 +2768,18 @@
- adev = devnr_to_adev(AV8100_DEVNR_DEFAULT);
- if (!adev)
- return -EFAULT;
- - if (adev->timer_flag == TIMER_POWERDOWN) {
- - dev_dbg(adev->dev, "%s busy %d\n", __func__, user);
- - return -EBUSY;
- - }
- - if (adev->params.suspended && (user == AV8100_HDMI_USER_AUDIO)) {
- - dev_dbg(adev->dev, "%s suspended %d\n", __func__, user);
- - return -EPERM;
- - }
- LOCK_AV8100_USRCNT;
- - switch (user) {
- - case AV8100_HDMI_USER_AUDIO:
- - if (!adev->usr_audio) {
- - adev->usr_cnt++;
- - adev->usr_audio = true;
- - }
- - break;
- - case AV8100_HDMI_USER_VIDEO:
- - if (!adev->usr_video) {
- - adev->usr_cnt++;
- - adev->usr_video = true;
- - }
- - break;
- - default:
- - break;
- - }
- + adev->usr_cnt++;
- usr_cnt = adev->usr_cnt;
- UNLOCK_AV8100_USRCNT;
- -
- - dev_dbg(adev->dev, "%s %d %d\n", __func__, usr_cnt, user);
- + dev_dbg(adev->dev, "%s %d\n", __func__, usr_cnt);
- return usr_cnt;
- }
- EXPORT_SYMBOL(av8100_hdmi_get);
- -int av8100_hdmi_put(enum av8100_hdmi_user user)
- +int av8100_hdmi_put(void)
- {
- struct av8100_device *adev;
- int usr_cnt;
- @@ -2838,41 +2789,16 @@
- return -EFAULT;
- LOCK_AV8100_USRCNT;
- - switch (user) {
- - case AV8100_HDMI_USER_AUDIO:
- - if (adev->usr_audio) {
- - adev->usr_cnt--;
- - adev->usr_audio = false;
- - }
- - break;
- - case AV8100_HDMI_USER_VIDEO:
- - if (adev->usr_video) {
- - adev->usr_cnt--;
- - adev->usr_video = false;
- - }
- - break;
- - default:
- - break;
- - }
- + if (adev->usr_cnt)
- + adev->usr_cnt--;
- usr_cnt = adev->usr_cnt;
- + UNLOCK_AV8100_USRCNT;
- - dev_dbg(adev->dev, "%s %d %d\n", __func__, usr_cnt, user);
- + dev_dbg(adev->dev, "%s %d\n", __func__, usr_cnt);
- - if (usr_cnt == 0) {
- - if (adev->params.suspended) {
- - adev->params.disp_on = false;
- - av8100_powerdown();
- - } else if (adev->params.plug_state == AV8100_UNPLUGGED) {
- - if (adev->params.pwr_recover) {
- - adev->params.pwr_recover = false;
- - av8100_powerdown();
- - av8100_powerup();
- - }
- - if (av8100_powerscan(true))
- - dev_err(adev->dev, "av8100_powerscan failed\n");
- - }
- - }
- - UNLOCK_AV8100_USRCNT;
- + if (usr_cnt == 0)
- + if (av8100_powerscan(true))
- + dev_err(adev->dev, "av8100_powerscan failed\n");
- return usr_cnt;
- }
- @@ -2880,7 +2806,9 @@
- int av8100_hdmi_video_off(void)
- {
- + int ret;
- struct av8100_device *adev;
- + union av8100_configuration config;
- adev = devnr_to_adev(AV8100_DEVNR_DEFAULT);
- if (!adev)
- @@ -2891,64 +2819,42 @@
- if (av8100_status_get().av8100_state < AV8100_OPMODE_VIDEO)
- return 0;
- - /* Video is off: mask uovbi interrupts */
- - if (av8100_reg_gen_int_mask_w(
- - AV8100_GENERAL_INTERRUPT_MASK_EOCM_LOW,
- - AV8100_GENERAL_INTERRUPT_MASK_VSIM_LOW,
- - AV8100_GENERAL_INTERRUPT_MASK_VSOM_LOW,
- - adev->params.cecm,
- - adev->params.hdcpm,
- - AV8100_GENERAL_INTERRUPT_MASK_UOVBM_LOW,
- - AV8100_GENERAL_INTERRUPT_MASK_TEM_LOW))
- - dev_dbg(adev->dev, "av8100_reg_gen_int_mask_w err\n");
- -
- - av8100_set_state(adev, AV8100_OPMODE_IDLE);
- -
- - return 0;
- -}
- -EXPORT_SYMBOL(av8100_hdmi_video_off);
- -
- -int av8100_hdmi_video_on(void)
- -{
- - struct av8100_device *adev;
- -
- - adev = devnr_to_adev(AV8100_DEVNR_DEFAULT);
- - if (!adev)
- + /* Get current av8100 video input format */
- + ret = av8100_conf_get(AV8100_COMMAND_VIDEO_INPUT_FORMAT,
- + &config);
- + if (ret) {
- + dev_err(adev->dev, "%s:av8100_conf_get "
- + "AV8100_COMMAND_VIDEO_INPUT_FORMAT failed\n",
- + __func__);
- return -EFAULT;
- + }
- - dev_dbg(adev->dev, "%s\n", __func__);
- + config.video_input_format.dsi_input_mode = AV8100_HDMI_DSI_OFF;
- - if (av8100_status_get().av8100_state < AV8100_OPMODE_IDLE)
- - return 0;
- + ret = av8100_conf_prep(AV8100_COMMAND_VIDEO_INPUT_FORMAT,
- + &config);
- + if (ret) {
- + dev_err(adev->dev, "%s:av8100_conf_prep "
- + "AV8100_COMMAND_VIDEO_INPUT_FORMAT failed\n",
- + __func__);
- + return -EFAULT;
- + }
- - /* Video is off: unmask uovbi interrupts */
- - if (av8100_reg_gen_int_mask_w(
- - AV8100_GENERAL_INTERRUPT_MASK_EOCM_LOW,
- - AV8100_GENERAL_INTERRUPT_MASK_VSIM_LOW,
- - AV8100_GENERAL_INTERRUPT_MASK_VSOM_LOW,
- - adev->params.cecm,
- - adev->params.hdcpm,
- - adev->params.uovbm,
- - AV8100_GENERAL_INTERRUPT_MASK_TEM_LOW))
- - dev_dbg(adev->dev, "av8100_reg_gen_int_mask_w err\n");
- + /* Video input */
- + ret = av8100_conf_w(AV8100_COMMAND_VIDEO_INPUT_FORMAT,
- + NULL, NULL, I2C_INTERFACE);
- + if (ret) {
- + dev_err(adev->dev, "%s:av8100_conf_w "
- + "AV8100_COMMAND_VIDEO_INPUT_FORMAT failed\n",
- + __func__);
- + return -EFAULT;
- + }
- - av8100_set_state(adev, AV8100_OPMODE_VIDEO);
- + av8100_set_state(adev, AV8100_OPMODE_IDLE);
- return 0;
- }
- -EXPORT_SYMBOL(av8100_hdmi_video_on);
- -
- -void av8100_conf_lock(void)
- -{
- - LOCK_AV8100_CONF;
- -}
- -EXPORT_SYMBOL(av8100_conf_lock);
- -
- -void av8100_conf_unlock(void)
- -{
- - UNLOCK_AV8100_CONF;
- -}
- -EXPORT_SYMBOL(av8100_conf_unlock);
- +EXPORT_SYMBOL(av8100_hdmi_video_off);
- int av8100_powerwakeup(bool disp_user)
- {
- @@ -2966,12 +2872,16 @@
- goto av8100_powerwakeup_end;
- }
- - if (disp_user)
- + if (disp_user) {
- adev->params.disp_on = true;
- + if (av8100_status_get().av8100_state < AV8100_OPMODE_STANDBY)
- + ret = av8100_powerup();
- + } else {
- + if (av8100_status_get().av8100_state > AV8100_OPMODE_SHUTDOWN)
- + av8100_powerdown();
- - if (av8100_status_get().av8100_state < AV8100_OPMODE_STANDBY)
- - ret = av8100_powerup();
- -
- + set_hrtimer(adev, TIMER_POWERUP);
- + }
- av8100_powerwakeup_end:
- return ret;
- }
- @@ -3016,8 +2926,7 @@
- set_hrtimer(adev, TIMER_POWERDOWN);
- adev->params.busy = true;
- } else {
- - if (!adev->usr_audio)
- - ret = av8100_powerdown();
- + ret = av8100_powerdown();
- }
- av8100_powerscan_end:
- return ret;
- @@ -3071,7 +2980,7 @@
- return -EFAULT;
- adev->params.busy = false;
- - adev->flag = 0;
- + adev->flag &= ~AV8100_EVENTS;
- adev->timer_flag = TIMER_UNSET;
- hrtimer_cancel(&adev->hrtimer);
- pdata = adev->dev->platform_data;
- @@ -3434,10 +3343,8 @@
- av8100_download_firmware_err2:
- UNLOCK_AV8100_FWDL;
- - if (!adev->params.suspended) {
- - adev->flag |= AV8100_SCAN_TIMER_EVENT;
- - wake_up_interruptible(&adev->event);
- - }
- + adev->flag |= AV8100_SCAN_TIMER_EVENT;
- + wake_up_interruptible(&adev->event);
- return retval;
- }
- @@ -4851,11 +4758,7 @@
- container_of(data, struct av8100_device, early_suspend);
- adev->params.suspended = false;
- - if (!adev->params.disp_on) {
- - adev->flag &= ~AV8100_EVENTS;
- - hrtimer_cancel(&adev->hrtimer);
- - (void)av8100_powerwakeup(false);
- - }
- + (void)av8100_powerwakeup(false);
- }
- static int av8100_open(struct inode *inode, struct file *filp)
- diff -ruN a/drivers/video/av8100/hdmi.c b/drivers/video/av8100/hdmi.c
- --- a/drivers/video/av8100/hdmi.c 2012-10-27 17:12:06.842927527 +0900
- +++ b/drivers/video/av8100/hdmi.c 2012-10-24 23:38:23.000000000 +0900
- @@ -409,7 +409,6 @@
- {
- union av8100_configuration config;
- struct av8100_status status;
- - int ret = 0;
- status = av8100_status_get();
- if (status.av8100_state < AV8100_OPMODE_STANDBY)
- @@ -430,24 +429,19 @@
- config.infoframes_format.crc = crc;
- config.infoframes_format.length = data_len;
- memcpy(&config.infoframes_format.data, data, data_len);
- - av8100_conf_lock();
- if (av8100_conf_prep(AV8100_COMMAND_INFOFRAMES,
- &config) != 0) {
- dev_err(hdev->dev, "av8100_conf_prep FAIL\n");
- - ret = -EINVAL;
- - goto infofrsend_end;
- + return -EINVAL;
- }
- if (av8100_conf_w(AV8100_COMMAND_INFOFRAMES,
- NULL, NULL, I2C_INTERFACE) != 0) {
- dev_err(hdev->dev, "av8100_conf_w FAIL\n");
- - ret = -EINVAL;
- - goto infofrsend_end;
- + return -EINVAL;
- }
- -infofrsend_end:
- - av8100_conf_unlock();
- - return ret;
- + return 0;
- }
- static int hdcpchkaesotp(struct hdmi_device *hdev, u8 *crc, u8 *progged)
- @@ -702,7 +696,6 @@
- {
- union av8100_configuration config;
- struct av8100_status status;
- - int ret = 0;
- status = av8100_status_get();
- if (status.av8100_state < AV8100_OPMODE_STANDBY) {
- @@ -727,24 +720,19 @@
- config.audio_input_format.audio_if_mode = cfg->if_mode;
- config.audio_input_format.audio_mute = cfg->mute;
- - av8100_conf_lock();
- if (av8100_conf_prep(AV8100_COMMAND_AUDIO_INPUT_FORMAT,
- &config) != 0) {
- dev_err(hdev->dev, "av8100_conf_prep FAIL\n");
- - ret = -EINVAL;
- - goto audiocfg_end;
- + return -EINVAL;
- }
- if (av8100_conf_w(AV8100_COMMAND_AUDIO_INPUT_FORMAT,
- NULL, NULL, I2C_INTERFACE) != 0) {
- dev_err(hdev->dev, "av8100_conf_w FAIL\n");
- - ret = -EINVAL;
- - goto audiocfg_end;
- + return -EINVAL;
- }
- -audiocfg_end:
- - av8100_conf_unlock();
- - return ret;
- + return 0;
- }
- /* sysfs */
- @@ -2174,19 +2162,15 @@
- else
- config.hdmi_format.hdmi_mode = AV8100_HDMI_ON;
- - av8100_conf_lock();
- if (av8100_conf_prep(AV8100_COMMAND_HDMI, &config) != 0) {
- dev_err(hdev->dev, "av8100_conf_prep FAIL\n");
- - av8100_conf_unlock();
- return -EINVAL;
- }
- if (av8100_conf_w(AV8100_COMMAND_HDMI, NULL, NULL,
- I2C_INTERFACE) != 0) {
- dev_err(hdev->dev, "av8100_conf_w FAIL\n");
- - av8100_conf_unlock();
- return -EINVAL;
- }
- - av8100_conf_unlock();
- }
- break;
- diff -ruN a/drivers/video/b2r2/b2r2_api.c b/drivers/video/b2r2/b2r2_api.c
- --- a/drivers/video/b2r2/b2r2_api.c 2012-10-27 17:12:06.314921488 +0900
- +++ b/drivers/video/b2r2/b2r2_api.c 2012-10-24 23:38:23.000000000 +0900
- @@ -308,6 +308,7 @@
- case B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE:
- case B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE:
- + case B2R2_BLT_FMT_YV12:
- return true;
- default:
- return false;
- diff -ruN a/drivers/video/b2r2/b2r2_generic.c b/drivers/video/b2r2/b2r2_generic.c
- --- a/drivers/video/b2r2/b2r2_generic.c 2012-10-27 17:12:06.314921488 +0900
- +++ b/drivers/video/b2r2/b2r2_generic.c 2012-10-24 23:38:23.000000000 +0900
- @@ -211,6 +211,7 @@
- case B2R2_BLT_FMT_YVU420_PACKED_PLANAR:
- case B2R2_BLT_FMT_YVU422_PACKED_PLANAR:
- case B2R2_BLT_FMT_YUV444_PACKED_PLANAR:
- + case B2R2_BLT_FMT_YV12:
- return B2R2_NATIVE_YUV;
- default:
- /* Should never ever happen */
- @@ -240,103 +241,13 @@
- return B2R2_TY_ALPHA_RANGE_128; /* 0 - 128 */
- }
- -static unsigned int get_pitch(struct b2r2_control *cont,
- - enum b2r2_blt_fmt format, u32 width)
- -{
- - switch (format) {
- - case B2R2_BLT_FMT_1_BIT_A1: {
- - int pitch = width >> 3;
- - /* Check for remainder */
- - if (width & 7)
- - pitch++;
- - return pitch;
- - break;
- - }
- - case B2R2_BLT_FMT_8_BIT_A8:
- - return width;
- - break;
- - case B2R2_BLT_FMT_16_BIT_RGB565: /* all 16 bits/pixel RGB formats */
- - case B2R2_BLT_FMT_16_BIT_ARGB1555:
- - case B2R2_BLT_FMT_16_BIT_ARGB4444:
- - case B2R2_BLT_FMT_16_BIT_ABGR4444:
- - return width * 2;
- - break;
- - case B2R2_BLT_FMT_24_BIT_RGB888: /* all 24 bits/pixel raster formats */
- - case B2R2_BLT_FMT_24_BIT_ARGB8565:
- - case B2R2_BLT_FMT_24_BIT_YUV888:
- - case B2R2_BLT_FMT_24_BIT_VUY888:
- - return width * 3;
- - break;
- - case B2R2_BLT_FMT_32_BIT_ARGB8888: /* all 32 bits/pixel formats */
- - case B2R2_BLT_FMT_32_BIT_ABGR8888:
- - case B2R2_BLT_FMT_32_BIT_VUYA8888:
- - case B2R2_BLT_FMT_32_BIT_AYUV8888:
- - return width * 4;
- - break;
- - case B2R2_BLT_FMT_CB_Y_CR_Y:
- - /* width of the buffer must be a multiple of 4 */
- - if (width & 3) {
- - b2r2_log_warn(cont->dev, "%s: Illegal width "
- - "for fmt=%#010x width=%d\n", __func__,
- - format, width);
- - return 0;
- - }
- - return width * 2;
- - break;
- - case B2R2_BLT_FMT_YUV444_PACKED_PLANAR:
- - return width;
- - break;
- - /* fall through, same pitch and pointers */
- - case B2R2_BLT_FMT_YUV420_PACKED_PLANAR:
- - case B2R2_BLT_FMT_YUV422_PACKED_PLANAR:
- - case B2R2_BLT_FMT_YVU420_PACKED_PLANAR:
- - case B2R2_BLT_FMT_YVU422_PACKED_PLANAR:
- - case B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR:
- - case B2R2_BLT_FMT_YUV422_PACKED_SEMI_PLANAR:
- - case B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR:
- - case B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR:
- - /* width of the buffer must be a multiple of 2 */
- - if (width & 1) {
- - b2r2_log_warn(cont->dev, "%s: Illegal width "
- - "for fmt=%#010x width=%d\n", __func__,
- - format, width);
- - return 0;
- - }
- - /*
- - * return pitch of the Y-buffer.
- - * U and V pitch can be derived from it.
- - */
- - return width;
- - break;
- - case B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE:
- - case B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE:
- - /* width of the buffer must be a multiple of 16. */
- - if (width & 15) {
- - b2r2_log_warn(cont->dev, "%s: Illegal width "
- - "for fmt=%#010x width=%d\n", __func__,
- - format, width);
- - return 0;
- - }
- - /*
- - * return pitch of the Y-buffer.
- - * U and V pitch can be derived from it.
- - */
- - return width;
- - break;
- - default:
- - b2r2_log_warn(cont->dev, "%s: Unable to determine pitch "
- - "for fmt=%#010x width=%d\n", __func__,
- - format, width);
- - return 0;
- - }
- -}
- -
- static s32 validate_buf(struct b2r2_control *cont,
- const struct b2r2_blt_img *image,
- const struct b2r2_resolved_buf *buf)
- {
- u32 expect_buf_size;
- u32 pitch;
- + u32 chroma_pitch;
- if (image->width <= 0 || image->height <= 0) {
- b2r2_log_warn(cont->dev, "%s: width=%d or height=%d negative"
- @@ -346,7 +257,8 @@
- if (image->pitch == 0) {
- /* autodetect pitch based on format and width */
- - pitch = get_pitch(cont, image->fmt, image->width);
- + pitch = b2r2_calc_pitch_from_width(cont->dev,
- + image->width, image->fmt);
- } else
- pitch = image->pitch;
- @@ -361,22 +273,22 @@
- }
- /* format specific adjustments */
- + chroma_pitch = b2r2_get_chroma_pitch(pitch, image->fmt);
- switch (image->fmt) {
- case B2R2_BLT_FMT_YUV420_PACKED_PLANAR:
- case B2R2_BLT_FMT_YVU420_PACKED_PLANAR:
- + case B2R2_BLT_FMT_YV12:
- /*
- * Use ceil(height/2) in case buffer height
- * is not divisible by 2.
- */
- - expect_buf_size +=
- - (pitch >> 1) * ((image->height + 1) >> 1) * 2;
- + expect_buf_size += chroma_pitch *
- + ((image->height + 1) >> 1) * 2;
- break;
- case B2R2_BLT_FMT_YUV422_PACKED_PLANAR:
- case B2R2_BLT_FMT_YVU422_PACKED_PLANAR:
- - expect_buf_size += (pitch >> 1) * image->height * 2;
- - break;
- case B2R2_BLT_FMT_YUV444_PACKED_PLANAR:
- - expect_buf_size += pitch * image->height * 2;
- + expect_buf_size += chroma_pitch * image->height * 2;
- break;
- case B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR:
- @@ -558,6 +470,7 @@
- case B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE:
- case B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE:
- + case B2R2_BLT_FMT_YV12:
- if ((req->user_req.flags & B2R2_BLT_FLAG_SOURCE_FILL) != 0) {
- fill_fmt = B2R2_NATIVE_AYCBCR8888;
- /*
- @@ -575,33 +488,9 @@
- b2r2_setup_ivmx(node, B2R2_CC_BLT_YUV888_TO_RGB);
- } else {
- /* SOURCE_FILL_RAW */
- - bool dst_yuv_planar =
- - B2R2_BLT_FMT_YUV420_PACKED_PLANAR ==
- - dst_img->fmt ||
- - B2R2_BLT_FMT_YUV422_PACKED_PLANAR ==
- - dst_img->fmt ||
- - B2R2_BLT_FMT_YVU420_PACKED_PLANAR ==
- - dst_img->fmt ||
- - B2R2_BLT_FMT_YVU422_PACKED_PLANAR ==
- - dst_img->fmt ||
- - B2R2_BLT_FMT_YUV444_PACKED_PLANAR ==
- - dst_img->fmt;
- -
- - bool dst_yuv_semi_planar =
- - B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR ==
- - dst_img->fmt ||
- - B2R2_BLT_FMT_YUV422_PACKED_SEMI_PLANAR ==
- - dst_img->fmt ||
- - B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR ==
- - dst_img->fmt ||
- - B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR ==
- - dst_img->fmt ||
- - B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE ==
- - dst_img->fmt ||
- - B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE ==
- - dst_img->fmt;
- -
- - if (dst_yuv_planar || dst_yuv_semi_planar) {
- + if (b2r2_is_ycbcrp_fmt(dst_img->fmt) ||
- + b2r2_is_ycbcrsp_fmt(dst_img->fmt) ||
- + b2r2_is_mb_fmt(dst_img->fmt))
- /*
- * SOURCE_FILL_RAW cannot be supported
- * with multi-buffer formats.
- @@ -609,9 +498,8 @@
- * from misbehaving.
- */
- fill_fmt = B2R2_NATIVE_AYCBCR8888;
- - } else {
- + else
- fill_fmt = to_native_fmt(cont, dst_img->fmt);
- - }
- switch (dst_img->fmt) {
- case B2R2_BLT_FMT_24_BIT_YUV888:
- @@ -712,27 +600,13 @@
- u32 fctl = 0;
- u32 rsf = 0;
- u32 rzi = 0;
- - bool yuv_semi_planar =
- - src_img->fmt == B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR ||
- - src_img->fmt == B2R2_BLT_FMT_YUV422_PACKED_SEMI_PLANAR ||
- - src_img->fmt == B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR ||
- - src_img->fmt == B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR ||
- - src_img->fmt == B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE ||
- - src_img->fmt == B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE;
- -
- - bool yuv_planar =
- - src_img->fmt == B2R2_BLT_FMT_YUV420_PACKED_PLANAR ||
- - src_img->fmt == B2R2_BLT_FMT_YUV422_PACKED_PLANAR ||
- - src_img->fmt == B2R2_BLT_FMT_YVU420_PACKED_PLANAR ||
- - src_img->fmt == B2R2_BLT_FMT_YVU422_PACKED_PLANAR ||
- - src_img->fmt == B2R2_BLT_FMT_YUV444_PACKED_PLANAR;
- -
- struct b2r2_filter_spec *hf;
- struct b2r2_filter_spec *vf;
- -
- bool use_h_filter = false;
- bool use_v_filter = false;
- -
- + const bool yuv_planar = b2r2_is_ycbcrp_fmt(src_img->fmt);
- + const bool yuv_semi_planar = b2r2_is_ycbcrsp_fmt(src_img->fmt) ||
- + b2r2_is_mb_fmt(src_img->fmt);
- struct b2r2_control *cont = req->instance->control;
- bool fullrange = (req->user_req.flags &
- B2R2_BLT_FLAG_FULL_RANGE_YUV) != 0;
- @@ -748,7 +622,8 @@
- if (src_img->pitch == 0) {
- /* Determine pitch based on format and width of the image. */
- - src_pitch = get_pitch(cont, src_img->fmt, src_img->width);
- + src_pitch = b2r2_calc_pitch_from_width(cont->dev,
- + src_img->width, src_img->fmt);
- } else {
- src_pitch = src_img->pitch;
- }
- @@ -852,7 +727,8 @@
- case B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE:
- - case B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE: {
- + case B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE:
- + case B2R2_BLT_FMT_YV12: {
- /*
- * Luma handled in the same way
- * for all YUV multi-buffer formats.
- @@ -906,6 +782,7 @@
- case B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE:
- + case B2R2_BLT_FMT_YV12:
- /*
- * Chrominance is always half the luminance size
- * so chrominance resizer is always active.
- @@ -1025,50 +902,14 @@
- */
- u32 cb_addr = 0;
- u32 cr_addr = 0;
- - u32 chroma_pitch = 0;
- - bool swapped_chroma =
- - src_img->fmt == B2R2_BLT_FMT_YVU420_PACKED_PLANAR ||
- - src_img->fmt == B2R2_BLT_FMT_YVU422_PACKED_PLANAR;
- enum b2r2_native_fmt src_fmt =
- to_native_fmt(cont, src_img->fmt);
- + u32 chroma_pitch =
- + b2r2_get_chroma_pitch(src_pitch, src_img->fmt);
- - if (swapped_chroma)
- - cr_addr = req->src_resolved.physical_address +
- - src_pitch * src_img->height;
- - else
- - cb_addr = req->src_resolved.physical_address +
- - src_pitch * src_img->height;
- -
- - switch (src_img->fmt) {
- - case B2R2_BLT_FMT_YUV420_PACKED_PLANAR:
- - case B2R2_BLT_FMT_YVU420_PACKED_PLANAR:
- - chroma_pitch = src_pitch >> 1;
- - if (swapped_chroma)
- - cb_addr = cr_addr + chroma_pitch *
- - (src_img->height >> 1);
- - else
- - cr_addr = cb_addr + chroma_pitch *
- - (src_img->height >> 1);
- - break;
- - case B2R2_BLT_FMT_YUV422_PACKED_PLANAR:
- - case B2R2_BLT_FMT_YVU422_PACKED_PLANAR:
- - chroma_pitch = src_pitch >> 1;
- - if (swapped_chroma)
- - cb_addr = cr_addr + chroma_pitch *
- - src_img->height;
- - else
- - cr_addr = cb_addr + chroma_pitch *
- - src_img->height;
- - break;
- - case B2R2_BLT_FMT_YUV444_PACKED_PLANAR:
- - /* Chrominance has full resolution, same as luminance.*/
- - chroma_pitch = src_pitch;
- - cr_addr =
- - cb_addr + chroma_pitch * src_img->height;
- - break;
- - default:
- - break;
- - }
- + b2r2_get_cb_cr_addr(req->src_resolved.physical_address,
- + src_pitch, src_img->height, src_img->fmt,
- + &cr_addr, &cb_addr);
- node->node.GROUP3.B2R2_SBA = cr_addr;
- node->node.GROUP3.B2R2_STY =
- @@ -1222,20 +1063,9 @@
- u32 fctl = 0;
- u32 rsf = 0;
- u32 endianness = 0;
- - bool yuv_semi_planar =
- - dst_img->fmt == B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR ||
- - dst_img->fmt == B2R2_BLT_FMT_YUV422_PACKED_SEMI_PLANAR ||
- - dst_img->fmt == B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR ||
- - dst_img->fmt == B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR ||
- - dst_img->fmt == B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE ||
- - dst_img->fmt == B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE;
- -
- - bool yuv_planar =
- - dst_img->fmt == B2R2_BLT_FMT_YUV420_PACKED_PLANAR ||
- - dst_img->fmt == B2R2_BLT_FMT_YUV422_PACKED_PLANAR ||
- - dst_img->fmt == B2R2_BLT_FMT_YVU420_PACKED_PLANAR ||
- - dst_img->fmt == B2R2_BLT_FMT_YVU422_PACKED_PLANAR ||
- - dst_img->fmt == B2R2_BLT_FMT_YUV444_PACKED_PLANAR;
- + const bool yuv_planar = b2r2_is_ycbcrp_fmt(dst_img->fmt);
- + const bool yuv_semi_planar = b2r2_is_ycbcrsp_fmt(dst_img->fmt) ||
- + b2r2_is_mb_fmt(dst_img->fmt);
- u32 dst_pitch = 0;
- struct b2r2_control *cont = req->instance->control;
- @@ -1244,7 +1074,8 @@
- if (dst_img->pitch == 0) {
- /* Determine pitch based on format and width of the image. */
- - dst_pitch = get_pitch(cont, dst_img->fmt, dst_img->width);
- + dst_pitch = b2r2_calc_pitch_from_width(cont->dev,
- + dst_img->width, dst_img->fmt);
- } else {
- dst_pitch = dst_img->pitch;
- }
- @@ -1299,7 +1130,8 @@
- case B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE:
- - case B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE: {
- + case B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE:
- + case B2R2_BLT_FMT_YV12: {
- if (dst_img->fmt == B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR ||
- dst_img->fmt ==
- B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR) {
- @@ -1320,6 +1152,7 @@
- case B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE:
- + case B2R2_BLT_FMT_YV12:
- /*
- * Chrominance is always half the luminance size
- * so chrominance resizer is always active.
- @@ -1394,47 +1227,14 @@
- */
- u32 cb_addr = 0;
- u32 cr_addr = 0;
- - u32 chroma_pitch = 0;
- - bool swapped_chroma =
- - dst_img->fmt == B2R2_BLT_FMT_YVU420_PACKED_PLANAR ||
- - dst_img->fmt == B2R2_BLT_FMT_YVU422_PACKED_PLANAR;
- + u32 chroma_pitch =
- + b2r2_get_chroma_pitch(dst_pitch, dst_img->fmt);
- enum b2r2_native_fmt dst_native_fmt =
- to_native_fmt(cont, dst_img->fmt);
- - if (swapped_chroma)
- - cr_addr = req->dst_resolved.physical_address +
- - dst_pitch * dst_img->height;
- - else
- - cb_addr = req->dst_resolved.physical_address +
- - dst_pitch * dst_img->height;
- -
- - switch (dst_img->fmt) {
- - case B2R2_BLT_FMT_YUV420_PACKED_PLANAR:
- - chroma_pitch = dst_pitch >> 1;
- - if (swapped_chroma)
- - cb_addr = cr_addr + chroma_pitch *
- - (dst_img->height >> 1);
- - else
- - cr_addr = cb_addr + chroma_pitch *
- - (dst_img->height >> 1);
- - break;
- - case B2R2_BLT_FMT_YUV422_PACKED_PLANAR:
- - chroma_pitch = dst_pitch >> 1;
- - if (swapped_chroma)
- - cb_addr = cr_addr + chroma_pitch *
- - dst_img->height;
- - else
- - cr_addr = cb_addr + chroma_pitch *
- - dst_img->height;
- - break;
- - case B2R2_BLT_FMT_YUV444_PACKED_PLANAR:
- - chroma_pitch = dst_pitch;
- - cr_addr =
- - cb_addr + chroma_pitch * dst_img->height;
- - break;
- - default:
- - break;
- - }
- + b2r2_get_cb_cr_addr(req->dst_resolved.physical_address,
- + dst_pitch, dst_img->height, dst_img->fmt,
- + &cb_addr, &cr_addr);
- node->node.GROUP3.B2R2_SBA = cr_addr;
- node->node.GROUP3.B2R2_STY =
- @@ -1638,21 +1438,9 @@
- {
- const struct b2r2_blt_img *dst_img = &(req->user_req.dst_img);
- const enum b2r2_blt_fmt dst_fmt = dst_img->fmt;
- - const bool yuv_planar_dst =
- - dst_fmt == B2R2_BLT_FMT_YUV420_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV422_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU420_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU422_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV444_PACKED_PLANAR;
- -
- - const bool yuv_semi_planar_dst =
- - dst_fmt == B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV422_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE ||
- - dst_fmt == B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE;
- -
- + const bool yuv_planar_dst = b2r2_is_ycbcrp_fmt(dst_fmt);
- + const bool yuv_semi_planar_dst = b2r2_is_ycbcrsp_fmt(dst_fmt) ||
- + b2r2_is_mb_fmt(dst_fmt);
- const u32 group4_b2r2_sty =
- (B2R2_GENERIC_WORK_BUF_PITCH << B2R2_TY_BITMAP_PITCH_SHIFT) |
- B2R2_GENERIC_WORK_BUF_FMT |
- @@ -1671,8 +1459,8 @@
- b2r2_log_info(cont->dev, "%s ENTRY\n", __func__);
- if (dst_img->pitch == 0) {
- - /* Determine pitch based on format and width of the image. */
- - dst_pitch = get_pitch(cont, dst_img->fmt, dst_img->width);
- + dst_pitch = b2r2_calc_pitch_from_width(cont->dev,
- + dst_img->width, dst_img->fmt);
- } else
- dst_pitch = dst_img->pitch;
- @@ -1696,31 +1484,19 @@
- u32 cb_addr = 0;
- u32 cr_addr = 0;
- - u32 chroma_pitch = 0;
- - bool swapped_chroma =
- - dst_fmt == B2R2_BLT_FMT_YVU420_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU422_PACKED_PLANAR;
- + u32 chroma_pitch = b2r2_get_chroma_pitch(dst_pitch, dst_fmt);
- +
- enum b2r2_native_fmt dst_native_fmt =
- to_native_fmt(cont, dst_img->fmt);
- enum b2r2_ty alpha_range = get_alpha_range(cont, dst_img->fmt);
- - if (swapped_chroma)
- - cr_addr = req->dst_resolved.physical_address +
- - dst_pitch * dst_img->height;
- - else
- - cb_addr = req->dst_resolved.physical_address +
- - dst_pitch * dst_img->height;
- + b2r2_get_cb_cr_addr(req->dst_resolved.physical_address,
- + dst_pitch, dst_img->height, dst_fmt,
- + &cr_addr, &cb_addr);
- switch (dst_fmt) {
- case B2R2_BLT_FMT_YUV420_PACKED_PLANAR:
- case B2R2_BLT_FMT_YVU420_PACKED_PLANAR:
- - chroma_pitch = dst_pitch >> 1;
- - if (swapped_chroma)
- - cb_addr = cr_addr + chroma_pitch *
- - (dst_img->height >> 1);
- - else
- - cr_addr = cb_addr + chroma_pitch *
- - (dst_img->height >> 1);
- /*
- * Chrominance is always half the luminance size
- * so chrominance resizer is always active.
- @@ -1735,13 +1511,6 @@
- break;
- case B2R2_BLT_FMT_YUV422_PACKED_PLANAR:
- case B2R2_BLT_FMT_YVU422_PACKED_PLANAR:
- - chroma_pitch = dst_pitch >> 1;
- - if (swapped_chroma)
- - cb_addr = cr_addr + chroma_pitch *
- - dst_img->height;
- - else
- - cr_addr = cb_addr + chroma_pitch *
- - dst_img->height;
- /*
- * YUV422 or YVU422
- * Chrominance is always half the luminance size
- @@ -1755,9 +1524,6 @@
- rsf |= (1 << 10) << B2R2_RSF_VSRC_INC_SHIFT;
- break;
- case B2R2_BLT_FMT_YUV444_PACKED_PLANAR:
- - chroma_pitch = dst_pitch;
- - cr_addr =
- - cb_addr + chroma_pitch * dst_img->height;
- /*
- * No scaling required since
- * chrominance is not subsampled.
- @@ -1825,7 +1591,6 @@
- node->node.GROUP4.B2R2_SBA = in_buf->phys_addr;
- node->node.GROUP4.B2R2_STY = group4_b2r2_sty;
- -
- /*
- * Red chroma (V-component)
- * The flag B2R2_TTY_CB_NOT_CR actually works
- @@ -2121,19 +1886,9 @@
- (B2R2_BLT_FLAG_SOURCE_FILL |
- B2R2_BLT_FLAG_SOURCE_FILL_RAW)) != 0;
- - yuv_planar_dst =
- - dst_fmt == B2R2_BLT_FMT_YUV420_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV422_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU420_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU422_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV444_PACKED_PLANAR;
- - yuv_semi_planar_dst =
- - dst_fmt == B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV422_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE ||
- - dst_fmt == B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE;
- + yuv_planar_dst = b2r2_is_ycbcrp_fmt(dst_fmt);
- + yuv_semi_planar_dst = b2r2_is_ycbcrsp_fmt(dst_fmt) ||
- + b2r2_is_mb_fmt(dst_fmt);
- *node_count = 0;
- *work_buf_width = 0;
- @@ -2428,31 +2183,12 @@
- const struct b2r2_blt_rect *dst_rect = &(req->user_req.dst_rect);
- const struct b2r2_blt_rect *src_rect = &(req->user_req.src_rect);
- const enum b2r2_blt_fmt src_fmt = req->user_req.src_img.fmt;
- - bool yuv_multi_buffer_src =
- - src_fmt == B2R2_BLT_FMT_YUV420_PACKED_PLANAR ||
- - src_fmt == B2R2_BLT_FMT_YUV422_PACKED_PLANAR ||
- - src_fmt == B2R2_BLT_FMT_YVU420_PACKED_PLANAR ||
- - src_fmt == B2R2_BLT_FMT_YVU422_PACKED_PLANAR ||
- - src_fmt == B2R2_BLT_FMT_YUV444_PACKED_PLANAR ||
- - src_fmt == B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR ||
- - src_fmt == B2R2_BLT_FMT_YUV422_PACKED_SEMI_PLANAR ||
- - src_fmt == B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR ||
- - src_fmt == B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR ||
- - src_fmt == B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE ||
- - src_fmt == B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE;
- + const bool yuv_multi_buffer_src = b2r2_is_ycbcrsp_fmt(src_fmt) ||
- + b2r2_is_ycbcrp_fmt(src_fmt) || b2r2_is_mb_fmt(src_fmt);
- const enum b2r2_blt_fmt dst_fmt = req->user_req.dst_img.fmt;
- - const bool yuv_multi_buffer_dst =
- - dst_fmt == B2R2_BLT_FMT_YUV420_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV422_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU420_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU422_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV444_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV422_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE ||
- - dst_fmt == B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE;
- + const bool yuv_multi_buffer_dst = b2r2_is_ycbcrsp_fmt(dst_fmt) ||
- + b2r2_is_ycbcrp_fmt(dst_fmt) || b2r2_is_mb_fmt(dst_fmt);
- +
- s32 h_scf = 1 << 10;
- s32 v_scf = 1 << 10;
- s32 src_x = 0;
- @@ -2830,19 +2566,6 @@
- if (yuv_multi_buffer_dst) {
- s32 dst_w = dst_rect_area->width;
- s32 dst_h = dst_rect_area->height;
- - bool yuv420_dst =
- - dst_fmt == B2R2_BLT_FMT_YUV420_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU420_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE;
- -
- - bool yuv422_dst =
- - dst_fmt == B2R2_BLT_FMT_YUV422_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU422_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV422_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE;
- node = node->next;
- /* Luma on SRC3 */
- node->node.GROUP5.B2R2_SXY =
- @@ -2852,7 +2575,7 @@
- ((dst_w & 0xfff) << B2R2_SZ_WIDTH_SHIFT) |
- ((dst_h & 0xfff) << B2R2_SZ_HEIGHT_SHIFT);
- - if (yuv420_dst) {
- + if (b2r2_is_ycbcr420_fmt(dst_fmt)) {
- /*
- * Chroma goes on SRC2 and potentially on SRC1.
- * Chroma is half the size of luma. Must round up
- @@ -2879,7 +2602,7 @@
- node->node.GROUP3.B2R2_SSZ =
- node->node.GROUP4.B2R2_SSZ;
- }
- - } else if (yuv422_dst) {
- + } else if (b2r2_is_ycbcr422_fmt(dst_fmt)) {
- /*
- * Chroma goes on SRC2 and potentially on SRC1.
- * Now chroma is half the size of luma
- @@ -3007,11 +2730,7 @@
- int i = 0;
- /* Number of nodes required to write chroma output */
- int n_nodes = 1;
- - if (dst_fmt == B2R2_BLT_FMT_YUV420_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV422_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU420_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YVU422_PACKED_PLANAR ||
- - dst_fmt == B2R2_BLT_FMT_YUV444_PACKED_PLANAR)
- + if (b2r2_is_ycbcrp_fmt(dst_fmt))
- n_nodes = 2;
- node->node.GROUP4.B2R2_SXY = 0;
- diff -ruN a/drivers/video/b2r2/b2r2_input_validation.c b/drivers/video/b2r2/b2r2_input_validation.c
- --- a/drivers/video/b2r2/b2r2_input_validation.c 2012-10-27 17:12:06.326921627 +0900
- +++ b/drivers/video/b2r2/b2r2_input_validation.c 2012-10-24 23:38:23.000000000 +0900
- @@ -75,6 +75,7 @@
- case B2R2_BLT_FMT_YUV444_PACKED_PLANAR:
- case B2R2_BLT_FMT_24_BIT_VUY888:
- case B2R2_BLT_FMT_32_BIT_VUYA8888:
- + case B2R2_BLT_FMT_YV12:
- return true;
- default:
- @@ -96,6 +97,7 @@
- case B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE:
- case B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE:
- + case B2R2_BLT_FMT_YV12:
- return false;
- default:
- return true;
- @@ -194,6 +196,7 @@
- case B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR:
- return b2r2_align_up(width, 2);
- + case B2R2_BLT_FMT_YV12:
- case B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE:
- case B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE:
- return b2r2_align_up(width, 16);
- @@ -220,6 +223,7 @@
- break;
- + case B2R2_BLT_FMT_YV12:
- case B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE:
- case B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE:
- if (!b2r2_is_aligned(width, 16))
- @@ -241,6 +245,7 @@
- case B2R2_BLT_FMT_YVU420_PACKED_PLANAR:
- case B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR:
- + case B2R2_BLT_FMT_YV12:
- if (!b2r2_is_aligned(height, 2))
- return false;
- diff -ruN a/drivers/video/b2r2/b2r2_node_split.c b/drivers/video/b2r2/b2r2_node_split.c
- --- a/drivers/video/b2r2/b2r2_node_split.c 2012-10-27 17:12:06.322921580 +0900
- +++ b/drivers/video/b2r2/b2r2_node_split.c 2012-10-24 23:38:23.000000000 +0900
- @@ -2178,7 +2178,8 @@
- if (upsample) {
- h_rsf /= 2;
- - if (b2r2_is_yuv420_fmt(src->fmt))
- + if (b2r2_is_yuv420_fmt(src->fmt) ||
- + b2r2_is_yvu420_fmt(src->fmt))
- v_rsf /= 2;
- }
- @@ -2187,7 +2188,8 @@
- if (downsample) {
- h_rsf *= 2;
- - if (b2r2_is_yuv420_fmt(dst->fmt))
- + if (b2r2_is_yuv420_fmt(dst->fmt) ||
- + b2r2_is_yvu420_fmt(dst->fmt))
- v_rsf *= 2;
- }
- @@ -2407,7 +2409,8 @@
- tmp_buf.win.x >>= 1;
- tmp_buf.win.width = (tmp_buf.win.width + 1) / 2;
- - if (b2r2_is_yuv420_fmt(src->fmt)) {
- + if (b2r2_is_yuv420_fmt(src->fmt) ||
- + b2r2_is_yvu420_fmt(src->fmt)) {
- tmp_buf.win.height =
- (tmp_buf.win.height + 1) / 2;
- tmp_buf.win.y >>= 1;
- @@ -2425,7 +2428,8 @@
- * Each chroma buffer will have half as many values
- * per line as the luma buffer
- */
- - tmp_buf.pitch = (tmp_buf.pitch + 1) / 2;
- + tmp_buf.pitch = b2r2_get_chroma_pitch(src->pitch,
- + src->fmt);
- /* Horizontal resolution is half */
- tmp_buf.win.x >>= 1;
- @@ -2435,16 +2439,22 @@
- * If the buffer is in YUV420 format, the vertical
- * resolution is half as well
- */
- - if (b2r2_is_yuv420_fmt(src->fmt)) {
- + if (b2r2_is_yuv420_fmt(src->fmt) ||
- + b2r2_is_yvu420_fmt(src->fmt)) {
- tmp_buf.win.height =
- (tmp_buf.win.height + 1) / 2;
- tmp_buf.win.y >>= 1;
- }
- }
- - set_src_3(node, src->addr, src); /* Y */
- - set_src_2(node, tmp_buf.chroma_addr, &tmp_buf); /* U */
- - set_src_1(node, tmp_buf.chroma_cr_addr, &tmp_buf); /* V */
- + set_src_3(node, src->addr, src);
- + if (b2r2_is_yvu_fmt(src->fmt)) {
- + set_src_1(node, tmp_buf.chroma_addr, &tmp_buf);
- + set_src_2(node, tmp_buf.chroma_cr_addr, &tmp_buf);
- + } else {
- + set_src_2(node, tmp_buf.chroma_addr, &tmp_buf);
- + set_src_1(node, tmp_buf.chroma_cr_addr, &tmp_buf);
- + }
- break;
- default:
- @@ -2564,7 +2574,8 @@
- * resolution is half as well. Height must be rounded in
- * the same way as is done for width.
- */
- - if (b2r2_is_yuv420_fmt(dst->fmt)) {
- + if (b2r2_is_yuv420_fmt(dst->fmt) ||
- + b2r2_is_yvu420_fmt(dst->fmt)) {
- dst_planes[1].win.y /= 2;
- dst_planes[1].win.height =
- (dst_planes[1].win.height + 1) / 2;
- @@ -2575,10 +2586,8 @@
- /* There will be a third plane as well */
- nbr_planes = 3;
- - if (!b2r2_is_yuv444_fmt(dst->fmt)) {
- - /* The chroma planes have half the luma pitch */
- - dst_planes[1].pitch /= 2;
- - }
- + dst_planes[1].pitch = b2r2_get_chroma_pitch(
- + dst->pitch, dst->fmt);
- memcpy(&dst_planes[2], &dst_planes[1],
- sizeof(dst_planes[2]));
- @@ -2764,41 +2773,14 @@
- switch (buf->type) {
- case B2R2_FMT_TYPE_SEMI_PLANAR:
- - buf->chroma_addr = (u32)(((u8 *)addr) +
- - buf->pitch * buf->height);
- + b2r2_get_cb_cr_addr(buf->addr, buf->pitch, buf->height,
- + buf->fmt, &buf->chroma_addr,
- + &buf->chroma_addr);
- break;
- case B2R2_FMT_TYPE_PLANAR:
- - if (b2r2_is_yuv422_fmt(buf->fmt) ||
- - b2r2_is_yuv420_fmt(buf->fmt)) {
- - buf->chroma_addr = (u32)(((u8 *)addr) +
- - buf->pitch * buf->height);
- - } else {
- - buf->chroma_cr_addr = (u32)(((u8 *)addr) +
- - buf->pitch * buf->height);
- - }
- - if (b2r2_is_yuv420_fmt(buf->fmt)) {
- - /*
- - * Use ceil(height/2) in case
- - * buffer height is not divisible by 2.
- - */
- - buf->chroma_cr_addr =
- - (u32)(((u8 *)buf->chroma_addr) +
- - (buf->pitch >> 1) *
- - ((buf->height + 1) >> 1));
- - } else if (b2r2_is_yuv422_fmt(buf->fmt)) {
- - buf->chroma_cr_addr =
- - (u32)(((u8 *)buf->chroma_addr) +
- - (buf->pitch >> 1) * buf->height);
- - } else if (b2r2_is_yvu420_fmt(buf->fmt)) {
- - buf->chroma_addr =
- - (u32)(((u8 *)buf->chroma_cr_addr) +
- - (buf->pitch >> 1) *
- - ((buf->height + 1) >> 1));
- - } else if (b2r2_is_yvu422_fmt(buf->fmt)) {
- - buf->chroma_addr =
- - (u32)(((u8 *)buf->chroma_cr_addr) +
- - (buf->pitch >> 1) * buf->height);
- - }
- + b2r2_get_cb_cr_addr(buf->addr, buf->pitch, buf->height,
- + buf->fmt, &buf->chroma_addr,
- + &buf->chroma_cr_addr);
- break;
- default:
- break;
- diff -ruN a/drivers/video/b2r2/b2r2_utils.c b/drivers/video/b2r2/b2r2_utils.c
- --- a/drivers/video/b2r2/b2r2_utils.c 2012-10-27 17:12:06.302921352 +0900
- +++ b/drivers/video/b2r2/b2r2_utils.c 2012-10-24 23:38:23.000000000 +0900
- @@ -324,6 +324,7 @@
- case B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE:
- + case B2R2_BLT_FMT_YV12:
- return 12;
- case B2R2_BLT_FMT_16_BIT_ARGB4444:
- @@ -378,6 +379,7 @@
- case B2R2_BLT_FMT_32_BIT_AYUV8888:
- case B2R2_BLT_FMT_24_BIT_VUY888:
- case B2R2_BLT_FMT_32_BIT_VUYA8888:
- + case B2R2_BLT_FMT_YV12:
- return 8;
- default:
- @@ -476,6 +478,7 @@
- case B2R2_BLT_FMT_YUV422_PACKED_PLANAR:
- case B2R2_BLT_FMT_YVU422_PACKED_PLANAR:
- case B2R2_BLT_FMT_YUV444_PACKED_PLANAR:
- + case B2R2_BLT_FMT_YV12:
- return true;
- default:
- @@ -491,6 +494,7 @@
- case B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE:
- + case B2R2_BLT_FMT_YV12:
- return true;
- default:
- @@ -541,6 +545,20 @@
- }
- }
- +u32 b2r2_get_chroma_pitch(u32 luma_pitch, enum b2r2_blt_fmt fmt)
- +{
- + switch (fmt) {
- + case B2R2_BLT_FMT_YV12:
- + return b2r2_align_up(luma_pitch >> 1, 16);
- + case B2R2_BLT_FMT_YUV444_PACKED_PLANAR:
- + case B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR:
- + case B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR:
- + return luma_pitch;
- + default:
- + return luma_pitch >> 1;
- + }
- +}
- +
- u32 b2r2_calc_pitch_from_width(struct device *dev,
- s32 width, enum b2r2_blt_fmt fmt)
- {
- @@ -550,6 +568,9 @@
- } else if (b2r2_is_ycbcrsp_fmt(fmt) || b2r2_is_ycbcrp_fmt(fmt)) {
- return (u32)b2r2_div_round_up(width *
- b2r2_get_fmt_y_bpp(dev, fmt), 8);
- + } else if (b2r2_is_mb_fmt(fmt)) {
- + return b2r2_align_up((u32)b2r2_div_round_up(width *
- + b2r2_get_fmt_y_bpp(dev, fmt), 8), 16);
- } else {
- b2r2_log_err(dev, "%s: Internal error! "
- "Pitchless format supplied.\n",
- @@ -802,6 +823,7 @@
- case B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE:
- case B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE:
- case B2R2_BLT_FMT_YUV444_PACKED_PLANAR:
- + case B2R2_BLT_FMT_YV12:
- return true;
- default:
- return false;
- @@ -818,6 +840,7 @@
- case B2R2_BLT_FMT_YVU422_PACKED_PLANAR:
- case B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR:
- + case B2R2_BLT_FMT_YV12:
- return true;
- default:
- return false;
- @@ -832,9 +855,7 @@
- switch (fmt) {
- case B2R2_BLT_FMT_YUV420_PACKED_PLANAR:
- - case B2R2_BLT_FMT_YVU420_PACKED_PLANAR:
- case B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR:
- - case B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YUV420_PACKED_SEMIPLANAR_MB_STE:
- return true;
- default:
- @@ -845,11 +866,8 @@
- bool b2r2_is_yuv422_fmt(enum b2r2_blt_fmt fmt)
- {
- switch (fmt) {
- - case B2R2_BLT_FMT_CB_Y_CR_Y:
- case B2R2_BLT_FMT_YUV422_PACKED_PLANAR:
- - case B2R2_BLT_FMT_YVU422_PACKED_PLANAR:
- case B2R2_BLT_FMT_YUV422_PACKED_SEMI_PLANAR:
- - case B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YUV422_PACKED_SEMIPLANAR_MB_STE:
- return true;
- default:
- @@ -865,6 +883,7 @@
- switch (fmt) {
- case B2R2_BLT_FMT_YVU420_PACKED_PLANAR:
- case B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR:
- + case B2R2_BLT_FMT_YV12:
- return true;
- default:
- return false;
- @@ -928,6 +947,7 @@
- case B2R2_BLT_FMT_YUV422_PACKED_SEMI_PLANAR: /* Fall through */
- case B2R2_BLT_FMT_YVU422_PACKED_SEMI_PLANAR: /* Fall through */
- case B2R2_BLT_FMT_YUV444_PACKED_PLANAR:
- + case B2R2_BLT_FMT_YV12:
- return width;
- case B2R2_BLT_FMT_16_BIT_ARGB4444: /* Fall through */
- @@ -1004,6 +1024,7 @@
- case B2R2_BLT_FMT_YUV422_PACKED_PLANAR:
- case B2R2_BLT_FMT_YVU422_PACKED_PLANAR:
- case B2R2_BLT_FMT_YUV444_PACKED_PLANAR:
- + case B2R2_BLT_FMT_YV12:
- return B2R2_NATIVE_YUV;
- default:
- /* Should never ever happen */
- @@ -1096,6 +1117,7 @@
- case B2R2_BLT_FMT_YUV422_PACKED_PLANAR:
- case B2R2_BLT_FMT_YVU422_PACKED_PLANAR:
- case B2R2_BLT_FMT_YUV444_PACKED_PLANAR:
- + case B2R2_BLT_FMT_YV12:
- return B2R2_FMT_TYPE_PLANAR;
- case B2R2_BLT_FMT_YUV420_PACKED_SEMI_PLANAR:
- case B2R2_BLT_FMT_YVU420_PACKED_SEMI_PLANAR:
- @@ -1405,7 +1427,44 @@
- return "VUY888";
- case B2R2_BLT_FMT_32_BIT_VUYA8888:
- return "VUYA8888";
- + case B2R2_BLT_FMT_YV12:
- + return "YV12";
- default:
- return "UNKNOWN";
- }
- }
- +
- +void b2r2_get_cb_cr_addr(u32 phy_base_addr, u32 luma_pitch, u32 height,
- + enum b2r2_blt_fmt fmt, u32 *cb_addr, u32 *cr_addr)
- +{
- + u32 chroma_pitch = b2r2_get_chroma_pitch(luma_pitch, fmt);
- +
- + if (cr_addr == NULL || cb_addr == NULL)
- + return;
- +
- + if (b2r2_is_yvu_fmt(fmt))
- + *cr_addr = phy_base_addr + luma_pitch * height;
- + else
- + *cb_addr = phy_base_addr + luma_pitch * height;
- +
- + switch (fmt) {
- + case B2R2_BLT_FMT_YUV420_PACKED_PLANAR:
- + *cr_addr = *cb_addr + chroma_pitch * (height >> 1);
- + break;
- + case B2R2_BLT_FMT_YVU420_PACKED_PLANAR:
- + case B2R2_BLT_FMT_YV12:
- + *cb_addr = *cr_addr + chroma_pitch * (height >> 1);
- + break;
- + case B2R2_BLT_FMT_YUV422_PACKED_PLANAR:
- + *cr_addr = *cb_addr + chroma_pitch * height;
- + break;
- + case B2R2_BLT_FMT_YVU422_PACKED_PLANAR:
- + *cb_addr = *cr_addr + chroma_pitch * height;
- + break;
- + case B2R2_BLT_FMT_YUV444_PACKED_PLANAR:
- + *cr_addr = *cb_addr + chroma_pitch * height;
- + break;
- + default:
- + break;
- + }
- +}
- diff -ruN a/drivers/video/b2r2/b2r2_utils.h b/drivers/video/b2r2/b2r2_utils.h
- --- a/drivers/video/b2r2/b2r2_utils.h 2012-10-27 17:12:06.294921262 +0900
- +++ b/drivers/video/b2r2/b2r2_utils.h 2012-10-24 23:38:23.000000000 +0900
- @@ -77,6 +77,9 @@
- bool b2r2_is_yvu422_fmt(enum b2r2_blt_fmt fmt);
- bool b2r2_is_yuv444_fmt(enum b2r2_blt_fmt fmt);
- int b2r2_fmt_byte_pitch(enum b2r2_blt_fmt fmt, u32 width);
- +u32 b2r2_get_chroma_pitch(u32 luma_pitch, enum b2r2_blt_fmt fmt);
- +void b2r2_get_cb_cr_addr(u32 phy_base_addr, u32 luma_pitch, u32 height,
- + enum b2r2_blt_fmt fmt, u32 *cb_addr, u32 *cr_addr);
- enum b2r2_native_fmt b2r2_to_native_fmt(enum b2r2_blt_fmt fmt);
- u32 b2r2_to_RGB888(u32 color, const enum b2r2_blt_fmt fmt);
- enum b2r2_fmt_type b2r2_get_fmt_type(enum b2r2_blt_fmt fmt);
- diff -ruN a/drivers/video/mcde/display-av8100.c b/drivers/video/mcde/display-av8100.c
- --- a/drivers/video/mcde/display-av8100.c 2012-10-27 17:12:05.858916283 +0900
- +++ b/drivers/video/mcde/display-av8100.c 2012-10-24 23:38:23.000000000 +0900
- @@ -972,48 +972,34 @@
- }
- }
- - av8100_conf_lock();
- -
- /*
- * Don't look at dev->port->hdmi_sdtv_switch; it states only which
- * one should be started, not which one is currently working
- */
- - if (av8100_conf_get(AV8100_COMMAND_HDMI, &av8100_config)) {
- - ret = -EFAULT;
- - goto hdmi_set_video_mode_end;
- - }
- + if (av8100_conf_get(AV8100_COMMAND_HDMI, &av8100_config))
- + return -EFAULT;
- if (av8100_config.hdmi_format.hdmi_mode == AV8100_HDMI_ON) {
- /* Set HDMI mode to OFF */
- av8100_config.hdmi_format.hdmi_mode = AV8100_HDMI_OFF;
- av8100_config.hdmi_format.dvi_format = AV8100_DVI_CTRL_CTL0;
- av8100_config.hdmi_format.hdmi_format = AV8100_HDMI;
- - if (av8100_conf_prep(AV8100_COMMAND_HDMI, &av8100_config)) {
- - ret = -EFAULT;
- - goto hdmi_set_video_mode_end;
- - }
- + if (av8100_conf_prep(AV8100_COMMAND_HDMI, &av8100_config))
- + return -EFAULT;
- if (av8100_conf_w(AV8100_COMMAND_HDMI, NULL, NULL,
- - I2C_INTERFACE)) {
- - ret = -EFAULT;
- - goto hdmi_set_video_mode_end;
- - }
- - }
- - if (av8100_conf_get(AV8100_COMMAND_DENC, &av8100_config)) {
- - ret = -EFAULT;
- - goto hdmi_set_video_mode_end;
- + I2C_INTERFACE))
- + return -EFAULT;
- }
- + if (av8100_conf_get(AV8100_COMMAND_DENC, &av8100_config))
- + return -EFAULT;
- if (av8100_config.denc_format.enable) {
- /* Turn off DENC */
- av8100_config.denc_format.enable = 0;
- - if (av8100_conf_prep(AV8100_COMMAND_DENC, &av8100_config)) {
- - ret = -EFAULT;
- - goto hdmi_set_video_mode_end;
- - }
- + if (av8100_conf_prep(AV8100_COMMAND_DENC, &av8100_config))
- + return -EFAULT;
- if (av8100_conf_w(AV8100_COMMAND_DENC, NULL, NULL,
- - I2C_INTERFACE)) {
- - ret = -EFAULT;
- - goto hdmi_set_video_mode_end;
- - }
- + I2C_INTERFACE))
- + return -EFAULT;
- }
- /* Get current av8100 video output format */
- @@ -1023,7 +1009,7 @@
- dev_err(&dev->dev, "%s:av8100_conf_get "
- "AV8100_COMMAND_VIDEO_OUTPUT_FORMAT failed\n",
- __func__);
- - goto hdmi_set_video_mode_end;
- + return ret;
- }
- if (dev->port->hdmi_sdtv_switch == SDTV_SWITCH)
- @@ -1047,7 +1033,7 @@
- av8100_config.video_output_format.video_output_cea_vesa) {
- dev_err(&dev->dev, "%s:video output format not found "
- "\n", __func__);
- - goto hdmi_set_video_mode_end;
- + return ret;
- }
- ret = av8100_conf_prep(AV8100_COMMAND_VIDEO_OUTPUT_FORMAT,
- @@ -1056,7 +1042,7 @@
- dev_err(&dev->dev, "%s:av8100_conf_prep "
- "AV8100_COMMAND_VIDEO_OUTPUT_FORMAT failed\n",
- __func__);
- - goto hdmi_set_video_mode_end;
- + return ret;
- }
- /* Get current av8100 video input format */
- @@ -1066,7 +1052,7 @@
- dev_err(&dev->dev, "%s:av8100_conf_get "
- "AV8100_COMMAND_VIDEO_INPUT_FORMAT failed\n",
- __func__);
- - goto hdmi_set_video_mode_end;
- + return ret;
- }
- /* Set correct av8100 video input pixel format */
- @@ -1121,7 +1107,7 @@
- dev_err(&dev->dev, "%s:av8100_conf_prep "
- "AV8100_COMMAND_VIDEO_INPUT_FORMAT failed\n",
- __func__);
- - goto hdmi_set_video_mode_end;
- + return ret;
- }
- ret = av8100_conf_w(AV8100_COMMAND_VIDEO_INPUT_FORMAT,
- @@ -1130,7 +1116,7 @@
- dev_err(&dev->dev, "%s:av8100_conf_w "
- "AV8100_COMMAND_VIDEO_INPUT_FORMAT failed\n",
- __func__);
- - goto hdmi_set_video_mode_end;
- + return ret;
- }
- if (dev->port->hdmi_sdtv_switch == SDTV_SWITCH) {
- @@ -1155,7 +1141,7 @@
- dev_err(&dev->dev, "%s:av8100_configuration_prepare "
- "AV8100_COMMAND_COLORSPACECONVERSION failed\n",
- __func__);
- - goto hdmi_set_video_mode_end;
- + return ret;
- }
- ret = av8100_conf_w(
- @@ -1165,7 +1151,7 @@
- dev_err(&dev->dev, "%s:av8100_conf_w "
- "AV8100_COMMAND_COLORSPACECONVERSION failed\n",
- __func__);
- - goto hdmi_set_video_mode_end;
- + return ret;
- }
- /* Set video output format */
- @@ -1173,7 +1159,7 @@
- NULL, NULL, I2C_INTERFACE);
- if (ret) {
- dev_err(&dev->dev, "av8100_conf_w failed\n");
- - goto hdmi_set_video_mode_end;
- + return ret;
- }
- /* Set audio input format */
- @@ -1183,16 +1169,13 @@
- dev_err(&dev->dev, "%s:av8100_conf_w "
- "AV8100_COMMAND_AUDIO_INPUT_FORMAT failed\n",
- __func__);
- - goto hdmi_set_video_mode_end;
- + return ret;
- }
- dev->update_flags |= UPDATE_FLAG_VIDEO_MODE;
- dev->first_update = true;
- -hdmi_set_video_mode_end:
- - av8100_conf_unlock();
- -
- - return ret;
- + return 0;
- }
- static u16 rotate_byte_left(u8 c, int nr)
- @@ -1281,13 +1264,10 @@
- * Only one of them should be enabled.
- * Note HDMI/DVI and DENC are always turned off in set_video_mode.
- */
- - av8100_conf_lock();
- switch (dev->port->hdmi_sdtv_switch) {
- case SDTV_SWITCH:
- - if (av8100_conf_get(AV8100_COMMAND_DENC, &av8100_config)) {
- - ret = -EFAULT;
- - goto hdmi_on_first_update_end;
- - }
- + if (av8100_conf_get(AV8100_COMMAND_DENC, &av8100_config))
- + return -EFAULT;
- av8100_config.denc_format.enable = 1;
- if (dev->video_mode.yres == NATIVE_YRES_SDTV) {
- av8100_config.denc_format.standard_selection =
- @@ -1320,7 +1300,7 @@
- if (ret) {
- dev_err(&dev->dev, "%s:av8100_conf_prep "
- "AV8100_COMMAND_HDMI/DENC failed\n", __func__);
- - goto hdmi_on_first_update_end;
- + return ret;
- }
- if (dev->port->hdmi_sdtv_switch == SDTV_SWITCH)
- @@ -1332,16 +1312,12 @@
- if (ret) {
- dev_err(&dev->dev, "%s:av8100_conf_w "
- "AV8100_COMMAND_HDMI/DENC failed\n", __func__);
- - goto hdmi_on_first_update_end;
- + return ret;
- }
- -hdmi_on_first_update_end:
- - av8100_conf_unlock();
- +
- return ret;
- }
- -#define HDMI_GET_RETRY_TIME 500000
- -#define HDMI_GET_RETRY_CNT_MAX 4
- -
- static int hdmi_set_power_mode(struct mcde_display_device *ddev,
- enum mcde_display_power_mode power_mode)
- {
- @@ -1351,9 +1327,6 @@
- /* OFF -> STANDBY */
- if (ddev->power_mode == MCDE_DISPLAY_PM_OFF &&
- power_mode != MCDE_DISPLAY_PM_OFF) {
- - int cnt;
- - int get_res;
- -
- /*
- * the regulator for analog TV out is only enabled here,
- * this means that one needs to switch to the OFF state
- @@ -1368,21 +1341,9 @@
- ddev->power_mode = MCDE_DISPLAY_PM_STANDBY;
- /* Get HDMI resource */
- - for (cnt = 0; cnt < HDMI_GET_RETRY_CNT_MAX; cnt++) {
- - get_res = av8100_hdmi_get(AV8100_HDMI_USER_VIDEO);
- - if (get_res >= 0)
- - break;
- - else
- - usleep_range(HDMI_GET_RETRY_TIME,
- - HDMI_GET_RETRY_TIME * 12 / 10);
- - }
- + av8100_hdmi_get();
- - if (get_res < 0)
- - return -EFAULT;
- - else if (get_res > 1)
- - av8100_hdmi_video_on();
- - else
- - hdmi_set_port_pixel_format(ddev);
- + hdmi_set_port_pixel_format(ddev);
- }
- /* STANDBY -> ON */
- if (ddev->power_mode == MCDE_DISPLAY_PM_STANDBY &&
- @@ -1403,8 +1364,8 @@
- memset(&(ddev->video_mode), 0, sizeof(struct mcde_video_mode));
- /* Put HDMI resource */
- - if (av8100_hdmi_put(AV8100_HDMI_USER_VIDEO)) {
- - /* Audio is still used */
- + if (av8100_hdmi_put()) {
- + /* Audio is still used; disable video */
- av8100_hdmi_video_off();
- }
- diff -ruN a/drivers/video/mcde/logo.c b/drivers/video/mcde/logo.c
- --- a/drivers/video/mcde/logo.c 2012-10-27 17:12:05.890916646 +0900
- +++ b/drivers/video/mcde/logo.c 2012-10-24 23:38:23.000000000 +0900
- @@ -3,6 +3,7 @@
- * Show Logo in RLE 565 format
- *
- * Copyright (C) 2008 Google Incorporated
- + * Copyright (C) 2012 Sony Mobile Communications AB.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- @@ -113,7 +114,8 @@
- unsigned int widepixel = ptr[1];
- widepixel = (widepixel & 0xf800) << (19-11) |
- (widepixel & 0x07e0) << (10-5) |
- - (widepixel & 0x001f) << (3-0);
- + (widepixel & 0x001f) << (3-0) |
- + 0xff000000; /* Set alpha channel*/
- memset32(bits, widepixel, j << 2);
- }
- bits += j * fb_depth(info);
- diff -ruN a/include/linux/compdev.h b/include/linux/compdev.h
- --- a/include/linux/compdev.h 2012-10-27 17:11:56.614813356 +0900
- +++ b/include/linux/compdev.h 2012-10-24 23:38:23.000000000 +0900
- @@ -43,6 +43,7 @@
- COMPDEV_FMT_YVU420_SP,
- COMPDEV_FMT_YUV420_P,
- COMPDEV_FMT_YVU420_P,
- + COMPDEV_FMT_YV12,
- };
- struct compdev_size {
- diff -ruN a/include/linux/hwmem.h b/include/linux/hwmem.h
- --- a/include/linux/hwmem.h 2012-10-27 17:11:59.354843335 +0900
- +++ b/include/linux/hwmem.h 2012-10-24 23:38:23.000000000 +0900
- @@ -581,6 +581,7 @@
- phys_addr_t (*get_alloc_paddr)(void *alloc);
- void *(*get_alloc_kaddr)(void *instance, void *alloc);
- size_t (*get_alloc_size)(void *alloc);
- + struct page **(*get_alloc_sglist)(void *alloc);
- };
- struct hwmem_mem_type_struct {
- diff -ruN a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h
- --- a/include/linux/mfd/ab8500.h 2012-10-27 17:11:57.662824769 +0900
- +++ b/include/linux/mfd/ab8500.h 2012-10-24 23:38:23.000000000 +0900
- @@ -1,5 +1,6 @@
- /*
- * Copyright (C) ST-Ericsson SA 2010
- + * Copyright (C) 2012 Sony Mobile Communications AB.
- *
- * License Terms: GNU General Public License v2
- * Author: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
- @@ -222,6 +223,7 @@
- * struct ab8500 - ab8500 internal structure
- * @dev: parent device
- * @lock: read/write operations lock
- + * @latch_lock: latch array access lock
- * @irq_lock: genirq bus lock
- * @transfer_ongoing: 0 if no transfer ongoing
- * @irq: irq line
- @@ -234,6 +236,7 @@
- * @tx_buf: tx buf for SPI
- * @mask: cache of IRQ regs for bus lock
- * @oldmask: cache of previous IRQ regs for bus lock
- + * @latch: outstanding content of LatchX register
- * @mask_size: Actual number of valid entries in mask[], oldmask[] and
- * irq_reg_offset
- * @irq_reg_offset: Array of offsets into IRQ registers
- @@ -241,6 +244,7 @@
- struct ab8500 {
- struct device *dev;
- struct mutex lock;
- + struct mutex latch_lock;
- struct mutex irq_lock;
- atomic_t transfer_ongoing;
- int irq_base;
- @@ -257,6 +261,7 @@
- u8 *mask;
- u8 *oldmask;
- + u8 *latch;
- int mask_size;
- const int *irq_reg_offset;
- };
- diff -ruN a/include/video/av8100.h b/include/video/av8100.h
- --- a/include/video/av8100.h 2012-10-27 17:11:55.546801796 +0900
- +++ b/include/video/av8100.h 2012-10-24 23:38:23.000000000 +0900
- @@ -201,11 +201,6 @@
- AV8100_PATTERN_AUDIO_I2S_MEM
- };
- -enum av8100_hdmi_user {
- - AV8100_HDMI_USER_AUDIO,
- - AV8100_HDMI_USER_VIDEO
- -};
- -
- struct av8100_video_input_format_cmd {
- enum av8100_dsi_mode dsi_input_mode;
- enum av8100_pixel_format input_pixel_format;
- @@ -414,12 +409,9 @@
- int av8100_init(void);
- void av8100_exit(void);
- -int av8100_hdmi_get(enum av8100_hdmi_user user);
- -int av8100_hdmi_put(enum av8100_hdmi_user user);
- +int av8100_hdmi_get(void);
- +int av8100_hdmi_put(void);
- int av8100_hdmi_video_off(void);
- -int av8100_hdmi_video_on(void);
- -void av8100_conf_lock(void);
- -void av8100_conf_unlock(void);
- int av8100_powerwakeup(bool from_scan_mode);
- int av8100_powerscan(bool to_scan_mode);
- int av8100_powerup(void);
- diff -ruN a/include/video/b2r2_blt.h b/include/video/b2r2_blt.h
- --- a/include/video/b2r2_blt.h 2012-10-27 17:11:55.554801882 +0900
- +++ b/include/video/b2r2_blt.h 2012-10-24 23:38:23.000000000 +0900
- @@ -161,6 +161,11 @@
- B2R2_BLT_FMT_24_BIT_VUY888 = 0x7F00000D,
- B2R2_BLT_FMT_32_BIT_VUYA8888 = 0x7F00000E,
- B2R2_BLT_FMT_16_BIT_ABGR4444 = 0x7F00000F,
- + /*
- + * YV12 is a YVU420P format with alignment requirements
- + * on luma and chroma stride
- + */
- + B2R2_BLT_FMT_YV12 = 0x7F000010,
- };
- /**
- diff -ruN a/kernel-build-sin.sh b/kernel-build-sin.sh
- --- a/kernel-build-sin.sh 2012-10-27 17:11:45.306694863 +0900
- +++ b/kernel-build-sin.sh 1970-01-01 09:00:00.000000000 +0900
- @@ -1,102 +0,0 @@
- -#!/bin/bash
- -
- -die () {
- - echo >&2 "$@"
- - exit 1
- -}
- -
- -PRODUCT_DEFCNFG=$1
- -FSCONFIG=$2
- -
- -[ "$1" = "" ] && die "product{cdb/hayabusa/..} has to be specified as first argument"
- -[ "$2" = "" ] && die "fsconfig.xml has to be specified as second argument"
- -
- -if [ ! -f "arch/arm/configs/${PRODUCT_DEFCNFG}" ]; then
- - # instead of specifying blue_cdb_defconfig, it could be 'cdb'
- - PRODUCT_DEFCNFG=riogrande_${PRODUCT_DEFCNFG}_defconfig
- -fi
- -
- -if [ ! -f "arch/arm/configs/${PRODUCT_DEFCNFG}" ]; then
- - echo "Please use any of the following products:"
- - for line in $(ls arch/arm/configs/riogrande_*_defconfig);
- - do
- - NAME=$(basename $line)
- - echo " - $NAME"
- - done
- - exit 1
- -fi
- -
- -if [ ! -f "$OUT/ramdisk.img" ]; then
- - echo "Missing ramdisk.img in $OUT"
- - exit 1
- -fi
- -
- -echo "Using defconfig ${PRODUCT_DEFCNFG}"
- -
- -#---------------------------------------------------------------------
- -# Check the actual number of CPUs on the machine and adjust the number
- -#---------------------------------------------------------------------
- -CPU_COUNT=`grep "^processor" /proc/cpuinfo | wc -l`
- -if [ $? -eq 0 -a -n "$CPU_COUNT" ] ; then
- - JOBS=`expr $CPU_COUNT + 1`
- - echo Found $CPU_COUNT CPUs, building with $JOBS parallel jobs.
- -else
- - JOBS=5
- - echo Unable to determine number of CPUs, defaulting to $JOBS parallel jobs.
- -fi
- -
- -#------------------------------------------------------------
- -# Need this to be able to build. Taken from kernel/Android.mk
- -#------------------------------------------------------------
- -export STERICSSON_WLAN_BUILT_IN=y
- -
- -if [ "$3" == "clean" ] ; then
- - echo 'Cleaning build...'
- - #-------------------
- - # Clean up the build
- - #-------------------
- - ARCH=arm CROSS_COMPILE=../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- make mrproper
- -fi
- -
- -if [ ! -e ".config" ] ; then
- - echo 'No .config file, generating...'
- - #---------------------------
- - # kernel configuration setup
- - #---------------------------
- - ARCH=arm CROSS_COMPILE=../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- make $PRODUCT_DEFCNFG
- -fi
- -
- -#------
- -# Build
- -#------
- -ARCH=arm CROSS_COMPILE=../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- make -j$JOBS
- -
- -if [ $? -ne 0 ] ; then
- - echo "Build error - skip signing"
- - exit 1
- -fi
- -
- -#------
- -# Sign
- -#------
- -
- -SIN_PATH=../vendor/semc/build/sin
- -
- -MKELFPY=$SIN_PATH/mkelf.py
- -SEMCSC=$SIN_PATH/semcsc.py
- -CSH=$SIN_PATH/create_sin_header
- -
- -# kernel.elf
- -$MKELFPY -o kernel-unsigned.elf arch/arm/boot/zImage@0x00008000 \
- - $OUT/ramdisk.img@0x1000000,ramdisk $OUT/cmdline.txt@cmdline
- -
- -$SEMCSC -c $FSCONFIG -p Kernel -t internal -i kernel-unsigned.elf -o kernel.elf
- -
- -# kernel.si_
- -$CSH Kernel $FSCONFIG kernel.si_
- -cat kernel.elf >> kernel.si_
- -
- -# kernel.sin
- -$SEMCSC -c $FSCONFIG -p Kernel -t external -i kernel.si_ -o kernel.sin
- -
- -echo "All done."
- diff -ruN a/net/compat-wireless/drivers/staging/cw1200/ap.c b/net/compat-wireless/drivers/staging/cw1200/ap.c
- --- a/net/compat-wireless/drivers/staging/cw1200/ap.c 2012-10-27 17:11:51.054753987 +0900
- +++ b/net/compat-wireless/drivers/staging/cw1200/ap.c 2012-10-24 23:38:24.000000000 +0900
- @@ -497,6 +497,7 @@
- priv->delayed_link_loss = 0;
- spin_lock(&priv->bss_loss_lock);
- priv->bss_loss_status = CW1200_BSS_LOSS_NONE;
- + priv->bss_loss_checking = 0;
- spin_unlock(&priv->bss_loss_lock);
- cancel_delayed_work_sync(&priv->bss_loss_work);
- cancel_delayed_work_sync(&priv->connection_loss_work);
- diff -ruN a/net/compat-wireless/drivers/staging/cw1200/cw1200.h b/net/compat-wireless/drivers/staging/cw1200/cw1200.h
- --- a/net/compat-wireless/drivers/staging/cw1200/cw1200.h 2012-10-27 17:11:51.058754029 +0900
- +++ b/net/compat-wireless/drivers/staging/cw1200/cw1200.h 2012-10-24 23:38:24.000000000 +0900
- @@ -61,6 +61,8 @@
- #define CW1200_JOIN_TIMEOUT (1 * HZ)
- #define CW1200_AUTH_TIMEOUT (5 * HZ)
- +#define BSS_LOSS_CHECKING_MAX_TRY 10
- +
- /* Please keep order */
- enum cw1200_join_status {
- CW1200_JOIN_STATUS_PASSIVE = 0,
- @@ -278,6 +280,7 @@
- int delayed_link_loss;
- spinlock_t bss_loss_lock;
- int bss_loss_status;
- + int bss_loss_checking;
- int bss_loss_confirm_id;
- /* TX rate policy cache */
- diff -ruN a/net/compat-wireless/drivers/staging/cw1200/scan.c b/net/compat-wireless/drivers/staging/cw1200/scan.c
- --- a/net/compat-wireless/drivers/staging/cw1200/scan.c 2012-10-27 17:11:51.054753987 +0900
- +++ b/net/compat-wireless/drivers/staging/cw1200/scan.c 2012-10-24 23:38:24.000000000 +0900
- @@ -269,6 +269,7 @@
- "beacons.\n", tmo);
- spin_lock(&priv->bss_loss_lock);
- priv->bss_loss_status = CW1200_BSS_LOSS_NONE;
- + priv->bss_loss_checking = 0;
- spin_unlock(&priv->bss_loss_lock);
- cancel_delayed_work_sync(&priv->bss_loss_work);
- queue_delayed_work(priv->workqueue,
- diff -ruN a/net/compat-wireless/drivers/staging/cw1200/sta.c b/net/compat-wireless/drivers/staging/cw1200/sta.c
- --- a/net/compat-wireless/drivers/staging/cw1200/sta.c 2012-10-27 17:11:51.054753987 +0900
- +++ b/net/compat-wireless/drivers/staging/cw1200/sta.c 2012-10-24 23:38:24.000000000 +0900
- @@ -158,6 +158,7 @@
- priv->delayed_link_loss = 0;
- spin_lock(&priv->bss_loss_lock);
- priv->bss_loss_status = CW1200_BSS_LOSS_NONE;
- + priv->bss_loss_checking = 0;
- spin_unlock(&priv->bss_loss_lock);
- priv->join_status = CW1200_JOIN_STATUS_PASSIVE;
- @@ -1102,6 +1103,7 @@
- priv->delayed_link_loss = 0;
- spin_lock(&priv->bss_loss_lock);
- priv->bss_loss_status = CW1200_BSS_LOSS_NONE;
- + priv->bss_loss_checking = 0;
- spin_unlock(&priv->bss_loss_lock);
- cancel_delayed_work_sync(&priv->bss_loss_work);
- cancel_delayed_work_sync(&priv->connection_loss_work);
- @@ -1168,6 +1170,7 @@
- return;
- } else if (priv->bss_loss_status == CW1200_BSS_LOSS_CONFIRMING) {
- priv->bss_loss_status = CW1200_BSS_LOSS_NONE;
- + priv->bss_loss_checking = 0;
- spin_unlock(&priv->bss_loss_lock);
- return;
- }
- @@ -1192,6 +1195,7 @@
- spin_lock(&priv->bss_loss_lock);
- priv->bss_loss_status = CW1200_BSS_LOSS_NONE;
- + priv->bss_loss_checking = 0;
- spin_unlock(&priv->bss_loss_lock);
- }
- diff -ruN a/net/compat-wireless/drivers/staging/cw1200/txrx.c b/net/compat-wireless/drivers/staging/cw1200/txrx.c
- --- a/net/compat-wireless/drivers/staging/cw1200/txrx.c 2012-10-27 17:11:51.046753902 +0900
- +++ b/net/compat-wireless/drivers/staging/cw1200/txrx.c 2012-10-24 23:38:24.000000000 +0900
- @@ -1041,6 +1041,17 @@
- ht_flags |= IEEE80211_TX_RC_GREEN_FIELD;
- if (likely(!arg->status)) {
- + spin_lock(&priv->bss_loss_lock);
- + if ((priv->bss_loss_status == CW1200_BSS_LOSS_CONFIRMING) &&
- + (priv->bss_loss_checking < BSS_LOSS_CHECKING_MAX_TRY)) {
- + priv->bss_loss_status = CW1200_BSS_LOSS_CHECKING;
- + priv->bss_loss_checking++;
- + spin_unlock(&priv->bss_loss_lock);
- + cancel_delayed_work(&priv->bss_loss_work);
- + queue_delayed_work(priv->workqueue,
- + &priv->bss_loss_work, 0);
- + } else
- + spin_unlock(&priv->bss_loss_lock);
- tx->flags |= IEEE80211_TX_STAT_ACK;
- priv->cqm_tx_failure_count = 0;
- ++tx_count;
- @@ -1059,6 +1070,7 @@
- arg->packetID) {
- priv->bss_loss_status =
- CW1200_BSS_LOSS_CONFIRMED;
- + priv->bss_loss_checking = 0;
- spin_unlock(&priv->bss_loss_lock);
- cancel_delayed_work(&priv->bss_loss_work);
- queue_delayed_work(priv->workqueue,
- diff -ruN a/sound/soc/codecs/av8100_audio.c b/sound/soc/codecs/av8100_audio.c
- --- a/sound/soc/codecs/av8100_audio.c 2012-10-27 17:11:53.682781797 +0900
- +++ b/sound/soc/codecs/av8100_audio.c 2012-10-24 23:38:24.000000000 +0900
- @@ -179,14 +179,12 @@
- config.hdmi_format.hdmi_mode = AV8100_HDMI_ON;
- config.hdmi_format.hdmi_format = AV8100_HDMI;
- config.hdmi_format.dvi_format = AV8100_DVI_CTRL_CTL0;
- - av8100_conf_lock();
- ret = av8100_conf_prep(AV8100_COMMAND_HDMI, &config);
- if (ret != 0) {
- pr_err("%s: Setting hdmi_format failed "
- "(av8100_conf_prep returned %d)!\n",
- __func__,
- ret);
- - av8100_conf_unlock();
- return -EINVAL;
- }
- ret = av8100_conf_w(AV8100_COMMAND_HDMI,
- @@ -198,11 +196,9 @@
- "(av8100_conf_w returned %d)!\n",
- __func__,
- ret);
- - av8100_conf_unlock();
- return -EINVAL;
- }
- - av8100_conf_unlock();
- return 0;
- }
- @@ -262,14 +258,12 @@
- /* Send audio info-frame */
- pr_info("%s: Sending audio info-frame.", __func__);
- - av8100_conf_lock();
- ret = av8100_conf_prep(AV8100_COMMAND_INFOFRAMES, &config);
- if (ret != 0) {
- pr_err("%s: Sending audio info-frame failed "
- "(av8100_conf_prep returned %d)!\n",
- __func__,
- ret);
- - av8100_conf_unlock();
- return -EINVAL;
- }
- ret = av8100_conf_w(AV8100_COMMAND_INFOFRAMES,
- @@ -281,11 +275,9 @@
- "(av8100_conf_w returned %d)!\n",
- __func__,
- ret);
- - av8100_conf_unlock();
- return -EINVAL;
- }
- - av8100_conf_unlock();
- return 0;
- }
- @@ -310,8 +302,7 @@
- pr_debug("%s: Enter.\n", __func__);
- /* Get HDMI resource */
- - if (av8100_hdmi_get(AV8100_HDMI_USER_AUDIO) < 0)
- - return -EBUSY;
- + av8100_hdmi_get();
- /* Startup AV8100 if it is not already started */
- ret = av8100_codec_powerup();
- @@ -321,7 +312,7 @@
- __func__,
- ret);
- /* Put HDMI resource */
- - av8100_hdmi_put(AV8100_HDMI_USER_AUDIO);
- + av8100_hdmi_put();
- return -EINVAL;
- }
- @@ -332,7 +323,7 @@
- struct snd_soc_dai *codec_dai)
- {
- /* Put HDMI resource */
- - av8100_hdmi_put(AV8100_HDMI_USER_AUDIO);
- + av8100_hdmi_put();
- pr_debug("%s: Enter.\n", __func__);
- }
- @@ -376,14 +367,12 @@
- config.audio_input_format.audio_word_lg = AV8100_AUDIO_16BITS;
- config.audio_input_format.audio_format = AV8100_AUDIO_LPCM_MODE;
- config.audio_input_format.audio_mute = AV8100_AUDIO_MUTE_DISABLE;
- - av8100_conf_lock();
- ret = av8100_conf_prep(AV8100_COMMAND_AUDIO_INPUT_FORMAT, &config);
- if (ret != 0) {
- pr_err("%s: Setting audio_input_format failed "
- "(av8100_conf_prep returned %d)!\n",
- __func__,
- ret);
- - av8100_conf_unlock();
- return -EINVAL;
- }
- ret = av8100_conf_w(AV8100_COMMAND_AUDIO_INPUT_FORMAT,
- @@ -395,11 +384,9 @@
- "(av8100_conf_w returned %d)!\n",
- __func__,
- ret);
- - av8100_conf_unlock();
- - return -EINVAL;
- + return -EINVAL;
- }
- - av8100_conf_unlock();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement