aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/input/adxl34x.h
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2010-06-25 11:44:10 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-06-25 11:55:15 -0400
commit671386bb23c57e5448f386a41101ed65ad1d488c (patch)
tree24a5292641e6228833ba09ec309838a426a55fee /include/linux/input/adxl34x.h
parente27c729219ad24c8ac9a4b34cf192e56917565c5 (diff)
Input: adxl34x - add support for ADXL346 orientation sensing
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'include/linux/input/adxl34x.h')
-rw-r--r--include/linux/input/adxl34x.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/include/linux/input/adxl34x.h b/include/linux/input/adxl34x.h
index 712118238038..df00d998a44a 100644
--- a/include/linux/input/adxl34x.h
+++ b/include/linux/input/adxl34x.h
@@ -288,6 +288,62 @@ struct adxl34x_platform_data {
288 u32 ev_code_ff; /* EV_KEY */ 288 u32 ev_code_ff; /* EV_KEY */
289 u32 ev_code_act_inactivity; /* EV_KEY */ 289 u32 ev_code_act_inactivity; /* EV_KEY */
290 290
291 /*
292 * Use ADXL34x INT2 instead of INT1
293 */
291 u8 use_int2; 294 u8 use_int2;
295
296 /*
297 * ADXL346 only ORIENTATION SENSING feature
298 * The orientation function of the ADXL346 reports both 2-D and
299 * 3-D orientation concurrently.
300 */
301
302#define ADXL_EN_ORIENTATION_2D 1
303#define ADXL_EN_ORIENTATION_3D 2
304#define ADXL_EN_ORIENTATION_2D_3D 3
305
306 u8 orientation_enable;
307
308 /*
309 * The width of the deadzone region between two or more
310 * orientation positions is determined by setting the Deadzone
311 * value. The deadzone region size can be specified with a
312 * resolution of 3.6deg. The deadzone angle represents the total
313 * angle where the orientation is considered invalid.
314 */
315
316#define ADXL_DEADZONE_ANGLE_0p0 0 /* !!!0.0 [deg] */
317#define ADXL_DEADZONE_ANGLE_3p6 1 /* 3.6 [deg] */
318#define ADXL_DEADZONE_ANGLE_7p2 2 /* 7.2 [deg] */
319#define ADXL_DEADZONE_ANGLE_10p8 3 /* 10.8 [deg] */
320#define ADXL_DEADZONE_ANGLE_14p4 4 /* 14.4 [deg] */
321#define ADXL_DEADZONE_ANGLE_18p0 5 /* 18.0 [deg] */
322#define ADXL_DEADZONE_ANGLE_21p6 6 /* 21.6 [deg] */
323#define ADXL_DEADZONE_ANGLE_25p2 7 /* 25.2 [deg] */
324
325 u8 deadzone_angle;
326
327 /*
328 * To eliminate most human motion such as walking or shaking,
329 * a Divisor value should be selected to effectively limit the
330 * orientation bandwidth. Set the depth of the filter used to
331 * low-pass filter the measured acceleration for stable
332 * orientation sensing
333 */
334
335#define ADXL_LP_FILTER_DIVISOR_2 0
336#define ADXL_LP_FILTER_DIVISOR_4 1
337#define ADXL_LP_FILTER_DIVISOR_8 2
338#define ADXL_LP_FILTER_DIVISOR_16 3
339#define ADXL_LP_FILTER_DIVISOR_32 4
340#define ADXL_LP_FILTER_DIVISOR_64 5
341#define ADXL_LP_FILTER_DIVISOR_128 6
342#define ADXL_LP_FILTER_DIVISOR_256 7
343
344 u8 divisor_length;
345
346 u32 ev_codes_orient_2d[4]; /* EV_KEY {+X, -X, +Y, -Y} */
347 u32 ev_codes_orient_3d[6]; /* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */
292}; 348};
293#endif 349#endif