aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/cy8ctmg110_ts.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/input/touchscreen/cy8ctmg110_ts.c
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'drivers/input/touchscreen/cy8ctmg110_ts.c')
-rw-r--r--drivers/input/touchscreen/cy8ctmg110_ts.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c
index 96e0eedcc7e..d8815c5d54a 100644
--- a/drivers/input/touchscreen/cy8ctmg110_ts.c
+++ b/drivers/input/touchscreen/cy8ctmg110_ts.c
@@ -99,18 +99,9 @@ static int cy8ctmg110_read_regs(struct cy8ctmg110 *tsc,
99 int ret; 99 int ret;
100 struct i2c_msg msg[2] = { 100 struct i2c_msg msg[2] = {
101 /* first write slave position to i2c devices */ 101 /* first write slave position to i2c devices */
102 { 102 { client->addr, 0, 1, &cmd },
103 .addr = client->addr,
104 .len = 1,
105 .buf = &cmd
106 },
107 /* Second read data from position */ 103 /* Second read data from position */
108 { 104 { client->addr, I2C_M_RD, len, data }
109 .addr = client->addr,
110 .flags = I2C_M_RD,
111 .len = len,
112 .buf = data
113 }
114 }; 105 };
115 106
116 ret = i2c_transfer(client->adapter, msg, 2); 107 ret = i2c_transfer(client->adapter, msg, 2);
@@ -175,7 +166,7 @@ static irqreturn_t cy8ctmg110_irq_thread(int irq, void *dev_id)
175 return IRQ_HANDLED; 166 return IRQ_HANDLED;
176} 167}
177 168
178static int cy8ctmg110_probe(struct i2c_client *client, 169static int __devinit cy8ctmg110_probe(struct i2c_client *client,
179 const struct i2c_device_id *id) 170 const struct i2c_device_id *id)
180{ 171{
181 const struct cy8ctmg110_pdata *pdata = client->dev.platform_data; 172 const struct cy8ctmg110_pdata *pdata = client->dev.platform_data;
@@ -260,8 +251,7 @@ static int cy8ctmg110_probe(struct i2c_client *client,
260 } 251 }
261 252
262 err = request_threaded_irq(client->irq, NULL, cy8ctmg110_irq_thread, 253 err = request_threaded_irq(client->irq, NULL, cy8ctmg110_irq_thread,
263 IRQF_TRIGGER_RISING | IRQF_ONESHOT, 254 IRQF_TRIGGER_RISING, "touch_reset_key", ts);
264 "touch_reset_key", ts);
265 if (err < 0) { 255 if (err < 0) {
266 dev_err(&client->dev, 256 dev_err(&client->dev,
267 "irq %d busy? error %d\n", client->irq, err); 257 "irq %d busy? error %d\n", client->irq, err);
@@ -323,7 +313,7 @@ static int cy8ctmg110_resume(struct device *dev)
323static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume); 313static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume);
324#endif 314#endif
325 315
326static int cy8ctmg110_remove(struct i2c_client *client) 316static int __devexit cy8ctmg110_remove(struct i2c_client *client)
327{ 317{
328 struct cy8ctmg110 *ts = i2c_get_clientdata(client); 318 struct cy8ctmg110 *ts = i2c_get_clientdata(client);
329 319
@@ -357,10 +347,21 @@ static struct i2c_driver cy8ctmg110_driver = {
357 }, 347 },
358 .id_table = cy8ctmg110_idtable, 348 .id_table = cy8ctmg110_idtable,
359 .probe = cy8ctmg110_probe, 349 .probe = cy8ctmg110_probe,
360 .remove = cy8ctmg110_remove, 350 .remove = __devexit_p(cy8ctmg110_remove),
361}; 351};
362 352
363module_i2c_driver(cy8ctmg110_driver); 353static int __init cy8ctmg110_init(void)
354{
355 return i2c_add_driver(&cy8ctmg110_driver);
356}
357
358static void __exit cy8ctmg110_exit(void)
359{
360 i2c_del_driver(&cy8ctmg110_driver);
361}
362
363module_init(cy8ctmg110_init);
364module_exit(cy8ctmg110_exit);
364 365
365MODULE_AUTHOR("Samuli Konttila <samuli.konttila@aavamobile.com>"); 366MODULE_AUTHOR("Samuli Konttila <samuli.konttila@aavamobile.com>");
366MODULE_DESCRIPTION("cy8ctmg110 TouchScreen Driver"); 367MODULE_DESCRIPTION("cy8ctmg110 TouchScreen Driver");