summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorErik Lilliebjerg <elilliebjerg@nvidia.com>2015-05-22 09:43:43 -0400
committerRobert Collins <rcollins@nvidia.com>2017-07-17 17:32:21 -0400
commitfe5bebef2f85cf4834f6db56c43d4cb0f25cdac8 (patch)
tree29025f74b74aa12616bec2fa6f1dbce48227c307 /include/linux
parent220b44eb725b24c7b9025747230b486db8e172c3 (diff)
iio: Add sensor wake_up support
- 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>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nvs_light.h39
1 files changed, 1 insertions, 38 deletions
diff --git a/include/linux/nvs_light.h b/include/linux/nvs_light.h
index d5058dabd..9d04fea25 100644
--- a/include/linux/nvs_light.h
+++ b/include/linux/nvs_light.h
@@ -14,7 +14,6 @@
14#ifndef _NVS_LIGHT_H_ 14#ifndef _NVS_LIGHT_H_
15#define _NVS_LIGHT_H_ 15#define _NVS_LIGHT_H_
16 16
17#include <linux/iio/iio.h>
18#include <linux/of.h> 17#include <linux/of.h>
19#include <linux/nvs.h> 18#include <linux/nvs.h>
20 19
@@ -23,7 +22,6 @@
23#define RET_HW_UPDATE (1) 22#define RET_HW_UPDATE (1)
24 23
25#define NVS_LIGHT_STRING "light" 24#define NVS_LIGHT_STRING "light"
26#define SENSOR_FLAG_ON_CHANGE_MODE 0x2 /* from AOS sensors.h */
27 25
28/** 26/**
29 * struct nvs_light_dynamic - the structure that allows the NVS 27 * struct nvs_light_dynamic - the structure that allows the NVS
@@ -108,45 +106,10 @@ struct nvs_light {
108 unsigned int nld_i_hi; /* high index limit to dynamic table */ 106 unsigned int nld_i_hi; /* high index limit to dynamic table */
109 struct nvs_light_dynamic *nld_tbl; /* ptr to nvs_light_dynamic table */ 107 struct nvs_light_dynamic *nld_tbl; /* ptr to nvs_light_dynamic table */
110 struct sensor_cfg *cfg; /* pointer to sensor configuration */ 108 struct sensor_cfg *cfg; /* pointer to sensor configuration */
111 void *nvs_data; /* NVS data for NVS handler */ 109 void *nvs_st; /* NVS state data for NVS handler */
112 int (*handler)(void *handle, void *buffer, s64 ts); 110 int (*handler)(void *handle, void *buffer, s64 ts);
113}; 111};
114 112
115static const struct iio_chan_spec iio_chan_spec_nvs_light[] = {
116 {
117 .type = IIO_LIGHT,
118 .scan_type = { .sign = 'u',
119 .realbits = 32,
120 .storagebits = 32,
121 .endianness = IIO_CPU,
122 },
123 .info_mask_shared_by_all
124 = BIT(IIO_CHAN_INFO_RAW) |
125 BIT(IIO_CHAN_INFO_BATCH_FLUSH) |
126 BIT(IIO_CHAN_INFO_BATCH_PERIOD) |
127 BIT(IIO_CHAN_INFO_BATCH_TIMEOUT) |
128 BIT(IIO_CHAN_INFO_BATCH_FLAGS) |
129 BIT(IIO_CHAN_INFO_PEAK) |
130 BIT(IIO_CHAN_INFO_PEAK_SCALE) |
131 BIT(IIO_CHAN_INFO_SCALE) |
132 BIT(IIO_CHAN_INFO_OFFSET) |
133 BIT(IIO_CHAN_INFO_THRESHOLD_LOW) |
134 BIT(IIO_CHAN_INFO_THRESHOLD_HIGH),
135 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
136 BIT(IIO_CHAN_INFO_BATCH_FLUSH) |
137 BIT(IIO_CHAN_INFO_BATCH_PERIOD) |
138 BIT(IIO_CHAN_INFO_BATCH_TIMEOUT) |
139 BIT(IIO_CHAN_INFO_BATCH_FLAGS) |
140 BIT(IIO_CHAN_INFO_PEAK) |
141 BIT(IIO_CHAN_INFO_PEAK_SCALE) |
142 BIT(IIO_CHAN_INFO_SCALE) |
143 BIT(IIO_CHAN_INFO_OFFSET) |
144 BIT(IIO_CHAN_INFO_THRESHOLD_LOW) |
145 BIT(IIO_CHAN_INFO_THRESHOLD_HIGH),
146 },
147 IIO_CHAN_SOFT_TIMESTAMP(1)
148};
149
150int nvs_light_read(struct nvs_light *nl); 113int nvs_light_read(struct nvs_light *nl);
151int nvs_light_enable(struct nvs_light *nl); 114int nvs_light_enable(struct nvs_light *nl);
152int nvs_light_of_dt(struct nvs_light *nl, const struct device_node *np, 115int nvs_light_of_dt(struct nvs_light *nl, const struct device_node *np,