From 893728946556003c00a167b6f0bcbb8d5881f2ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Wed, 12 Mar 2014 09:52:39 +0800 Subject: [PATCH] input: ts: ct36x: init use async and fix compile warning --- drivers/input/touchscreen/ct36x/core.c | 2 +- drivers/input/touchscreen/ct36x/ct363.c | 4 ++-- drivers/input/touchscreen/ct36x/ct36x_priv.h | 8 -------- drivers/input/touchscreen/ct36x/ct36x_ts.c | 17 ++++++++++++----- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/input/touchscreen/ct36x/core.c b/drivers/input/touchscreen/ct36x/core.c index d2af589c7890..c6c03cc1c77f 100755 --- a/drivers/input/touchscreen/ct36x/core.c +++ b/drivers/input/touchscreen/ct36x/core.c @@ -81,13 +81,13 @@ static int ct36x_chip_era_flash(struct ct36x_data *ts) static int ct36x_chip_set_code(unsigned short flash_addr, char *buf) { unsigned char cod_chksum; + unsigned char *binary_data; // Flash address // data length buf[2] = (char)(flash_addr >> 8); buf[3] = (char)(flash_addr & 0xFF); buf[4] = 0x08; - unsigned char *binary_data; if(flag_ct36x_model ==365) binary_data = ct365_binary_data; diff --git a/drivers/input/touchscreen/ct36x/ct363.c b/drivers/input/touchscreen/ct36x/ct363.c index ade31173d52b..f5e295126bc1 100755 --- a/drivers/input/touchscreen/ct36x/ct363.c +++ b/drivers/input/touchscreen/ct36x/ct363.c @@ -24,8 +24,8 @@ struct ct363_priv{ static int ct363_init_hw(struct ct36x_data *ts) { - int ret = 0; /* + int ret = 0; ret = gpio_request(ts->rst_io.gpio, "ct363_rst"); if(ret < 0){ dev_err(ts->dev, "Failed to request rst gpio\n"); @@ -163,6 +163,7 @@ static int ct363_resume(struct ct36x_data *ts) static void ct363_report(struct ct36x_data *ts) { + int t ,m; int i, ret = 0; int sync = 0, x, y; int len = sizeof(struct ct363_finger_data) * ts->point_num; @@ -174,7 +175,6 @@ static void ct363_report(struct ct36x_data *ts) return; } - int t ,m; if(ct36x_dbg_level==2) for(t=0;t< ts->point_num;t++){ ct36x_dbg(ts, "CT363buf[%d]: ", t); diff --git a/drivers/input/touchscreen/ct36x/ct36x_priv.h b/drivers/input/touchscreen/ct36x/ct36x_priv.h index 770a4d9720c5..321584244d68 100755 --- a/drivers/input/touchscreen/ct36x/ct36x_priv.h +++ b/drivers/input/touchscreen/ct36x/ct36x_priv.h @@ -20,14 +20,6 @@ #include -//#include -//#include -//#if 1 -//#define ct36x_dbg(ts, format, arg...) \ -// dev_printk(KERN_INFO , ts->dev , format , ## arg) -//#else -//#define ct36x_dbg(ts, format, arg...) -//#endif int flag_ct36x_model; int ct36x_dbg_level = 0; diff --git a/drivers/input/touchscreen/ct36x/ct36x_ts.c b/drivers/input/touchscreen/ct36x/ct36x_ts.c index 5330f421c160..67d0f7f72444 100755 --- a/drivers/input/touchscreen/ct36x/ct36x_ts.c +++ b/drivers/input/touchscreen/ct36x/ct36x_ts.c @@ -1,5 +1,6 @@ #include "ct36x_priv.h" #include +#include #include "core.c" #include "ct360.c" @@ -141,6 +142,7 @@ static void ct36x_ts_late_resume(struct early_suspend *h) static int ct36x_ts_probe(struct i2c_client *client, const struct i2c_device_id *id) { + int orientation[4]; int ret = 0, i; struct ct36x_data *ts = NULL; /*struct ct36x_platform_data *pdata = client->dev.platform_data; @@ -191,11 +193,10 @@ static int ct36x_ts_probe(struct i2c_client *client, const struct i2c_device_id //ts->y_max = pdata->y_max; //ts->rst_io = pdata->rst_io; //ts->irq_io = pdata->irq_io; - ts->irq_io.gpio = of_get_named_gpio_flags(np, "touch-gpio", 0, &irq_flags); + ts->irq_io.gpio = of_get_named_gpio_flags(np, "touch-gpio", 0, (enum of_gpio_flags *)&irq_flags); ts->rst_io.gpio = of_get_named_gpio_flags(np, "reset-gpio", 0, &rst_flags); - printk("the irq_flags is %d,rst_flags is %d\n",irq_flags,rst_flags); - int orientation[4]; + printk("the irq_flags is %ld,rst_flags is %d\n",irq_flags,rst_flags); ret = of_property_read_u32_array(np, "orientation",orientation,4); if (ret < 0) @@ -337,7 +338,7 @@ static struct i2c_driver ct36x_ts_driver = { }, }; -static int __init ct36x_ts_init(void) +static void __init ct36x_ts_init_async(void *unused, async_cookie_t cookie) { #ifndef CONFIG_CT36X_TS //make modules int ret = 0; @@ -355,7 +356,13 @@ static int __init ct36x_ts_init(void) return ret; } #endif - return i2c_add_driver(&ct36x_ts_driver); + i2c_add_driver(&ct36x_ts_driver); +} + +static int __init ct36x_ts_init(void) +{ + async_schedule(ct36x_ts_init_async, NULL); + return 0; } static void __exit ct36x_ts_exit(void) -- 2.34.1