mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
driver: input: touchscreen: gslx680_pad add work for fw download
Change-Id: I06842c0fc9bd3a7c5b0bdf962e7663b3662ccfbc Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
This commit is contained in:
@@ -116,6 +116,8 @@ struct gsl_ts {
|
||||
int screen_max_x;
|
||||
int screen_max_y;
|
||||
struct gsl_touch_chip_info *gsl_chip_info;
|
||||
struct work_struct download_fw_work;
|
||||
struct work_struct resume_work;
|
||||
};
|
||||
|
||||
#ifdef GSL_DEBUG
|
||||
@@ -255,7 +257,6 @@ static void gsl_load_fw(struct i2c_client *client)
|
||||
ptr_fw = ts->gsl_chip_info->ptr_fw;
|
||||
|
||||
source_len = ts->gsl_chip_info->ptr_fw_len;
|
||||
|
||||
for (source_line = 0; source_line < source_len; source_line++)
|
||||
{
|
||||
/* init page trans, set the page val */
|
||||
@@ -359,6 +360,8 @@ static void clr_reg(struct i2c_client *client)
|
||||
static void init_chip(struct i2c_client *client)
|
||||
{
|
||||
int rc;
|
||||
struct gsl_ts *ts = i2c_get_clientdata(client);
|
||||
|
||||
gslX680_shutdown_low();
|
||||
mdelay(20);
|
||||
gslX680_shutdown_high();
|
||||
@@ -370,12 +373,7 @@ static void init_chip(struct i2c_client *client)
|
||||
dev_err(&client->dev, "------gslX680 test_i2c error------\n");
|
||||
return;
|
||||
}
|
||||
clr_reg(client);
|
||||
reset_chip(client);
|
||||
gsl_load_fw(client);
|
||||
startup_chip(client);
|
||||
reset_chip(client);
|
||||
startup_chip(client);
|
||||
queue_work(ts->wq, &ts->download_fw_work);
|
||||
}
|
||||
|
||||
static void check_mem_data(struct i2c_client *client)
|
||||
@@ -934,6 +932,27 @@ static int gsl_ts_suspend(struct device *dev)
|
||||
static int gsl_ts_resume(struct device *dev)
|
||||
{
|
||||
struct gsl_ts *ts = dev_get_drvdata(dev);
|
||||
|
||||
queue_work(ts->wq, &ts->resume_work);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void gsl_download_fw_work(struct work_struct *work)
|
||||
{
|
||||
struct gsl_ts *ts = dev_get_drvdata(&gsl_client->dev);
|
||||
|
||||
clr_reg(ts->client);
|
||||
reset_chip(ts->client);
|
||||
gsl_load_fw(ts->client);
|
||||
startup_chip(ts->client);
|
||||
reset_chip(ts->client);
|
||||
startup_chip(ts->client);
|
||||
}
|
||||
|
||||
static void gsl_resume_work(struct work_struct *work)
|
||||
{
|
||||
struct gsl_ts *ts = dev_get_drvdata(&gsl_client->dev);
|
||||
#ifdef SLEEP_CLEAR_POINT
|
||||
#ifdef REPORT_DATA_ANDROID_4_0
|
||||
int i;
|
||||
@@ -941,8 +960,8 @@ static int gsl_ts_resume(struct device *dev)
|
||||
#endif
|
||||
gslX680_shutdown_high();
|
||||
msleep(20);
|
||||
reset_chip(ts->client);
|
||||
startup_chip(ts->client);
|
||||
//reset_chip(ts->client);
|
||||
//startup_chip(ts->client);
|
||||
check_mem_data(ts->client);
|
||||
check_mem_data(ts->client);
|
||||
|
||||
@@ -960,9 +979,9 @@ static int gsl_ts_resume(struct device *dev)
|
||||
input_sync(ts->input);
|
||||
#endif
|
||||
enable_irq(ts->irq);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int gsl_ts_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
{
|
||||
@@ -1039,6 +1058,9 @@ static int gsl_ts_probe(struct i2c_client *client,
|
||||
dev_info(&ts->client->dev, "irq pin invalid\n");
|
||||
}
|
||||
|
||||
INIT_WORK(&ts->download_fw_work, gsl_download_fw_work);
|
||||
INIT_WORK(&ts->resume_work, gsl_resume_work);
|
||||
|
||||
gslX680_init();
|
||||
rc = gslX680_ts_init(client, ts);
|
||||
if (rc < 0) {
|
||||
|
||||
Reference in New Issue
Block a user