mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 07:03:37 +02:00
Merge branch 'develop' of xjh@10.10.10.29:/home/rockchip/kernel into develop_29server
This commit is contained in:
commit
29eb326bc7
|
|
@ -516,7 +516,7 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
|
|||
.type = "rtc_hym8563",
|
||||
.addr = 0x51,
|
||||
.flags = 0,
|
||||
///.irq = RK2818_PIN_PA4,
|
||||
.irq = RK29_PIN0_PA1,
|
||||
},
|
||||
#endif
|
||||
#if defined (CONFIG_GS_MMA8452)
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ o* Driver for MT9M001 CMOS Image Sensor from Micron
|
|||
#define SENSOR_TR(format, ...)
|
||||
#endif
|
||||
|
||||
#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\
|
||||
#define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_FALLING|\
|
||||
SOCAM_HSYNC_ACTIVE_HIGH | SOCAM_VSYNC_ACTIVE_LOW |\
|
||||
SOCAM_DATA_ACTIVE_HIGH | SOCAM_DATAWIDTH_8 |SOCAM_MCLK_24MHZ)
|
||||
|
||||
|
|
@ -143,6 +143,7 @@ static struct reginfo sensor_init_data[] =
|
|||
{0x3a14, 0x02},
|
||||
{0x3a15, 0x28},
|
||||
|
||||
{0x4708,0x00},
|
||||
|
||||
{0x3623, 0x00},
|
||||
{0x3634, 0x76},
|
||||
|
|
@ -1325,6 +1326,7 @@ static int sensor_write_array(struct i2c_client *client, struct reginfo *regarra
|
|||
{
|
||||
int err, cnt;
|
||||
int i = 0;
|
||||
char val00;
|
||||
|
||||
cnt = 0;
|
||||
while (regarray[i].reg != 0)
|
||||
|
|
@ -1340,6 +1342,10 @@ static int sensor_write_array(struct i2c_client *client, struct reginfo *regarra
|
|||
SENSOR_TR("%s..write array failed!!!\n", SENSOR_NAME_STRING());
|
||||
return -EPERM;
|
||||
}
|
||||
} else {
|
||||
sensor_read(client, regarray[i].reg, &val00);
|
||||
if (val00 != regarray[i].val)
|
||||
SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, val00);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
|
@ -1358,7 +1364,7 @@ static int sensor_init(struct v4l2_subdev *sd, u32 val)
|
|||
SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__);
|
||||
|
||||
/* soft reset */
|
||||
ret = sensor_write(client, 0x3012, 0x80);
|
||||
ret = sensor_write(client, 0x0103, 0x01);
|
||||
if (ret != 0)
|
||||
{
|
||||
SENSOR_TR("%s soft reset sensor failed\n",SENSOR_NAME_STRING());
|
||||
|
|
@ -1465,9 +1471,12 @@ static int sensor_deactivate(struct v4l2_subdev *sd)
|
|||
{
|
||||
struct i2c_client *client = sd->priv;
|
||||
u8 reg_val;
|
||||
int ret;
|
||||
|
||||
SENSOR_DG("\n%s..%s.. \n",SENSOR_NAME_STRING(),__FUNCTION__);
|
||||
ret = sensor_write(client, 0x0103, 0x01);
|
||||
|
||||
SENSOR_DG("\n%s..%s enter, reset ret:0x%x \n",SENSOR_NAME_STRING(),__FUNCTION__,ret);
|
||||
msleep(5);
|
||||
/* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */
|
||||
sensor_read(client,0x3000,®_val);
|
||||
sensor_write(client, 0x3000, reg_val&0xfc);
|
||||
|
|
@ -2399,7 +2408,7 @@ static int sensor_video_probe(struct soc_camera_device *icd,
|
|||
return -ENODEV;
|
||||
|
||||
/* soft reset */
|
||||
ret = sensor_write(client, 0x3012, 0x80);
|
||||
ret = sensor_write(client, 0x0103, 0x01);
|
||||
if (ret != 0)
|
||||
{
|
||||
SENSOR_TR("soft reset %s failed\n",SENSOR_NAME_STRING());
|
||||
|
|
|
|||
|
|
@ -2254,7 +2254,7 @@ static struct reginfo sensor_sxga[] =
|
|||
/* 800X600 SVGA*/
|
||||
static struct reginfo sensor_svga[] =
|
||||
{
|
||||
#if 0
|
||||
#if 1
|
||||
{0x3000,0xf8},
|
||||
{0x3001,0x48},
|
||||
{0x3002,0x5c},
|
||||
|
|
@ -3240,9 +3240,10 @@ static int sensor_read(struct i2c_client *client, u16 reg, u8 *val)
|
|||
/* write a array of registers */
|
||||
static int sensor_write_array(struct i2c_client *client, struct reginfo *regarray)
|
||||
{
|
||||
int err, cnt;
|
||||
int err = 0, cnt;
|
||||
int i = 0;
|
||||
struct sensor *sensor = to_sensor(client);
|
||||
char val00;
|
||||
|
||||
cnt = 0;
|
||||
while (regarray[i].reg != 0)
|
||||
|
|
@ -3267,7 +3268,13 @@ static int sensor_write_array(struct i2c_client *client, struct reginfo *regarra
|
|||
err = -EPERM;
|
||||
goto sensor_af_init_end;
|
||||
}
|
||||
} else {
|
||||
sensor_read(client, regarray[i].reg, &val00);
|
||||
if (val00 != regarray[i].val)
|
||||
SENSOR_TR("%s Reg:0x%x write(0x%x, 0x%x) fail\n",SENSOR_NAME_STRING(), regarray[i].reg, regarray[i].val, val00);
|
||||
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
|
|
@ -3821,8 +3828,11 @@ static int sensor_deactivate(struct v4l2_subdev *sd)
|
|||
{
|
||||
struct i2c_client *client = sd->priv;
|
||||
struct sensor *sensor = to_sensor(client);
|
||||
int ret;
|
||||
|
||||
SENSOR_DG("\n%s..%s enter \n",SENSOR_NAME_STRING(),__FUNCTION__);
|
||||
ret = sensor_write(client, 0x3008, 0x80);
|
||||
SENSOR_DG("\n%s..%s enter, reset ret:0x%x \n",SENSOR_NAME_STRING(),__FUNCTION__,ret);
|
||||
msleep(5);
|
||||
|
||||
/* ddl@rock-chips.com : all sensor output pin must change to input for other sensor */
|
||||
sensor_write(client, 0x3017, 0x00); // FREX,VSYNC,HREF,PCLK,D9-D6
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ static int hym8563_read_datetime(struct i2c_client *client, struct rtc_time *tm)
|
|||
if(tm->tm_year < 0)
|
||||
tm->tm_year = 0;
|
||||
tm->tm_isdst = 0;
|
||||
DBG("%s [%d]tm_wday=%d \n",__FUNCTION__,__LINE__,tm->tm_wday);
|
||||
DBG("%s [%d]tm_sec=%d \n",__FUNCTION__,__LINE__,tm->tm_sec);
|
||||
DBG("%s [%d]tm_min=%d \n",__FUNCTION__,__LINE__,tm->tm_min);
|
||||
DBG("%s [%d]tm_hour=%d \n",__FUNCTION__,__LINE__,tm->tm_hour);
|
||||
|
|
@ -128,6 +129,7 @@ static int hym8563_set_time(struct i2c_client *client, struct rtc_time *tm)
|
|||
u8 mon_day,i;
|
||||
u8 ret = 0;
|
||||
|
||||
DBG("%s [%d]tm_wday=%d \n",__FUNCTION__,__LINE__,tm->tm_wday);
|
||||
DBG("%s [%d]tm_sec=%d \n",__FUNCTION__,__LINE__,tm->tm_sec);
|
||||
DBG("%s [%d]tm_min=%d \n",__FUNCTION__,__LINE__,tm->tm_min);
|
||||
DBG("%s [%d]tm_hour=%d \n",__FUNCTION__,__LINE__,tm->tm_hour);
|
||||
|
|
@ -324,13 +326,13 @@ static int __devinit hym8563_probe(struct i2c_client *client,const struct i2c_d
|
|||
struct hym8563 *hym8563;
|
||||
struct rtc_device *rtc = NULL;
|
||||
struct rtc_time tm_read, tm = {
|
||||
.tm_wday = 4,
|
||||
.tm_year = 109,
|
||||
.tm_mon = 9,
|
||||
.tm_mday = 1,
|
||||
.tm_hour = 12,
|
||||
.tm_min = 10,
|
||||
.tm_sec = 58
|
||||
.tm_wday = 6,
|
||||
.tm_year = 111,
|
||||
.tm_mon = 0,
|
||||
.tm_mday = 1,
|
||||
.tm_hour = 12,
|
||||
.tm_min = 0,
|
||||
.tm_sec = 0,
|
||||
};
|
||||
|
||||
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
|
||||
|
|
@ -352,7 +354,7 @@ static int __devinit hym8563_probe(struct i2c_client *client,const struct i2c_d
|
|||
hym8563_init_device(client);
|
||||
hym8563_read_datetime(client, &tm_read); //read time from hym8563
|
||||
|
||||
if(((tm_read.tm_year < 70) | (tm_read.tm_year > 137 )) | (tm_read.tm_mon == -1)) //if the hym8563 haven't initialized
|
||||
if(((tm_read.tm_year < 70) | (tm_read.tm_year > 137 )) | (tm_read.tm_mon == -1) | (rtc_valid_tm(&tm_read) != 0)) //if the hym8563 haven't initialized
|
||||
{
|
||||
hym8563_set_time(client, &tm); //initialize the hym8563
|
||||
}
|
||||
|
|
@ -366,7 +368,7 @@ static int __devinit hym8563_probe(struct i2c_client *client,const struct i2c_d
|
|||
|
||||
hym8563->irq_num = gpio_to_irq(client->irq);
|
||||
gpio_pull_updown(client->irq,GPIOPullUp);
|
||||
if(request_irq(hym8563->irq_num, hym8563_wakeup_irq,IRQF_TRIGGER_FALLING,NULL,hym8563) <0)
|
||||
if (request_irq(hym8563->irq_num, hym8563_wakeup_irq, IRQF_TRIGGER_FALLING, client->dev.driver->name, hym8563) < 0)
|
||||
{
|
||||
printk("unable to request rtc irq\n");
|
||||
goto exit;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user