summaryrefslogtreecommitdiffstats
path: root/include/linux/nvs.h
Commit message (Collapse)AuthorAge
* arm64: tegra186: nvs: Simplify nvs sensor definitionsRobert Collins2018-06-13
| | | | | | | | | | | | | | | | | | Sensor Kconfig definitions are simple and straightforward, but multiple entires in defconfig are required to run a single sensor. This change is intended to simplify that process such that a single defconfig entry will automatically enable the prerequisite Kconfig entries necessary to build the sensor drivers. Bug 2115403 Change-Id: I1375f96e19ecfe18f48db1efb5231e65f7e08b7a Signed-off-by: Robert Collins <rcollins@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1710797 Reviewed-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* misc: nvs: Add batch_read functionErik Lilliebjerg2018-03-14
| | | | | | | | | | | | | | | | | | | | | - Expand the kernel NVS API to include reading the period and timeout values the sensor HW is set to regardless of what the requested values are. This will address cache issues in the upper SW. - Started implementation of ABI by adding structure size and version. Bug 2009330 Bug 2059088 Change-Id: Id8f35b687c03d2f303ea64db774b08ad773e7516 Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1658067 Tested-by: Robert Collins <rcollins@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Robert Collins <rcollins@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
* misc: nvs: create common NVS moduleRobert Collins2017-07-18
| | | | | | | | | | | | - Create common NVidia Sensor framework module. - Add support for the kernel's INPUT subsystem. Change-Id: Iccd73a544570f15db1eb7911de034423ba982489 Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/1278898 GVS: Gerrit_Virtual_Submit Tested-by: Robert Collins <rcollins@nvidia.com> Reviewed-by: Robert Collins <rcollins@nvidia.com>
* iio: common: nvs: dynamic sensorsErik Lilliebjerg2017-07-18
| | | | | | | | | | | | | | - Add dynamic sensor support to kernel IIO subsystem. - Convert IIO kernel abstraction layer to be kernel 4.4 IIO compatible. Bug 1802888 Change-Id: I7bec665cab34f1c5d84335712aeddb96165d8e0e Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/1278896 GVS: Gerrit_Virtual_Submit Tested-by: Robert Collins <rcollins@nvidia.com> Reviewed-by: Robert Collins <rcollins@nvidia.com>
* iio: common: NVS HAL API 1.4 supportErik Lilliebjerg2017-07-18
| | | | | | | | | | | | | | | | | | - Add support for Android sensor HAL API 1.4: - Add API 1.4 sensor definitions. - Add dynamic sensor support. Bug 1802888 Bug 1795292 Change-Id: Id6ad4e6200d3d980b60e8fecd1408bd92014c682 Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/1206627 (cherry picked from commit f925bc0436cc478faec51d35f9cd1ddcee6052b9) Reviewed-on: http://git-master/r/1217190 Tested-by: Robert Collins <rcollins@nvidia.com> Reviewed-by: Akhilesh Khumbum <akhumbum@nvidia.com> Reviewed-by: Robert Collins <rcollins@nvidia.com>
* iio: imu: nvi v.334 ICM SMDErik Lilliebjerg2017-07-18
| | | | | | | | | | | | | | | - Fix ICM DMP FW v.2 significant motion default parameters. - Add realtime sensor configuration for significant motion. - Fix ICM DMP FW v.2 maximum period by limiting accelerometer slowest clock setting to gyros since the FW v.2 WAR requires the same speed. Bug 1768847 Change-Id: I8e3d2574019da6e2e9a0e0e574cc33cab363d490 Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/1177154 GVS: Gerrit_Virtual_Submit Reviewed-by: Robert Collins <rcollins@nvidia.com>
* iio: common: nvs: Fix one-shot batchErik Lilliebjerg2017-07-18
| | | | | | | | | | | | | | | | | - Remove batch attributes from one-shot sensors. - Add ability to call core functions with NULL parameters, basically just moving the validity checks to common code. Bug 200130656 Change-Id: I691895e71c069f32147e5de1bf59ef5b93c5ddd9 Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/928489 (cherry picked from commit 73dc497b63ba4d44764920d16a31d834371644f3) Reviewed-on: http://git-master/r/929114 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Robert Collins <rcollins@nvidia.com> Tested-by: Robert Collins <rcollins@nvidia.com>
* iio: common: NVS v209 common timestampsErik Lilliebjerg2017-07-18
| | | | | | | | | | | | | | | | | | | | - Create a common timestamp function for NVS sensor drivers. - Timestamp changed from ktime_get_ts to get_monotonic_boottime to address the timestamp change through suspend. - Removed the dependency of the NVI driver on NVS drivers supporting the NVI auxiliary bus. If NVI_MPU is not enabled then these drivers build without NVI auxiliary bus API support. Bug 200142073 Change-Id: I53b16bfb39b53015f3ee1e5418755f9b3f0cd132 Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/821141 (cherry picked from commit 7c5801f839a493f17fa81993cc6b2315716c737a) Reviewed-on: http://git-master/r/823553 Reviewed-by: Robert Collins <rcollins@nvidia.com> Tested-by: Robert Collins <rcollins@nvidia.com>
* iio: light: CM3217 index fix.Erik Lilliebjerg2017-07-18
| | | | | | | | | | | | | | | | | | | | | | - Fix possible table index out-of-bounds. - Change default threshold values to something in reality. - Add CM3217 debug light dump. NVS_IIO v208: - Add ability to read debug dump from HW driver without a write. - Add sensor name to debug prints. - Add functionality to returned calls from HW driver allowing simplification of HW driver code, specifically for multi-sensor drivers. Bug 200145232 Change-Id: I79d014569e236c70d8a3cdec2945fc0f22e43c07 Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/818914 (cherry picked from commit 2821e9f1d517169d21ac8b18b648afd27bf438a1) Reviewed-on: http://git-master/r/819834 GVS: Gerrit_Virtual_Submit Reviewed-by: Robert Collins <rcollins@nvidia.com> Tested-by: Robert Collins <rcollins@nvidia.com>
* iio: common: nvs: NVS v207 DT fixesErik Lilliebjerg2017-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Expanded the NVS device tree parsing return values to include the number of changes made to allow efficient processing for sensor hub. - Add documentation to the NVS device tree parsing call. - Fix drivers using the NVS device tree configuration call for the new change. - Add one-shot sensor support to the NVS IIO interface layer. - Fix the flags attribute debug print in the NVS IIO interface layer. - Fix a possible divide by 0 in the common ALS module. - Fix a possible divide by 0 in the common proximity module. - Fix calibration proximity reporting in common proximity module. - Add a configuration option to not reverse the proximity range if the HW supports this. Typically, the proximity HW value gets larger the closer an object gets. By default NVS reverses this by subtracting the value from the maximum possible value. The configuration option allows this feature to be disabled. Bug 200137195 Change-Id: Ia278cc298fe54cd67e1600f3039c70e69f898ed9 Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/805080 (cherry picked from commit 5a685485642d333c0ed75da5714ef734ca9dc363) Reviewed-on: http://git-master/r/807680 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Robert Collins <rcollins@nvidia.com> Tested-by: Robert Collins <rcollins@nvidia.com>
* iio: common: nvs: Fix threshold high attribute.Erik Lilliebjerg2017-07-18
| | | | | | | | | | | | | | | | | | | | | - Fix the old value on a threshold high attribute write. - Simplify ALS calibation by entering just the calibrated values at runtime. This is opposed to also having to enter uncalibrated values and only via the device tree. - Add ability to modify interpolation (calibrated and uncalibrated) values at runtime. Bug 1671144 Change-Id: I6a9b132d306a64f1fca3161f3520e6677d5f647b Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/777749 (cherry picked from commit 93077f4b94531b8aeae93eb7db892e9c8420f012) Reviewed-on: http://git-master/r/781168 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Robert Collins <rcollins@nvidia.com> Tested-by: Robert Collins <rcollins@nvidia.com>
* iio: common: nvs: L4T suspend/resumeErik Lilliebjerg2017-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | - Previously, NVS suspend disabled device for non-WAKE_UP devices. The resume did nothing letting the Android OS resume the devices (re-enable it). This change stores the enable state before disabling on suspend and restores it during resume, at the kernel level. The situation of the data being pushed to the IIO subsytem before ready is already addressed with the test if the IIO buffer is enabled. - Allow sensor configuration flags changes in realtime. flags is a member of the Android sensor list structure. This change allows some of the flags bits to be changed via the kernel driver's flags attribute. This allows runtime changes, specifically the ability to enable/disable the WAKE_UP bit (bit 0). Bug 200121777 Bug 200124449 Change-Id: Ib809e559fa99ecd42c9a8ba92901928862f5c4f9 Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/771497 (cherry picked from commit 168ddbb752581c71b3918080fbcd626edaef31b5) Reviewed-on: http://git-master/r/777022 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Robert Collins <rcollins@nvidia.com> Tested-by: Robert Collins <rcollins@nvidia.com>
* iio: Add sensor wake_up supportErik Lilliebjerg2017-07-18
| | | | | | | | | | | | | | | | | | | | | | | | - Add wake_up sensor type support. - Remove IIO dependencies from light and proximity headers for portability. - Add driver documentation. - Add ICM20628 compatibility label. - Add global disable allowing no driver interaction with device. - Fix interpolation 64-bit divide in light and proximity modules. - Fix CM32180 device parameter table. - Fix IQS2X6 Kconfig label. Bug 1646541 Change-Id: Ice6d2b435c7f60256ef36601f7c7aaefbcbc53b3 Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/746199 (cherry picked from commit 82bd8d8464c2539577e5987f69271afeddce37ec) Reviewed-on: http://git-master/r/754562 (cherry picked from commit 267c198922c6957c6b5f630eb1e9b1aef13035fd) Reviewed-on: http://git-master/r/770738 GVS: Gerrit_Virtual_Submit Reviewed-by: Robert Collins <rcollins@nvidia.com> Tested-by: Robert Collins <rcollins@nvidia.com>
* io: sensors: nvs does not compile if checking kernel locksPhilip Rakity2017-07-18
| | | | | | | | | | | | if CONFIG_DEBUG_LOCK_ALLOC is defined code will not compile. bug 1633263 Change-Id: Iedec9610ccf3fe1048f3a97c0ac1e6919074c33b Signed-off-by: Philip Rakity <prakity@nvidia.com> Reviewed-on: http://git-master/r/729094 Reviewed-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-by: Robert Collins <rcollins@nvidia.com>
* iio: sensors: Invensense NVS driverErik Lilliebjerg2017-07-18
| | | | | | | | | | | | | | | | - Invensense driver modified to NVS virtual driver. - Allows disabling sensors via DT. - Add FSYNC status byte DEPENDS ON: < http://git-master/r/#/c/716675 http://git-master/r/#/c/717371 > Bug 200056862 Change-Id: I2b7622e9db51d48e144f7a328bc219b2ea9c1401 Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/717371 Reviewed-by: Robert Collins <rcollins@nvidia.com> Tested-by: Robert Collins <rcollins@nvidia.com>
* sensors: Fix IIO buffer corruptionErik Lilliebjerg2017-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix buffer corruption during FIFO flush by preserving buffer offsets when data buffer pointer passed in is NULL. A NULL pointer signals a FIFO flush. - Expanded scale and offset per channel. - Abstract HW driver from Linux IIO allowing drop in for sensor hub RTOS. - The option to increase resolution from micro to nano from kernel for more floating point precision in user space. Used when fusion is not on AP. - Add a generic IIO sensor type for Linux sensor support, i.e. non-Android specific sensor. - Expand the IIO layer to allow for a status byte. Allows non-AP fusion as well as adds a sideband for FSYNC data, (sync signal from camera). - Allow for a data-less sensor event, (sends timestamp only). Think step and significant motion. - Allow for versatile timestamp size in case from sensor hub. - Add orientation matrix debug input. - Add debug output to light module. Bug 1612040 Change-Id: I34685676cd92790e033d05149fef3541f7d57400 Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/709626 Reviewed-by: Joshua Cha <joshuac@nvidia.com> Reviewed-by: Ira Zhuang <izhuang@nvidia.com> Reviewed-by: Robert Collins <rcollins@nvidia.com>
* iio: light: Add Android sensors API 1.3 support.Erik Lilliebjerg2017-07-18
| | | | | | | | | | | | | | | | | | | - Add support for SENSORS_DEVICE_API_VERSION_1_3 - Add support for LTR659PS - Add support for ISL2902x - Add common light (ALS) module - Add common proximity module - Fix JSA1127 overflows Bug 200032233 Change-Id: I2f3393b64de6ab85f32a7e019b991caec336cb78 Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/663645 (cherry picked from commit cf7c3261fe9485d265073587cdc04f8e6312fbee) Reviewed-on: http://git-master/r/657335 Reviewed-by: Robert Collins <rcollins@nvidia.com> Tested-by: Robert Collins <rcollins@nvidia.com>
* iio: core: add Android L support for sensorsErik Lilliebjerg2017-07-18
The Android L support includes adding attributes for batch/flush as well as defining the new sensor types. This change adds new API version 1.3 support, along with IIO extensions for new sensor types (ALS, PROX), and functions (BATCH, FLUSH). These are requirements of Android-L sensor manager. Bug 200032233 Bug 200043858 Change-Id: I148447cd70081cdb02ee196533159041fdd23d6a Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-on: http://git-master/r/590662 Tested-by: Jon Mayo <jmayo@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Jon Mayo <jmayo@nvidia.com>