0001
0002
0003
0004
0005
0006
0007
0008 #ifndef _AD714X_H_
0009 #define _AD714X_H_
0010
0011 #include <linux/types.h>
0012
0013 #define STAGE_NUM 12
0014
0015 struct device;
0016 struct ad714x_platform_data;
0017 struct ad714x_driver_data;
0018 struct ad714x_chip;
0019
0020 typedef int (*ad714x_read_t)(struct ad714x_chip *, unsigned short, unsigned short *, size_t);
0021 typedef int (*ad714x_write_t)(struct ad714x_chip *, unsigned short, unsigned short);
0022
0023 struct ad714x_chip {
0024 unsigned short l_state;
0025 unsigned short h_state;
0026 unsigned short c_state;
0027 unsigned short adc_reg[STAGE_NUM];
0028 unsigned short amb_reg[STAGE_NUM];
0029 unsigned short sensor_val[STAGE_NUM];
0030
0031 struct ad714x_platform_data *hw;
0032 struct ad714x_driver_data *sw;
0033
0034 int irq;
0035 struct device *dev;
0036 ad714x_read_t read;
0037 ad714x_write_t write;
0038
0039 struct mutex mutex;
0040
0041 unsigned product;
0042 unsigned version;
0043
0044 __be16 xfer_buf[16] ____cacheline_aligned;
0045
0046 };
0047
0048 int ad714x_disable(struct ad714x_chip *ad714x);
0049 int ad714x_enable(struct ad714x_chip *ad714x);
0050 struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
0051 ad714x_read_t read, ad714x_write_t write);
0052
0053 #endif