/{
cif_sensor: cif_sensor{
compatible = "rockchip,sensor";
+ CONFIG_SENSOR_POWER_IOCTL_USR = <1>;
+ CONFIG_SENSOR_RESET_IOCTL_USR = <0>;
+ CONFIG_SENSOR_POWERDOWN_IOCTL_USR = <0>;
+ CONFIG_SENSOR_FLASH_IOCTL_USR = <0>;
+ CONFIG_SENSOR_AF_IOCTL_USR = <0>;
+
ov2659{
is_front = <1>;
rockchip,powerdown = <&gpio3 GPIO_D7 GPIO_ACTIVE_HIGH>;
+ #rockchip,power = <>;
mir = <0>;
flash_attach = <0>;
resolution = <ov2659_FULL_RESOLUTION>;
rk818_ldo4_reg:regulator@7 {
regulator-name= "rk818_ldo4";
- regulator-min-microvolt = <2500000>;
- regulator-max-microvolt = <2500000>;
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
regulator-initial-state = <3>;
regulator-state-mem {
regulator-state-enabled;
};
vip {
reg = <0x1012f200 0x20>;
+ rockchip,priority = <3 3>;
};
};
compatible = "rockchip,cif";
reg = <0x1010a000 0x2000>;
interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
- clocks = <&clk_gates3 3>,<&clk_gates6 5>,<&clk_gates6 4>,<&clk_cif0_in>,<&clk_cif_out>;
+ clocks = <&pd_vip>,<&clk_gates6 5>,<&clk_gates6 4>,<&clk_cif0_in>,<&clk_cif_out>;
clock-names = "pd_cif0", "aclk_cif0","hclk_cif0","cif0_in","cif0_out";
status = "okay";
};
obj-$(CONFIG_DDR_TEST) += ddr_test.o
obj-$(CONFIG_RK_PM_TESTS) += rk_pm_tests/
obj-$(CONFIG_RK_FT_TEST) += rk_pm_tests/ft/
-obj-$(CONFIG_ROCK_CHIP_SOC_CAMERA) += board-rk30-sdk-camera.o
+obj-$(CONFIG_ROCK_CHIP_SOC_CAMERA) += rk_camera.o
+++ /dev/null
-#include "rk_camera.h"
-#include <linux/regulator/consumer.h>
-#include <linux/regulator/driver.h>
-#include <linux/regulator/machine.h>
-#include <linux/delay.h>
-//*****************yzm***************
-static struct rkcamera_platform_data *new_camera_head;
-
-#define PMEM_CAM_SIZE PMEM_CAM_NECESSARY
-/*****************************************************************************************
- * camera devices
- * author: ddl@rock-chips.com
- *****************************************************************************************/
-#define CONFIG_SENSOR_POWER_IOCTL_USR 1 //define this refer to your board layout
-#define CONFIG_SENSOR_RESET_IOCTL_USR 0
-#define CONFIG_SENSOR_POWERDOWN_IOCTL_USR 0
-#define CONFIG_SENSOR_FLASH_IOCTL_USR 0
-#define CONFIG_SENSOR_AF_IOCTL_USR 0
-
-#if CONFIG_SENSOR_POWER_IOCTL_USR
-
-static int sensor_power_usr_cb (struct rk29camera_gpio_res *res,int on)
-{
- //#error "CONFIG_SENSOR_POWER_IOCTL_USR is 1, sensor_power_usr_cb function must be writed!!";
- return 0;
-}
-#endif
-
-#if CONFIG_SENSOR_RESET_IOCTL_USR
-static int sensor_reset_usr_cb (struct rk29camera_gpio_res *res,int on)
-{
-
-printk(KERN_EMERG "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
-
- #error "CONFIG_SENSOR_RESET_IOCTL_USR is 1, sensor_reset_usr_cb function must be writed!!";
-}
-#endif
-
-#if CONFIG_SENSOR_POWERDOWN_IOCTL_USR
-static int sensor_powerdown_usr_cb (struct rk29camera_gpio_res *res,int on)
-{
-
-printk(KERN_EMERG "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
-
- #error "CONFIG_SENSOR_POWERDOWN_IOCTL_USR is 1, sensor_powerdown_usr_cb function must be writed!!";
-}
-#endif
-
-#if CONFIG_SENSOR_FLASH_IOCTL_USR
-static int sensor_flash_usr_cb (struct rk29camera_gpio_res *res,int on)
-{
-
-printk(KERN_EMERG "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
-
- #error "CONFIG_SENSOR_FLASH_IOCTL_USR is 1, sensor_flash_usr_cb function must be writed!!";
-}
-#endif
-
-#if CONFIG_SENSOR_AF_IOCTL_USR
-static int sensor_af_usr_cb (struct rk29camera_gpio_res *res,int on)
-{
-
-printk(KERN_EMERG "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
-
- #error "CONFIG_SENSOR_AF_IOCTL_USR is 1, sensor_af_usr_cb function must be writed!!";
-}
-
-#endif
-
-static struct rk29camera_platform_ioctl_cb sensor_ioctl_cb = {
- #if CONFIG_SENSOR_POWER_IOCTL_USR
- .sensor_power_cb = sensor_power_usr_cb,
- #else
- .sensor_power_cb = NULL,
- #endif
-
- #if CONFIG_SENSOR_RESET_IOCTL_USR
- .sensor_reset_cb = sensor_reset_usr_cb,
- #else
- .sensor_reset_cb = NULL,
- #endif
-
- #if CONFIG_SENSOR_POWERDOWN_IOCTL_USR
- .sensor_powerdown_cb = sensor_powerdown_usr_cb,
- #else
- .sensor_powerdown_cb = NULL,
- #endif
-
- #if CONFIG_SENSOR_FLASH_IOCTL_USR
- .sensor_flash_cb = sensor_flash_usr_cb,
- #else
- .sensor_flash_cb = NULL,
- #endif
-
- #if CONFIG_SENSOR_AF_IOCTL_USR
- .sensor_af_cb = sensor_af_usr_cb,
- #else
- .sensor_af_cb = NULL,
- #endif
-};
-
-#include "../../../drivers/media/video/rk30_camera.c"
-
-
#include "rk_camera.h"\r
+#include "rk30_camera.h"\r
#include <linux/gpio.h>\r
#include <linux/delay.h>\r
#include <linux/version.h>\r
#include <linux/moduleparam.h>\r
#include <linux/of_gpio.h>\r
-//**********yzm***********//\r
+/**********yzm***********/\r
#include <linux/of.h>\r
#include <linux/of_irq.h>\r
#include <linux/kernel.h>\r
#include <linux/of_platform.h>\r
#include <linux/of_fdt.h>\r
#include <linux/module.h>\r
-//**********yzm***********//\r
+/**********yzm***********/\r
\r
-#define PMEM_CAM_NECESSARY 0x00000000 //yzm\r
+//#define PMEM_CAM_NECESSARY 0x00000000 /*yzm*/\r
\r
-static int camio_version = KERNEL_VERSION(0,1,9);//yzm camio_version\r
+static int camio_version = KERNEL_VERSION(0,1,9);/*yzm camio_version*/ \r
module_param(camio_version, int, S_IRUGO);\r
\r
-static int camera_debug = 0;//yzm camera_debug\r
+static int camera_debug = 0;/*yzm*/ \r
module_param(camera_debug, int, S_IRUGO|S_IWUSR); \r
\r
#undef CAMMODULE_NAME\r
static int rk_sensor_ioctrl(struct device *dev,enum rk29camera_ioctrl_cmd cmd, int on);\r
static int rk_sensor_power(struct device *dev, int on);\r
static int rk_sensor_register(void);\r
-//static int rk_sensor_reset(struct device *dev);\r
+/*static int rk_sensor_reset(struct device *dev);*/\r
+\r
+static int rk_dts_sensor_probe(struct platform_device *pdev);\r
+static int rk_dts_sensor_remove(struct platform_device *pdev);\r
+static int rk_dts_cif_probe(struct platform_device *pdev);\r
+static int rk_dts_cif_remove(struct platform_device *pdev);\r
+\r
static int rk_sensor_powerdown(struct device *dev, int on);\r
\r
+static struct rkcamera_platform_data *new_camera_head; \r
+\r
static struct rk29camera_platform_data rk_camera_platform_data = {\r
.io_init = rk_sensor_io_init,\r
.io_deinit = rk_sensor_io_deinit,\r
\r
};\r
\r
+struct rk29camera_platform_ioctl_cb sensor_ioctl_cb = {\r
+ .sensor_power_cb = NULL,\r
+ .sensor_reset_cb = NULL,\r
+ .sensor_powerdown_cb = NULL,\r
+ .sensor_flash_cb = NULL,\r
+ .sensor_af_cb = NULL,\r
+};\r
+\r
\r
static u64 rockchip_device_camera_dmamask = 0xffffffffUL;\r
#if RK_SUPPORT_CIF0\r
#if RK_SUPPORT_CIF0\r
struct platform_device rk_device_camera_host_0 = {\r
.name = RK29_CAM_DRV_NAME,\r
- .id = RK_CAM_PLATFORM_DEV_ID_0, // This is used to put cameras on this interface \r
+ .id = RK_CAM_PLATFORM_DEV_ID_0, /* This is used to put cameras on this interface*/ \r
.num_resources= 2,\r
- .resource = rk_camera_resource_host_0,//yzm\r
+ .resource = rk_camera_resource_host_0,/*yzm*/\r
.dev = {\r
.dma_mask = &rockchip_device_camera_dmamask,\r
.coherent_dma_mask = 0xffffffffUL,\r
#if RK_SUPPORT_CIF1\r
struct platform_device rk_device_camera_host_1 = {\r
.name = RK29_CAM_DRV_NAME,\r
- .id = RK_CAM_PLATFORM_DEV_ID_1, // This is used to put cameras on this interface \r
+ .id = RK_CAM_PLATFORM_DEV_ID_1, /* This is used to put cameras on this interface */\r
.num_resources = ARRAY_SIZE(rk_camera_resource_host_1),\r
- .resource = rk_camera_resource_host_1,//yzm\r
+ .resource = rk_camera_resource_host_1,/*yzm*/\r
.dev = {\r
.dma_mask = &rockchip_device_camera_dmamask,\r
.coherent_dma_mask = 0xffffffffUL,\r
.remove = rk_dts_sensor_remove,\r
};\r
\r
-//************yzm***************\r
\r
static int rk_dts_sensor_remove(struct platform_device *pdev)\r
{\r
struct device *dev = &pdev->dev;\r
struct rkcamera_platform_data *new_camera_list;\r
\r
+\r
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);\r
+ \r
np = dev->of_node;\r
if (!np)\r
return -ENODEV;\r
- \r
for_each_child_of_node(np, cp) {\r
u32 flash_attach,mir,i2c_rata,i2c_chl,i2c_add,cif_chl,mclk_rate,is_front;\r
u32 resolution,pwdn_info,powerup_sequence;\r
\r
strcpy(new_camera->dev.i2c_cam_info.type, cp->name);\r
new_camera->dev.i2c_cam_info.addr = i2c_add>>1;\r
- new_camera->dev.desc_info.host_desc.bus_id = RK29_CAM_PLATFORM_DEV_ID+cif_chl;//yzm\r
- new_camera->dev.desc_info.host_desc.i2c_adapter_id = i2c_chl;//yzm\r
- new_camera->dev.desc_info.host_desc.module_name = cp->name;//const\r
+ new_camera->dev.desc_info.host_desc.bus_id = RK29_CAM_PLATFORM_DEV_ID+cif_chl;/*yzm*/\r
+ new_camera->dev.desc_info.host_desc.i2c_adapter_id = i2c_chl;/*yzm*/\r
+ new_camera->dev.desc_info.host_desc.module_name = cp->name;/*const*/\r
new_camera->dev.device_info.name = "soc-camera-pdrv";\r
if(is_front)\r
sprintf(new_camera->dev_name,"%s_%s",cp->name,"front");\r
new_camera->mclk_rate = mclk_rate;\r
new_camera->of_node = cp;\r
\r
- // device = container_of(&(new_camera[sensor_num].dev.desc_info),rk_camera_device_register_info_t,desc_info);\r
- // debug_printk( "sensor num %d ,desc_info point %p +++++++\n",sensor_num,&(new_camera.dev.desc_info));\r
- // debug_printk( "sensor num %d ,dev %p +++++++\n",sensor_num,&(new_camera.dev));\r
- // debug_printk( "sensor num %d ,device point %p +++++++\n",sensor_num,device);\r
debug_printk( "******************* /n power = %x\n", power);\r
debug_printk( "******************* /n powerdown = %x\n", powerdown);\r
debug_printk( "******************* /n i2c_add = %x\n", new_camera->dev.i2c_cam_info.addr << 1);\r
return 0;\r
}\r
\r
-static int rk_dts_cif_probe(struct platform_device *pdev) //yzm\r
+static int rk_dts_cif_probe(struct platform_device *pdev) /*yzm*/\r
{\r
int irq,err;\r
struct device *dev = &pdev->dev;\r
return -ENODEV;\r
}\r
rk_camera_resource_host_0[0].flags = IORESOURCE_MEM;\r
- //map irqs\r
+ /*map irqs*/\r
irq = irq_of_parse_and_map(dev->of_node, 0);\r
if (irq < 0) {\r
printk(KERN_EMERG "Get irq resource from %s platform device failed!",pdev->name);\r
rk_camera_resource_host_0[1].start = irq;\r
rk_camera_resource_host_0[1].end = irq;\r
rk_camera_resource_host_0[1].flags = IORESOURCE_IRQ;\r
- //debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n res = [%x--%x] \n",rk_camera_resource_host_0[0].start , rk_camera_resource_host_0[0].end);\r
- //debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n irq_num = %d\n",irq);\r
return 0;\r
}\r
\r
\r
return 0;\r
}\r
- \r
+\r
+/************yzm**************end*/\r
\r
static int sensor_power_default_cb (struct rk29camera_gpio_res *res, int on)\r
{\r
if (camera_power != INVALID_GPIO) {\r
if (camera_io_init & RK29_CAM_POWERACTIVE_MASK) {\r
if (on) {\r
- //gpio_set_value(camera_power, ((camera_ioflag&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));\r
+ /*gpio_set_value(camera_power, ((camera_ioflag&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));*/\r
gpio_direction_output(camera_power,1);\r
dprintk("%s PowerPin=%d ..PinLevel = %x",res->dev_name, camera_power, ((camera_ioflag&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));\r
msleep(10);\r
} else {\r
- //gpio_set_value(camera_power, (((~camera_ioflag)&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));\r
+ /*gpio_set_value(camera_power, (((~camera_ioflag)&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));*/\r
gpio_direction_output(camera_power,0);\r
dprintk("%s PowerPin=%d ..PinLevel = %x",res->dev_name, camera_power, (((~camera_ioflag)&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));\r
}\r
return ret;\r
}\r
\r
-/*\r
-static void rk29_sensor_fps_get(int idx, unsigned int *val, int w, int h)\r
-{\r
-\r
-debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);\r
-\r
-\r
- switch (idx)\r
- {\r
- #ifdef CONFIG_SENSOR_0\r
- case 0:\r
- {\r
- if ((w==176) && (h==144)) {\r
- *val = CONFIG_SENSOR_QCIF_FPS_FIXED_0;\r
- #ifdef CONFIG_SENSOR_240X160_FPS_FIXED_0\r
- } else if ((w==240) && (h==160)) {\r
- *val = CONFIG_SENSOR_240X160_FPS_FIXED_0;\r
- #endif\r
- } else if ((w==320) && (h==240)) {\r
- *val = CONFIG_SENSOR_QVGA_FPS_FIXED_0;\r
- } else if ((w==352) && (h==288)) {\r
- *val = CONFIG_SENSOR_CIF_FPS_FIXED_0;\r
- } else if ((w==640) && (h==480)) {\r
- *val = CONFIG_SENSOR_VGA_FPS_FIXED_0;\r
- } else if ((w==720) && (h==480)) {\r
- *val = CONFIG_SENSOR_480P_FPS_FIXED_0;\r
- } else if ((w==800) && (h==600)) {\r
- *val = CONFIG_SENSOR_SVGA_FPS_FIXED_0;\r
- } else if ((w==1280) && (h==720)) {\r
- *val = CONFIG_SENSOR_720P_FPS_FIXED_0;\r
- }\r
- break;\r
- }\r
- #endif\r
- #ifdef CONFIG_SENSOR_1\r
- case 1:\r
- {\r
- if ((w==176) && (h==144)) {\r
- *val = CONFIG_SENSOR_QCIF_FPS_FIXED_1;\r
- #ifdef CONFIG_SENSOR_240X160_FPS_FIXED_1\r
- } else if ((w==240) && (h==160)) {\r
- *val = CONFIG_SENSOR_240X160_FPS_FIXED_1;\r
- #endif\r
- } else if ((w==320) && (h==240)) {\r
- *val = CONFIG_SENSOR_QVGA_FPS_FIXED_1;\r
- } else if ((w==352) && (h==288)) {\r
- *val = CONFIG_SENSOR_CIF_FPS_FIXED_1;\r
- } else if ((w==640) && (h==480)) {\r
- *val = CONFIG_SENSOR_VGA_FPS_FIXED_1;\r
- } else if ((w==720) && (h==480)) {\r
- *val = CONFIG_SENSOR_480P_FPS_FIXED_1;\r
- } else if ((w==800) && (h==600)) {\r
- *val = CONFIG_SENSOR_SVGA_FPS_FIXED_1;\r
- } else if ((w==1280) && (h==720)) {\r
- *val = CONFIG_SENSOR_720P_FPS_FIXED_1;\r
- }\r
- break;\r
- }\r
- #endif\r
- #ifdef CONFIG_SENSOR_01\r
- case 2:\r
- {\r
- if ((w==176) && (h==144)) {\r
- *val = CONFIG_SENSOR_QCIF_FPS_FIXED_01;\r
- #ifdef CONFIG_SENSOR_240X160_FPS_FIXED_01\r
- } else if ((w==240) && (h==160)) {\r
- *val = CONFIG_SENSOR_240X160_FPS_FIXED_01;\r
- #endif\r
- } else if ((w==320) && (h==240)) {\r
- *val = CONFIG_SENSOR_QVGA_FPS_FIXED_01;\r
- } else if ((w==352) && (h==288)) {\r
- *val = CONFIG_SENSOR_CIF_FPS_FIXED_01;\r
- } else if ((w==640) && (h==480)) {\r
- *val = CONFIG_SENSOR_VGA_FPS_FIXED_01;\r
- } else if ((w==720) && (h==480)) {\r
- *val = CONFIG_SENSOR_480P_FPS_FIXED_01;\r
- } else if ((w==800) && (h==600)) {\r
- *val = CONFIG_SENSOR_SVGA_FPS_FIXED_01;\r
- } else if ((w==1280) && (h==720)) {\r
- *val = CONFIG_SENSOR_720P_FPS_FIXED_01;\r
- }\r
- break;\r
- }\r
- #endif\r
- #ifdef CONFIG_SENSOR_02\r
- case 3:\r
- {\r
- if ((w==176) && (h==144)) {\r
- *val = CONFIG_SENSOR_QCIF_FPS_FIXED_02;\r
- #ifdef CONFIG_SENSOR_240X160_FPS_FIXED_02\r
- } else if ((w==240) && (h==160)) {\r
- *val = CONFIG_SENSOR_240X160_FPS_FIXED_02;\r
- #endif\r
- } else if ((w==320) && (h==240)) {\r
- *val = CONFIG_SENSOR_QVGA_FPS_FIXED_02;\r
- } else if ((w==352) && (h==288)) {\r
- *val = CONFIG_SENSOR_CIF_FPS_FIXED_02;\r
- } else if ((w==640) && (h==480)) {\r
- *val = CONFIG_SENSOR_VGA_FPS_FIXED_02;\r
- } else if ((w==720) && (h==480)) {\r
- *val = CONFIG_SENSOR_480P_FPS_FIXED_02;\r
- } else if ((w==800) && (h==600)) {\r
- *val = CONFIG_SENSOR_SVGA_FPS_FIXED_02;\r
- } else if ((w==1280) && (h==720)) {\r
- *val = CONFIG_SENSOR_720P_FPS_FIXED_02;\r
- }\r
- break;\r
- }\r
- #endif\r
- \r
- #ifdef CONFIG_SENSOR_11\r
- case 4:\r
- {\r
- if ((w==176) && (h==144)) {\r
- *val = CONFIG_SENSOR_QCIF_FPS_FIXED_11;\r
- #ifdef CONFIG_SENSOR_240X160_FPS_FIXED_11\r
- } else if ((w==240) && (h==160)) {\r
- *val = CONFIG_SENSOR_240X160_FPS_FIXED_11;\r
- #endif\r
- } else if ((w==320) && (h==240)) {\r
- *val = CONFIG_SENSOR_QVGA_FPS_FIXED_11;\r
- } else if ((w==352) && (h==288)) {\r
- *val = CONFIG_SENSOR_CIF_FPS_FIXED_11;\r
- } else if ((w==640) && (h==480)) {\r
- *val = CONFIG_SENSOR_VGA_FPS_FIXED_11;\r
- } else if ((w==720) && (h==480)) {\r
- *val = CONFIG_SENSOR_480P_FPS_FIXED_11;\r
- } else if ((w==800) && (h==600)) {\r
- *val = CONFIG_SENSOR_SVGA_FPS_FIXED_11;\r
- } else if ((w==1280) && (h==720)) {\r
- *val = CONFIG_SENSOR_720P_FPS_FIXED_11;\r
- }\r
- break;\r
- }\r
- #endif\r
- #ifdef CONFIG_SENSOR_12\r
- case 5:\r
- {\r
- if ((w==176) && (h==144)) {\r
- *val = CONFIG_SENSOR_QCIF_FPS_FIXED_12;\r
- #ifdef CONFIG_SENSOR_240X160_FPS_FIXED_12\r
- } else if ((w==240) && (h==160)) {\r
- *val = CONFIG_SENSOR_240X160_FPS_FIXED_12;\r
- #endif\r
- } else if ((w==320) && (h==240)) {\r
- *val = CONFIG_SENSOR_QVGA_FPS_FIXED_12;\r
- } else if ((w==352) && (h==288)) {\r
- *val = CONFIG_SENSOR_CIF_FPS_FIXED_12;\r
- } else if ((w==640) && (h==480)) {\r
- *val = CONFIG_SENSOR_VGA_FPS_FIXED_12;\r
- } else if ((w==720) && (h==480)) {\r
- *val = CONFIG_SENSOR_480P_FPS_FIXED_12;\r
- } else if ((w==800) && (h==600)) {\r
- *val = CONFIG_SENSOR_SVGA_FPS_FIXED_12;\r
- } else if ((w==1280) && (h==720)) {\r
- *val = CONFIG_SENSOR_720P_FPS_FIXED_12;\r
- }\r
- break;\r
- }\r
- #endif\r
- default:\r
- eprintk(" sensor-%d have not been define in board file!",idx);\r
- }\r
-}\r
-*/\r
static int _rk_sensor_io_init_(struct rk29camera_gpio_res *gpio_res,struct device_node *of_node)\r
{\r
int ret = 0;\r
bool io_requested_in_camera;\r
enum of_gpio_flags flags;\r
\r
- struct rkcamera_platform_data *new_camera;//yzm\r
- //struct device_node *parent_node;\r
+ struct rkcamera_platform_data *new_camera;/*yzm*/\r
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);\r
\r
\r
if (camera_power != INVALID_GPIO) {\r
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$/ camera_power = %x\n", camera_power );\r
\r
- camera_power = of_get_named_gpio_flags(of_node,"rockchip,power",0,&flags);//yzm\r
- gpio_res->gpio_power = camera_power;//yzm,½«ioµÄÍêÕûÐÅÏ¢´«»ØÈ¥¡£\r
+ camera_power = of_get_named_gpio_flags(of_node,"rockchip,power",0,&flags);/*yzm*/\r
+ gpio_res->gpio_power = camera_power;/*yzm information back to the IO*/\r
\r
- \r
- //dev->of_node = parent_node;//½«dev->of_node»¹Ô\r
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$/ camera_power = %x\n", camera_power ); \r
\r
- ret = gpio_request(camera_power, "camera power"); //ÉêÇëÃûΪ"camera power"µÄio¹Ü½Å\r
+ ret = gpio_request(camera_power, "camera power"); \r
if (ret) {\r
\r
io_requested_in_camera = false;\r
if (camera_powerdown != INVALID_GPIO) {\r
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$/ camera_powerdown = %x\n", camera_powerdown );\r
\r
- camera_powerdown = of_get_named_gpio_flags(of_node,"rockchip,powerdown",0,&flags);//yzm\r
- gpio_res->gpio_powerdown = camera_powerdown;//yzm,½«ioµÄÍêÕûÐÅÏ¢´«»ØÈ¥¡£\r
+ camera_powerdown = of_get_named_gpio_flags(of_node,"rockchip,powerdown",0,&flags);/*yzm*/\r
+ gpio_res->gpio_powerdown = camera_powerdown;/*yzm information back to the IO*/\r
\r
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$/ camera_powerdown = %x\n", camera_powerdown ); \r
ret = gpio_request(camera_powerdown, "camera powerdown");\r
}\r
if (gpio_res->gpio_init & RK29_CAM_AFACTIVE_MASK) {\r
if (camera_af != INVALID_GPIO) {\r
- // gpio_direction_input(camera_af);\r
+ /* gpio_direction_input(camera_af);*/\r
gpio_free(camera_af);\r
}\r
} \r
struct rkcamera_platform_data *new_cam_dev = NULL;\r
struct rk29camera_platform_data* plat_data = &rk_camera_platform_data;\r
int ret = RK29_CAM_IO_SUCCESS,i = 0;\r
- //struct soc_camera_link *dev_icl = NULL;//yzm\r
- struct soc_camera_desc *dev_icl = NULL;//yzm\r
+ struct soc_camera_desc *dev_icl = NULL;/*yzm*/\r
struct rkcamera_platform_data *new_camera;\r
-debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);\r
+ debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);\r
\r
if (res == NULL) {\r
new_camera = new_camera_head;\r
if (strcmp(new_camera->dev_name, dev_name(dev)) == 0) {\r
res = (struct rk29camera_gpio_res *)&new_camera->io; \r
new_cam_dev = &new_camera[i];\r
- //dev_icl = &new_camera[i].dev.link_info;\r
- dev_icl = &new_camera->dev.desc_info;//yzm\r
+ dev_icl = &new_camera->dev.desc_info;/*yzm*/\r
break;\r
}\r
new_camera = new_camera->next_camera;;\r
case Cam_Mclk:\r
{\r
if (plat_data->sensor_mclk && dev_icl) {\r
- //plat_data->sensor_mclk(dev_icl->bus_id,(on!=0)?1:0,on);\r
- plat_data->sensor_mclk(dev_icl->host_desc.bus_id,(on!=0)?1:0,on);//yzm\r
+ plat_data->sensor_mclk(dev_icl->host_desc.bus_id,(on!=0)?1:0,on);/*yzm*/\r
} else { \r
eprintk( "%s(%d): sensor_mclk(%p) or dev_icl(%p) is NULL",\r
__FUNCTION__,__LINE__,plat_data->sensor_mclk,dev_icl);\r
return ret;\r
}\r
\r
-static int rk_sensor_power(struct device *dev, int on) //icd->pdev\r
+static int rk_sensor_power(struct device *dev, int on) /*icd->pdev*/\r
{\r
int powerup_sequence,mclk_rate;\r
\r
\r
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);\r
\r
- new_camera = plat_data->register_dev_new; //new_camera[]\r
+ new_camera = plat_data->register_dev_new; /*new_camera[]*/\r
\r
- while (new_camera != NULL) {//yzm\r
- //while (strstr(new_camera->dev_name,"end")==NULL) {\r
+ while (new_camera != NULL) {\r
\r
- if (new_camera->io.gpio_powerdown != INVALID_GPIO) { //true\r
+ if (new_camera->io.gpio_powerdown != INVALID_GPIO) { \r
gpio_direction_output(new_camera->io.gpio_powerdown,\r
((new_camera->io.gpio_flag&RK29_CAM_POWERDNACTIVE_MASK)>>RK29_CAM_POWERDNACTIVE_BITPOS)); \r
}\r
\r
- debug_printk( "new_camera->dev_name= %s \n", new_camera->dev_name); //yzm\r
- debug_printk( "dev_name(dev)= %s \n", dev_name(dev)); //yzm\r
+ debug_printk( "new_camera->dev_name= %s \n", new_camera->dev_name); /*yzm*/\r
+ debug_printk( "dev_name(dev)= %s \n", dev_name(dev)); /*yzm*/\r
\r
- if (strcmp(new_camera->dev_name,dev_name(dev))) { //µ±²»ÊÇ´ò¿ªµÄsensorʱΪTRUE\r
- debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i\n", __FILE__, __LINE__);//yzm\r
+ if (strcmp(new_camera->dev_name,dev_name(dev))) { \r
+ debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i\n", __FILE__, __LINE__);\r
if (sensor_ioctl_cb.sensor_powerdown_cb && on)\r
{\r
- debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i\n", __FILE__, __LINE__);//yzm\r
+ debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i\n", __FILE__, __LINE__);\r
sensor_ioctl_cb.sensor_powerdown_cb(&new_camera->io,1);\r
}\r
} else {\r
new_device = new_camera;\r
dev_io = &new_camera->io;\r
- debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i\n", __FILE__, __LINE__);//yzm\r
+ debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i\n", __FILE__, __LINE__);/*yzm*/\r
if (!Sensor_Support_DirectResume(new_camera->pwdn_info))\r
real_pwroff = true; \r
else\r
real_pwroff = false;\r
}\r
- //new_camera++;\r
- new_camera = new_camera->next_camera;//yzm\r
+ new_camera = new_camera->next_camera;\r
}\r
\r
if (new_device != NULL) {\r
}\r
\r
if (on) {\r
- debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i\n", __FILE__, __LINE__);//yzm\r
+ debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i\n", __FILE__, __LINE__);\r
rk_sensor_pwrseq(dev, powerup_sequence, on,mclk_rate); \r
} else {\r
if (real_pwroff) {\r
if (rk_sensor_pwrseq(dev, powerup_sequence, on,mclk_rate)<0) /* ddl@rock-chips.com: v0.1.5 */\r
goto PowerDown;\r
\r
- /*ddl@rock-chips.com: all power down switch to Hi-Z after power off*/ //¸ß×è̬\r
+ /*ddl@rock-chips.com: all power down switch to Hi-Z after power off*/\r
new_camera = plat_data->register_dev_new;\r
- while (new_camera != NULL) {//yzm\r
- //while (strstr(new_camera->dev_name,"end")==NULL) {\r
+ while (new_camera != NULL) {\r
if (new_camera->io.gpio_powerdown != INVALID_GPIO) {\r
gpio_direction_input(new_camera->io.gpio_powerdown); \r
}\r
new_camera->pwdn_info |= 0x01;\r
- //new_camera++;\r
- new_camera = new_camera->next_camera;//yzm\r
+ new_camera = new_camera->next_camera;\r
}\r
} else { \r
PowerDown:\r
\r
new_camera = new_camera_head;\r
\r
- while (new_camera != NULL) {//yzm \r
+ while (new_camera != NULL) { \r
if (new_camera->dev.i2c_cam_info.addr == INVALID_VALUE) {\r
WARN(1, \r
KERN_ERR "%s(%d): new_camera[%d] i2c addr is invalidate!",\r
continue;\r
}\r
sprintf(new_camera->dev_name,"%s_%d",new_camera->dev.device_info.dev.init_name,i+3);\r
- new_camera->dev.device_info.dev.init_name =(const char*)&new_camera->dev_name[0];//ת»»³ÉÖ¸Õë\r
+ new_camera->dev.device_info.dev.init_name =(const char*)&new_camera->dev_name[0];\r
new_camera->io.dev_name =(const char*)&new_camera->dev_name[0];\r
- if (new_camera->orientation == INVALID_VALUE) { //¹ØÓÚǰºó·½Ïò\r
+ if (new_camera->orientation == INVALID_VALUE) {\r
if (strstr(new_camera->dev_name,"back")) { \r
new_camera->orientation = 90;\r
} else {\r
if ((new_camera->fov_v <= 0) || (new_camera->fov_v>360))\r
new_camera->fov_v = 100; \r
\r
- new_camera->dev.desc_info.subdev_desc.power = rk_sensor_power;//yzm\r
- new_camera->dev.desc_info.subdev_desc.powerdown = rk_sensor_powerdown;//yzm\r
- new_camera->dev.desc_info.host_desc.board_info =&new_camera->dev.i2c_cam_info; //yzm\r
+ new_camera->dev.desc_info.subdev_desc.power = rk_sensor_power;\r
+ new_camera->dev.desc_info.subdev_desc.powerdown = rk_sensor_powerdown;\r
+ new_camera->dev.desc_info.host_desc.board_info =&new_camera->dev.i2c_cam_info; \r
\r
- new_camera->dev.device_info.id = i+6;//?? platform_device.id\r
- new_camera->dev.device_info.dev.platform_data = &new_camera->dev.desc_info;//yzm\r
+ new_camera->dev.device_info.id = i+6;\r
+ new_camera->dev.device_info.dev.platform_data = &new_camera->dev.desc_info;\r
debug_printk("platform_data(desc_info) %p +++++++++++++\n",new_camera->dev.device_info.dev.platform_data);\r
- new_camera->dev.desc_info.subdev_desc.drv_priv = &rk_camera_platform_data;//yzm\r
+ new_camera->dev.desc_info.subdev_desc.drv_priv = &rk_camera_platform_data;\r
\r
platform_device_register(&(new_camera->dev.device_info));\r
-debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); \r
-debug_printk("new_camera = %p +++++++++++++\n",new_camera);\r
-debug_printk("new_camera->next_camera = %p +++++++++++++\n",new_camera->next_camera);\r
+ debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__); \r
+ debug_printk("new_camera = %p +++++++++++++\n",new_camera);\r
+ debug_printk("new_camera->next_camera = %p +++++++++++++\n",new_camera->next_camera);\r
\r
new_camera = new_camera->next_camera;\r
}\r
\r
return 0;\r
}\r
+#include "../../../drivers/media/video/rk30_camera.c"\r
#define RK29_CAM_SENSOR_OV2655 ov2655
#define RK29_CAM_SENSOR_OV2659 ov2659
-#define RK29_CAM_SENSOR_OV2660 ov2660 //yzm
+#define RK29_CAM_SENSOR_OV2660 ov2660 /*yzm*/
#define RK29_CAM_SENSOR_OV7690 ov7690
#define RK29_CAM_SENSOR_OV3640 ov3640
#define RK29_CAM_SENSOR_NAME_OV2655 "ov2655"
#define RK29_CAM_SENSOR_NAME_OV2659 "ov2659"
-#define RK29_CAM_SENSOR_NAME_OV2660 "ov2660" //yzm
+#define RK29_CAM_SENSOR_NAME_OV2660 "ov2660" /*yzm*/
#define RK29_CAM_SENSOR_NAME_OV7690 "ov7690"
#define ov2655_I2C_ADDR 0x60
#define ov2659_I2C_ADDR 0x60
-#define ov2660_I2C_ADDR 0x60 //yzm
+#define ov2660_I2C_ADDR 0x60 /*yzm*/
#define ov7690_I2C_ADDR 0x42
#define ov3640_I2C_ADDR 0x78
#define ov2655_PWRDN_ACTIVE 0x01
#define ov2659_PWRDN_ACTIVE 0x01
-#define ov2660_PWRDN_ACTIVE 0x01 //yzm
+#define ov2660_PWRDN_ACTIVE 0x01 /*yzm*/
#define ov7690_PWRDN_ACTIVE 0x01
#define ov3640_PWRDN_ACTIVE 0x01
typedef struct rk_camera_device_register_info {
struct i2c_board_info i2c_cam_info;
- struct soc_camera_desc desc_info;//yzm
+ struct soc_camera_desc desc_info;/*yzm*/
struct platform_device device_info;
}rk_camera_device_register_info_t;
int fov_h; /* fied of view horizontal */
int fov_v; /* fied of view vertical */
struct device_node *of_node;
- struct rkcamera_platform_data *next_camera;//yzm
+ struct rkcamera_platform_data *next_camera;/*yzm*/
};
int (*sensor_mclk)(int cif_idx, int on, int clk_rate);
struct rkcamera_platform_data *register_dev_new; //sensor
- struct device *cif_dev;//yzm host
+ struct device *cif_dev;/*yzm host*/
};
struct rk29camera_platform_ioctl_cb {
#define RK29_CAM_SENSOR_OV2655 ov2655
#define RK29_CAM_SENSOR_OV2659 ov2659
-#define RK29_CAM_SENSOR_OV2660 ov2660 //yzm
+#define RK29_CAM_SENSOR_OV2660 ov2660 /*yzm*/
#define RK29_CAM_SENSOR_OV7690 ov7690
#define RK29_CAM_SENSOR_OV3640 ov3640
#define RK29_CAM_SENSOR_NAME_OV2655 "ov2655"
#define RK29_CAM_SENSOR_NAME_OV2659 "ov2659"
-#define RK29_CAM_SENSOR_NAME_OV2660 "ov2660" //yzm
+#define RK29_CAM_SENSOR_NAME_OV2660 "ov2660" /*yzm*/
#define RK29_CAM_SENSOR_NAME_OV7690 "ov7690"
#define ov2655_I2C_ADDR 0x60
#define ov2659_I2C_ADDR 0x60
-#define ov2660_I2C_ADDR 0x60 //yzm
+#define ov2660_I2C_ADDR 0x60 /*yzm*/
#define ov7690_I2C_ADDR 0x42
#define ov3640_I2C_ADDR 0x78
#define ov2655_PWRDN_ACTIVE 0x01
#define ov2659_PWRDN_ACTIVE 0x01
-#define ov2660_PWRDN_ACTIVE 0x01 //yzm
+#define ov2660_PWRDN_ACTIVE 0x01 /*yzm*/
#define ov7690_PWRDN_ACTIVE 0x01
#define ov3640_PWRDN_ACTIVE 0x01
icd->user_width, icd->user_height);
/* set physical bus parameters */
- return ici->ops->set_bus_param(icd, pix->pixelformat);//yzm
+ return ici->ops->set_bus_param(icd, pix->pixelformat);/*yzm*/
}
static int soc_camera_open(struct file *file)
return ret;
}
+/**************yzm*************/
+/* ddl@rock-chips.com : Add ioctrl - VIDIOC_ENUM_FRAMEINTERVALS for soc-camera */
+static int soc_camera_enum_frameintervals (struct file *file, void *priv,
+ struct v4l2_frmivalenum *fival)
+{
+ struct soc_camera_device *icd = file->private_data;
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
+ struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
+ int ret;
+
+ WARN_ON(priv != file->private_data);
+ ret = v4l2_subdev_call(sd, video, enum_frameintervals, fival);
+ if (ret == -ENOIOCTLCMD) {
+ if (ici->ops->enum_frameinervals)
+ ret = ici->ops->enum_frameinervals(icd, fival);
+ else
+ ret = -ENOIOCTLCMD;
+ }
+
+ return ret;
+}
+/************yzm**************end*/
static int soc_camera_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{
else
ret = vb2_streamon(&icd->vb2_vidq, i);
- if (!ret)
- v4l2_subdev_call(sd, video, s_stream, 1);
+ if (!ret){
+ v4l2_subdev_call(sd, video, s_stream, 1);
+ if (ici->ops->s_stream)
+ ici->ops->s_stream(icd, 1); /* ddl@rock-chips.com : Add stream control for host */
+ }
return ret;
}
if (icd->streamer != file)
return -EBUSY;
+ /* ddl@rock-chips.com: v0.1.1 */
+ v4l2_subdev_call(sd, video, s_stream, 0);
+ if (ici->ops->s_stream)
+ ici->ops->s_stream(icd, 0); /* ddl@rock-chips.com : Add stream control for host */
/*
* This calls buf_release from host driver's videobuf_queue_ops for all
* remaining buffers. When the last buffer is freed, stop capture
return 0;
}
+/*************yzm*************/
+static int soc_camera_queryctrl(struct file *file, void *priv,
+ struct v4l2_queryctrl *qc)
+{
+ struct soc_camera_device *icd = file->private_data;
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
+ int i;
+ //printk( "/___________//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
+
+ WARN_ON(priv != file->private_data);
+
+ //printk("icd->ops->num_controls = %d ~~~~~~~~~~~~\n",icd->ops->num_controls);//yzm
+ //printk("ici->ops->num_controls = %d ~~~~~~~~~~~~\n",ici->ops->num_controls);//yzm
+
+ if (!qc->id)
+ return -EINVAL;
+
+ /* first device controls */
+ //if device support digital zoom ,first use it to do zoom,zyc
+ for (i = 0; i < icd->ops->num_controls; i++)
+ if (qc->id == icd->ops->controls[i].id) {
+ memcpy(qc, &(icd->ops->controls[i]),
+ sizeof(*qc));
+ return 0;
+ }
+
+ /* then check host controls */
+ for (i = 0; i < ici->ops->num_controls; i++)
+ if (qc->id == ici->ops->controls[i].id) {
+ memcpy(qc, &(ici->ops->controls[i]),
+ sizeof(*qc));
+ return 0;
+ }
+ //printk( "/___________//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
+ return -EINVAL;
+}
+
+/* ddl@rock-chips.com : Add ioctrl -VIDIOC_QUERYMENU */
+static int soc_camera_querymenu(struct file *file, void *priv,
+ struct v4l2_querymenu *qm)
+{
+ struct soc_camera_device *icd = file->private_data;
+ struct v4l2_queryctrl qctrl;
+ int i,j;
+
+ qctrl.id = qm->id;
+
+ if (soc_camera_queryctrl(file,priv, &qctrl) == 0) {
+ for (i = 0; i < icd->ops->num_menus; i++) {
+ if (qm->id == icd->ops->menus[i].id) {
+ for (j=0; j<=(qctrl.maximum - qctrl.minimum); j++) {
+
+ if (qm->index == icd->ops->menus[i].index) {
+ snprintf(qm->name, sizeof(qm->name), icd->ops->menus[i].name);
+ qm->reserved = 0;
+
+ return 0;
+ } else {
+ i++;
+ if ( i >= icd->ops->num_menus)
+ return -EINVAL;
+ }
+ }
+ }
+ }
+ }
+
+ return -EINVAL;
+}
+
+static int soc_camera_g_ctrl(struct file *file, void *priv,
+ struct v4l2_control *ctrl)
+{
+ struct soc_camera_device *icd = file->private_data;
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
+ struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
+ int ret;
+
+ WARN_ON(priv != file->private_data);
+
+ if (ici->ops->get_ctrl) {
+ ret = ici->ops->get_ctrl(icd, ctrl);
+ if (ret != -ENOIOCTLCMD)
+ return ret;
+ }
+
+ return v4l2_subdev_call(sd, core, g_ctrl, ctrl);
+}
+
+static int soc_camera_s_ctrl(struct file *file, void *priv,
+ struct v4l2_control *ctrl)
+{
+ struct soc_camera_device *icd = file->private_data;
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
+ struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
+ int ret;
+
+ WARN_ON(priv != file->private_data);
+
+ if (ici->ops->set_ctrl) {
+ ret = ici->ops->set_ctrl(icd, ctrl);
+ if (ret != -ENOIOCTLCMD)
+ return ret;
+ }
+
+ return v4l2_subdev_call(sd, core, s_ctrl, ctrl);
+}
+
+ /* ddl@rock-chips.com : Add ioctrl -VIDIOC_XXX_ext_ctrl for soc-camera */
+static int soc_camera_try_ext_ctrl(struct file *file, void *priv,
+ struct v4l2_ext_controls *ctrl)
+{
+ struct soc_camera_device *icd = file->private_data;
+ const struct v4l2_queryctrl *qctrl;
+ int i;
+
+ WARN_ON(priv != file->private_data);
+
+ if (ctrl->ctrl_class != V4L2_CTRL_CLASS_CAMERA)
+ return -EINVAL;
+
+ for (i=0; i<ctrl->count; i++) {
+ qctrl = soc_camera_find_qctrl(icd->ops, ctrl->controls[i].id);
+ if (!qctrl)
+ return -EINVAL;
+
+ if ((ctrl->controls[i].value < qctrl->minimum) ||(ctrl->controls[i].value > qctrl->minimum))
+ return -ERANGE;
+ }
+
+ return 0;
+}
+
+ /* ddl@rock-chips.com : Add ioctrl -VIDIOC_XXX_ext_ctrl for soc-camera */
+static int soc_camera_g_ext_ctrl(struct file *file, void *priv,
+ struct v4l2_ext_controls *ctrl)
+{
+ struct soc_camera_device *icd = file->private_data;
+ struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
+
+ WARN_ON(priv != file->private_data);
+
+ if (ctrl->ctrl_class != V4L2_CTRL_CLASS_CAMERA)
+ return -EINVAL;
+
+ return v4l2_subdev_call(sd, core, g_ext_ctrls, ctrl);
+}
+
+ /* ddl@rock-chips.com : Add ioctrl -VIDIOC_XXX_ext_ctrl for soc-camera */
+static int soc_camera_s_ext_ctrl(struct file *file, void *priv,
+ struct v4l2_ext_controls *ctrl)
+{
+ struct soc_camera_device *icd = file->private_data;
+ struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
+
+ WARN_ON(priv != file->private_data);
+
+ if (ctrl->ctrl_class != V4L2_CTRL_CLASS_CAMERA)
+ return -EINVAL;
+
+ return v4l2_subdev_call(sd, core, s_ext_ctrls, ctrl);
+}
+ /*************yzm*************end*/
static int soc_camera_cropcap(struct file *file, void *fh,
struct v4l2_cropcap *a)
ret = video_dev_create(icd);
if (ret < 0)
goto evdc;
- ssdd->socdev = icd;//yzm
+ ssdd->socdev = icd;/*yzm*/
/* Non-i2c cameras, e.g., soc_camera_platform, have no board_info */
if (shd->board_info) {
ret = soc_camera_init_i2c(icd, sdesc);
evdc:
mutex_lock(&ici->host_lock);
ici->ops->remove(icd);
- soc_camera_power_off(icd->pdev,ssdd);//yzm
+ soc_camera_power_off(icd->pdev,ssdd);/*yzm*/
mutex_unlock(&ici->host_lock);
eadd:
v4l2_ctrl_handler_free(&icd->ctrl_handler);
.vidioc_prepare_buf = soc_camera_prepare_buf,
.vidioc_streamon = soc_camera_streamon,
.vidioc_streamoff = soc_camera_streamoff,
+ /**************yzm***************/
+ .vidioc_queryctrl = soc_camera_queryctrl,
+ .vidioc_querymenu = soc_camera_querymenu, /* ddl@rock-chips.com: Add ioctrl - vidioc_querymenu for soc-camera */
+ .vidioc_g_ctrl = soc_camera_g_ctrl,
+ .vidioc_s_ctrl = soc_camera_s_ctrl,
+ .vidioc_g_ext_ctrls = soc_camera_g_ext_ctrl, /* ddl@rock-chips.com: Add ioctrl - vidioc_g_ext_ctrls for soc-camera */
+ .vidioc_s_ext_ctrls = soc_camera_s_ext_ctrl, /* ddl@rock-chips.com: Add ioctrl - vidioc_s_ext_ctrls for soc-camera */
+ .vidioc_try_ext_ctrls = soc_camera_try_ext_ctrl,/* ddl@rock-chips.com: Add ioctrl - vidioc_try_ext_ctrls for soc-camera */
+ .vidioc_enum_frameintervals = soc_camera_enum_frameintervals,/* ddl@rock-chips.com: Add ioctrl - VIDIOC_ENUM_FRAMEINTERVALS for soc-camera */
+ /**************yzm***************end*/
.vidioc_cropcap = soc_camera_cropcap,
.vidioc_g_crop = soc_camera_g_crop,
.vidioc_s_crop = soc_camera_s_crop,
vdev->ioctl_ops = &soc_camera_ioctl_ops;
vdev->release = video_device_release;
vdev->tvnorms = V4L2_STD_UNKNOWN;
- vdev->ctrl_handler = &icd->ctrl_handler;
+ vdev->ctrl_handler = NULL;//&icd->ctrl_handler; /**************yzm***************/
vdev->lock = &ici->host_lock;
icd->vdev = vdev;
int retval;
MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS);
-
if (b->memory == V4L2_MEMORY_MMAP)
down_read(¤t->mm->mmap_sem);
-
videobuf_queue_lock(q);
retval = -EBUSY;
if (q->reading) {
dprintk(1, "qbuf: requesting next field\n");
field = videobuf_next_field(q);
+
retval = q->ops->buf_prepare(q, buf, field);
if (0 != retval) {
dprintk(1, "qbuf: buffer_prepare returned %d\n", retval);
goto done;
}
-
list_add_tail(&buf->stream, &q->stream);
if (q->streaming) {
spin_lock_irqsave(q->irqlock, flags);
done:
videobuf_queue_unlock(q);
-
if (b->memory == V4L2_MEMORY_MMAP)
up_read(¤t->mm->mmap_sem);
-
return retval;
}
EXPORT_SYMBOL_GPL(videobuf_qbuf);
static int stream_next_buffer_check_queue(struct videobuf_queue *q, int noblock)
{
int retval;
+ bool is_ext_locked;
checks:
if (!q->streaming) {
} else {
dprintk(2, "next_buffer: waiting on buffer\n");
- /* Drop lock to avoid deadlock with qbuf */
- videobuf_queue_unlock(q);
-
+ /* Drop lock to avoid deadlock with qbuf */
+ videobuf_queue_unlock(q);
+ /*ddl@rock-chips.com */
+ is_ext_locked = q->ext_lock && mutex_is_locked(q->ext_lock);
+
+ /* Release vdev lock to prevent this wait from blocking outside access to
+ the device. */
+ if (is_ext_locked)
+ mutex_unlock(q->ext_lock);
+
+
/* Checking list_empty and streaming is safe without
* locks because we goto checks to validate while
* holding locks before proceeding */
retval = wait_event_interruptible(q->wait,
!list_empty(&q->stream) || !q->streaming);
- videobuf_queue_lock(q);
+ videobuf_queue_lock(q);
+ /*ddl@rock-chips.com */
+ if (is_ext_locked)
+ mutex_lock(q->ext_lock);
if (retval)
goto done;
{
//struct soc_camera_link *icl = to_soc_camera_link(icd);
struct soc_camera_desc *desc = to_soc_camera_desc(icd);
- struct rk29camera_platform_data *pdata = desc->subdev_desc.drv_priv;//yzm
+ struct rk29camera_platform_data *pdata = desc->subdev_desc.drv_priv;/*yzm*/
struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd));
struct generic_sensor *sensor = to_generic_sensor(client);
int ret = 0;
case Sensor_Power:
{
//if (icl->power) {
- if(desc->subdev_desc.power) {//yzm
- ret = desc->subdev_desc.power(icd->pdev, on);//yzm
+ if(desc->subdev_desc.power) {/*yzm*/
+ ret = desc->subdev_desc.power(icd->pdev, on);/*yzm*/
} else {
SENSOR_TR("haven't power callback");
ret = -EINVAL;
case Sensor_PowerDown:
{
//if (icl->powerdown) {
- if(desc->subdev_desc.powerdown) {//yzm
- ret = desc->subdev_desc.powerdown(icd->pdev, on);//yzm
+ if(desc->subdev_desc.powerdown) {/*yzm*/
+ ret = desc->subdev_desc.powerdown(icd->pdev, on);/*yzm*/
} else {
SENSOR_TR("haven't power down callback");
ret = -EINVAL;
int array_index = 0;
int num = sensor->info_priv.num_series;
//struct soc_camera_link *icl = to_soc_camera_link(icd);
- struct soc_camera_desc *desc = to_soc_camera_desc(icd);//yzm
- struct rk29camera_platform_data *pdata = desc->subdev_desc.drv_priv;//yzm
+ struct soc_camera_desc *desc = to_soc_camera_desc(icd);/*yzm*/
+ struct rk29camera_platform_data *pdata = desc->subdev_desc.drv_priv;/*yzm*/
struct rkcamera_platform_data *sensor_device=NULL,*new_camera;
new_camera = pdata->register_dev_new;
unsigned long generic_sensor_query_bus_param(struct soc_camera_device *icd)
{
//struct soc_camera_link *icl = to_soc_camera_link(icd);
- struct soc_camera_desc *desc = to_soc_camera_desc(icd);//yzm
+ struct soc_camera_desc *desc = to_soc_camera_desc(icd);/*yzm*/
struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd));
struct generic_sensor *sensor = to_generic_sensor(client);
/**************yzm************/
struct v4l2_mbus_config cfg;
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
cfg.flags = sensor->info_priv.bus_parameter;
- return soc_camera_apply_board_flags(&(desc->subdev_desc), &cfg);//yzm
+ return soc_camera_apply_board_flags(&(desc->subdev_desc), &cfg);/*yzm*/
/**************yzm*************/
}
#include <media/soc_camera.h>\r
#include <linux/vmalloc.h>\r
#include <linux/module.h>\r
-#include "../../../arch/arm/mach-rockchip/rk30_camera.h"//yzm\r
+#include "../../../arch/arm/mach-rockchip/rk30_camera.h"/*yzm*/\r
#include <linux/kernel.h>\r
/* Camera Sensor driver */\r
\r
extern int generic_sensor_g_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl);\r
extern int generic_sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_controls *ext_ctrl);\r
extern long generic_sensor_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg);\r
-extern int generic_sensor_s_power(struct v4l2_subdev *sd, int on);//yzm\r
+extern int generic_sensor_s_power(struct v4l2_subdev *sd, int on);/*yzm*/\r
extern int generic_sensor_enum_fmt(struct v4l2_subdev *sd, unsigned int index,enum v4l2_mbus_pixelcode *code);\r
extern int generic_sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf);\r
extern int generic_sensor_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *id);\r
-
#include <media/soc_camera.h>
#include <media/camsys_head.h>
#include <linux/android_pmem.h>
#include <linux/i2c.h>
#include <linux/of.h>
#include <linux/of_irq.h>
-#include "../../../arch/arm/mach-rockchip/rk30_camera.h"//yzm
-#include "../../../arch/arm/mach-rockchip/rk_camera.h"//yzm
+#include "../../../arch/arm/mach-rockchip/rk30_camera.h"/*yzm*/
+#include "../../../arch/arm/mach-rockchip/rk_camera.h"/*yzm*/
//**********yzm***********//
#include <linux/kernel.h>
#include <linux/of_address.h>
#include <linux/of_fdt.h>
#include <linux/module.h>
-static int rk_dts_sensor_probe(struct platform_device *pdev);
-static int rk_dts_sensor_remove(struct platform_device *pdev);
-static int rk_dts_cif_probe(struct platform_device *pdev);
-static int rk_dts_cif_remove(struct platform_device *pdev);
-
-#include "../../../arch/arm/mach-rockchip/rk_camera.c"//yzm
-
-
static int rk_register_camera_devices(void)
{
int i;
int host_registered_0,host_registered_1;
- struct rkcamera_platform_data *new_camera; //¶¨ÒåµÄÊÇÒ»¸ösensor½á¹¹Ìå
+ struct rkcamera_platform_data *new_camera;
//printk(KERN_EMERG "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
if (new_camera != NULL) {
while (new_camera != NULL) {
- if (new_camera->dev.desc_info.host_desc.bus_id == RK_CAM_PLATFORM_DEV_ID_1) {//yzm
+ if (new_camera->dev.desc_info.host_desc.bus_id == RK_CAM_PLATFORM_DEV_ID_1) {/*yzm*/
host_registered_1 = 1;
- } else if (new_camera->dev.desc_info.host_desc.bus_id == RK_CAM_PLATFORM_DEV_ID_0) {//yzm
+ } else if (new_camera->dev.desc_info.host_desc.bus_id == RK_CAM_PLATFORM_DEV_ID_0) {/*yzm*/
host_registered_0 = 1;
}
#if RK_SUPPORT_CIF0
if (host_registered_0) {
- platform_device_register(&rk_device_camera_host_0);//host_0 ÉÏÓÐsensor
+ platform_device_register(&rk_device_camera_host_0);//host_0 has sensor
} //host_device_register
#endif
#if RK_SUPPORT_CIF1
if (host_registered_1) {
- platform_device_register(&rk_device_camera_host_1);//host_1ÉÏÓÐsensor
+ platform_device_register(&rk_device_camera_host_1);//host_1 has sensor
} //host_device_register
#endif
if (rk_camera_platform_data.sensor_register)
- (rk_camera_platform_data.sensor_register)(); //µ÷ÓÃrk_sensor_register()
+ (rk_camera_platform_data.sensor_register)(); //call rk_sensor_register()
- #if PMEM_CAM_NECESSARY
- platform_device_register(&android_pmem_cam_device);//???
- #endif
return 0;
}
-module_init(rk_register_camera_devices);//yzm
+module_init(rk_register_camera_devices);/*yzm*/
#include <linux/videodev2.h>
#include <linux/kthread.h>
-//#include <mach/iomux.h>//yzm
#include <media/v4l2-common.h>
#include <media/v4l2-dev.h>
#include <media/videobuf-dma-contig.h>
#include <linux/rockchip/iomap.h>
#include "../../video/rockchip/rga/rga.h"
-#include "../../../arch/arm/mach-rockchip/rk30_camera.h"//yzm
+#include "../../../arch/arm/mach-rockchip/rk30_camera.h"/*yzm*/
+#include <linux/rockchip/cru.h>
/*******yzm*********
#define RKCAMERA_DG2(format, ...) dprintk(2, format, ## __VA_ARGS__)
#define debug_printk(format, ...) dprintk(3, format, ## __VA_ARGS__)
-#define RK30_CRU_BASE 0x00 //yzm
+#define RK30_CRU_BASE 0x00 /*yzm*/
-// CIF Reg Offset
+/* CIF Reg Offset*/
#define CIF_CIF_CTRL 0x00
#define CIF_CIF_INTEN 0x04
#define CIF_CIF_INTSTAT 0x08
#define CIF_CIF_LAST_LINE 0x68
#define CIF_CIF_LAST_PIX 0x6c
-//The key register bit descrition
-// CIF_CTRL Reg , ignore SCM,WBC,ISP,
+/*The key register bit descrition*/
+/* CIF_CTRL Reg , ignore SCM,WBC,ISP,*/
#define DISABLE_CAPTURE (0x00<<0)
#define ENABLE_CAPTURE (0x01<<0)
#define MODE_ONEFRAME (0x00<<1)
#define MODE_LINELOOP (0x02<<1)
#define AXI_BURST_16 (0x0F << 12)
-//CIF_CIF_INTEN
+/*CIF_CIF_INTEN*/
#define FRAME_END_EN (0x01<<1)
#define BUS_ERR_EN (0x01<<6)
#define SCL_ERR_EN (0x01<<7)
-//CIF_CIF_FOR
+/*CIF_CIF_FOR*/
#define VSY_HIGH_ACTIVE (0x01<<0)
#define VSY_LOW_ACTIVE (0x00<<0)
#define HSY_LOW_ACTIVE (0x01<<1)
#define UV_STORAGE_ORDER_UVUV (0x00<<19)
#define UV_STORAGE_ORDER_VUVU (0x01<<19)
-//CIF_CIF_SCL_CTRL
+/*CIF_CIF_SCL_CTRL*/
#define ENABLE_SCL_DOWN (0x01<<0)
#define DISABLE_SCL_DOWN (0x00<<0)
#define ENABLE_SCL_UP (0x01<<1)
#define mask_cif_reg(addr, msk, val) write_cif_reg(addr, (val)|((~(msk))&read_cif_reg(addr)))
/*********yzm***********/
-//#if defined(CONFIG_ARCH_RK30) || defined(CONFIG_ARCH_RK3188)
-//CRU,PIXCLOCK
+/*#if defined(CONFIG_ARCH_RK30) || defined(CONFIG_ARCH_RK3188)*/
+/*CRU,PIXCLOCK*/
#define CRU_PCLK_REG30 0xbc
#define ENANABLE_INVERT_PCLK_CIF0 ((0x1<<24)|(0x1<<8))
#define DISABLE_INVERT_PCLK_CIF0 ((0x1<<24)|(0x0<<8))
#define write_cru_reg(addr, val) __raw_writel(val, addr+RK30_CRU_BASE)
#define read_cru_reg(addr) __raw_readl(addr+RK30_CRU_BASE)
#define mask_cru_reg(addr, msk, val) write_cru_reg(addr,(val)|((~(msk))&read_cru_reg(addr)))
-//#endif //yzm end
+/*#endif yzm*/
#if defined(CONFIG_ARCH_RK3026)
-//CRU,PIXCLOCK
+/*CRU,PIXCLOCK*/
#define CRU_PCLK_REG30 0xbc
#define ENANABLE_INVERT_PCLK_CIF0 ((0x1<<23)|(0x1<<7))
#define DISABLE_INVERT_PCLK_CIF0 ((0x1<<23)|(0x0<<7))
#if defined(CONFIG_ARCH_RK3066B) || defined(CONFIG_ARCH_RK3188)
-//GRF_IO_CON3 0x100
+/*GRF_IO_CON3 0x100*/
#define CIF_DRIVER_STRENGTH_2MA (0x00 << 12)
#define CIF_DRIVER_STRENGTH_4MA (0x01 << 12)
#define CIF_DRIVER_STRENGTH_8MA (0x02 << 12)
#define CIF_DRIVER_STRENGTH_12MA (0x03 << 12)
#define CIF_DRIVER_STRENGTH_MASK (0x03 << 28)
-//GRF_IO_CON4 0x104
+/*GRF_IO_CON4 0x104*/
#define CIF_CLKOUT_AMP_3V3 (0x00 << 10)
#define CIF_CLKOUT_AMP_1V8 (0x01 << 10)
#define CIF_CLKOUT_AMP_MASK (0x01 << 26)
#define mask_grf_reg(addr, msk, val)
#endif
-#define CAM_WORKQUEUE_IS_EN() (false)//(true)
-#define CAM_IPPWORK_IS_EN() (false)//((pcdev->zoominfo.a.c.width != pcdev->icd->user_width) || (pcdev->zoominfo.a.c.height != pcdev->icd->user_height))
+#define CAM_WORKQUEUE_IS_EN() (false)/*(true)*/
+#define CAM_IPPWORK_IS_EN() (false)/*((pcdev->zoominfo.a.c.width != pcdev->icd->user_width) || (pcdev->zoominfo.a.c.height != pcdev->icd->user_height))*/
-#define IS_CIF0() (true)//(pcdev->hostid == RK_CAM_PLATFORM_DEV_ID_0)
+#define IS_CIF0() (true)/*(pcdev->hostid == RK_CAM_PLATFORM_DEV_ID_0)*/
#if (CONFIG_CAMERA_SCALE_CROP_MACHINE == RK_CAM_SCALE_CROP_IPP)
#define CROP_ALIGN_BYTES (0x03)
#define CIF_DO_CROP 0
unsigned int cifFmt;
unsigned int cifVirWidth;
unsigned int cifScale;
-// unsigned int VipCrm;
+/* unsigned int VipCrm;*/
enum rk_camera_reg_state Inval;
};
struct rk_camera_work
};
struct rk_cif_clk
{
- //************must modify start************/
+ /************must modify start************/
struct clk *pd_cif;
struct clk *aclk_cif;
struct clk *hclk_cif;
struct clk *cif_clk_in;
struct clk *cif_clk_out;
- //************must modify end************/
+ /************must modify end************/
spinlock_t lock;
bool on;
unsigned int last_fps;
unsigned long frame_interval;
unsigned int pixfmt;
- //for ipp
+ /*for ipp */
unsigned int vipmem_phybase;
void __iomem *vipmem_virbase;
unsigned int vipmem_size;
#endif
int host_width;
int host_height;
- int host_left; //sensor output size ?
+ int host_left; /*sensor output size ?*/
int host_top;
int hostid;
int icd_width;
static int rk_camera_s_stream(struct soc_camera_device *icd, int enable);
static void rk_camera_capture_process(struct work_struct *work);
-//static int rk_camera_scale_crop_arm(struct work_struct *work);
+/*static int rk_camera_scale_crop_arm(struct work_struct *work);*/
+
+static inline void rk3128_cru_set_soft_reset(u32 idx, bool on)
+{
+ void __iomem *reg = RK_CRU_VIRT + RK312X_CRU_SOFTRSTS_CON(6);
+ u32 val = on ? 0x10001U << 14 : 0x10000U << 14;
+ writel_relaxed(val, reg);
+ dsb();
+}
static void rk_camera_cif_reset(struct rk_camera_dev *pcdev, int only_rst)
{
-/*************yzm**************
int ctrl_reg,inten_reg,crop_reg,set_size_reg,for_reg,vir_line_width_reg,scl_reg,y_reg,uv_reg;
- enum rk3288_cru_soft_reset cif_reset_index = SOFT_RST_CIF0;
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
-
- if (IS_CIF0() == false) {
-#if RK_SUPPORT_CIF1
- cif_reset_index = SOFT_RST_CIF1;
-#else
- RKCAMERA_TR("%s: CIF1 is invalidate\n",__FUNCTION__);
- BUG();
-#endif
- }
-
if (only_rst == true) {
- rk3288_cru_set_soft_reset(cif_reset_index, true);
+ rk3128_cru_set_soft_reset(0, true);
udelay(5);
- rk3288_cru_set_soft_reset(cif_reset_index, false);
+ rk3128_cru_set_soft_reset(0, false);
} else {
ctrl_reg = read_cif_reg(pcdev->base,CIF_CIF_CTRL);
if (ctrl_reg & ENABLE_CAPTURE) {
y_reg = read_cif_reg(pcdev->base, CIF_CIF_FRM0_ADDR_Y);
uv_reg = read_cif_reg(pcdev->base, CIF_CIF_FRM0_ADDR_UV);
- rk3288_cru_set_soft_reset(cif_reset_index, true);
+ rk3128_cru_set_soft_reset(0, true);
udelay(5);
- rk3288_cru_set_soft_reset(cif_reset_index, false);
+ rk3128_cru_set_soft_reset(0, false);
write_cif_reg(pcdev->base,CIF_CIF_CTRL, ctrl_reg&~ENABLE_CAPTURE);
write_cif_reg(pcdev->base,CIF_CIF_INTEN, inten_reg);
write_cif_reg(pcdev->base,CIF_CIF_FOR, for_reg);
write_cif_reg(pcdev->base,CIF_CIF_VIR_LINE_WIDTH,vir_line_width_reg);
write_cif_reg(pcdev->base,CIF_CIF_SCL_CTRL,scl_reg);
- write_cif_reg(pcdev->base,CIF_CIF_FRM0_ADDR_Y,y_reg); / *ddl@rock-chips.com v0.3.0x13
+ write_cif_reg(pcdev->base,CIF_CIF_FRM0_ADDR_Y,y_reg); /*ddl@rock-chips.com v0.3.0x13 */
write_cif_reg(pcdev->base,CIF_CIF_FRM0_ADDR_UV,uv_reg);
}
- *///***********yzm*************end
return;
}
unsigned int *size)
{
struct soc_camera_device *icd = vq->priv_data;
- //struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
struct rk_camera_dev *pcdev = ici->priv;
unsigned int i;
struct rk_camera_work *wk;
else
bytes_per_line_host = soc_mbus_bytes_per_line(pcdev->host_width,
icd->current_fmt->host_fmt);
- // dev_dbg(&icd->dev, "count=%d, size=%d\n", *count, *size);//yzm
+ /* dev_dbg(&icd->dev, "count=%d, size=%d\n", *count, *size);*/ /*yzm*/
if (bytes_per_line_host < 0)
return bytes_per_line_host;
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
- dev_dbg(icd->control, "%s (vb=0x%p) 0x%08lx %zd\n", __func__,//yzm
+ dev_dbg(icd->control, "%s (vb=0x%p) 0x%08lx %zd\n", __func__,/*yzm*/
&buf->vb, buf->vb.baddr, buf->vb.bsize);
/* ddl@rock-chips.com: buf_release called soc_camera_streamoff and soc_camera_close*/
*/
videobuf_waiton(vq, &buf->vb, 0, 0);
videobuf_dma_contig_free(vq, &buf->vb);
- //dev_dbg(&icd->dev, "%s freed\n", __func__);//yzm
+ /*dev_dbg(&icd->dev, "%s freed\n", __func__);*/ /*yzm*/
buf->vb.state = VIDEOBUF_NEEDS_INIT;
return;
}
icd->current_fmt->host_fmt);
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
- //dump_stack();
if ((bytes_per_line < 0) || (vb->boff == 0))
return -EINVAL;
buf = container_of(vb, struct rk_camera_buffer, vb);
- //dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %zd\n", __func__,//yzm
- // vb, vb->baddr, vb->bsize);//yzm
+ /*dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %zd\n", __func__,*/ /*yzm*/
+ /* vb, vb->baddr, vb->bsize);*/ /*yzm*/
/* Added list head initialization on alloc */
WARN_ON(!list_empty(&vb->queue));
struct videobuf_buffer *vb)
{
struct soc_camera_device *icd = vq->priv_data;
- //struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
struct rk_camera_dev *pcdev = ici->priv;
#if CAMERA_VIDEOBUF_ARM_ACCESS
struct rk29_camera_vbinfo *vb_info;
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
- //dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %zd\n", __func__,//yzm
- // vb, vb->baddr, vb->bsize);//yzm
+ /*dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %zd\n", __func__,
+ vb, vb->baddr, vb->bsize); */ /*yzm*/
vb->state = VIDEOBUF_QUEUED;
if (list_empty(&pcdev->capture)) {
switch (pixfmt)
{
case V4L2_PIX_FMT_YUV420:
- case V4L2_PIX_FMT_UYVY: // yuv 422, but sensor has defined this format(in fact ,should be defined yuv 420), treat this as yuv 420.
+ case V4L2_PIX_FMT_UYVY: /* yuv 422, but sensor has defined this format(in fact ,should be defined yuv 420), treat this as yuv 420.*/
case V4L2_PIX_FMT_YUYV:
{
*ippfmt = RK_FORMAT_YCbCr_420_SP;
struct rk_camera_work *camera_work = container_of(work, struct rk_camera_work, work);
struct videobuf_buffer *vb = camera_work->vb;
struct rk_camera_dev *pcdev = camera_work->pcdev;
- //enum v4l2_mbus_pixelcode icd_code = pcdev->icd->current_fmt->code;
+ /*enum v4l2_mbus_pixelcode icd_code = pcdev->icd->current_fmt->code; */
unsigned long flags = 0;
int err = 0;
struct timeval tv;
unsigned long reg_cifctrl;
-debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
+debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
reg_cifctrl = read_cif_reg(pcdev->base,CIF_CIF_CTRL);
struct rk_camera_dev *pcdev = data;
unsigned long reg_intstat;
-debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
spin_lock(&pcdev->lock);
}
reg_intstat = read_cif_reg(pcdev->base,CIF_CIF_INTSTAT);
-
+ debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s() ,reg_intstat 0x%lx\n", __FILE__, __LINE__,__FUNCTION__,reg_intstat);
if (reg_intstat & 0x0200)
rk_camera_cifirq(irq,data);
{
struct rk_camera_buffer *buf = container_of(vb, struct rk_camera_buffer, vb);
struct soc_camera_device *icd = vq->priv_data;
- //struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
struct rk_camera_dev *pcdev = ici->priv;
#if CAMERA_VIDEOBUF_ARM_ACCESS
struct rk29_camera_vbinfo *vb_info =NULL;
static void rk_camera_init_videobuf(struct videobuf_queue *q,
struct soc_camera_device *icd)
{
- //struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
struct rk_camera_dev *pcdev = ici->priv;
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
V4L2_BUF_TYPE_VIDEO_CAPTURE,
V4L2_FIELD_NONE,
sizeof(struct rk_camera_buffer),
- icd,&icd->video_lock);
+ icd,&(ici->host_lock) );
}
static int rk_camera_mclk_ctrl(int cif_idx, int on, int clk_rate)
spin_lock(&clk->lock);
if (on && !clk->on) {
- clk_prepare_enable(clk->pd_cif); //yzm
+ clk_prepare_enable(clk->pd_cif); /*yzm*/
clk_prepare_enable(clk->aclk_cif);
clk_prepare_enable(clk->hclk_cif);
clk_prepare_enable(clk->cif_clk_in);
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
write_cif_reg(pcdev->base,CIF_CIF_CTRL,AXI_BURST_16|MODE_ONEFRAME|DISABLE_CAPTURE); /* ddl@rock-chips.com : vip ahb burst 16 */
- write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x01); //capture complete interrupt enable
+ //write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x01); //capture complete interrupt enable
return 0;
}
* there can be only one camera on RK28 quick capture interface */
static int rk_camera_add_device(struct soc_camera_device *icd)
{
- // struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
- struct rk_camera_dev *pcdev = ici->priv; //ÔÚrk_camra_probÖгõʼ»¯
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
+ struct rk_camera_dev *pcdev = ici->priv; /*Initialize in rk_camra_prob*/
struct device *control = to_soc_camera_control(icd);
struct v4l2_subdev *sd;
int ret,i,icd_catch;
if (ret)
goto ebusy;
/* ddl@rock-chips.com : v4l2_subdev is not created when ici->ops->add called in soc_camera_probe */
- if (control) { //openʱTRUE£¬ ÄÚºËÆô¶¯¼ÓÔØÊ±FALSE
+ if (control) { //TRUE in open ,FALSE in kernel start
sd = dev_get_drvdata(control);
v4l2_subdev_call(sd, core, ioctl, RK29_CAM_SUBDEV_IOREQUEST,(void*)pcdev->pdata);
#if 0
if (ret)
goto ebusy;
#endif
- //µ÷ÓÃgeneric_sensor_ioctl
+ /* call generic_sensor_ioctl*/
v4l2_subdev_call(sd, core, ioctl, RK29_CAM_SUBDEV_CB_REGISTER,(void*)(&pcdev->icd_cb));
- //µ÷ÓÃgeneric_sensor_cropcap
+ /* call generic_sensor_cropcap*/
if (v4l2_subdev_call(sd, video, cropcap, &cropcap) == 0) {
memcpy(&pcdev->cropinfo.bounds ,&cropcap.bounds,sizeof(struct v4l2_rect));
} else {
}
static void rk_camera_remove_device(struct soc_camera_device *icd)
{
- //struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
struct rk_camera_dev *pcdev = ici->priv;
-// struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
+ /*struct v4l2_subdev *sd = soc_camera_to_subdev(icd);*/
#if CAMERA_VIDEOBUF_ARM_ACCESS
struct rk29_camera_vbinfo *vb_info;
unsigned int i;
/* ddl@rock-chips.com: Application will call VIDIOC_STREAMOFF before close device, but
stream may be turn on again before close device, if suspend and resume happened. */
- //if (read_cif_reg(pcdev->base,CIF_CIF_CTRL) & ENABLE_CAPTURE) {
+ /*if (read_cif_reg(pcdev->base,CIF_CIF_CTRL) & ENABLE_CAPTURE) {*/
if ((atomic_read(&pcdev->stop_cif) == false) && pcdev->fps_timer.istarted) { /* ddl@rock-chips.com: v0.3.0x15*/
rk_camera_s_stream(icd,0);
}
- //½«DEACTIVATE ÒÆ¶¯µ½generic_sensor_s_powerÖÐ
- //v4l2_subdev_call(sd, core, ioctl, RK29_CAM_SUBDEV_DEACTIVATE,NULL);//yzm
- //if stream off is not been executed,timer is running.
+ /* move DEACTIVATE into generic_sensor_s_power*/
+ /* v4l2_subdev_call(sd, core, ioctl, RK29_CAM_SUBDEV_DEACTIVATE,NULL);*/ /*yzm*/
+ /* if stream off is not been executed,timer is running.*/
if(pcdev->fps_timer.istarted){
hrtimer_cancel(&pcdev->fps_timer.timer);
pcdev->fps_timer.istarted = false;
static int rk_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt)
{
unsigned long bus_flags, camera_flags, common_flags = 0;
- //unsigned int cif_for = 0;
+ /*unsigned int cif_for = 0;*/
const struct soc_mbus_pixelfmt *fmt;
int ret = 0;
- //struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
- //struct rk_camera_dev *pcdev = ici->priv;
+ /*struct soc_camera_host *ici = to_soc_camera_host(icd->parent);*/ /*yzm*/
+ /*struct rk_camera_dev *pcdev = ici->priv;*/
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
ret = -EINVAL;
goto RK_CAMERA_SET_BUS_PARAM_END;
}
-*///***************yzm************end
+*/
+/***************yzm************end*/
ret = icd->ops->set_bus_param(icd, common_flags);
if (ret < 0)
goto RK_CAMERA_SET_BUS_PARAM_END;
static int rk_camera_try_bus_param(struct soc_camera_device *icd, __u32 pixfmt)
{
-// unsigned long bus_flags, camera_flags;
-// int ret;
+/* unsigned long bus_flags, camera_flags;*/
+/* int ret;*/
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
/**********yzm***********
static void rk_camera_setup_format(struct soc_camera_device *icd, __u32 host_pixfmt, enum v4l2_mbus_pixelcode icd_code, struct v4l2_rect *rect)
{
- //struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
struct rk_camera_dev *pcdev = ici->priv;
unsigned int cif_fs = 0,cif_crop = 0;
unsigned int cif_fmt_val = read_cif_reg(pcdev->base,CIF_CIF_FOR) | INPUT_MODE_YUV|YUV_INPUT_422|INPUT_420_ORDER_EVEN|OUTPUT_420_ORDER_EVEN;
rk_camera_cif_reset(pcdev,true);
write_cif_reg(pcdev->base,CIF_CIF_CTRL,AXI_BURST_16|MODE_ONEFRAME|DISABLE_CAPTURE); /* ddl@rock-chips.com : vip ahb burst 16 */
- write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x01|0x200); //capture complete interrupt enable
+ //write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x01|0x200); /*capture complete interrupt enable*/
write_cif_reg(pcdev->base,CIF_CIF_FOR,cif_fmt_val); /* ddl@rock-chips.com: VIP capture mode and capture format must be set before FS register set */
if((read_cif_reg(pcdev->base,CIF_CIF_CTRL) & MODE_PINGPONG)
||(read_cif_reg(pcdev->base,CIF_CIF_CTRL) & MODE_LINELOOP)) {
BUG();
- } else{ // this is one frame mode
+ } else{ /* this is one frame mode*/
cif_crop = (rect->left+ (rect->top<<16));
cif_fs = ((rect->width ) + (rect->height<<16));
}
write_cif_reg(pcdev->base,CIF_CIF_VIR_LINE_WIDTH, rect->width);
write_cif_reg(pcdev->base,CIF_CIF_FRAME_STATUS, 0x00000003);
- //MUST bypass scale
+ /*MUST bypass scale */
write_cif_reg(pcdev->base,CIF_CIF_SCL_CTRL,0x10);
RKCAMERA_DG1("CIF_CIF_CROP:0x%x CIF_CIF_FS:0x%x CIF_CIF_FOR:0x%x\n",cif_crop,cif_fs,cif_fmt_val);
return;
struct soc_camera_format_xlate *xlate)
{
struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
- //struct device *dev = icd->dev.parent;
- struct device *dev = icd->parent;//yzm
+ struct device *dev = icd->parent;/*yzm*/
int formats = 0, ret;
enum v4l2_mbus_pixelcode code;
const struct soc_mbus_pixelfmt *fmt;
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
- ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); //µ÷ÓÃgeneric_sensor_enum_fmt()
+ ret = v4l2_subdev_call(sd, video, enum_mbus_fmt, idx, &code); /*call generic_sensor_enum_fmt()*/
if (ret < 0)
/* No more formats */
return 0;
}
static int rk_camera_get_crop(struct soc_camera_device *icd,struct v4l2_crop *crop)
{
- //struct soc_camera_host *ici =to_soc_camera_host(icd->dev.parent);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
struct rk_camera_dev *pcdev = ici->priv;
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
static int rk_camera_set_crop(struct soc_camera_device *icd,
const struct v4l2_crop *crop)
{
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
struct rk_camera_dev *pcdev = ici->priv;
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
static int rk_camera_set_fmt(struct soc_camera_device *icd,
struct v4l2_format *f)
{
- //struct device *dev = icd->dev.parent;
- struct device *dev = icd->parent;//yzm
+ struct device *dev = icd->parent;/*yzm*/
struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
const struct soc_camera_format_xlate *xlate = NULL;
- //struct soc_camera_host *ici =to_soc_camera_host(icd->dev.parent);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
struct rk_camera_dev *pcdev = ici->priv;
struct v4l2_pix_format *pix = &f->fmt.pix;
struct v4l2_mbus_framefmt mf;
/* ddl@rock-chips.com: sensor init code transmit in here after open */
if (pcdev->icd_init == 0) {
- v4l2_subdev_call(sd,core, init, 0); //µ÷ÓÃgeneric_sensor_init()
+ v4l2_subdev_call(sd,core, init, 0); /*call generic_sensor_init()*/
pcdev->icd_init = 1;
- return 0; //Ö±½ÓÍ˳ö!!!!!!!
+ return 0; /*directly return !!!!!!*/
}
stream_on = read_cif_reg(pcdev->base,CIF_CIF_CTRL);
if (stream_on & ENABLE_CAPTURE)
mf.reserved[0] = pix->priv; /* ddl@rock-chips.com : v0.3.3 */
mf.reserved[1] = 0;
- ret = v4l2_subdev_call(sd, video, s_mbus_fmt, &mf); //generic_sensor_s_fmt
+ ret = v4l2_subdev_call(sd, video, s_mbus_fmt, &mf); /*generic_sensor_s_fmt*/
if (mf.code != xlate->code)
return -EINVAL;
sensor_w = mf.width;
sensor_h = mf.height;
- ratio = ((mf.width*mf.reserved[1])/100)&(~0x03); // 4 align
+ ratio = ((mf.width*mf.reserved[1])/100)&(~0x03); /* 4 align*/
mf.width -= ratio;
- ratio = ((ratio*mf.height/mf.width)+1)&(~0x01); // 2 align
+ ratio = ((ratio*mf.height/mf.width)+1)&(~0x01); /* 2 align*/
mf.height -= ratio;
if ((mf.width != usr_w) || (mf.height != usr_h)) {
spin_lock(&pcdev->cropinfo.lock);
if (((mf.width*10/mf.height) != (usr_w*10/usr_h))) {
if ((pcdev->cropinfo.c.width == 0)&&(pcdev->cropinfo.c.height == 0)) {
- //Scale + Crop center is for keep aspect ratio unchange
+ /*Scale + Crop center is for keep aspect ratio unchange*/
ratio = ((mf.width*10/usr_w) >= (mf.height*10/usr_h))?(mf.height*10/usr_h):(mf.width*10/usr_w);
pcdev->host_width = ratio*usr_w/10;
pcdev->host_height = ratio*usr_h/10;
pcdev->host_left = ((sensor_w-pcdev->host_width )>>1);
pcdev->host_top = ((sensor_h-pcdev->host_height)>>1);
} else {
- //Scale + crop(user define)
+ /*Scale + crop(user define)*/
pcdev->host_width = pcdev->cropinfo.c.width*mf.width/pcdev->cropinfo.bounds.width;
pcdev->host_height = pcdev->cropinfo.c.height*mf.height/pcdev->cropinfo.bounds.height;
pcdev->host_left = (pcdev->cropinfo.c.left*mf.width/pcdev->cropinfo.bounds.width);
pcdev->host_top &= (~0x01);
} else {
if ((pcdev->cropinfo.c.width == 0)&&(pcdev->cropinfo.c.height == 0)) {
- //Crop Center for cif can work , then scale
+ /*Crop Center for cif can work , then scale*/
pcdev->host_width = mf.width;
pcdev->host_height = mf.height;
pcdev->host_left = ((sensor_w - mf.width)>>1)&(~0x01);
pcdev->host_top = ((sensor_h - mf.height)>>1)&(~0x01);
} else {
- //Crop center for cif can work + crop(user define), then scale
+ /*Crop center for cif can work + crop(user define), then scale */
pcdev->host_width = pcdev->cropinfo.c.width*mf.width/pcdev->cropinfo.bounds.width;
pcdev->host_height = pcdev->cropinfo.c.height*mf.height/pcdev->cropinfo.bounds.height;
pcdev->host_left = (pcdev->cropinfo.c.left*mf.width/pcdev->cropinfo.bounds.width)+((sensor_w - mf.width)>>1);
rect.top = pcdev->host_top;
down(&pcdev->zoominfo.sem);
-#if CIF_DO_CROP // this crop is only for digital zoom
+#if CIF_DO_CROP /* this crop is only for digital zoom*/
pcdev->zoominfo.a.c.left = 0;
pcdev->zoominfo.a.c.top = 0;
pcdev->zoominfo.a.c.width = pcdev->host_width*100/pcdev->zoominfo.zoom_rate;
pcdev->zoominfo.a.c.height &= ~CROP_ALIGN_BYTES;
pcdev->zoominfo.vir_width = pcdev->zoominfo.a.c.width;
pcdev->zoominfo.vir_height = pcdev->zoominfo.a.c.height;
- //recalculate the CIF width & height
+ /*recalculate the CIF width & height*/
rect.width = pcdev->zoominfo.a.c.width ;
rect.height = pcdev->zoominfo.a.c.height;
rect.left = ((((pcdev->host_width - pcdev->zoominfo.a.c.width)>>1))+pcdev->host_left)&(~0x01);
pcdev->zoominfo.a.c.width &= ~CROP_ALIGN_BYTES;
pcdev->zoominfo.a.c.height = pcdev->host_height*100/pcdev->zoominfo.zoom_rate;
pcdev->zoominfo.a.c.height &= ~CROP_ALIGN_BYTES;
- //now digital zoom use ipp to do crop and scale
+ /*now digital zoom use ipp to do crop and scale*/
if(pcdev->zoominfo.zoom_rate != 100){
pcdev->zoominfo.a.c.left = ((pcdev->host_width - pcdev->zoominfo.a.c.width)>>1)&(~0x01);
pcdev->zoominfo.a.c.top = ((pcdev->host_height - pcdev->zoominfo.a.c.height)>>1)&(~0x01);
static int rk_camera_try_fmt(struct soc_camera_device *icd,
struct v4l2_format *f)
{
- //struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
struct rk_camera_dev *pcdev = ici->priv;
struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
const struct soc_camera_format_xlate *xlate;
struct v4l2_pix_format *pix = &f->fmt.pix;
__u32 pixfmt = pix->pixelformat;
int ret,usr_w,usr_h,i;
- bool is_capture = rk_camera_fmt_capturechk(f); //¼ì²âfÊÇ·ñ·ûºÏÒÑÉ趨µÄ·Ö±æÂÊ
+ bool is_capture = rk_camera_fmt_capturechk(f); /* testing f is in line with the already set*/
bool vipmem_is_overflow = false;
struct v4l2_mbus_framefmt mf;
int bytes_per_line_host;
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
- xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); //¼ì²âÏñËØ¸ñʽ
+ xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
if (!xlate) {
- //dev_err(icd->dev.parent, "Format (%c%c%c%c) not found\n", pixfmt & 0xFF, (pixfmt >> 8) & 0xFF,
- dev_err(icd->parent, "Format (%c%c%c%c) not found\n", pixfmt & 0xFF, (pixfmt >> 8) & 0xFF,//yzm
+ /*dev_err(icd->dev.parent, "Format (%c%c%c%c) not found\n", pixfmt & 0xFF, (pixfmt >> 8) & 0xFF,*/
+ dev_err(icd->parent, "Format (%c%c%c%c) not found\n", pixfmt & 0xFF, (pixfmt >> 8) & 0xFF,/*yzm*/
(pixfmt >> 16) & 0xFF, (pixfmt >> 24) & 0xFF);
ret = -EINVAL;
RKCAMERA_TR("%s(version:%c%c%c) support format:\n",rk_cam_driver_description,(RK_CAM_VERSION_CODE&0xff0000)>>16,
if ((usr_w == 10000) && (usr_h == 10000)) {
mf.reserved[6] = 0xfefe5a5a;
}
- //µ÷ÓÃgeneric_sensor_try_fmt()
+ /* call generic_sensor_try_fmt()*/
ret = v4l2_subdev_call(sd, video, try_mbus_fmt, &mf);
if (ret < 0)
goto RK_CAMERA_TRY_FMT_END;
- //query resolution.
+ /*query resolution.*/
if((usr_w == 10000) && (usr_h == 10000)) {
pix->width = mf.width;
pix->height = mf.height;
break;
default:
/* TODO: support interlaced at least in pass-through mode */
- //dev_err(icd->dev.parent, "Field type %d unsupported.\n",
- dev_err(icd->parent, "Field type %d unsupported.\n",//yzm
+ dev_err(icd->parent, "Field type %d unsupported.\n",
mf.field);
goto RK_CAMERA_TRY_FMT_END;
}
* 10 5 1 3 3 3 + 5 < 32
*/
-//»ñÈ¡É豸µÄcapabilities£¬¿´¿´É豸¾ßÌåÓÐʲô¹¦ÄÜ
-//±ÈÈçÊÇ·ñ¾ßÓÐÊÓÆµÊäÈë,»òÕßÒôƵÊäÈëÊä³öµÈ¡£
static int rk_camera_querycap(struct soc_camera_host *ici,
struct v4l2_capability *cap)
{
i=0;
new_camera = pcdev->pdata->register_dev_new;
- //while (strstr(new_camera->dev_name,"end")==NULL) {
while(new_camera != NULL){
if (strcmp(dev_name(pcdev->icd->pdev), new_camera->dev_name) == 0) {
sprintf(orientation,"-%d",new_camera->orientation);
}
static int rk_camera_suspend(struct soc_camera_device *icd, pm_message_t state)
{
- //struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
struct rk_camera_dev *pcdev = ici->priv;
struct v4l2_subdev *sd;
int ret = 0;
static int rk_camera_resume(struct soc_camera_device *icd)
{
- //struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
struct rk_camera_dev *pcdev = ici->priv;
struct v4l2_subdev *sd;
int ret = 0;
struct v4l2_subdev *sd;
struct rk_camera_work *camera_work = container_of(work, struct rk_camera_work, work);
struct rk_camera_dev *pcdev = camera_work->pcdev;
- //struct soc_camera_link *tmp_soc_cam_link;
+ /*struct soc_camera_link *tmp_soc_cam_link;*/
struct v4l2_mbus_framefmt mf;
int index = 0;
unsigned long flags = 0;
int ctrl;
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
-
+ return;
if(pcdev->icd == NULL)
return;
sd = soc_camera_to_subdev(pcdev->icd);
- //tmp_soc_cam_desc = to_soc_camera_link(pcdev->icd);//yzm
- //dump regs
+ /*tmp_soc_cam_desc = to_soc_camera_link(pcdev->icd);*/ /*yzm*/
+ /*dump regs*/
{
RKCAMERA_TR("CIF_CIF_CTRL = 0x%lx\n",read_cif_reg(pcdev->base,CIF_CIF_CTRL));
RKCAMERA_TR("CIF_CIF_INTEN = 0x%lx\n",read_cif_reg(pcdev->base,CIF_CIF_INTEN));
struct rk_camera_timer *fps_timer = container_of(timer, struct rk_camera_timer, timer);
struct rk_camera_dev *pcdev = fps_timer->pcdev;
int rec_flag,i;
- // static unsigned int last_fps = 0;
- //struct soc_camera_link *tmp_soc_cam_link;//yzm
- //tmp_soc_cam_link = to_soc_camera_link(pcdev->icd);//yzm
+ /*static unsigned int last_fps = 0;*/
+ /*struct soc_camera_link *tmp_soc_cam_link;*/ /*yzm*/
+ /*tmp_soc_cam_link = to_soc_camera_link(pcdev->icd);*/ /*yzm*/
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
RKCAMERA_TR("Camera host haven't recevie data from sensor,last fps = %d,pcdev->fps = %d,cif_irq: %ld,dma_irq: %ld!\n",
pcdev->last_fps,pcdev->fps,pcdev->irqinfo.cifirq_idx, pcdev->irqinfo.dmairq_idx);
pcdev->camera_reinit_work.pcdev = pcdev;
- //INIT_WORK(&(pcdev->camera_reinit_work.work), rk_camera_reinit_work);
+ /*INIT_WORK(&(pcdev->camera_reinit_work.work), rk_camera_reinit_work);*/
pcdev->reinit_times++;
queue_work(pcdev->camera_wq,&(pcdev->camera_reinit_work.work));
} else if(!pcdev->timer_get_fps) {
fival_pre = fival_nxt;
while (fival_nxt != NULL) {
- RKCAMERA_DG1("%s %c%c%c%c %dx%d framerate : %d/%d\n", dev_name(pcdev->icd->control), //yzm
+ RKCAMERA_DG1("%s %c%c%c%c %dx%d framerate : %d/%d\n", dev_name(pcdev->icd->control), /*yzm*/
fival_nxt->fival.pixel_format & 0xFF, (fival_nxt->fival.pixel_format >> 8) & 0xFF,
(fival_nxt->fival.pixel_format >> 16) & 0xFF, (fival_nxt->fival.pixel_format >> 24),
fival_nxt->fival.width, fival_nxt->fival.height, fival_nxt->fival.discrete.denominator,
pcdev->last_fps = pcdev->fps ;
pcdev->fps_timer.timer.node.expires= ktime_add_us(pcdev->fps_timer.timer.node.expires, ktime_to_us(ktime_set(3, 0)));
pcdev->fps_timer.timer._softexpires= ktime_add_us(pcdev->fps_timer.timer._softexpires, ktime_to_us(ktime_set(3, 0)));
- //return HRTIMER_NORESTART;
+ /*return HRTIMER_NORESTART;*/
if(pcdev->reinit_times >=2)
return HRTIMER_NORESTART;
else
}
static int rk_camera_s_stream(struct soc_camera_device *icd, int enable)
{
- //struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
struct rk_camera_dev *pcdev = ici->priv;
int cif_ctrl_val;
int ret;
unsigned long flags;
-debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
+ debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
WARN_ON(pcdev->icd != icd);
pcdev->irqinfo.cifirq_normal_idx = 0;
pcdev->irqinfo.cifirq_abnormal_idx = 0;
pcdev->irqinfo.dmairq_idx = 0;
-
+
+ write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x01|0x200); /*capture complete interrupt enable*/
cif_ctrl_val |= ENABLE_CAPTURE;
write_cif_reg(pcdev->base,CIF_CIF_CTRL, cif_ctrl_val);
spin_unlock_irqrestore(&pcdev->lock,flags);
-
+ printk("%s:stream enable CIF_CIF_CTRL 0x%lx",__func__,read_cif_reg(pcdev->base,CIF_CIF_CTRL));
hrtimer_start(&(pcdev->fps_timer.timer),ktime_set(3, 0),HRTIMER_MODE_REL);
pcdev->fps_timer.istarted = true;
} else {
- //cancel timer before stop cif
+ /*cancel timer before stop cif*/
ret = hrtimer_cancel(&pcdev->fps_timer.timer);
pcdev->fps_timer.istarted = false;
flush_work(&(pcdev->camera_reinit_work.work));
spin_lock_irqsave(&pcdev->lock, flags);
write_cif_reg(pcdev->base,CIF_CIF_CTRL, cif_ctrl_val);
atomic_set(&pcdev->stop_cif,true);
+ write_cif_reg(pcdev->base,CIF_CIF_INTEN, 0x0);
spin_unlock_irqrestore(&pcdev->lock, flags);
flush_workqueue((pcdev->camera_wq));
}
- //must be reinit,or will be somthing wrong in irq process.
+ /*must be reinit,or will be somthing wrong in irq process.*/
if(enable == false) {
pcdev->active = NULL;
INIT_LIST_HEAD(&pcdev->capture);
}
int rk_camera_enum_frameintervals(struct soc_camera_device *icd, struct v4l2_frmivalenum *fival)
{
- //struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
struct rk_camera_dev *pcdev = ici->priv;
struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
struct rk_camera_frmivalenum *fival_list = NULL;
const struct v4l2_queryctrl *qctrl, int zoom_rate)
{
struct v4l2_crop a;
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
struct rk_camera_dev *pcdev = ici->priv;
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
unsigned long tmp_cifctrl;
#endif
- //change the crop and scale parameters
+ /*change the crop and scale parameters*/
#if CIF_DO_CROP
a.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- //a.c.width = pcdev->host_width*100/zoom_rate;
+ /*a.c.width = pcdev->host_width*100/zoom_rate;*/
a.c.width = pcdev->host_width*100/zoom_rate;
a.c.width &= ~CROP_ALIGN_BYTES;
a.c.height = pcdev->host_height*100/zoom_rate;
for (i = 0; i < ops->num_controls; i++)
if (ops->controls[i].id == id)
return &ops->controls[i];
-*///**************yzm********
+**************yzm*********/
return NULL;
}
static int rk_camera_set_ctrl(struct soc_camera_device *icd,
struct v4l2_control *sctrl)
{
- //struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
- struct soc_camera_host *ici = to_soc_camera_host(icd->parent);//yzm
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);/*yzm*/
const struct v4l2_queryctrl *qctrl;
struct rk_camera_dev *pcdev = ici->priv;
.remove = rk_camera_remove_device,
.suspend = rk_camera_suspend,
.resume = rk_camera_resume,
- //.enum_frameinervals = rk_camera_enum_frameintervals,
+ .enum_frameinervals = rk_camera_enum_frameintervals,
.cropcap = rk_camera_cropcap,
.set_crop = rk_camera_set_crop,
.get_crop = rk_camera_get_crop,
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
strcpy(state_str,"cif_pin_jpe");
- __raw_writel(((1<<1)|(1<<(1+16))),RK_GRF_VIRT+0x0380);
+ /*__raw_writel(((1<<1)|(1<<(1+16))),RK_GRF_VIRT+0x0380);*/
- //mux CIF0_CLKOUT
+ /*mux CIF0_CLKOUT*/
pinctrl = devm_pinctrl_get(dev);
if (IS_ERR(pinctrl)) {
}
/***********yzm***********/
-static int rk_camera_probe(struct platform_device *pdev) //host probe
+static int rk_camera_probe(struct platform_device *pdev)
{
struct rk_camera_dev *pcdev;
struct resource *res;
int irq,i;
int err = 0;
struct rk_cif_clk *clk=NULL;
- struct device *dev_cif = ((struct rk29camera_platform_data*)pdev->dev.platform_data)->cif_dev;//yzm
+ struct device *dev_cif = ((struct rk29camera_platform_data*)pdev->dev.platform_data)->cif_dev;/*yzm*/
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
RKCAMERA_TR("%s version: v%d.%d.%d Zoom by %s",RK29_CAM_DRV_NAME,(RK_CAM_VERSION_CODE&0xff0000)>>16,
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq(pdev, 0);
-// irq = irq_of_parse_and_map(dev_cif->of_node, 0);
-//debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n res = [%x--%x] \n",res->start , res->end);
-//debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n irq_num = %d\n", irq);
-
+ /* irq = irq_of_parse_and_map(dev_cif->of_node, 0);
+ debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n res = [%x--%x] \n",res->start , res->end);
+ debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n irq_num = %d\n", irq);
+ */
if (!res || irq < 0) {
err = -ENODEV;
goto exit;
}
pcdev->zoominfo.zoom_rate = 100;
- pcdev->hostid = pdev->id; //»ñÈ¡hostµÄid
+ pcdev->hostid = pdev->id; /* get host id*/
#ifdef CONFIG_SOC_RK3028
pcdev->chip_id = rk3028_version_val();
#else
pcdev->chip_id = -1;
#endif
-//***********yzm***********
- if (IS_CIF0()) {
+ /***********yzm***********/
+ if (IS_CIF0()) {
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$/is_cif0\n");
clk = &cif_clk[0];
cif_clk[0].pd_cif = devm_clk_get(dev_cif, "pd_cif0");
cif_clk[0].cif_clk_out = devm_clk_get(dev_cif, "cif0_out");
spin_lock_init(&cif_clk[0].lock);
cif_clk[0].on = false;
- rk_camera_cif_iomux(dev_cif);//yzm
+ rk_camera_cif_iomux(dev_cif);/*yzm*/
} else {
- clk = &cif_clk[1];
- cif_clk[1].pd_cif = devm_clk_get(dev_cif, "pd_cif0");//Ŀǰֻ¶¨ÒåÁËcif0 yzm
+ clk = &cif_clk[1];
+ cif_clk[1].pd_cif = devm_clk_get(dev_cif, "pd_cif0");/*cif0 only yzm*/
cif_clk[1].aclk_cif = devm_clk_get(dev_cif, "aclk_cif0");
cif_clk[1].hclk_cif = devm_clk_get(dev_cif, "hclk_cif0");
cif_clk[1].cif_clk_in = devm_clk_get(dev_cif, "cif0_in");
cif_clk[1].cif_clk_out = devm_clk_get(dev_cif, "cif0_out");
spin_lock_init(&cif_clk[1].lock);
cif_clk[1].on = false;
- rk_camera_cif_iomux(dev_cif);//yzm
+ rk_camera_cif_iomux(dev_cif);/*yzm*/
}
-debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
+ debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
-//***********yzm**********end
+ /***********yzm**********/
dev_set_drvdata(&pdev->dev, pcdev);
pcdev->res = res;
pcdev->pdata = pdev->dev.platform_data; /* ddl@rock-chips.com : Request IO in init function */
- // = rk_camera_platform_data ÄǸö´ó½á¹¹Ìåyzm
+ /*= rk_camera_platform_data */
if (pcdev->pdata && pcdev->pdata->io_init) {
- pcdev->pdata->io_init();//yzm µ÷ÓÃrk_sensor_io_init()
+ pcdev->pdata->io_init();/* call rk_sensor_io_init()*/
if (pcdev->pdata->sensor_mclk == NULL)
pcdev->pdata->sensor_mclk = rk_camera_mclk_ctrl;
}
pcdev->soc_host.drv_name = RK29_CAM_DRV_NAME;
pcdev->soc_host.ops = &rk_soc_camera_host_ops;
- pcdev->soc_host.priv = pcdev; //Ö¸Ïò×Ô¼º£¬ÔÚrk_camera_add_deviceÖÐÓе÷ÓÃ
+ pcdev->soc_host.priv = pcdev; /*to itself,csll in rk_camera_add_device*/
pcdev->soc_host.v4l2_dev.dev = &pdev->dev;
pcdev->soc_host.nr = pdev->id;
-debug_printk("/$$$$$$$$$$$$$$$$$$$$$$/next soc_camera_host_register\n");
+ debug_printk("/$$$$$$$$$$$$$$$$$$$$$$/next soc_camera_host_register\n");
err = soc_camera_host_register(&pcdev->soc_host);
struct rk_camera_frmivalenum *fival_list,*fival_nxt;
int i;
-debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
+ debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()/n", __FILE__, __LINE__,__FUNCTION__);
free_irq(pcdev->irqinfo.irq, pcdev);
static struct platform_driver rk_camera_driver =
{
.driver = {
- .name = RK29_CAM_DRV_NAME, //host
+ .name = RK29_CAM_DRV_NAME, /*host */
},
.probe = rk_camera_probe,
.remove = (rk_camera_remove),
platform_driver_unregister(&rk_camera_driver);
}
-device_initcall_sync(rk_camera_init); //module_init();
+device_initcall_sync(rk_camera_init);
module_exit(rk_camera_exit);
MODULE_DESCRIPTION("RKSoc Camera Host driver");
MODULE_AUTHOR("ddl <ddl@rock-chips>");
MODULE_LICENSE("GPL");
-//#endif//yzm
+//#endif/*yzm*/
unsigned char devnum; /* Device number per host */
struct soc_camera_sense *sense; /* See comment in struct definition */
- struct soc_camera_ops *ops;//yzm
- struct mutex video_lock;//yzm
+ struct soc_camera_ops *ops;/*yzm*/
+ struct mutex video_lock;/*yzm*/
struct video_device *vdev;
struct v4l2_ctrl_handler ctrl_handler;
/****************yzm**************/
int (*suspend)(struct soc_camera_device *, pm_message_t);
int (*resume)(struct soc_camera_device *);
- //int (*enum_frameinervals)(struct soc_camera_device *, struct v4l2_frmivalenum);
+ int (*enum_frameinervals)(struct soc_camera_device *, struct v4l2_frmivalenum *);/* ddl@rock-chips.com :Add ioctrl - VIDIOC_ENUM_FRAMEINTERVALS for soc-camera */
int (*get_ctrl)(struct soc_camera_device *, struct v4l2_control *);
int (*set_ctrl)(struct soc_camera_device *, struct v4l2_control *);
int (*s_stream)(struct soc_camera_device *, int enable);
struct soc_camera_device *);
int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *);
int (*querycap)(struct soc_camera_host *, struct v4l2_capability *);
- int (*set_bus_param)(struct soc_camera_device *, __u32);//yzm
+ int (*set_bus_param)(struct soc_camera_device *, __u32);/*yzm*/
int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
int (*enum_framesizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *);
/* sensor driver private platform data */
void *drv_priv;
- struct soc_camera_device *socdev;//yzm
+ struct soc_camera_device *socdev;/*yzm*/
/* Optional regulators that have to be managed on power on/off events */
struct regulator_bulk_data *regulators;
int (*power)(struct device *, int);
int (*reset)(struct device *);
- int (*powerdown)(struct device *, int);//yzm
+ int (*powerdown)(struct device *, int);/*yzm*/
/*
* some platforms may support different data widths than the sensors
* native ones due to different data line routing. Let the board code
unsigned long flags;
void *priv;
- void *priv_usr; //yzm@rock-chips.com
+ void *priv_usr; /*yzm*/
/* Optional regulators that have to be managed on power on/off events */
struct regulator_bulk_data *regulators;
int num_regulators;
/* Optional callbacks to power on or off and reset the sensor */
int (*power)(struct device *, int);
int (*reset)(struct device *);
- int (*powerdown)(struct device *,int); //yzm@rock-chips.com
+ int (*powerdown)(struct device *,int); /*yzm*/
/*
* some platforms may support different data widths than the sensors
* native ones due to different data line routing. Let the board code
unsigned long pixel_clock_max;
unsigned long pixel_clock;
};
+/***************yzm****************/
+static inline struct v4l2_queryctrl const *soc_camera_find_qctrl(
+ struct soc_camera_ops *ops, int id)
+{
+ int i;
+
+ for (i = 0; i < ops->num_controls; i++)
+ if (ops->controls[i].id == id)
+ return &ops->controls[i];
+
+ return NULL;
+}
+/***************yzm****************rnd*/
#define SOCAM_DATAWIDTH(x) BIT((x) - 1)
#define SOCAM_DATAWIDTH_4 SOCAM_DATAWIDTH(4)
#define V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+11)
#define V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE+12)
-#define V4L2_CID_FOCUS_CONTINUOUS (V4L2_CID_CAMERA_CLASS_BASE+4)//yzm
-#define V4L2_CID_FLASH (V4L2_CID_CAMERA_CLASS_BASE+3)//yzm
-#define V4L2_CID_EFFECT (V4L2_CID_CAMERA_CLASS_BASE+2)//yzm
-#define V4L2_CID_SCENE (V4L2_CID_CAMERA_CLASS_BASE+1)//yzm
-#define V4L2_CID_FOCUSZONE (V4L2_CID_CAMERA_CLASS_BASE+5)//yzm
-#define V4L2_CID_FACEDETECT (V4L2_CID_CAMERA_CLASS_BASE+6)//yzm
+/**************yzm**************/
+/* ddl@rock-chips.com : Add ioctrl - V4L2_CID_SCENE for camera scene control */
+#define V4L2_CID_CAMERA_CLASS_BASE_ROCK (V4L2_CID_CAMERA_CLASS_BASE + 30)
+#define V4L2_CID_SCENE (V4L2_CID_CAMERA_CLASS_BASE_ROCK+1)
+#define V4L2_CID_EFFECT (V4L2_CID_CAMERA_CLASS_BASE_ROCK+2)
+#define V4L2_CID_FLASH (V4L2_CID_CAMERA_CLASS_BASE_ROCK+3)
+#define V4L2_CID_FOCUS_CONTINUOUS (V4L2_CID_CAMERA_CLASS_BASE_ROCK+4)
+#define V4L2_CID_FOCUSZONE (V4L2_CID_CAMERA_CLASS_BASE_ROCK+5)
+#define V4L2_CID_FACEDETECT (V4L2_CID_CAMERA_CLASS_BASE_ROCK+6)
+#define V4L2_CID_HDR (V4L2_CID_CAMERA_CLASS_BASE_ROCK+7)
+#define V4L2_CID_ISO (V4L2_CID_CAMERA_CLASS_BASE_ROCK + 8)
+#define V4L2_CID_ANTIBANDING (V4L2_CID_CAMERA_CLASS_BASE_ROCK + 9)
+#define V4L2_CID_WHITEBALANCE_LOCK (V4L2_CID_CAMERA_CLASS_BASE_ROCK + 10)
+#define V4L2_CID_EXPOSURE_LOCK (V4L2_CID_CAMERA_CLASS_BASE_ROCK + 11)
+#define V4L2_CID_METERING_AREAS (V4L2_CID_CAMERA_CLASS_BASE_ROCK + 12)
+#define V4L2_CID_WDR (V4L2_CID_CAMERA_CLASS_BASE_ROCK + 13)
+#define V4L2_CID_EDGE (V4L2_CID_CAMERA_CLASS_BASE_ROCK + 14)
+#define V4L2_CID_JPEG_EXIF (V4L2_CID_CAMERA_CLASS_BASE_ROCK + 15)
+/***************yzm***************/
#define V4L2_CID_ZOOM_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+13)
#define V4L2_CID_ZOOM_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+14)