xref: /openbmc/linux/include/linux/input/adxl34x.h (revision 176eb8dc)
1e27c7292SMichael Hennerich /*
2e27c7292SMichael Hennerich  * include/linux/input/adxl34x.h
3e27c7292SMichael Hennerich  *
4e27c7292SMichael Hennerich  * Digital Accelerometer characteristics are highly application specific
5e27c7292SMichael Hennerich  * and may vary between boards and models. The platform_data for the
6e27c7292SMichael Hennerich  * device's "struct device" holds this information.
7e27c7292SMichael Hennerich  *
8e27c7292SMichael Hennerich  * Copyright 2009 Analog Devices Inc.
9e27c7292SMichael Hennerich  *
10e27c7292SMichael Hennerich  * Licensed under the GPL-2 or later.
11e27c7292SMichael Hennerich  */
12e27c7292SMichael Hennerich 
13e27c7292SMichael Hennerich #ifndef __LINUX_INPUT_ADXL34X_H__
14e27c7292SMichael Hennerich #define __LINUX_INPUT_ADXL34X_H__
15e27c7292SMichael Hennerich 
16176eb8dcSWolfram Sang #include <linux/input.h>
17176eb8dcSWolfram Sang 
18e27c7292SMichael Hennerich struct adxl34x_platform_data {
19e27c7292SMichael Hennerich 
20e27c7292SMichael Hennerich 	/*
21e27c7292SMichael Hennerich 	 * X,Y,Z Axis Offset:
22e27c7292SMichael Hennerich 	 * offer user offset adjustments in twoscompliment
23e27c7292SMichael Hennerich 	 * form with a scale factor of 15.6 mg/LSB (i.e. 0x7F = +2 g)
24e27c7292SMichael Hennerich 	 */
25e27c7292SMichael Hennerich 
26e27c7292SMichael Hennerich 	s8 x_axis_offset;
27e27c7292SMichael Hennerich 	s8 y_axis_offset;
28e27c7292SMichael Hennerich 	s8 z_axis_offset;
29e27c7292SMichael Hennerich 
30e27c7292SMichael Hennerich 	/*
31e27c7292SMichael Hennerich 	 * TAP_X/Y/Z Enable: Setting TAP_X, Y, or Z Enable enables X,
32e27c7292SMichael Hennerich 	 * Y, or Z participation in Tap detection. A '0' excludes the
33e27c7292SMichael Hennerich 	 * selected axis from participation in Tap detection.
34e27c7292SMichael Hennerich 	 * Setting the SUPPRESS bit suppresses Double Tap detection if
355eb9f900SMichael Tandy 	 * acceleration greater than tap_threshold is present during the
365eb9f900SMichael Tandy 	 * tap_latency period, i.e. after the first tap but before the
375eb9f900SMichael Tandy 	 * opening of the second tap window.
38e27c7292SMichael Hennerich 	 */
39e27c7292SMichael Hennerich 
40e27c7292SMichael Hennerich #define ADXL_SUPPRESS	(1 << 3)
41e27c7292SMichael Hennerich #define ADXL_TAP_X_EN	(1 << 2)
42e27c7292SMichael Hennerich #define ADXL_TAP_Y_EN	(1 << 1)
43e27c7292SMichael Hennerich #define ADXL_TAP_Z_EN	(1 << 0)
44e27c7292SMichael Hennerich 
45e27c7292SMichael Hennerich 	u8 tap_axis_control;
46e27c7292SMichael Hennerich 
47e27c7292SMichael Hennerich 	/*
48e27c7292SMichael Hennerich 	 * tap_threshold:
49e27c7292SMichael Hennerich 	 * holds the threshold value for tap detection/interrupts.
50e27c7292SMichael Hennerich 	 * The data format is unsigned. The scale factor is 62.5 mg/LSB
51e27c7292SMichael Hennerich 	 * (i.e. 0xFF = +16 g). A zero value may result in undesirable
52e27c7292SMichael Hennerich 	 * behavior if Tap/Double Tap is enabled.
53e27c7292SMichael Hennerich 	 */
54e27c7292SMichael Hennerich 
55e27c7292SMichael Hennerich 	u8 tap_threshold;
56e27c7292SMichael Hennerich 
57e27c7292SMichael Hennerich 	/*
58e27c7292SMichael Hennerich 	 * tap_duration:
59e27c7292SMichael Hennerich 	 * is an unsigned time value representing the maximum
60e27c7292SMichael Hennerich 	 * time that an event must be above the tap_threshold threshold
61e27c7292SMichael Hennerich 	 * to qualify as a tap event. The scale factor is 625 us/LSB. A zero
62e27c7292SMichael Hennerich 	 * value will prevent Tap/Double Tap functions from working.
63e27c7292SMichael Hennerich 	 */
64e27c7292SMichael Hennerich 
65e27c7292SMichael Hennerich 	u8 tap_duration;
66e27c7292SMichael Hennerich 
67e27c7292SMichael Hennerich 	/*
68e27c7292SMichael Hennerich 	 * tap_latency:
69e27c7292SMichael Hennerich 	 * is an unsigned time value representing the wait time
70e27c7292SMichael Hennerich 	 * from the detection of a tap event to the opening of the time
71e27c7292SMichael Hennerich 	 * window tap_window for a possible second tap event. The scale
72e27c7292SMichael Hennerich 	 * factor is 1.25 ms/LSB. A zero value will disable the Double Tap
73e27c7292SMichael Hennerich 	 * function.
74e27c7292SMichael Hennerich 	 */
75e27c7292SMichael Hennerich 
76e27c7292SMichael Hennerich 	u8 tap_latency;
77e27c7292SMichael Hennerich 
78e27c7292SMichael Hennerich 	/*
79e27c7292SMichael Hennerich 	 * tap_window:
80e27c7292SMichael Hennerich 	 * is an unsigned time value representing the amount
81e27c7292SMichael Hennerich 	 * of time after the expiration of tap_latency during which a second
82e27c7292SMichael Hennerich 	 * tap can begin. The scale factor is 1.25 ms/LSB. A zero value will
83e27c7292SMichael Hennerich 	 * disable the Double Tap function.
84e27c7292SMichael Hennerich 	 */
85e27c7292SMichael Hennerich 
86e27c7292SMichael Hennerich 	u8 tap_window;
87e27c7292SMichael Hennerich 
88e27c7292SMichael Hennerich 	/*
89e27c7292SMichael Hennerich 	 * act_axis_control:
90e27c7292SMichael Hennerich 	 * X/Y/Z Enable: A '1' enables X, Y, or Z participation in activity
91e27c7292SMichael Hennerich 	 * or inactivity detection. A '0' excludes the selected axis from
92e27c7292SMichael Hennerich 	 * participation. If all of the axes are excluded, the function is
93e27c7292SMichael Hennerich 	 * disabled.
94e27c7292SMichael Hennerich 	 * AC/DC: A '0' = DC coupled operation and a '1' = AC coupled
95e27c7292SMichael Hennerich 	 * operation. In DC coupled operation, the current acceleration is
96e27c7292SMichael Hennerich 	 * compared with activity_threshold and inactivity_threshold directly
97e27c7292SMichael Hennerich 	 * to determine whether activity or inactivity is detected. In AC
98e27c7292SMichael Hennerich 	 * coupled operation for activity detection, the acceleration value
99e27c7292SMichael Hennerich 	 * at the start of activity detection is taken as a reference value.
100e27c7292SMichael Hennerich 	 * New samples of acceleration are then compared to this
101e27c7292SMichael Hennerich 	 * reference value and if the magnitude of the difference exceeds
102e27c7292SMichael Hennerich 	 * activity_threshold the device will trigger an activity interrupt. In
103e27c7292SMichael Hennerich 	 * AC coupled operation for inactivity detection, a reference value
104e27c7292SMichael Hennerich 	 * is used again for comparison and is updated whenever the
105e27c7292SMichael Hennerich 	 * device exceeds the inactivity threshold. Once the reference
106e27c7292SMichael Hennerich 	 * value is selected, the device compares the magnitude of the
107e27c7292SMichael Hennerich 	 * difference between the reference value and the current
108e27c7292SMichael Hennerich 	 * acceleration with inactivity_threshold. If the difference is below
109e27c7292SMichael Hennerich 	 * inactivity_threshold for a total of inactivity_time, the device is
110e27c7292SMichael Hennerich 	 * considered inactive and the inactivity interrupt is triggered.
111e27c7292SMichael Hennerich 	 */
112e27c7292SMichael Hennerich 
113e27c7292SMichael Hennerich #define ADXL_ACT_ACDC		(1 << 7)
114e27c7292SMichael Hennerich #define ADXL_ACT_X_EN		(1 << 6)
115e27c7292SMichael Hennerich #define ADXL_ACT_Y_EN		(1 << 5)
116e27c7292SMichael Hennerich #define ADXL_ACT_Z_EN		(1 << 4)
117e27c7292SMichael Hennerich #define ADXL_INACT_ACDC		(1 << 3)
118e27c7292SMichael Hennerich #define ADXL_INACT_X_EN		(1 << 2)
119e27c7292SMichael Hennerich #define ADXL_INACT_Y_EN		(1 << 1)
120e27c7292SMichael Hennerich #define ADXL_INACT_Z_EN		(1 << 0)
121e27c7292SMichael Hennerich 
122e27c7292SMichael Hennerich 	u8 act_axis_control;
123e27c7292SMichael Hennerich 
124e27c7292SMichael Hennerich 	/*
125e27c7292SMichael Hennerich 	 * activity_threshold:
126e27c7292SMichael Hennerich 	 * holds the threshold value for activity detection.
127e27c7292SMichael Hennerich 	 * The data format is unsigned. The scale factor is
128e27c7292SMichael Hennerich 	 * 62.5 mg/LSB. A zero value may result in undesirable behavior if
129e27c7292SMichael Hennerich 	 * Activity interrupt is enabled.
130e27c7292SMichael Hennerich 	 */
131e27c7292SMichael Hennerich 
132e27c7292SMichael Hennerich 	u8 activity_threshold;
133e27c7292SMichael Hennerich 
134e27c7292SMichael Hennerich 	/*
135e27c7292SMichael Hennerich 	 * inactivity_threshold:
136e27c7292SMichael Hennerich 	 * holds the threshold value for inactivity
137e27c7292SMichael Hennerich 	 * detection. The data format is unsigned. The scale
138e27c7292SMichael Hennerich 	 * factor is 62.5 mg/LSB. A zero value may result in undesirable
139e27c7292SMichael Hennerich 	 * behavior if Inactivity interrupt is enabled.
140e27c7292SMichael Hennerich 	 */
141e27c7292SMichael Hennerich 
142e27c7292SMichael Hennerich 	u8 inactivity_threshold;
143e27c7292SMichael Hennerich 
144e27c7292SMichael Hennerich 	/*
145e27c7292SMichael Hennerich 	 * inactivity_time:
146e27c7292SMichael Hennerich 	 * is an unsigned time value representing the
147e27c7292SMichael Hennerich 	 * amount of time that acceleration must be below the value in
148e27c7292SMichael Hennerich 	 * inactivity_threshold for inactivity to be declared. The scale factor
149e27c7292SMichael Hennerich 	 * is 1 second/LSB. Unlike the other interrupt functions, which
150e27c7292SMichael Hennerich 	 * operate on unfiltered data, the inactivity function operates on the
151e27c7292SMichael Hennerich 	 * filtered output data. At least one output sample must be
152e27c7292SMichael Hennerich 	 * generated for the inactivity interrupt to be triggered. This will
153e27c7292SMichael Hennerich 	 * result in the function appearing un-responsive if the
154e27c7292SMichael Hennerich 	 * inactivity_time register is set with a value less than the time
155e27c7292SMichael Hennerich 	 * constant of the Output Data Rate. A zero value will result in an
156e27c7292SMichael Hennerich 	 * interrupt when the output data is below inactivity_threshold.
157e27c7292SMichael Hennerich 	 */
158e27c7292SMichael Hennerich 
159e27c7292SMichael Hennerich 	u8 inactivity_time;
160e27c7292SMichael Hennerich 
161e27c7292SMichael Hennerich 	/*
162e27c7292SMichael Hennerich 	 * free_fall_threshold:
163e27c7292SMichael Hennerich 	 * holds the threshold value for Free-Fall detection.
164e27c7292SMichael Hennerich 	 * The data format is unsigned. The root-sum-square(RSS) value
165e27c7292SMichael Hennerich 	 * of all axes is calculated and compared to the value in
166e27c7292SMichael Hennerich 	 * free_fall_threshold to determine if a free fall event may be
167e27c7292SMichael Hennerich 	 * occurring.  The scale factor is 62.5 mg/LSB. A zero value may
168e27c7292SMichael Hennerich 	 * result in undesirable behavior if Free-Fall interrupt is
169e27c7292SMichael Hennerich 	 * enabled. Values between 300 and 600 mg (0x05 to 0x09) are
170e27c7292SMichael Hennerich 	 * recommended.
171e27c7292SMichael Hennerich 	 */
172e27c7292SMichael Hennerich 
173e27c7292SMichael Hennerich 	u8 free_fall_threshold;
174e27c7292SMichael Hennerich 
175e27c7292SMichael Hennerich 	/*
176e27c7292SMichael Hennerich 	 * free_fall_time:
177e27c7292SMichael Hennerich 	 * is an unsigned time value representing the minimum
178e27c7292SMichael Hennerich 	 * time that the RSS value of all axes must be less than
179e27c7292SMichael Hennerich 	 * free_fall_threshold to generate a Free-Fall interrupt. The
180e27c7292SMichael Hennerich 	 * scale factor is 5 ms/LSB. A zero value may result in
181e27c7292SMichael Hennerich 	 * undesirable behavior if Free-Fall interrupt is enabled.
182e27c7292SMichael Hennerich 	 * Values between 100 to 350 ms (0x14 to 0x46) are recommended.
183e27c7292SMichael Hennerich 	 */
184e27c7292SMichael Hennerich 
185e27c7292SMichael Hennerich 	u8 free_fall_time;
186e27c7292SMichael Hennerich 
187e27c7292SMichael Hennerich 	/*
188e27c7292SMichael Hennerich 	 * data_rate:
189e27c7292SMichael Hennerich 	 * Selects device bandwidth and output data rate.
190e27c7292SMichael Hennerich 	 * RATE = 3200 Hz / (2^(15 - x)). Default value is 0x0A, or 100 Hz
191e27c7292SMichael Hennerich 	 * Output Data Rate. An Output Data Rate should be selected that
192e27c7292SMichael Hennerich 	 * is appropriate for the communication protocol and frequency
193e27c7292SMichael Hennerich 	 * selected. Selecting too high of an Output Data Rate with a low
194e27c7292SMichael Hennerich 	 * communication speed will result in samples being discarded.
195e27c7292SMichael Hennerich 	 */
196e27c7292SMichael Hennerich 
197e27c7292SMichael Hennerich 	u8 data_rate;
198e27c7292SMichael Hennerich 
199e27c7292SMichael Hennerich 	/*
200e27c7292SMichael Hennerich 	 * data_range:
201e27c7292SMichael Hennerich 	 * FULL_RES: When this bit is set with the device is
202e27c7292SMichael Hennerich 	 * in Full-Resolution Mode, where the output resolution increases
203e27c7292SMichael Hennerich 	 * with RANGE to maintain a 4 mg/LSB scale factor. When this
204e27c7292SMichael Hennerich 	 * bit is cleared the device is in 10-bit Mode and RANGE determine the
205e27c7292SMichael Hennerich 	 * maximum g-Range and scale factor.
206e27c7292SMichael Hennerich 	 */
207e27c7292SMichael Hennerich 
208e27c7292SMichael Hennerich #define ADXL_FULL_RES		(1 << 3)
209e27c7292SMichael Hennerich #define ADXL_RANGE_PM_2g	0
210e27c7292SMichael Hennerich #define ADXL_RANGE_PM_4g	1
211e27c7292SMichael Hennerich #define ADXL_RANGE_PM_8g	2
212e27c7292SMichael Hennerich #define ADXL_RANGE_PM_16g	3
213e27c7292SMichael Hennerich 
214e27c7292SMichael Hennerich 	u8 data_range;
215e27c7292SMichael Hennerich 
216e27c7292SMichael Hennerich 	/*
217e27c7292SMichael Hennerich 	 * low_power_mode:
218e27c7292SMichael Hennerich 	 * A '0' = Normal operation and a '1' = Reduced
219e27c7292SMichael Hennerich 	 * power operation with somewhat higher noise.
220e27c7292SMichael Hennerich 	 */
221e27c7292SMichael Hennerich 
222e27c7292SMichael Hennerich 	u8 low_power_mode;
223e27c7292SMichael Hennerich 
224e27c7292SMichael Hennerich 	/*
225e27c7292SMichael Hennerich 	 * power_mode:
226e27c7292SMichael Hennerich 	 * LINK: A '1' with both the activity and inactivity functions
227e27c7292SMichael Hennerich 	 * enabled will delay the start of the activity function until
228e27c7292SMichael Hennerich 	 * inactivity is detected. Once activity is detected, inactivity
229e27c7292SMichael Hennerich 	 * detection will begin and prevent the detection of activity. This
230e27c7292SMichael Hennerich 	 * bit serially links the activity and inactivity functions. When '0'
231e27c7292SMichael Hennerich 	 * the inactivity and activity functions are concurrent. Additional
2325eb9f900SMichael Tandy 	 * information can be found in the ADXL34x datasheet's Application
2335eb9f900SMichael Tandy 	 * section under Link Mode.
234e27c7292SMichael Hennerich 	 * AUTO_SLEEP: A '1' sets the ADXL34x to switch to Sleep Mode
235e27c7292SMichael Hennerich 	 * when inactivity (acceleration has been below inactivity_threshold
236e27c7292SMichael Hennerich 	 * for at least inactivity_time) is detected and the LINK bit is set.
2375eb9f900SMichael Tandy 	 * A '0' disables automatic switching to Sleep Mode. See the
2385eb9f900SMichael Tandy 	 * Sleep Bit section of the ADXL34x datasheet for more information.
239e27c7292SMichael Hennerich 	 */
240e27c7292SMichael Hennerich 
241e27c7292SMichael Hennerich #define ADXL_LINK	(1 << 5)
242e27c7292SMichael Hennerich #define ADXL_AUTO_SLEEP	(1 << 4)
243e27c7292SMichael Hennerich 
244e27c7292SMichael Hennerich 	u8 power_mode;
245e27c7292SMichael Hennerich 
246e27c7292SMichael Hennerich 	/*
247e27c7292SMichael Hennerich 	 * fifo_mode:
248e27c7292SMichael Hennerich 	 * BYPASS The FIFO is bypassed
249e27c7292SMichael Hennerich 	 * FIFO   FIFO collects up to 32 values then stops collecting data
250e27c7292SMichael Hennerich 	 * STREAM FIFO holds the last 32 data values. Once full, the FIFO's
251e27c7292SMichael Hennerich 	 *        oldest data is lost as it is replaced with newer data
252e27c7292SMichael Hennerich 	 *
253e27c7292SMichael Hennerich 	 * DEFAULT should be ADXL_FIFO_STREAM
254e27c7292SMichael Hennerich 	 */
255e27c7292SMichael Hennerich 
256e27c7292SMichael Hennerich #define ADXL_FIFO_BYPASS	0
257e27c7292SMichael Hennerich #define ADXL_FIFO_FIFO		1
258e27c7292SMichael Hennerich #define ADXL_FIFO_STREAM	2
259e27c7292SMichael Hennerich 
260e27c7292SMichael Hennerich 	u8 fifo_mode;
261e27c7292SMichael Hennerich 
262e27c7292SMichael Hennerich 	/*
263e27c7292SMichael Hennerich 	 * watermark:
264e27c7292SMichael Hennerich 	 * The Watermark feature can be used to reduce the interrupt load
265e27c7292SMichael Hennerich 	 * of the system. The FIFO fills up to the value stored in watermark
266e27c7292SMichael Hennerich 	 * [1..32] and then generates an interrupt.
267e27c7292SMichael Hennerich 	 * A '0' disables the watermark feature.
268e27c7292SMichael Hennerich 	 */
269e27c7292SMichael Hennerich 
270e27c7292SMichael Hennerich 	u8 watermark;
271e27c7292SMichael Hennerich 
2725eb9f900SMichael Tandy 	/*
2735eb9f900SMichael Tandy 	 * When acceleration measurements are received from the ADXL34x
2745eb9f900SMichael Tandy 	 * events are sent to the event subsystem. The following settings
2755eb9f900SMichael Tandy 	 * select the event type and event code for new x, y and z axis data
2765eb9f900SMichael Tandy 	 * respectively.
2775eb9f900SMichael Tandy 	 */
278e27c7292SMichael Hennerich 	u32 ev_type;	/* EV_ABS or EV_REL */
279e27c7292SMichael Hennerich 
280e27c7292SMichael Hennerich 	u32 ev_code_x;	/* ABS_X,Y,Z or REL_X,Y,Z */
281e27c7292SMichael Hennerich 	u32 ev_code_y;	/* ABS_X,Y,Z or REL_X,Y,Z */
282e27c7292SMichael Hennerich 	u32 ev_code_z;	/* ABS_X,Y,Z or REL_X,Y,Z */
283e27c7292SMichael Hennerich 
284e27c7292SMichael Hennerich 	/*
285e27c7292SMichael Hennerich 	 * A valid BTN or KEY Code; use tap_axis_control to disable
286e27c7292SMichael Hennerich 	 * event reporting
287e27c7292SMichael Hennerich 	 */
288e27c7292SMichael Hennerich 
289e27c7292SMichael Hennerich 	u32 ev_code_tap[3];	/* EV_KEY {X-Axis, Y-Axis, Z-Axis} */
290e27c7292SMichael Hennerich 
291e27c7292SMichael Hennerich 	/*
292e27c7292SMichael Hennerich 	 * A valid BTN or KEY Code for Free-Fall or Activity enables
293e27c7292SMichael Hennerich 	 * input event reporting. A '0' disables the Free-Fall or
294e27c7292SMichael Hennerich 	 * Activity reporting.
295e27c7292SMichael Hennerich 	 */
296e27c7292SMichael Hennerich 
297e27c7292SMichael Hennerich 	u32 ev_code_ff;	/* EV_KEY */
298e27c7292SMichael Hennerich 	u32 ev_code_act_inactivity;	/* EV_KEY */
299e27c7292SMichael Hennerich 
300671386bbSMichael Hennerich 	/*
3015eb9f900SMichael Tandy 	 * Use ADXL34x INT2 pin instead of INT1 pin for interrupt output
302671386bbSMichael Hennerich 	 */
303e27c7292SMichael Hennerich 	u8 use_int2;
304671386bbSMichael Hennerich 
305671386bbSMichael Hennerich 	/*
306671386bbSMichael Hennerich 	 * ADXL346 only ORIENTATION SENSING feature
307671386bbSMichael Hennerich 	 * The orientation function of the ADXL346 reports both 2-D and
308671386bbSMichael Hennerich 	 * 3-D orientation concurrently.
309671386bbSMichael Hennerich 	 */
310671386bbSMichael Hennerich 
311671386bbSMichael Hennerich #define ADXL_EN_ORIENTATION_2D		1
312671386bbSMichael Hennerich #define ADXL_EN_ORIENTATION_3D		2
313671386bbSMichael Hennerich #define ADXL_EN_ORIENTATION_2D_3D	3
314671386bbSMichael Hennerich 
315671386bbSMichael Hennerich 	u8 orientation_enable;
316671386bbSMichael Hennerich 
317671386bbSMichael Hennerich 	/*
318671386bbSMichael Hennerich 	 * The width of the deadzone region between two or more
319671386bbSMichael Hennerich 	 * orientation positions is determined by setting the Deadzone
320671386bbSMichael Hennerich 	 * value. The deadzone region size can be specified with a
321671386bbSMichael Hennerich 	 * resolution of 3.6deg. The deadzone angle represents the total
322671386bbSMichael Hennerich 	 * angle where the orientation is considered invalid.
323671386bbSMichael Hennerich 	 */
324671386bbSMichael Hennerich 
325671386bbSMichael Hennerich #define ADXL_DEADZONE_ANGLE_0p0		0	/* !!!0.0 [deg] */
326671386bbSMichael Hennerich #define ADXL_DEADZONE_ANGLE_3p6		1	/* 3.6 [deg] */
327671386bbSMichael Hennerich #define ADXL_DEADZONE_ANGLE_7p2		2	/* 7.2 [deg] */
328671386bbSMichael Hennerich #define ADXL_DEADZONE_ANGLE_10p8	3	/* 10.8 [deg] */
329671386bbSMichael Hennerich #define ADXL_DEADZONE_ANGLE_14p4	4	/* 14.4 [deg] */
330671386bbSMichael Hennerich #define ADXL_DEADZONE_ANGLE_18p0	5	/* 18.0 [deg] */
331671386bbSMichael Hennerich #define ADXL_DEADZONE_ANGLE_21p6	6	/* 21.6 [deg] */
332671386bbSMichael Hennerich #define ADXL_DEADZONE_ANGLE_25p2	7	/* 25.2 [deg] */
333671386bbSMichael Hennerich 
334671386bbSMichael Hennerich 	u8 deadzone_angle;
335671386bbSMichael Hennerich 
336671386bbSMichael Hennerich 	/*
337671386bbSMichael Hennerich 	 * To eliminate most human motion such as walking or shaking,
338671386bbSMichael Hennerich 	 * a Divisor value should be selected to effectively limit the
339671386bbSMichael Hennerich 	 * orientation bandwidth. Set the depth of the filter used to
340671386bbSMichael Hennerich 	 * low-pass filter the measured acceleration for stable
341671386bbSMichael Hennerich 	 * orientation sensing
342671386bbSMichael Hennerich 	 */
343671386bbSMichael Hennerich 
344671386bbSMichael Hennerich #define ADXL_LP_FILTER_DIVISOR_2	0
345671386bbSMichael Hennerich #define ADXL_LP_FILTER_DIVISOR_4	1
346671386bbSMichael Hennerich #define ADXL_LP_FILTER_DIVISOR_8	2
347671386bbSMichael Hennerich #define ADXL_LP_FILTER_DIVISOR_16	3
348671386bbSMichael Hennerich #define ADXL_LP_FILTER_DIVISOR_32	4
349671386bbSMichael Hennerich #define ADXL_LP_FILTER_DIVISOR_64	5
350671386bbSMichael Hennerich #define ADXL_LP_FILTER_DIVISOR_128	6
351671386bbSMichael Hennerich #define ADXL_LP_FILTER_DIVISOR_256	7
352671386bbSMichael Hennerich 
353671386bbSMichael Hennerich 	u8 divisor_length;
354671386bbSMichael Hennerich 
355671386bbSMichael Hennerich 	u32 ev_codes_orient_2d[4];	/* EV_KEY {+X, -X, +Y, -Y} */
356671386bbSMichael Hennerich 	u32 ev_codes_orient_3d[6];	/* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */
357e27c7292SMichael Hennerich };
358e27c7292SMichael Hennerich #endif
359