Export the epm header files for clients from userspace to send commands to the driver. Change-Id: I9b413f461da58cbf92aefeca9285ac6798468ea2 Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
45 lines
1003 B
C
45 lines
1003 B
C
#ifndef __EPM_ADC_H
|
|
#define __EPM_ADC_H
|
|
|
|
#include <linux/i2c.h>
|
|
|
|
struct epm_chan_request {
|
|
/* EPM ADC device index. 0 - ADC1, 1 - ADC2 */
|
|
uint32_t device_idx;
|
|
/* Channel number within the EPM ADC device */
|
|
uint32_t channel_idx;
|
|
/* The data meaningful for each individual channel whether it is
|
|
* voltage, current etc. */
|
|
int32_t physical;
|
|
};
|
|
|
|
#ifdef __KERNEL__
|
|
struct epm_chan_properties {
|
|
uint32_t resistorValue;
|
|
uint32_t gain;
|
|
};
|
|
|
|
struct epm_adc_platform_data {
|
|
struct epm_chan_properties *channel;
|
|
uint32_t num_channels;
|
|
uint32_t num_adc;
|
|
uint32_t chan_per_adc;
|
|
uint32_t chan_per_mux;
|
|
struct i2c_board_info epm_i2c_board_info;
|
|
uint32_t bus_id;
|
|
uint32_t gpio_expander_base_addr;
|
|
};
|
|
#endif
|
|
|
|
#define EPM_ADC_IOCTL_CODE 0x91
|
|
|
|
#define EPM_ADC_REQUEST _IOWR(EPM_ADC_IOCTL_CODE, 1, \
|
|
struct epm_chan_request)
|
|
|
|
#define EPM_ADC_INIT _IOR(EPM_ADC_IOCTL_CODE, 2, \
|
|
uint32_t)
|
|
|
|
#define EPM_ADC_DEINIT _IOR(EPM_ADC_IOCTL_CODE, 3, \
|
|
uint32_t)
|
|
#endif /* __EPM_ADC_H */
|