Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ams.h
Go to the documentation of this file.
1 #include <linux/i2c.h>
2 #include <linux/input-polldev.h>
3 #include <linux/kthread.h>
4 #include <linux/mutex.h>
5 #include <linux/spinlock.h>
6 #include <linux/types.h>
7 #include <linux/of_device.h>
8 
9 enum ams_irq {
11  AMS_IRQ_SHOCK = 0x02,
17 };
18 
19 struct ams {
20  /* Locks */
22  struct mutex lock;
23 
24  /* General properties */
27  char has_device;
28  char vflag;
31 
32  /* Interrupt worker */
35 
36  /* Implementation
37  *
38  * Only call these functions with the main lock held.
39  */
40  void (*exit)(void);
41 
42  void (*get_xyz)(s8 *x, s8 *y, s8 *z);
44 
46 
47 #ifdef CONFIG_SENSORS_AMS_I2C
48  /* I2C properties */
49  struct i2c_client *i2c_client;
50 #endif
51 
52  /* Joystick emulation */
53  struct input_polled_dev *idev;
55 
56  /* calibrated null values */
58 };
59 
60 extern struct ams ams_info;
61 
62 extern void ams_sensors(s8 *x, s8 *y, s8 *z);
63 extern int ams_sensor_attach(void);
64 extern void ams_sensor_detach(void);
65 
66 extern int ams_pmu_init(struct device_node *np);
67 extern int ams_i2c_init(struct device_node *np);
68 
69 extern int ams_input_init(void);
70 extern void ams_input_exit(void);