From 8dea78da5cee153b8af9c07a2745f6c55057fe12 Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Thu, 17 Jan 2013 16:15:55 -0500 Subject: Patched in Tegra support. --- drivers/input/touchscreen/cy8ctmg110_ts.c | 35 ++++++++++++++++--------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'drivers/input/touchscreen/cy8ctmg110_ts.c') 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, int ret; struct i2c_msg msg[2] = { /* first write slave position to i2c devices */ - { - .addr = client->addr, - .len = 1, - .buf = &cmd - }, + { client->addr, 0, 1, &cmd }, /* Second read data from position */ - { - .addr = client->addr, - .flags = I2C_M_RD, - .len = len, - .buf = data - } + { client->addr, I2C_M_RD, len, data } }; ret = i2c_transfer(client->adapter, msg, 2); @@ -175,7 +166,7 @@ static irqreturn_t cy8ctmg110_irq_thread(int irq, void *dev_id) return IRQ_HANDLED; } -static int cy8ctmg110_probe(struct i2c_client *client, +static int __devinit cy8ctmg110_probe(struct i2c_client *client, const struct i2c_device_id *id) { const struct cy8ctmg110_pdata *pdata = client->dev.platform_data; @@ -260,8 +251,7 @@ static int cy8ctmg110_probe(struct i2c_client *client, } err = request_threaded_irq(client->irq, NULL, cy8ctmg110_irq_thread, - IRQF_TRIGGER_RISING | IRQF_ONESHOT, - "touch_reset_key", ts); + IRQF_TRIGGER_RISING, "touch_reset_key", ts); if (err < 0) { dev_err(&client->dev, "irq %d busy? error %d\n", client->irq, err); @@ -323,7 +313,7 @@ static int cy8ctmg110_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(cy8ctmg110_pm, cy8ctmg110_suspend, cy8ctmg110_resume); #endif -static int cy8ctmg110_remove(struct i2c_client *client) +static int __devexit cy8ctmg110_remove(struct i2c_client *client) { struct cy8ctmg110 *ts = i2c_get_clientdata(client); @@ -357,10 +347,21 @@ static struct i2c_driver cy8ctmg110_driver = { }, .id_table = cy8ctmg110_idtable, .probe = cy8ctmg110_probe, - .remove = cy8ctmg110_remove, + .remove = __devexit_p(cy8ctmg110_remove), }; -module_i2c_driver(cy8ctmg110_driver); +static int __init cy8ctmg110_init(void) +{ + return i2c_add_driver(&cy8ctmg110_driver); +} + +static void __exit cy8ctmg110_exit(void) +{ + i2c_del_driver(&cy8ctmg110_driver); +} + +module_init(cy8ctmg110_init); +module_exit(cy8ctmg110_exit); MODULE_AUTHOR("Samuli Konttila "); MODULE_DESCRIPTION("cy8ctmg110 TouchScreen Driver"); -- cgit v1.2.2