@@ -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);
@@ -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);
@@ -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;