This driver adds support for Sharp's GP2AP002A00F proximity sensor. The proximity is measured as a binary switch, i.e. an object is either detected or not detected. Hence, this driver is implemented as a switch that reports SW_FRONT_PROXIMITY.
Showing the changes to include/linux/input (1 of 4 files). Show all
Unified · Split
| @@ -0,0 +1,22 @@ | |||
| 1 | #ifndef _GP2AP002A00F_H_ | ||
| 2 | #define _GP2AP002A00F_H_ | ||
| 3 | |||
| 4 | #include <linux/i2c.h> | ||
| 5 | |||
| 6 | #define GP2A_I2C_NAME "gp2ap002a00f" | ||
| 7 | |||
| 8 | /** | ||
| 9 | * struct gp2a_platform_data - Sharp gp2ap002a00f proximity platform data | ||
| 10 | * @vout_gpio: The gpio connected to the object detected pin (VOUT) | ||
| 11 | * @wakeup: Set to true if the proximity can wake the device from suspend | ||
| 12 | * @hw_setup: Callback for setting up hardware such as gpios and vregs | ||
| 13 | * @hw_shutdown: Callback for properly shutting down hardware | ||
| 14 | */ | ||
| 15 | struct gp2a_platform_data { | ||
| 16 | int vout_gpio; | ||
| 17 | bool wakeup; | ||
| 18 | int (*hw_setup)(struct i2c_client *client); | ||
| 19 | int (*hw_shutdown)(struct i2c_client *client); | ||
| 20 | }; | ||
| 21 | |||
| 22 | #endif | ||