The new Android sensor HAL requires more interfaces to communicate with
sensors driver. Change batching interface to meet the requirements. Sensor
drivers can use the interfaces to provide more features.
Change-Id: I7f3cbdcaa6f5473b038d1cdc07eb34685c1fca23
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Add enable_wakeup interface in sensors calss to provide an interface
for user space applications to control the wake up flag. The wake up
flag indicates if the driver works on wake up mode, which means it
can wake up the processor even it is in suspend mode.
Change-Id: I8edf145a190093a4c5384fd948b067b788b1fb1a
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
The sensors calibrate interface is a generic interface for sensor
calibrate. Add the interface for user space applications to calibrate
sensors. The interface can send the calibration data to userspace and
also get the calibration data form userspace to driver.
Change-Id: I156e1878f813e8ab0adfb3f2253cdd7fad65e55d
Signed-off-by: Daqing Chen <chendaqing@codeaurora.org>
Batch interface allow sensor events reported in batches, flush
interface is used to flush sensor FIFO. These two interface can
save device power by reduce the amount of device wakeup.
Sensor class provide generic interfaces for sensor drivers to access
by sensor HAL, drivers using sensors class should register corresponding
sensor class callback to export their interface.
Change-Id: I1307d731793dbc9a6a2b07de3b1de5188d0d8504
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
The self test interface is a generic interface for sensor self test.
Add the interface for user space applications to test sensors. Drivers
using sensors class should try to implement the callback if needed.
Change-Id: I008198534940c1357cfb1c7c4ff9b9b37beffdee
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
The sensor class driver will create the "enable" and "poll_delay"
handles in the "/sys/class/sensors/xxx/" for each sensor driver.
The userspace code could easily find the control interface by
searching the "/sys/class/sensors/" folder.
Change-Id: Ia18f062262e4b78db7d7de87acb49dfcf485063b
Signed-off-by: Jie Cheng <rockiec@codeaurora.org>
Add the sensor handle and type define for the sensor class device
drivers. The define is used for the sensor class device driver
parameters "handle" and "type". By using the define, people could
easily get the "handle" and "type" name.
Change-Id: I3e985a831d428fe3e921b2aecd8018b92d139302
Signed-off-by: Jie Cheng <rockiec@codeaurora.org>
Add a new sensors sysfs class and put all the sensors device driver
information in this class folder.
Change-Id: I7c35ec4642e4dbd264945ad3839914935b301af0
Signed-off-by: Jie Cheng <rockiec@codeaurora.org>