From: 黄涛 Date: Sun, 25 Mar 2012 07:16:37 +0000 (+0800) Subject: Merge remote-tracking branch 'origin/develop-3.0-rk30' into develop-3.0 X-Git-Tag: firefly_0821_release~9595 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e153fabd0b02cb7de95a6ad81e0e2d4a66dd8d82;p=firefly-linux-kernel-4.4.55.git Merge remote-tracking branch 'origin/develop-3.0-rk30' into develop-3.0 Conflicts: arch/arm/mach-rk29/Makefile arch/arm/mach-rk29/include/mach/rk29_camera.h drivers/gpu/ion/ion.c drivers/gpu/ion/ion_carveout_heap.c drivers/gpu/ion/ion_priv.h drivers/media/video/gc0307.c drivers/media/video/gc0308.c drivers/media/video/gc0309.c drivers/media/video/gc2015.c drivers/media/video/gt2005.c drivers/media/video/mt9d112.c drivers/media/video/mt9d113.c drivers/media/video/mt9p111.c drivers/media/video/mt9t111.c drivers/media/video/ov2640_rk.c drivers/media/video/ov2655.c drivers/media/video/ov2659.c drivers/media/video/ov5640.c drivers/media/video/ov5642.c drivers/media/video/ov7675.c drivers/media/video/rk29_camera.c drivers/media/video/sid130B.c drivers/media/video/siv120b.c drivers/mmc/host/rk29_sdmmc.c include/linux/ion.h --- e153fabd0b02cb7de95a6ad81e0e2d4a66dd8d82 diff --cc arch/arm/mach-rk29/Kconfig index e9596a60f19a,6c3e86d3b459..c85df82a93f9 mode 100755,100644..100755 --- a/arch/arm/mach-rk29/Kconfig +++ b/arch/arm/mach-rk29/Kconfig diff --cc arch/arm/mach-rk29/Makefile index fdb46163a67b,4809e2ddeef5..89009d8a521a mode 100755,100644..100755 --- a/arch/arm/mach-rk29/Makefile +++ b/arch/arm/mach-rk29/Makefile @@@ -1,11 -1,5 +1,5 @@@ - obj-y += timer.o io.o devices.o verifyID.o iomux.o clock.o rk29-pl330.o dma.o ddr.o sram.o memcpy_dma.o reset.o -obj-y += timer.o io.o devices.o iomux.o clock.o rk29-pl330.o dma.o ddr.o memcpy_dma.o reset.o ++obj-y += timer.o io.o devices.o verifyID.o iomux.o clock.o rk29-pl330.o dma.o ddr.o memcpy_dma.o reset.o obj-y += tests.o memtester.o - obj-y += early_printk.o - ifndef CONFIG_DEBUG_LL - obj-y += ../kernel/debug.o - endif - obj-$(CONFIG_RK29_LAST_LOG) += last_log.o - obj-$(CONFIG_USB_GADGET) += usb_detect.o obj-$(CONFIG_PM) += pm.o obj-$(CONFIG_CPU_FREQ) += cpufreq.o obj-$(CONFIG_DDR_FREQ) += ddrfreq.o diff --cc drivers/gpu/ion/ion.c index f5074c0348d4,6a1c59ae9650..90316b5613aa --- a/drivers/gpu/ion/ion.c +++ b/drivers/gpu/ion/ion.c @@@ -303,7 -303,7 +303,6 @@@ struct ion_handle *ion_alloc(struct ion /* if the client doesn't support this heap type */ if (!((1 << heap->type) & client->heap_mask)) continue; -- /* if the caller didn't specify this heap type */ if (!((1 << heap->id) & flags)) continue; @@@ -911,7 -911,7 +910,7 @@@ err static long ion_share_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { struct ion_buffer *buffer = filp->private_data; -- ++ switch (cmd) { case PMEM_GET_PHYS: { @@@ -966,7 -963,7 +965,7 @@@ static int ion_ioctl_share(struct file if (parent->f_flags & O_DSYNC) file->f_flags |= O_DSYNC; -- ++ ion_buffer_get(handle->buffer); fd_install(fd, file); @@@ -985,15 -982,15 +984,15 @@@ static long ion_ioctl(struct file *filp case ION_IOC_ALLOC: { struct ion_allocation_data data; ++ if (copy_from_user(&data, (void __user *)arg, sizeof(data))) return -EFAULT; -- data.handle = ion_alloc(client, data.len, data.align, data.flags); if (IS_ERR_OR_NULL(data.handle)) { printk("%s: alloc 0x%x bytes failed\n", __func__, data.len); -- return -ENOMEM; -- } ++ return -ENOMEM; ++ } if (copy_to_user((void __user *)arg, &data, sizeof(data))) return -EFAULT; break; @@@ -1104,47 -1101,13 +1103,47 @@@ return err; } -- err = data.handle->buffer->heap->ops->cache_op(buffer->heap, buffer, ++ err = data.handle->buffer->heap->ops->cache_op(buffer->heap, buffer, data.virt, data.size, cmd); mutex_unlock(&client->lock); if(err < 0) return err; break; } - case ION_GET_CLIENT: ++ case ION_GET_CLIENT: + { + struct ion_handle *handle; + struct ion_client_data data; + struct rb_node *n; + + if (copy_from_user(&data, (void __user *)arg, + sizeof(struct ion_client_data))) + return -EFAULT; + + mutex_lock(&client->lock); + switch (data.type) { + case ION_TYPE_GET_TOTAL_SIZE: + data.total_size = 0; + for (n = rb_first(&client->handles); n; n = rb_next(n)) { + handle = rb_entry(n, struct ion_handle, node); + data.total_size += handle->buffer->size; + } + break; + case ION_TYPE_SIZE_GET_COUNT: + data.count = 0; + for (n = rb_first(&client->handles); n; n = rb_next(n)) { + handle = rb_entry(n, struct ion_handle, node); + if(handle->buffer->size == data.size) + data.count++; + } + break; + } + mutex_unlock(&client->lock); + if (copy_to_user((void __user *)arg, &data, + sizeof(struct ion_client_data))) + return -EFAULT; + break; + } default: return -ENOTTY; } @@@ -1352,6 -1315,6 +1351,7 @@@ static const struct file_operations deb .llseek = seq_lseek, .release = single_release, }; ++ struct ion_device *ion_device_create(long (*custom_ioctl) (struct ion_client *client, unsigned int cmd, diff --cc drivers/gpu/ion/ion_carveout_heap.c index c8fa2d82d423,ec355c7da546..38080f12aee5 --- a/drivers/gpu/ion/ion_carveout_heap.c +++ b/drivers/gpu/ion/ion_carveout_heap.c @@@ -13,8 -13,8 +13,8 @@@ * GNU General Public License for more details. * */ ++#include -- #include #include #include #include @@@ -25,19 -25,19 +25,18 @@@ #include #include #include --#include #include #include -- #include "ion_priv.h" --#define ION_CACHED ++#include ++ #define RESERVED_SIZE(total) ((total)/10) ++ struct ion_carveout_heap { struct ion_heap heap; struct gen_pool *pool; ion_phys_addr_t base; -- unsigned long allocated_bytes; unsigned long vpu_allocated_bytes; unsigned long max_allocated; @@@ -45,6 -45,6 +44,7 @@@ unsigned long bit_nr; unsigned long *bits; }; ++ ion_phys_addr_t ion_carveout_allocate(struct ion_heap *heap, unsigned long size, unsigned long align, @@@ -52,12 -52,12 +52,12 @@@ { struct ion_carveout_heap *carveout_heap = container_of(heap, struct ion_carveout_heap, heap); -- unsigned long offset; ++ unsigned long offset; unsigned long free_size = carveout_heap->total_size - carveout_heap->allocated_bytes; -- if((flags & (1<total_size))){ -- printk("%s: heap %s has not enough memory for vpu: vpu allocated(%luM)\n", ++ if ((flags & (1<total_size))) { ++ printk("%s: heap %s has not enough memory for vpu: vpu allocated(%luM)\n", __func__, heap->name, carveout_heap->vpu_allocated_bytes/SZ_1M); return ION_CARVEOUT_ALLOCATE_FAIL; } @@@ -70,13 -70,13 +70,13 @@@ " the allocation of size %lu pages still failed." " Memory is probably fragmented.\n", __func__, heap->name, -- (carveout_heap->total_size - carveout_heap->allocated_bytes)/SZ_1K, ++ (carveout_heap->total_size - carveout_heap->allocated_bytes)/SZ_1K, size/SZ_1K); else printk("%s: heap %s has not enough memory(%luK)" "the alloction of size is %luK.\n", __func__, heap->name, -- (carveout_heap->total_size - carveout_heap->allocated_bytes)/SZ_1K, ++ (carveout_heap->total_size - carveout_heap->allocated_bytes)/SZ_1K, size/SZ_1K); return ION_CARVEOUT_ALLOCATE_FAIL; } @@@ -88,7 -88,7 +88,7 @@@ if((offset + size - carveout_heap->base) > carveout_heap->max_allocated) carveout_heap->max_allocated = offset + size - carveout_heap->base; -- bitmap_set(carveout_heap->bits, ++ bitmap_set(carveout_heap->bits, (offset - carveout_heap->base)/PAGE_SIZE , size/PAGE_SIZE); return offset; } @@@ -105,7 -105,7 +105,7 @@@ void ion_carveout_free(struct ion_heap if(flags & (1<vpu_allocated_bytes -= size; carveout_heap->allocated_bytes -= size; -- bitmap_clear(carveout_heap->bits, ++ bitmap_clear(carveout_heap->bits, (addr - carveout_heap->base)/PAGE_SIZE, size/PAGE_SIZE); } @@@ -177,9 -177,8 +177,10 @@@ int ion_carveout_heap_map_user(struct i vma->vm_end - vma->vm_start, pgprot_noncached(vma->vm_page_prot)); + buffer->vm_start = vma->vm_start; return err; } ++ int ion_carveout_cache_op(struct ion_heap *heap, struct ion_buffer *buffer, void *virt, size_t size, unsigned int cmd) { @@@ -190,20 -189,20 +191,20 @@@ switch(cmd) { case ION_CACHE_FLUSH: dmac_flush_range((void *)start, (void *)end); -- outer_flush_range(buffer->priv_phys,buffer->priv_phys + size); ++ outer_flush_range(buffer->priv_phys,buffer->priv_phys + size); break; case ION_CACHE_CLEAN: -- /* When cleaning, always clean the innermost (L1) cache first ++ /* When cleaning, always clean the innermost (L1) cache first * and then clean the outer cache(s). */ dmac_clean_range((void *)start, (void *)end); -- outer_clean_range(buffer->priv_phys,buffer->priv_phys + size); ++ outer_clean_range(buffer->priv_phys,buffer->priv_phys + size); break; case ION_CACHE_INVALID: -- /* When invalidating, always invalidate the outermost cache first ++ /* When invalidating, always invalidate the outermost cache first * and the L1 cache last. */ -- outer_inv_range(buffer->priv_phys,buffer->priv_phys + size); ++ outer_inv_range(buffer->priv_phys,buffer->priv_phys + size); dmac_inv_range((void *)start, (void *)end); break; default: @@@ -219,7 -218,7 +220,7 @@@ static int ion_carveout_print_debug(str container_of(heap, struct ion_carveout_heap, heap); for(i = carveout_heap->bit_nr/8 - 1; i>= 0; i--){ -- seq_printf(s, "%.3uM> Bits[%.3d - %.3d]: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", ++ seq_printf(s, "%.3uM> Bits[%.3d - %.3d]: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", i+1, i*8 + 7, i*8, carveout_heap->bits[i*8 + 7], carveout_heap->bits[i*8 + 6], @@@ -236,10 -235,10 +237,11 @@@ carveout_heap->allocated_bytes/SZ_1M); seq_printf(s, "max_allocated: %luM\n", carveout_heap->max_allocated/SZ_1M); -- seq_printf(s, "Heap size: %luM, heap base: 0x%lx\n", ++ seq_printf(s, "Heap size: %luM, heap base: 0x%lx\n", carveout_heap->total_size/SZ_1M, carveout_heap->base); return 0; } ++ static struct ion_heap_ops carveout_heap_ops = { .allocate = ion_carveout_heap_allocate, .free = ion_carveout_heap_free, @@@ -274,7 -273,7 +276,7 @@@ struct ion_heap *ion_carveout_heap_crea carveout_heap->max_allocated = 0; carveout_heap->total_size = heap_data->size; carveout_heap->bit_nr = heap_data->size/(PAGE_SIZE * sizeof(unsigned long) * 8); -- carveout_heap->bits = ++ carveout_heap->bits = (unsigned long *)kzalloc(carveout_heap->bit_nr * sizeof(unsigned long), GFP_KERNEL); return &carveout_heap->heap; diff --cc drivers/gpu/ion/ion_priv.h index f4ef07a8e28e,f954d2d90058..75b1e753628e --- a/drivers/gpu/ion/ion_priv.h +++ b/drivers/gpu/ion/ion_priv.h @@@ -75,8 -75,7 +75,7 @@@ struct ion_buffer void *vaddr; int dmap_cnt; struct scatterlist *sglist; - unsigned long vm_start; -- ++ unsigned long vm_start; int marked; }; diff --cc drivers/mmc/host/rk29_sdmmc.c index a98ad50a2518,785f092e1c4d..625973bcce53 --- a/drivers/mmc/host/rk29_sdmmc.c +++ b/drivers/mmc/host/rk29_sdmmc.c @@@ -74,7 -79,7 +79,7 @@@ int debug_level = 5 #define RK29_SDMMC_WAIT_DTO_INTERNVAL 4500 //The time interval from the CMD_DONE_INT to DTO_INT #define RK29_SDMMC_REMOVAL_DELAY 2000 //The time interval from the CD_INT to detect_timer react. - #define RK29_SDMMC_VERSION "Ver.2.16 The last modify date is 2012-02-13,modifyed by XBW." -#define RK29_SDMMC_VERSION "Ver.3.03 The last modify date is 2012-03-23,modifyed by XBW." ++#define RK29_SDMMC_VERSION "Ver.3.03 The last modify date is 2012-03-23,modifyed by XBW." #if !defined(CONFIG_USE_SDMMC0_FOR_WIFI_DEVELOP_BOARD) #define RK29_CTRL_SDMMC_ID 0 //mainly used by SDMMC diff --cc drivers/usb/gadget/storage_common.c index af2d06f97748,b4b023b24677..e881ba4450c7 mode 100755,100644..100755 --- a/drivers/usb/gadget/storage_common.c +++ b/drivers/usb/gadget/storage_common.c diff --cc include/linux/ion.h index 1063072b28fb,202766b7d0e5..da979c28eb53 mode 100755,100644..100755 --- a/include/linux/ion.h +++ b/include/linux/ion.h @@@ -307,21 -307,11 +307,24 @@@ struct ion_phys_data unsigned long phys; size_t size; }; ++ struct ion_flush_data { struct ion_handle *handle; void *virt; size_t size; }; ++ +struct ion_client_data { +#define ION_TYPE_GET_TOTAL_SIZE 0 +#define ION_TYPE_SIZE_GET_COUNT 1 - unsigned int type; - union { - size_t size; - size_t total_size; - }; - unsigned int count; ++ unsigned int type; ++ union { ++ size_t size; ++ size_t total_size; ++ }; ++ unsigned int count; +}; ++ #define ION_IOC_MAGIC 'I' /** @@@ -381,5 -371,4 +384,6 @@@ #define ION_CACHE_CLEAN _IOWR(ION_IOC_MAGIC, 8, struct ion_flush_data) #define ION_CACHE_INVALID _IOWR(ION_IOC_MAGIC, 9, struct ion_flush_data) #define ION_GET_PHYS _IOWR(ION_IOC_MAGIC, 10, unsigned long) - #define ION_GET_CLIENT _IOWR(ION_IOC_MAGIC, 11, struct ion_client_data) ++#define ION_GET_CLIENT _IOWR(ION_IOC_MAGIC, 11, struct ion_client_data) ++ #endif /* _LINUX_ION_H */ diff --cc sound/soc/rk29/Kconfig index 395dac05a32c,e58d9f09d4ab..98169399de09 --- a/sound/soc/rk29/Kconfig +++ b/sound/soc/rk29/Kconfig @@@ -71,32 -78,16 +78,32 @@@ config SND_RK29_SOC_RT563 config SND_RK29_SOC_RT5625 tristate "SoC I2S Audio support for rockchip - RT5625" - depends on SND_RK29_SOC && I2C_RK29 + depends on SND_RK29_SOC select SND_RK29_SOC_I2S - select SND_SOC_RT5625 help Say Y if you want to add support for SoC audio on rockchip with the RT5625. +choice + depends on SND_RK29_SOC_RT5625 + prompt "RT5625 hardware select" + + config SND_SOC_RT5625_SPK_FORM_SPKOUT + bool "spk from spkout" + select SND_SOC_RT5625 + help + if your codec output hardware connect is spk from spkout, choose it + + config SND_SOC_RT5625_SPK_FORM_HPOUT + bool "spk from hpout" + select SND_SOC_RT5625 + help + if your codec output hardware connect is spk from spkout, choose it +endchoice + config SND_RK29_SOC_WM8994 tristate "SoC I2S Audio support for rockchip - WM8994" - depends on SND_RK29_SOC && I2C_RK29 + depends on SND_RK29_SOC select SND_RK29_SOC_I2S select SND_SOC_WM8994 help