u32 powerdown = INVALID_GPIO,power = INVALID_GPIO,reset = INVALID_GPIO;\r
u32 af = INVALID_GPIO,flash = INVALID_GPIO;\r
\r
- int pwr_active = INVALID_VALUE, rst_active = INVALID_VALUE, pwdn_active = INVALID_VALUE;\r
+ int pwr_active = 0, rst_active = 0, pwdn_active = 0;\r
int orientation = 0;\r
struct rkcamera_platform_data *new_camera; \r
new_camera = kzalloc(sizeof(struct rkcamera_platform_data),GFP_KERNEL);\r
dprintk("%s:Get %s pwr_active failed!\n",__func__, cp->name); \r
}\r
if (of_property_read_u32(cp, "rockchip,reset", &reset)) {\r
- printk("%s:Get %s rockchip,reset failed!\n",__func__, cp->name); \r
+ dprintk("%s:Get %s rockchip,reset failed!\n",__func__, cp->name); \r
}\r
if (of_property_read_u32(cp, "rst_active", &rst_active)) {\r
dprintk("%s:Get %s rst_active failed!\n",__func__, cp->name); \r
}\r
if (of_property_read_u32(cp, "rockchip,af", &af)) {\r
- printk("%s:Get %s rockchip,af failed!\n",__func__, cp->name); \r
+ dprintk("%s:Get %s rockchip,af failed!\n",__func__, cp->name); \r
}\r
if (of_property_read_u32(cp, "rockchip,flash", &flash)) {\r
- printk("%s:Get %s rockchip,flash failed!\n",__func__, cp->name); \r
+ dprintk("%s:Get %s rockchip,flash failed!\n",__func__, cp->name); \r
}\r
if (of_property_read_u32(cp, "i2c_add", &i2c_add)) {\r
printk("%s:Get %s rockchip,i2c_add failed!\n",__func__, cp->name); \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_direction_output(camera_power,1);\r
+ gpio_set_value(camera_power, ((camera_ioflag&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));\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_direction_output(camera_power,0);\r
+ gpio_set_value(camera_power, (((~camera_ioflag)&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));\r
dprintk("%s PowerPin=%d ..PinLevel = %x",res->dev_name, camera_power, (((~camera_ioflag)&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));\r
}\r
} else {\r
dprintk("%s power pin(%d) init success(0x%x)" ,gpio_res->dev_name,camera_power,(((~camera_ioflag)&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));\r
\r
}\r
-/*\r
+\r
if (camera_reset != INVALID_GPIO) {\r
+ \r
+ camera_power = of_get_named_gpio_flags(of_node,"rockchip,reset",0,&flags);/*yzm*/\r
+ gpio_res->gpio_reset = camera_reset;/*yzm information back to the IO*/\r
ret = gpio_request(camera_reset, "camera reset");\r
if (ret) {\r
io_requested_in_camera = false;\r
- for (i=0; i<RK_CAM_NUM; i++) {\r
- io_res = &rk_camera_platform_data.gpio_res[i];\r
- if (io_res->gpio_init & RK29_CAM_RESETACTIVE_MASK) {\r
- if (io_res->gpio_reset == camera_reset)\r
- io_requested_in_camera = true; \r
- }\r
- }\r
\r
if (io_requested_in_camera==false) {\r
- i=0;\r
- while (strstr(new_camera[i].dev_name,"end")==NULL) {\r
- io_res = &new_camera[i].io;\r
+ \r
+ new_camera = new_camera_head;\r
+ while (new_camera != NULL) {\r
+ io_res = &new_camera->io;\r
if (io_res->gpio_init & RK29_CAM_RESETACTIVE_MASK) {\r
if (io_res->gpio_reset == camera_reset)\r
io_requested_in_camera = true; \r
}\r
- i++;\r
+ new_camera = new_camera->next_camera;\r
}\r
}\r
\r
ret =0;\r
}\r
}\r
-\r
- if (rk_camera_platform_data.iomux(camera_reset,dev) < 0) {\r
- ret = -1;\r
- eprintk("%s reset pin(%d) iomux init failed", gpio_res->dev_name,camera_reset);\r
- goto _rk_sensor_io_init_end_;\r
- }\r
- \r
+ \r
gpio_res->gpio_init |= RK29_CAM_RESETACTIVE_MASK;\r
gpio_set_value(camera_reset, ((camera_ioflag&RK29_CAM_RESETACTIVE_MASK)>>RK29_CAM_RESETACTIVE_BITPOS));\r
gpio_direction_output(camera_reset, ((camera_ioflag&RK29_CAM_RESETACTIVE_MASK)>>RK29_CAM_RESETACTIVE_BITPOS));\r
dprintk("%s reset pin(%d) init success(0x%x)" ,gpio_res->dev_name,camera_reset,((camera_ioflag&RK29_CAM_RESETACTIVE_MASK)>>RK29_CAM_RESETACTIVE_BITPOS));\r
\r
}\r
-*/\r
+\r
if (camera_powerdown != INVALID_GPIO) {\r
debug_printk( "/$$$$$$$$$$$$$$$$$$$$$$/ camera_powerdown = %x\n", camera_powerdown );\r
\r
dprintk("%s powerdown pin(%d) init success(0x%x)" ,gpio_res->dev_name,camera_powerdown,((camera_ioflag&RK29_CAM_POWERDNACTIVE_BITPOS)>>RK29_CAM_POWERDNACTIVE_BITPOS));\r
\r
}\r
-/*\r
+\r
if (camera_flash != INVALID_GPIO) {\r
+\r
+ camera_flash = of_get_named_gpio_flags(of_node,"rockchip,flash",0,&flags);/*yzm*/\r
+ gpio_res->gpio_flash = camera_flash;/*yzm information back to the IO*/\r
ret = gpio_request(camera_flash, "camera flash");\r
if (ret) {\r
io_requested_in_camera = false;\r
- for (i=0; i<RK_CAM_NUM; i++) {\r
- io_res = &rk_camera_platform_data.gpio_res[i];\r
- if (io_res->gpio_init & RK29_CAM_POWERDNACTIVE_MASK) {\r
- if (io_res->gpio_powerdown == camera_powerdown)\r
- io_requested_in_camera = true; \r
- }\r
- }\r
\r
if (io_requested_in_camera==false) {\r
- i=0;\r
- while (strstr(new_camera[i].dev_name,"end")==NULL) {\r
- io_res = &new_camera[i].io;\r
+\r
+ new_camera = new_camera_head;\r
+ while (new_camera != NULL) {\r
+ io_res = &new_camera->io;\r
if (io_res->gpio_init & RK29_CAM_POWERDNACTIVE_MASK) {\r
if (io_res->gpio_powerdown == camera_powerdown)\r
io_requested_in_camera = true; \r
}\r
- i++;\r
+ new_camera = new_camera->next_camera;\r
}\r
}\r
\r
}\r
\r
\r
- if (rk_camera_platform_data.iomux(camera_flash,dev) < 0) {\r
- printk("%s flash pin(%d) iomux init failed\n",gpio_res->dev_name,camera_flash); \r
- }\r
\r
gpio_res->gpio_init |= RK29_CAM_FLASHACTIVE_MASK;\r
gpio_set_value(camera_flash, ((~camera_ioflag&RK29_CAM_FLASHACTIVE_MASK)>>RK29_CAM_FLASHACTIVE_BITPOS)); // falsh off \r
\r
} \r
\r
-\r
if (camera_af != INVALID_GPIO) {\r
+ \r
+ camera_af = of_get_named_gpio_flags(of_node,"rockchip,af",0,&flags);/*yzm*/\r
+ gpio_res->gpio_af = camera_af;/*yzm information back to the IO*/\r
ret = gpio_request(camera_af, "camera af");\r
if (ret) {\r
io_requested_in_camera = false;\r
- for (i=0; i<RK_CAM_NUM; i++) {\r
- io_res = &rk_camera_platform_data.gpio_res[i];\r
- if (io_res->gpio_init & RK29_CAM_AFACTIVE_MASK) {\r
- if (io_res->gpio_af == camera_af)\r
- io_requested_in_camera = true; \r
- }\r
- }\r
\r
if (io_requested_in_camera==false) {\r
- i=0;\r
- while (strstr(new_camera[i].dev_name,"end")==NULL) {\r
- io_res = &new_camera[i].io;\r
+\r
+ new_camera = new_camera_head;\r
+ while (new_camera != NULL) {\r
+ io_res = &new_camera->io;\r
if (io_res->gpio_init & RK29_CAM_AFACTIVE_MASK) {\r
if (io_res->gpio_af == camera_af)\r
io_requested_in_camera = true; \r
}\r
- i++;\r
+ new_camera = new_camera->next_camera;\r
}\r
}\r
\r
}\r
\r
}\r
-\r
-\r
- if (rk_camera_platform_data.iomux(camera_af,dev) < 0) {\r
- ret = -1;\r
- eprintk("%s af pin(%d) iomux init failed\n",gpio_res->dev_name,camera_af); \r
- goto _rk_sensor_io_init_end_; \r
- }\r
\r
gpio_res->gpio_init |= RK29_CAM_AFACTIVE_MASK;\r
//gpio_direction_output(camera_af, ((camera_ioflag&RK29_CAM_AFACTIVE_MASK)>>RK29_CAM_AFACTIVE_BITPOS));\r
dprintk("%s af pin(%d) init success",gpio_res->dev_name, camera_af);\r
\r
}\r
-*/\r
\r
\r
_rk_sensor_io_init_end_:\r