rk312x : cif : cif driver v0.0x1.2
authorzyc <zyc@rock-chips.com>
Tue, 2 Sep 2014 03:59:50 +0000 (11:59 +0800)
committerzyc <zyc@rock-chips.com>
Tue, 2 Sep 2014 03:59:50 +0000 (11:59 +0800)
arch/arm/boot/dts/rk3126-cif-sensor.dtsi [new file with mode: 0755]
arch/arm/boot/dts/rk3126-sdk.dts
arch/arm/boot/dts/rk3128-cif-sensor.dtsi [new file with mode: 0755]
arch/arm/boot/dts/rk3128-sdk.dts
arch/arm/boot/dts/rk312x-cif-sensor.dtsi [deleted file]
arch/arm/boot/dts/rk312x-sdk.dtsi
arch/arm/mach-rockchip/rk_camera.c
drivers/media/video/Kconfig
drivers/media/video/rk30_camera_oneframe.c

diff --git a/arch/arm/boot/dts/rk3126-cif-sensor.dtsi b/arch/arm/boot/dts/rk3126-cif-sensor.dtsi
new file mode 100755 (executable)
index 0000000..ce96811
--- /dev/null
@@ -0,0 +1,54 @@
+#include "rk312x.dtsi" 
+#include "rk312x-pinctrl.dtsi"
+#include "../../mach-rockchip/rk_camera_sensor_info.h"
+/{
+       rk3126_cif_sensor: rk3126_cif_sensor{
+                       compatible = "rockchip,sensor";
+                       status = "disabled";
+                       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_B3 GPIO_ACTIVE_HIGH>;
+                       pwdn_active = <ov2659_PWRDN_ACTIVE>;
+                       #rockchip,power = <>;
+                       #pwr_active = <>;
+                       #rockchip,reset = <>;
+                       #rst_active = <>;
+                       mir = <0>;
+                       flash_attach = <0>;
+                       resolution = <ov2659_FULL_RESOLUTION>;
+                       powerup_sequence = <ov2659_PWRSEQ>;             
+                       orientation = <0>;
+                       i2c_add = <ov2659_I2C_ADDR>;
+                       i2c_rata = <100000>;
+                       i2c_chl = <1>;
+                       cif_chl = <0>;
+                       mclk_rate = <24>;
+               };
+               gc0329{
+                       is_front = <1>; 
+                       rockchip,powerdown = <&gpio3 GPIO_B3 GPIO_ACTIVE_HIGH>;
+                       pwdn_active = <gc0329_PWRDN_ACTIVE>;
+                       #rockchip,power = <>;
+                       #pwr_active = <>;
+                       #rockchip,reset = <>;
+                       #rst_active = <>;
+                       mir = <0>;
+                       flash_attach = <0>;
+                       resolution = <gc0329_FULL_RESOLUTION>;
+                       powerup_sequence = <gc0329_PWRSEQ>;     
+                       orientation = <0>;
+                       i2c_add = <gc0329_I2C_ADDR>;
+                       i2c_rata = <100000>;
+                       i2c_chl = <1>;
+                       cif_chl = <0>;
+                       mclk_rate = <24>;
+               };
+       };
+};
+
index 7015997943d402459231b4d6499da258b3441b83..778b25b951125ecbcb4caf707f11b5b442107e97 100755 (executable)
                status = "disabled";
        };
 };
+
+&rk3126_cif_sensor{
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/rk3128-cif-sensor.dtsi b/arch/arm/boot/dts/rk3128-cif-sensor.dtsi
new file mode 100755 (executable)
index 0000000..209c9b1
--- /dev/null
@@ -0,0 +1,54 @@
+#include "rk312x.dtsi" 
+#include "rk312x-pinctrl.dtsi"
+#include "../../mach-rockchip/rk_camera_sensor_info.h"
+/{
+       rk3128_cif_sensor: rk3128_cif_sensor{
+                       compatible = "rockchip,sensor";
+                       status = "disabled";
+                       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>;
+                       pwdn_active = <ov2659_PWRDN_ACTIVE>;
+                       #rockchip,power = <>;
+                       #pwr_active = <>;
+                       #rockchip,reset = <>;
+                       #rst_active = <>;
+                       mir = <0>;
+                       flash_attach = <0>;
+                       resolution = <ov2659_FULL_RESOLUTION>;
+                       powerup_sequence = <ov2659_PWRSEQ>;             
+                       orientation = <0>;
+                       i2c_add = <ov2659_I2C_ADDR>;
+                       i2c_rata = <100000>;
+                       i2c_chl = <0>;
+                       cif_chl = <0>;
+                       mclk_rate = <24>;
+               };
+               gc0329{
+                       is_front = <1>; 
+                       rockchip,powerdown = <&gpio3 GPIO_D7 GPIO_ACTIVE_HIGH>;
+                       pwdn_active = <gc0329_PWRDN_ACTIVE>;
+                       #rockchip,power = <>;
+                       #pwr_active = <>;
+                       #rockchip,reset = <>;
+                       #rst_active = <>;
+                       mir = <0>;
+                       flash_attach = <0>;
+                       resolution = <gc0329_FULL_RESOLUTION>;
+                       powerup_sequence = <gc0329_PWRSEQ>;     
+                       orientation = <0>;
+                       i2c_add = <gc0329_I2C_ADDR>;
+                       i2c_rata = <100000>;
+                       i2c_chl = <0>;
+                       cif_chl = <0>;
+                       mclk_rate = <24>;
+               };
+       };
+};
+
index 209a4ca02f7ce17a365ce5d644a8524a4af48117..c22d460b48d6287c89bbc9ebdb35b6d3da6ce463 100755 (executable)
@@ -89,3 +89,8 @@
         gpio_debug = <1>;
         codec_hp_det = <0>;
 };
+
+&rk3128_cif_sensor{
+       status = "okay";
+};
+
diff --git a/arch/arm/boot/dts/rk312x-cif-sensor.dtsi b/arch/arm/boot/dts/rk312x-cif-sensor.dtsi
deleted file mode 100644 (file)
index 029cc51..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#include "rk312x.dtsi" 
-#include "rk312x-pinctrl.dtsi"
-#include "../../mach-rockchip/rk_camera_sensor_info.h"
-/{
-       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>;
-                       #pwdn_active = <>;
-                       #rockchip,power = <>;
-                       #pwr_active = <>;
-                       #rockchip,reset = <>;
-                       #rst_active = <>;
-                       mir = <0>;
-                       flash_attach = <0>;
-                       resolution = <ov2659_FULL_RESOLUTION>;
-                       pwdn_info = <ov2659_PWRDN_ACTIVE>;
-                       powerup_sequence = <ov2659_PWRSEQ>;             
-                       orientation = <0>;
-                       i2c_add = <ov2659_I2C_ADDR>;
-                       i2c_rata = <100000>;
-                       i2c_chl = <0>;
-                       cif_chl = <0>;
-                       mclk_rate = <24>;
-               };
-               gc0329{
-                       is_front = <1>; 
-                       rockchip,powerdown = <&gpio3 GPIO_D7 GPIO_ACTIVE_HIGH>;
-                       #pwdn_active = <>;
-                       #rockchip,power = <>;
-                       #pwr_active = <>;
-                       #rockchip,reset = <>;
-                       #rst_active = <>;
-                       mir = <0>;
-                       flash_attach = <0>;
-                       resolution = <gc0329_FULL_RESOLUTION>;
-                       pwdn_info = <gc0329_PWRDN_ACTIVE>;
-                       powerup_sequence = <gc0329_PWRSEQ>;     
-                       orientation = <0>;
-                       i2c_add = <gc0329_I2C_ADDR>;
-                       i2c_rata = <100000>;
-                       i2c_chl = <0>;
-                       cif_chl = <0>;
-                       mclk_rate = <24>;
-               };
-       };
-};
-
index 47cfe8a8bf124efc556ebac618ee481bb37b289b..99894420a8fff85435d071d2b77000ff79dce780 100755 (executable)
@@ -1,8 +1,9 @@
 /dts-v1/;
 
 #include "rk312x.dtsi"
+#include "rk3126-cif-sensor.dtsi"
+#include "rk3128-cif-sensor.dtsi"
 
-#include "rk312x-cif-sensor.dtsi"
 / {
        fiq-debugger {
                status = "okay";
                        status = "okay";
        };
 };
+&i2c1 {
+       status = "okay";
+};
+
 &i2c2 {
        status = "okay";
        ts@55 {
         status = "okay";
 };
 
-&cif_sensor{
-       status = "okay";
-};
index b899d6f76e7337ee09fcce5aef6bc6243e214cc7..350d759379f6cb73874bfea6fd02e0fd5843463f 100644 (file)
@@ -158,7 +158,7 @@ static int  rk_dts_sensor_probe(struct platform_device *pdev)
        for_each_child_of_node(np, cp) {\r
                u32 flash_attach = 0,mir = 0,i2c_rata = 0,i2c_chl = 0,i2c_add = 0;\r
                u32 cif_chl = 0, mclk_rate = 0, is_front = 0;\r
-               u32 resolution = 0, pwdn_info = 0, powerup_sequence = 0;\r
+               u32 resolution = 0, powerup_sequence = 0;\r
                \r
                u32     powerdown = INVALID_GPIO,power = INVALID_GPIO,reset = INVALID_GPIO;\r
                u32 af = INVALID_GPIO,flash = INVALID_GPIO;\r
@@ -228,9 +228,6 @@ static int  rk_dts_sensor_probe(struct platform_device *pdev)
                if (of_property_read_u32(cp, "resolution", &resolution)) {\r
                        printk("%s:Get %s rockchip,resolution failed!\n",__func__, cp->name);                           \r
                }\r
-               if (of_property_read_u32(cp, "pwdn_info", &pwdn_info)) {\r
-                       printk("%s:Get %s rockchip,pwdn_info failed!\n",__func__, cp->name);                            \r
-               }\r
                if (of_property_read_u32(cp, "powerup_sequence", &powerup_sequence)) {\r
                        printk("%s:Get %s rockchip,powerup_sequence failed!\n",__func__, cp->name);                             \r
                }\r
@@ -260,7 +257,7 @@ static int  rk_dts_sensor_probe(struct platform_device *pdev)
                new_camera->mirror = mir;\r
                new_camera->i2c_rate = i2c_rata;\r
                new_camera->flash = flash_attach;\r
-               new_camera->pwdn_info = ((pwdn_info&0x10)|0x01);\r
+               new_camera->pwdn_info = ((pwdn_active&0x10)|0x01);\r
                new_camera->powerup_sequence = powerup_sequence;\r
                new_camera->mclk_rate = mclk_rate;\r
                new_camera->of_node = cp;\r
index 2ed6a1343b86614d9213388fdd600c79973c95a9..54ddb6565f7be839a15427a14f3f4165a471dfcf 100644 (file)
@@ -31,6 +31,7 @@ menu "rockchip camera sensor interface driver"
 
        config GC0329
                tristate "gc0329,support"
+               default y
 
        config GC2015
                tristate "gc2015,support"
index 0e3a6ec2cd50aeb03d7d7157b4aa81ac38693957..c609203941419c8caec8978eb0589241148479b2 100755 (executable)
@@ -258,8 +258,10 @@ static u32 DISABLE_INVERT_PCLK_CIF1;
 *v0.1.1:
          1. spin lock in struct rk_cif_clk is not neccessary,and scheduled func clk_get called in this spin lock scope
             cause warning, so remove this spin lock .
+*v0.1.2:
+                1. rk3126 and rk3128 use different dts file.            
 */
-#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 1, 0x1)
+#define RK_CAM_VERSION_CODE KERNEL_VERSION(0, 1, 0x2)
 static int version = RK_CAM_VERSION_CODE;
 module_param(version, int, S_IRUGO);
 
@@ -492,7 +494,6 @@ static void rk_camera_cif_reset(struct rk_camera_dev *pcdev, int only_rst)
     int ctrl_reg,inten_reg,crop_reg,set_size_reg,for_reg,vir_line_width_reg,scl_reg,y_reg,uv_reg;
        u32 RK_CRU_SOFTRST_CON = 0;
        debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$//n Here I am: %s:%i-------%s()\n", __FILE__, __LINE__,__FUNCTION__);
-       printk("&&&&&&&&&&&&&&&&&&&%s&&&&&&&&&&&&&&&\n",pcdev->pdata->rockchip_name);
        if(strstr(pcdev->pdata->rockchip_name,"3128")||strstr(pcdev->pdata->rockchip_name,"3126"))
                RK_CRU_SOFTRST_CON = RK312X_CRU_SOFTRSTS_CON(6);