Dmitry Torokhov wrote on 2010-06-25: > Mike, Michael, > > I was looking through outstanding patches to ad7879 and here they are. > Since I made some changes to the patches you wrote and there also some > new code and I do not have the hardware I'd appreciate if you could > try them out so they can be applied. > > Thank you. > Hi Dmitry, I tested your ad7879 patch set - A few issues see patch below. -Fix ad7879_probe() parameter passing. -Add missing input_set_drvdata() -Avoid unbalanced irq enable warning: disable_irq() after request. -Fix sysfs disable hook logic: the file is called disable so don't treat it as enable. Signed-off-by: Michael Hennerich <michael.hennerich@xxxxxxxxxx> drivers/input/touchscreen/ad7879-i2c.c | 2 +- drivers/input/touchscreen/ad7879-spi.c | 2 +- drivers/input/touchscreen/ad7879.c | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/ad7879-i2c.c b/drivers/input/touchscreen/ad7879-i2c.c index 79e3857..d82a38e 100644 --- a/drivers/input/touchscreen/ad7879-i2c.c +++ b/drivers/input/touchscreen/ad7879-i2c.c @@ -87,7 +87,7 @@ static int __devinit ad7879_i2c_probe(struct i2c_client *client, return -EIO; } - ts = ad7879_probe(&client->dev, client->irq, AD7879_DEVID, + ts = ad7879_probe(&client->dev, AD7879_DEVID, client->irq, &ad7879_i2c_bus_ops); if (IS_ERR(ts)) return PTR_ERR(ts); diff --git a/drivers/input/touchscreen/ad7879-spi.c b/drivers/input/touchscreen/ad7879-spi.c index 6e32f3a..9fa8e5d 100644 --- a/drivers/input/touchscreen/ad7879-spi.c +++ b/drivers/input/touchscreen/ad7879-spi.c @@ -141,7 +141,7 @@ static int __devinit ad7879_spi_probe(struct spi_device *spi) return -EINVAL; } - ts = ad7879_probe(&spi->dev, spi->irq, AD7879_DEVID, &ad7879_spi_bus_ops); + ts = ad7879_probe(&spi->dev, AD7879_DEVID, spi->irq, &ad7879_spi_bus_ops); if (IS_ERR(ts)) return PTR_ERR(ts); diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c index 4e2c1b7..1ac0713 100644 --- a/drivers/input/touchscreen/ad7879.c +++ b/drivers/input/touchscreen/ad7879.c @@ -315,7 +315,7 @@ static ssize_t ad7879_disable_store(struct device *dev, if (error) return error; - ad7879_toggle(ts, val); + ad7879_toggle(ts, !val); return count; } @@ -557,6 +557,8 @@ struct ad7879 *ad7879_probe(struct device *dev, u8 devid, unsigned int irq, goto err_free_mem; } + disable_irq(ts->irq); /* request_irq returns with irqs enabled */ + err = sysfs_create_group(&dev->kobj, &ad7879_attr_group); if (err) goto err_free_irq; @@ -565,6 +567,8 @@ struct ad7879 *ad7879_probe(struct device *dev, u8 devid, unsigned int irq, if (err) goto err_remove_attr; + input_set_drvdata(input_dev, ts); + err = input_register_device(input_dev); if (err) goto err_remove_gpio; Greetings, Michael Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 4036 Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
Attachment:
ad7879.patch
Description: ad7879.patch