Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ad7606.h
Go to the documentation of this file.
1 /*
2  * AD7606 ADC driver
3  *
4  * Copyright 2011 Analog Devices Inc.
5  *
6  * Licensed under the GPL-2.
7  */
8 
9 #ifndef IIO_ADC_AD7606_H_
10 #define IIO_ADC_AD7606_H_
11 
12 /*
13  * TODO: struct ad7606_platform_data needs to go into include/linux/iio
14  */
15 
31  unsigned default_os;
32  unsigned default_range;
33  unsigned gpio_convst;
34  unsigned gpio_reset;
35  unsigned gpio_range;
36  unsigned gpio_os0;
37  unsigned gpio_os1;
38  unsigned gpio_os2;
39  unsigned gpio_frstdata;
40  unsigned gpio_stby;
41 };
42 
52  const char *name;
54  const struct iio_chan_spec *channels;
55  unsigned num_channels;
56 };
57 
62 struct ad7606_state {
63  struct device *dev;
64  const struct ad7606_chip_info *chip_info;
66  struct regulator *reg;
69  const struct ad7606_bus_ops *bops;
70  unsigned range;
71  unsigned oversampling;
72  bool done;
74 
75  /*
76  * DMA (thus cache coherency maintenance) requires the
77  * transfer buffers to live in their own cache lines.
78  */
79 
80  unsigned short data[8] ____cacheline_aligned;
81 };
82 
84  /* more methods added in future? */
85  int (*read_block)(struct device *, int, void *);
86 };
87 
88 void ad7606_suspend(struct iio_dev *indio_dev);
89 void ad7606_resume(struct iio_dev *indio_dev);
90 struct iio_dev *ad7606_probe(struct device *dev, int irq,
91  void __iomem *base_address, unsigned id,
92  const struct ad7606_bus_ops *bops);
93 int ad7606_remove(struct iio_dev *indio_dev, int irq);
94 int ad7606_reset(struct ad7606_state *st);
95 
100 };
101 
102 int ad7606_register_ring_funcs_and_init(struct iio_dev *indio_dev);
103 void ad7606_ring_cleanup(struct iio_dev *indio_dev);
104 #endif /* IIO_ADC_AD7606_H_ */