blob: 9cf2acf0784eb9d5234740be6c3ea319f5ed99c5 [file] [log] [blame]
Siddartha Mohanadoss53c16f92011-10-17 15:57:15 -07001#ifndef __EPM_ADC_H
2#define __EPM_ADC_H
3
4#include <linux/i2c.h>
5
6struct epm_chan_request {
7 /* EPM ADC device index. 0 - ADC1, 1 - ADC2 */
8 uint32_t device_idx;
9 /* Channel number within the EPM ADC device */
10 uint32_t channel_idx;
11 /* The data meaningful for each individual channel whether it is
12 * voltage, current etc. */
13 int32_t physical;
14};
15
Siddartha Mohanadoss79f975f2012-07-11 10:13:30 -070016#ifdef __KERNEL__
Siddartha Mohanadoss53c16f92011-10-17 15:57:15 -070017struct epm_chan_properties {
18 uint32_t resistorValue;
19 uint32_t gain;
20};
21
22struct epm_adc_platform_data {
23 struct epm_chan_properties *channel;
24 uint32_t num_channels;
25 uint32_t num_adc;
26 uint32_t chan_per_adc;
27 uint32_t chan_per_mux;
28 struct i2c_board_info epm_i2c_board_info;
29 uint32_t bus_id;
30 uint32_t gpio_expander_base_addr;
31};
Siddartha Mohanadoss79f975f2012-07-11 10:13:30 -070032#endif
Siddartha Mohanadosseb90c922012-03-27 22:58:06 -070033
34#define EPM_ADC_IOCTL_CODE 0x91
35
36#define EPM_ADC_REQUEST _IOWR(EPM_ADC_IOCTL_CODE, 1, \
37 struct epm_chan_request)
38
39#define EPM_ADC_INIT _IOR(EPM_ADC_IOCTL_CODE, 2, \
40 uint32_t)
41
42#define EPM_ADC_DEINIT _IOR(EPM_ADC_IOCTL_CODE, 3, \
43 uint32_t)
Siddartha Mohanadoss53c16f92011-10-17 15:57:15 -070044#endif /* __EPM_ADC_H */