Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ad714x.h
Go to the documentation of this file.
1 /*
2  * AD714X CapTouch Programmable Controller driver (bus interfaces)
3  *
4  * Copyright 2009-2011 Analog Devices Inc.
5  *
6  * Licensed under the GPL-2 or later.
7  */
8 
9 #ifndef _AD714X_H_
10 #define _AD714X_H_
11 
12 #include <linux/types.h>
13 
14 #define STAGE_NUM 12
15 
16 struct device;
18 struct ad714x_driver_data;
19 struct ad714x_chip;
20 
21 typedef int (*ad714x_read_t)(struct ad714x_chip *, unsigned short, unsigned short *, size_t);
22 typedef int (*ad714x_write_t)(struct ad714x_chip *, unsigned short, unsigned short);
23 
24 struct ad714x_chip {
25  unsigned short l_state;
26  unsigned short h_state;
27  unsigned short c_state;
28  unsigned short adc_reg[STAGE_NUM];
29  unsigned short amb_reg[STAGE_NUM];
30  unsigned short sensor_val[STAGE_NUM];
31 
34 
35  int irq;
36  struct device *dev;
39 
40  struct mutex mutex;
41 
42  unsigned product;
43  unsigned version;
44 
46 
47 };
48 
49 int ad714x_disable(struct ad714x_chip *ad714x);
50 int ad714x_enable(struct ad714x_chip *ad714x);
51 struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq,
53 void ad714x_remove(struct ad714x_chip *ad714x);
54 
55 #endif