diff --git a/arch/arm/mach-rk29/board-rk29-newton.c b/arch/arm/mach-rk29/board-rk29-newton.c index 6033f91b9bb6..16a693c3c2eb 100755 --- a/arch/arm/mach-rk29/board-rk29-newton.c +++ b/arch/arm/mach-rk29/board-rk29-newton.c @@ -176,15 +176,14 @@ struct rk29_nand_platform_data rk29_nand_data = { * author: zyw@rock-chips.com *****************************************************************************************/ #define FB_ID 0 -#define FB_DISPLAY_ON_PIN INVALID_GPIO// RK29_PIN6_PD0 -//#define FB_LCD_STANDBY_PIN INVALID_GPIO -#define FB_LCD_STANDBY_PIN RK29_PIN6_PD1 +#define FB_DISPLAY_ON_PIN RK29_PIN6_PD1 +#define FB_LCD_STANDBY_PIN RK29_PIN1_PD6 #define FB_LCD_CABC_EN_PIN RK29_PIN6_PD2 #define FB_MCU_FMK_PIN INVALID_GPIO #define FB_DISPLAY_ON_VALUE GPIO_HIGH -//#define FB_LCD_STANDBY_VALUE GPIO_HIGH -#define FB_LCD_STANDBY_VALUE GPIO_LOW +#define FB_LCD_STANDBY_VALUE GPIO_HIGH +//#define FB_LCD_STANDBY_VALUE GPIO_LOW static int rk29_lcd_io_init(void) { diff --git a/arch/arm/mach-rk29/include/mach/rk29-ipp.h b/arch/arm/mach-rk29/include/mach/rk29-ipp.h index cb468d66760c..36027c802451 100755 --- a/arch/arm/mach-rk29/include/mach/rk29-ipp.h +++ b/arch/arm/mach-rk29/include/mach/rk29-ipp.h @@ -20,12 +20,19 @@ struct rk29_ipp_image struct rk29_ipp_req { struct rk29_ipp_image src0; // source0 image struct rk29_ipp_image dst0; // destination0 image - struct rk29_ipp_image src1; // source1 image - struct rk29_ipp_image dst1; // destination1 image + //struct rk29_ipp_image src1; // source1 image + //struct rk29_ipp_image dst1; // destination1 image uint32_t src_vir_w; uint32_t dst_vir_w; uint32_t timeout; + uint32_t flag; //rotate + + /*store_clip_mode + 0:when src width is not 64-bits aligned,use dummy data make it 64-bits aligned 1:packed + we usually set to 0 + */ + uint8_t store_clip_mode; //deinterlace_enable 1:enable 0:disable uint8_t deinterlace_enable; @@ -105,6 +112,7 @@ typedef enum #define IPP_PROCESS_ST (0x50) /*ipp config*/ +#define STORE_CLIP_MODE (1<<26) #define DEINTERLACE_ENABLE (1<<24) #define ROT_ENABLE (1<<8) #define PRE_SCALE (1<<4) diff --git a/drivers/media/video/ov7675.c b/drivers/media/video/ov7675.c index 8417928571ee..84942e75d56e 100755 --- a/drivers/media/video/ov7675.c +++ b/drivers/media/video/ov7675.c @@ -144,7 +144,7 @@ static struct reginfo sensor_init_data[] = {0x0e, 0x61}, {0x0f, 0x4b}, {0x16, 0x02}, - {0x1e, 0x07}, //0x27 + {0x1e, 0x17}, //0x07//0x27 {0x21, 0x02}, {0x22, 0x91}, {0x29, 0x07}, @@ -181,22 +181,22 @@ static struct reginfo sensor_init_data[] = {0x66, 0x05}, {0x94, 0x10}, {0x95, 0x12}, - {0x7a, 0x24}, - {0x7b, 0x04}, - {0x7c, 0x07}, - {0x7d, 0x12}, - {0x7e, 0x2f}, - {0x7f, 0x3f}, - {0x80, 0x4d}, - {0x81, 0x5a}, - {0x82, 0x69}, - {0x83, 0x74}, - {0x84, 0x7f}, - {0x85, 0x91}, - {0x86, 0x9e}, - {0x87, 0xbb}, - {0x88, 0xd2}, - {0x89, 0xe5}, + {0x7a, 0x20},// {0x7a, 0x24}, + {0x7b, 0x16},// {0x7b, 0x04}, + {0x7c, 0x23},// {0x7c, 0x07}, + {0x7d, 0x3c},// {0x7d, 0x12}, + {0x7e, 0x5c},// {0x7e, 0x2f}, + {0x7f, 0x69},// {0x7f, 0x3f}, + {0x80, 0x75},// {0x80, 0x4d}, + {0x81, 0x7e},// {0x81, 0x5a}, + {0x82, 0x88},// {0x82, 0x69}, + {0x83, 0x8f},// {0x83, 0x74}, + {0x84, 0x96},// {0x84, 0x7f}, + {0x85, 0xa3},// {0x85, 0x91}, + {0x86, 0xaf},// {0x86, 0x9e}, + {0x87, 0xc4},// {0x87, 0xbb}, + {0x88, 0xd7},// {0x88, 0xd2}, + {0x89, 0xe8},// {0x89, 0xe5}, {0x43, 0x0a}, {0x44, 0xf0}, {0x45, 0x34}, @@ -228,7 +228,7 @@ static struct reginfo sensor_init_data[] = {0x75, 0x63}, {0x76, 0xe1}, {0x4c, 0x00}, - {0x77, 0x01}, + {0x77, 0x04},//0x01 {0x4b, 0x09}, {0xc9, 0x60}, {0x41, 0x38}, @@ -1214,7 +1214,7 @@ static int sensor_write(struct i2c_client *client, u8 reg, u8 val) while ((cnt-- > 0) && (err < 0)) { /* ddl@rock-chips.com : Transfer again if transent is failed */ err = i2c_transfer(client->adapter, msg, 1); - + udelay(50); if (err >= 0) { return 0; } else { @@ -1230,13 +1230,10 @@ static int sensor_write(struct i2c_client *client, u8 reg, u8 val) static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) { int err,cnt; - //u8 buf[2]; u8 buf[1]; struct i2c_msg msg[2]; - - //buf[0] = reg >> 8; + buf[0] = reg; - buf[1] = reg & 0xFF; msg[0].addr = client->addr; msg[0].flags = client->flags; @@ -1270,7 +1267,6 @@ static int sensor_read(struct i2c_client *client, u8 reg, u8 *val) } /* write a array of registers */ -#if 1 static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) { int err = 0, cnt; @@ -1311,27 +1307,24 @@ sensor_write_array_end: sensor_task_lock(client,0); return err; } -#else -static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray) +static int sensor_readchk_array(struct i2c_client *client, struct reginfo *regarray) { - int err; + int cnt; int i = 0; - u8 val_read; + char valchk; + + cnt = 0; + valchk = 0; while (regarray[i].reg != 0) { - err = sensor_write(client, regarray[i].reg, regarray[i].val); - if (err != 0) - { - SENSOR_TR("%s..write failed current i = %d\n", SENSOR_NAME_STRING(),i); - return err; - } - err = sensor_read(client, regarray[i].reg, &val_read); - SENSOR_TR("%s..reg[0x%x]=0x%x,0x%x\n", SENSOR_NAME_STRING(),regarray[i].reg, val_read, regarray[i].val); + sensor_read(client, regarray[i].reg, &valchk); + if (valchk != regarray[i].val) + SENSOR_TR("%s Reg:0x%x read(0x%x, 0x%x) error\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, valchk); + i++; } return 0; } -#endif static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd cmd, int on) { struct soc_camera_link *icl = to_soc_camera_link(icd); @@ -1343,10 +1336,12 @@ static int sensor_ioctrl(struct soc_camera_device *icd,enum rk29sensor_power_cmd case Sensor_PowerDown: { if (icl->powerdown) { + if (on == 0) + mdelay(1); ret = icl->powerdown(icd->pdev, on); if (ret == RK29_CAM_IO_SUCCESS) { if (on == 0) { - mdelay(2); + mdelay(20); if (icl->reset) icl->reset(icd->pdev); } @@ -1678,7 +1673,7 @@ static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f) } else if (((set_w <= 1280) && (set_h <= 1024)) && sensor_sxga[0].reg) { - winseqe_set_addr = sensor_sxga; + winseqe_set_addr = sensor_vga; //sensor_sxga; set_w = 1280; set_h = 1024; } diff --git a/drivers/media/video/rk29_camera.c b/drivers/media/video/rk29_camera.c index 04e6df1d3a1e..3e19731fe08c 100755 --- a/drivers/media/video/rk29_camera.c +++ b/drivers/media/video/rk29_camera.c @@ -270,8 +270,14 @@ static int rk29_sensor_io_init(void) if (camera_power != INVALID_GPIO) { ret = gpio_request(camera_power, "camera power"); - if (ret) - goto sensor_io_int_loop_end; + if (ret) { + if (i == 0) { + goto sensor_io_int_loop_end; + } else { + if (camera_power != rk29_camera_platform_data.gpio_res[0].gpio_power) + goto sensor_io_int_loop_end; + } + } rk29_camera_platform_data.gpio_res[i].gpio_init |= RK29_CAM_POWERACTIVE_MASK; gpio_set_value(camera_reset, (((~camera_ioflag)&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS)); gpio_direction_output(camera_power, (((~camera_ioflag)&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS)); diff --git a/drivers/staging/rk29/ipp/rk29-ipp.c b/drivers/staging/rk29/ipp/rk29-ipp.c index b0865cd94a4e..a9c12c2b0efd 100755 --- a/drivers/staging/rk29/ipp/rk29-ipp.c +++ b/drivers/staging/rk29/ipp/rk29-ipp.c @@ -249,25 +249,25 @@ int ipp_check_param(const struct rk29_ipp_req *req) /*IPP can support up to 8191*8191 resolution in RGB format,but we limit the image size to 8190*8190 here*/ //check src width and height if (unlikely((req->src0.w <16) || (req->src0.w > 8190) || (req->src0.h < 16) || (req->src0.h > 8190))) { - ERR("invalid source resolution\n"); + printk("ipp invalid source resolution\n"); return -EINVAL; } //check dst width and height if (unlikely((req->dst0.w <16) || (req->dst0.w > 2047) || (req->dst0.h < 16) || (req->dst0.h > 2047))) { - ERR("invalid destination resolution\n"); + printk("ipp invalid destination resolution\n"); return -EINVAL; } //check src_vir_w if(unlikely(req->src_vir_w < req->src0.w)){ - ERR("invalid src_vir_w\n"); + printk("ipp invalid src_vir_w\n"); return -EINVAL; } //check dst_vir_w if(unlikely(req->dst_vir_w < req->dst0.w)){ - ERR("invalid dst_vir_w\n"); + printk("ipp invalid dst_vir_w\n"); return -EINVAL; } @@ -288,7 +288,7 @@ int ipp_check_param(const struct rk29_ipp_req *req) //check rotate degree if(req->flag >= IPP_ROT_LIMIT) { - ERR("rk29_ipp is not surpport rot degree!!!!\n"); + printk("rk29_ipp does not surpport rot degree!!!!\n"); return -EINVAL; } return 0; @@ -862,12 +862,18 @@ int ipp_blit(const struct rk29_ipp_req *req) /*Configure other*/ ipp_write((req->dst_vir_w<<16)|req->src_vir_w, IPP_IMG_VIR); - //store clip mode always set to 1 now - ipp_write(ipp_read(IPP_CONFIG)|(1<<26), IPP_CONFIG);//store clip mode - + //store clip mode + if(req->store_clip_mode == 1) + { + ipp_write(ipp_read(IPP_CONFIG)|STORE_CLIP_MODE, IPP_CONFIG); + } + else + { + ipp_write(ipp_read(IPP_CONFIG)&(~STORE_CLIP_MODE), IPP_CONFIG); + } + /* Start the operation */ - ipp_write(8, IPP_INT);// - + ipp_write(8, IPP_INT);// dsb(); ipp_write(1, IPP_PROCESS_ST);