aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/lis3lv02d.h
diff options
context:
space:
mode:
authorÉric Piel <eric.piel@tremplin-utc.net>2009-12-14 21:01:39 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-15 11:53:36 -0500
commitbc62c1471773fc32adcfc05100abd16fa2b6e126 (patch)
tree34894261672d0c73c01b46ed92ebad7eb75ea8c4 /drivers/hwmon/lis3lv02d.h
parent66c8569bf990064b3f11e0f211a81a46e0b627ff (diff)
lis3: update documentation and comments
Most of the documentation and comments were written when the driver was only supporting one type of chip, only via ACPI/HP. Update the info to the much clearer understanding that we have now. Signed-off-by: Éric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/hwmon/lis3lv02d.h')
-rw-r--r--drivers/hwmon/lis3lv02d.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/hwmon/lis3lv02d.h b/drivers/hwmon/lis3lv02d.h
index 3e1ff46f72d3..2431c5199534 100644
--- a/drivers/hwmon/lis3lv02d.h
+++ b/drivers/hwmon/lis3lv02d.h
@@ -2,7 +2,7 @@
2 * lis3lv02d.h - ST LIS3LV02DL accelerometer driver 2 * lis3lv02d.h - ST LIS3LV02DL accelerometer driver
3 * 3 *
4 * Copyright (C) 2007-2008 Yan Burman 4 * Copyright (C) 2007-2008 Yan Burman
5 * Copyright (C) 2008 Eric Piel 5 * Copyright (C) 2008-2009 Eric Piel
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -22,20 +22,18 @@
22#include <linux/input-polldev.h> 22#include <linux/input-polldev.h>
23 23
24/* 24/*
25 * The actual chip is STMicroelectronics LIS3LV02DL or LIS3LV02DQ that seems to 25 * This driver tries to support the "digital" accelerometer chips from
26 * be connected via SPI. There exists also several similar chips (such as LIS302DL or 26 * STMicroelectronics such as LIS3LV02DL, LIS302DL, LIS3L02DQ, LIS331DL,
27 * LIS3L02DQ) and they have slightly different registers, but we can provide a 27 * LIS35DE, or LIS202DL. They are very similar in terms of programming, with
28 * common interface for all of them. 28 * almost the same registers. In addition to differing on physical properties,
29 * They can also be connected via I²C. 29 * they differ on the number of axes (2/3), precision (8/12 bits), and special
30 * features (freefall detection, click...). Unfortunately, not all the
31 * differences can be probed via a register.
32 * They can be connected either via I²C or SPI.
30 */ 33 */
31 34
32#include <linux/lis3lv02d.h> 35#include <linux/lis3lv02d.h>
33 36
34/* 2-byte registers */
35#define LIS_DOUBLE_ID 0x3A /* LIS3LV02D[LQ] */
36/* 1-byte registers */
37#define LIS_SINGLE_ID 0x3B /* LIS[32]02DL and others */
38
39enum lis3_reg { 37enum lis3_reg {
40 WHO_AM_I = 0x0F, 38 WHO_AM_I = 0x0F,
41 OFFSET_X = 0x16, 39 OFFSET_X = 0x16,
@@ -94,6 +92,12 @@ enum lis3lv02d_reg {
94 DD_THSE_H = 0x3F, 92 DD_THSE_H = 0x3F,
95}; 93};
96 94
95enum lis3_who_am_i {
96 WAI_12B = 0x3A, /* 12 bits: LIS3LV02D[LQ]... */
97 WAI_8B = 0x3B, /* 8 bits: LIS[23]02D[LQ]... */
98 WAI_6B = 0x52, /* 6 bits: LIS331DLF - not supported */
99};
100
97enum lis3lv02d_ctrl1 { 101enum lis3lv02d_ctrl1 {
98 CTRL1_Xen = 0x01, 102 CTRL1_Xen = 0x01,
99 CTRL1_Yen = 0x02, 103 CTRL1_Yen = 0x02,
@@ -194,7 +198,7 @@ struct lis3lv02d {
194 int (*write) (struct lis3lv02d *lis3, int reg, u8 val); 198 int (*write) (struct lis3lv02d *lis3, int reg, u8 val);
195 int (*read) (struct lis3lv02d *lis3, int reg, u8 *ret); 199 int (*read) (struct lis3lv02d *lis3, int reg, u8 *ret);
196 200
197 u8 whoami; /* 3Ah: 2-byte registries, 3Bh: 1-byte registries */ 201 u8 whoami; /* indicates measurement precision */
198 s16 (*read_data) (struct lis3lv02d *lis3, int reg); 202 s16 (*read_data) (struct lis3lv02d *lis3, int reg);
199 int mdps_max_val; 203 int mdps_max_val;
200 204