Merge remote-tracking branch 'origin/develop-3.0-rk30' into develop-3.0
author黄涛 <huangtao@rock-chips.com>
Sun, 25 Mar 2012 07:16:37 +0000 (15:16 +0800)
committer黄涛 <huangtao@rock-chips.com>
Sun, 25 Mar 2012 07:16:37 +0000 (15:16 +0800)
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

16 files changed:
1  2 
arch/arm/Makefile
arch/arm/mach-rk29/Kconfig
arch/arm/mach-rk29/Makefile
arch/arm/mach-rk29/include/mach/board.h
arch/arm/mach-rk29/pm.c
drivers/gpu/ion/ion.c
drivers/gpu/ion/ion_carveout_heap.c
drivers/gpu/ion/ion_priv.h
drivers/input/touchscreen/rk29_i2c_goodix.c
drivers/media/video/Kconfig
drivers/mfd/wm831x-i2c.c
drivers/mmc/host/rk29_sdmmc.c
drivers/usb/gadget/storage_common.c
drivers/video/Makefile
include/linux/ion.h
sound/soc/rk29/Kconfig

Simple merge
index e9596a60f19aba28af06933f4b5e20715f2e2aa2,6c3e86d3b459797a8ae4d6dadfdce170cf2f1b8e..c85df82a93f9da791d6fba23c6e81a9299a6ff1e
mode 100755,100644..100755
index fdb46163a67b9e2e8cc3ccef12ed53baee9414e0,4809e2ddeef5a8ed2341af599cdc05dd025558da..89009d8a521a2d52c4fad316906237bea9c9dc42
mode 100755,100644..100755
@@@ -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
Simple merge
index f5074c0348d44f159ecb4cd7a6f48a2f949918bc,6a1c59ae965086df7eba62dd2b08adc085025b5f..90316b5613aa0be32331ca38399c115feb477474
@@@ -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;
                        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,
index c8fa2d82d4231bc62dcde9745c21fc4ebb039506,ec355c7da546adea8726bb697c432800dbf28953..38080f12aee52fba593b12e4075f1f42afb42225
@@@ -13,8 -13,8 +13,8 @@@
   * GNU General Public License for more details.
   *
   */
++#include <linux/spinlock.h>
  
-- #include <linux/spinlock.h>
  #include <linux/err.h>
  #include <linux/genalloc.h>
  #include <linux/io.h>
  #include <linux/vmalloc.h>
  #include <linux/iommu.h>
  #include <linux/seq_file.h>
--#include <asm/mach/map.h>
  #include <linux/dma-mapping.h>
  #include <asm/cacheflush.h>
--
  #include "ion_priv.h"
  
--#define ION_CACHED
++#include <asm/mach/map.h>
++
  #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,
  {
        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<<ION_VPU_ID)) && 
--              (free_size < RESERVED_SIZE(carveout_heap->total_size))){
--              printk("%s: heap %s has not enough memory for vpu: vpu allocated(%luM)\n", 
++      if ((flags & (1<<ION_VPU_ID)) &&
++              (free_size < RESERVED_SIZE(carveout_heap->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;
        }
                                " 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<<ION_VPU_ID))
                carveout_heap->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)
  {
        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],
                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;
index f4ef07a8e28e29cdbb1df9f658828510e562655e,f954d2d90058c9c886d206acc73d19734b3ed537..75b1e753628e7684891dcb8b3d6d3aace85ad5d7
@@@ -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;
  };
  
Simple merge
Simple merge
index a98ad50a2518c11aae3911871d947c1103130917,785f092e1c4d5320a5f9003cd8a3dd8352eef5a1..625973bcce534cd52ee2cb6f1799a6a2a7175868
@@@ -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
index af2d06f97748a2ad9911c5ee22ec230d1c6c2d73,b4b023b246776ae5907cf4b7b53fd5c312b29e7f..e881ba4450c772c53c9689b51cc95a0118c46848
mode 100755,100644..100755
Simple merge
index 1063072b28fb21229fd2644c343c5d3d5996953d,202766b7d0e5b319306fb100dcb198b3e005eafc..da979c28eb5358231b5f231a23f3f1f18297c43b
mode 100755,100644..100755
@@@ -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;
  };
-         unsigned int type;
-         union {
-                 size_t size;
-                 size_t total_size;
-         };
-         unsigned int count;
++
 +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;
 +};
++
  #define ION_IOC_MAGIC         'I'
  
  /**
  #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 */
index 395dac05a32cf4d5262758266dff536ebfdaec51,e58d9f09d4ab15db315c91e60f213a2503fcccf8..98169399de09fcf6d39992508ffa0458ab3cc9d6
@@@ -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