Add the sensor class device support for the kxtj9 accelerometer
sensor.
Change-Id: I4548c6787f8bc4654c1b3e08d65fa4cb1727bef5
Signed-off-by: Jie Cheng <rockiec@codeaurora.org>
The kxtj9 irq handling and enable/disable logic is not correctly
handled. Thus causing the sensor consumes more power.
Change-Id: I114e36c648d9c7e485d77ed5e490c518c93855d3
CRs-fixed: 580419
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
The cm36283 als sensor reported inaccurate illumination value
due to not calibrated on 8x10 MTP devices.
CRs-Fixed: 579407
Change-Id: Ie7239f11944579e3d107b3fe739844ceb764998b
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Mma8x5x accelerometer driver continue polling sensor data after
sensor power off, this is because power state flag has been added
into sensor state variable but control condition logic did not
update accordingly.
Change-Id: I4b2ad1a043782d9dea03c5af9a688a0cc4439186
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Device needs to turn off when both ambient light sensor and
proximity sensor is not enabled, this will maximize power saving.
Change-Id: I3195f180e065c1605029af37da4a65ce30612ac2
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Disable device regulators for power saving while device is not in
active state.
CRs-Fixed: 547435
Change-Id: I0984ef75e927d1b8e177782503bb3b2cfa8fa987
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
The driver outputs too much logs and affect debugging other issues.
Some more clean up is done in the patch to supress the checkpatch
failures and keep the code style consistency.
Change-Id: I8ad9eeb2e100ab3a6999c895c4e264e689d0702c
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Remove the MPU3040 gyroscope driver parent to allow the system
registers the driver in the "/sys/devices/virtual/input" folder.
The system will give the driver sysfs interface correct permission
according to the ueventd file.
CRs-Fixed: 510210
Change-Id: I957acc809005a06f6a8219140d8a4d609e46b435
Signed-off-by: Jie Cheng <rockiec@codeaurora.org>
Add FIR filter to process light sensor data of stk3x1x ALPS. This
filter is used to suppress data jitter which is caused by power
supply noise.
CRs-Fixed: 524706
Change-Id: Ic3a33621dffc69f198f0389efcb82aa0963efd97
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Change name of light sensor device that sensor HAL can distinguish
the device with other devices. Sensor HAL needs to distinguish different
devices because device drivers may use different sysfs interfaces and
may report different formats of data.
CRs-Fixed 524706
Change-Id: I3d2d31ef12c30abb9d884eda5b1248160aa2aceb
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Increase idle state polling interval for MMA8x5x to reduce power
consumption caused by idle polling.
CRs-Fixed: 542388
Change-Id: Id1e2c319e1310abfdf7d9ecd416c94c63d0e1768
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
The error handling routine in the previous code may cause
NULL pointer failure if probing error. Fix the issue by
re-arranging the error handling procedure.
Change-Id: I3529e00ccb92160011a622644bc10bedceda1c86
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Report cm36283 sensor input event via workqueue.
Change-Id: I9af0f70a8a3c46c23d1cc921015fa1d37b079f6c
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Add Capella cm36283 ambient light/proximity sensor devicetree support
to make it compatible with the current Linux kernel structure.
Change-Id: I23d7916480d1924b4a0a8121b2a587993a1d4b61
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Add cm36283 proximity and ambient light sensor suspend/resume
support.
Change-Id: Ibbe70955955487386bc190285675fb678c6e875c
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Fix cm36283 driver building error, which is caused by not compatible with
the current kernel source code.
Change-Id: If383201fac55f4fb701b869be0b3a6164f4d3ba4
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
The irq should be disabled after request_irq to avoid unbalanced irq.
Change-Id: Ic33c9061599a851072febac1bcc374b232644779
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Signed-off-by: Mallesh Koujalagi <malles@codeaurora.org>
The irq interrupt and i2c transfer should only happen when
the device boots up.
CRs-fixed: 519828
Change-Id: I28ec1d79e13b11137e2c009b5dcae765161ee9aa
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Sensor HAL library control sensors by read/write certain filesystem
node. So we need to change the attribute of these filesystem node
in sensor driver that HAL layer can access them.
Change-Id: I7fc9f93ace78755e913e42145b88cd84de236584
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Signed-off-by: Pan Fang <fangpan@codeaurora.org>
Kconfig and makefile entity is required to build Sitronix stk3x1x
light/proximity sensor driver.
Change-Id: I8a64d6b11ef7bae72af09744346ab90b762e1c33
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Power control function is required to request regulator and
configure supply voltage for device.
Power enable/disable function will be called to turn ON/OFF device
power supply.
Change-Id: Ie5dd587fdee06b2dbdf15941468838c4f46933c2
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Add device tree parser and binding document for Sensortek stk3x1x
series ambient light/proximity sensor.
Change-Id: I8e553da2856ecd42629a409347659e71dcdd8f2f
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Minor cleanup, only change those may cause potential problem.
Change-Id: I507135f0a24e831f00dc9217b80cba7f8e069f73
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
First version of Capella cm36283 ambient light/proximity sensor
driver which is provided by sensor vendor.
Change-Id: I4cf7dcb13e763e0b0236d3ee952fac5f9093640d
Signed-off-by: Joseph Hsiao <joseph.cy.hsiao@gmail.com>
Git-commit: 708b4ce7b1dd451f44a9981cbd58f4bca5aa9e5e
Git-repo: https://github.com/josephhsiao/capellamicro
[lix@codeaurora.org: Solve trivial compiling issue.]
Signed-off-by: Xiaocheng Li <lix@codeaurora.org>
[bingzhec@codeaurora.org: add more detail to commit text]
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Add the sensor power management in the enable sysfs interface,
through which the HAL layer could enable/disable the sensor.
Change-Id: I68d77a5085e2d80deedb273f0ff1e0d5664ba71c
Signed-off-by: Xiaocheng Li <lix@codeaurora.org>
Add the input data divider to adjust the sensor axis data.
Change-Id: Id85654d4bcaea956b53d724c782e74f821e47721
Signed-off-by: Xiaocheng Li <lix@codeaurora.org>
Add devicetree support in the bmp180 driver to parse and handle
the sensor device configuration information from DT. The regulator
config function is added to control the bmp180 vdd and vlogic
power.
Change-Id: Ia5bbe016b428ff5c75c6bc43a29fa937ed1e7ef7
Signed-off-by: Richard Liu <richardl@codeaurora.org>
Accelerometer Kionix kxtj9 always outputs 8-bit data because assign
a boolean value to bit mask variable. This patch will fix this and
also change the resolution control variable name from "res_12bit"
to "res_ctl" to avoid misleading.
Change-Id: I4784bfb18679a1a64941eafc80762241cdd825fe
Signed-off-by: Figo Wang <figow@codeaurora.org>