m701 - tp: improve tp can't work when low power startup.

This commit is contained in:
zhengxing 2012-10-20 15:18:19 +08:00
parent 4389421ec1
commit 79707beff7
2 changed files with 27 additions and 15 deletions

View File

@ -158,7 +158,9 @@ static int ft5306_init_platform_hw(void)
return -EIO;
}
gpio_direction_output(TOUCH_RESET_PIN, 0);
gpio_direction_output(TOUCH_RESET_PIN, 1);
gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
mdelay(50);
gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
mdelay(50);
gpio_direction_input(TOUCH_INT_PIN);

View File

@ -851,23 +851,33 @@ static int ft5306_probe(struct i2c_client *client ,const struct i2c_device_id *
return -ENOMEM;
}
while(retry < 5)
{
ret=ft5306_set_regs(client,FT5X0X_REG_PMODE, buf_test,1);
if(ret > 0)break;
retry++;
}
if(ret <= 0)
{
FTprintk("FT5306 I2C TEST ERROR!\n");
err = -ENODEV;
goto exit_i2c_test_fail;
}
while(retry < 5)
{
ret = ft5306_set_regs(client,FT5X0X_REG_PMODE, buf_test, 1);
if(ret > 0)
break;
retry++;
printk("FT5306 I2C TEST FAILED, retry = %d, ret = %d, will again...\n", retry, ret);
if (pdata->exit_platform_hw)
pdata->exit_platform_hw();
if (pdata->init_platform_hw)
pdata->init_platform_hw();
}
printk("FT5306 I2C TEST OK, retry = %d, ret = %d\n", retry, ret);
if(ret <= 0)
{
printk("FT5306 I2C TEST ERROR! retry = %d, ret = %d\n", retry, ret);
err = -ENODEV;
goto exit_i2c_test_fail;
}
input_dev = input_allocate_device();
if (!input_dev) {
err = -ENOMEM;
FTprintk("failed to allocate input device\n");
printk("failed to allocate input device\n");
goto exit_input_dev_alloc_failed;
}
ft5x0x_ts->client = this_client = client;
@ -903,7 +913,7 @@ static int ft5306_probe(struct i2c_client *client ,const struct i2c_device_id *
input_dev->name = "ft5x0x_ts-touchscreen"; //dev_name(&client->dev)
err = input_register_device(input_dev);
if (err) {
FTprintk("ft5306_ts_probe: failed to register input device: \n");
printk("ft5306_ts_probe: failed to register input device: \n");
goto exit_input_register_device_failed;
}