struct work_struct poll_work;
wait_queue_head_t wq_data_avail;
const struct ad7606_bus_ops *bops;
- int irq;
- unsigned id;
unsigned range;
unsigned oversampling;
bool done;
struct iio_dev *ad7606_probe(struct device *dev, int irq,
void __iomem *base_address, unsigned id,
const struct ad7606_bus_ops *bops);
-int ad7606_remove(struct iio_dev *indio_dev);
+int ad7606_remove(struct iio_dev *indio_dev, int irq);
int ad7606_reset(struct ad7606_state *st);
enum ad7606_supported_device_ids {
st = iio_priv(indio_dev);
st->dev = dev;
- st->id = id;
- st->irq = irq;
st->bops = bops;
st->base_address = base_address;
st->range = pdata->default_range == 10000 ? 10000 : 5000;
if (ret)
dev_warn(st->dev, "failed to RESET: no RESET GPIO specified\n");
- ret = request_irq(st->irq, ad7606_interrupt,
+ ret = request_irq(irq, ad7606_interrupt,
IRQF_TRIGGER_FALLING, st->chip_info->name, indio_dev);
if (ret)
goto error_free_gpios;
ad7606_ring_cleanup(indio_dev);
error_free_irq:
- free_irq(st->irq, indio_dev);
+ free_irq(irq, indio_dev);
error_free_gpios:
ad7606_free_gpios(st);
return ERR_PTR(ret);
}
-int ad7606_remove(struct iio_dev *indio_dev)
+int ad7606_remove(struct iio_dev *indio_dev, int irq)
{
struct ad7606_state *st = iio_priv(indio_dev);
iio_buffer_unregister(indio_dev);
ad7606_ring_cleanup(indio_dev);
- free_irq(st->irq, indio_dev);
+ free_irq(irq, indio_dev);
if (!IS_ERR(st->reg)) {
regulator_disable(st->reg);
regulator_put(st->reg);
struct resource *res;
struct ad7606_state *st = iio_priv(indio_dev);
- ad7606_remove(indio_dev);
+ ad7606_remove(indio_dev, platform_get_irq(pdev, 0));
iounmap(st->base_address);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);