diff options
author | AnilKumar Ch <anilkumar@ti.com> | 2012-09-24 05:23:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-26 16:24:25 -0400 |
commit | e2b2ed8365e040b274dd23bdabd34ec3b0e43137 (patch) | |
tree | c4d4a0d8c2488e9f339860b92dc0f10bdc4b3a86 | |
parent | bcdee04ea7ae0406ae69094f6df1aacb66a69a0b (diff) |
lis3lv02d: fix some comments specific to lis331dlh driver
Fix some minor problems in comments of lis331dlh driver
* correct comments with respect to 2G sensitivity
* correct typo lis3331dlh mistake to lis331dlh
* add comment to say only 2G range is supported
* change the function name from lis3lv02d_read_16 to
lis331dlh_read_data.
* update i2c_device_id table entry to maintaine consistancy
* update sensor display message
Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/misc/lis3lv02d/lis3lv02d.c | 13 | ||||
-rw-r--r-- | drivers/misc/lis3lv02d/lis3lv02d.h | 2 | ||||
-rw-r--r-- | drivers/misc/lis3lv02d/lis3lv02d_i2c.c | 2 |
3 files changed, 9 insertions, 8 deletions
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c index 9d37c576d526..e670072fe24c 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d.c +++ b/drivers/misc/lis3lv02d/lis3lv02d.c | |||
@@ -81,9 +81,10 @@ | |||
81 | #define LIS3_SENSITIVITY_8B (18 * LIS3_ACCURACY) | 81 | #define LIS3_SENSITIVITY_8B (18 * LIS3_ACCURACY) |
82 | 82 | ||
83 | /* | 83 | /* |
84 | * LIS3331DLH spec says 1LSBs corresponds 4G/1024 -> 1LSB is 1000/1024 mG. | 84 | * LIS331DLH spec says 1LSBs corresponds 4G/4096 -> 1LSB is 1000/1024 mG. |
85 | * Sensitivity values for +/-2G, outdata in 12 bits for +/-2G scale. so 4 | 85 | * Below macros defines sensitivity values for +/-2G. Dataout bits for |
86 | * bits adjustment is required | 86 | * +/-2G range is 12 bits so 4 bits adjustment must be done to get 12bit |
87 | * data from 16bit value. Currently this driver supports only 2G range. | ||
87 | */ | 88 | */ |
88 | #define LIS3DLH_SENSITIVITY_2G ((LIS3_ACCURACY * 1000) / 1024) | 89 | #define LIS3DLH_SENSITIVITY_2G ((LIS3_ACCURACY * 1000) / 1024) |
89 | #define SHIFT_ADJ_2G 4 | 90 | #define SHIFT_ADJ_2G 4 |
@@ -144,7 +145,7 @@ static s16 lis3lv02d_read_12(struct lis3lv02d *lis3, int reg) | |||
144 | } | 145 | } |
145 | 146 | ||
146 | /* 12bits for 2G range, 13 bits for 4G range and 14 bits for 8G range */ | 147 | /* 12bits for 2G range, 13 bits for 4G range and 14 bits for 8G range */ |
147 | static s16 lis3lv02d_read_16(struct lis3lv02d *lis3, int reg) | 148 | static s16 lis331dlh_read_data(struct lis3lv02d *lis3, int reg) |
148 | { | 149 | { |
149 | u8 lo, hi; | 150 | u8 lo, hi; |
150 | int v; | 151 | int v; |
@@ -987,8 +988,8 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3) | |||
987 | lis3->scale = LIS3_SENSITIVITY_8B; | 988 | lis3->scale = LIS3_SENSITIVITY_8B; |
988 | break; | 989 | break; |
989 | case WAI_3DLH: | 990 | case WAI_3DLH: |
990 | pr_info("16 bits 3DLH sensor found\n"); | 991 | pr_info("16 bits lis331dlh sensor found\n"); |
991 | lis3->read_data = lis3lv02d_read_16; | 992 | lis3->read_data = lis331dlh_read_data; |
992 | lis3->mdps_max_val = 2048; /* 12 bits for 2G */ | 993 | lis3->mdps_max_val = 2048; /* 12 bits for 2G */ |
993 | lis3->shift_adj = SHIFT_ADJ_2G; | 994 | lis3->shift_adj = SHIFT_ADJ_2G; |
994 | lis3->pwron_delay = LIS3_PWRON_DELAY_WAI_8B; | 995 | lis3->pwron_delay = LIS3_PWRON_DELAY_WAI_8B; |
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.h b/drivers/misc/lis3lv02d/lis3lv02d.h index c1a545e136a0..387504a37937 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d.h +++ b/drivers/misc/lis3lv02d/lis3lv02d.h | |||
@@ -104,9 +104,9 @@ enum lis3_who_am_i { | |||
104 | }; | 104 | }; |
105 | 105 | ||
106 | enum lis3_type { | 106 | enum lis3_type { |
107 | LIS3LV02D, | ||
107 | LIS3DC, | 108 | LIS3DC, |
108 | HP3DC, | 109 | HP3DC, |
109 | LIS3LV02D, | ||
110 | LIS2302D, | 110 | LIS2302D, |
111 | LIS331DLF, | 111 | LIS331DLF, |
112 | LIS331DLH, | 112 | LIS331DLH, |
diff --git a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c index 15255eb8ac81..2c0a1148ee22 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c | |||
@@ -235,7 +235,7 @@ static int lis3_i2c_runtime_resume(struct device *dev) | |||
235 | #endif /* CONFIG_PM_RUNTIME */ | 235 | #endif /* CONFIG_PM_RUNTIME */ |
236 | 236 | ||
237 | static const struct i2c_device_id lis3lv02d_id[] = { | 237 | static const struct i2c_device_id lis3lv02d_id[] = { |
238 | {"lis3lv02d", 0 }, | 238 | {"lis3lv02d", LIS3LV02D}, |
239 | {"lis331dlh", LIS331DLH}, | 239 | {"lis331dlh", LIS331DLH}, |
240 | {} | 240 | {} |
241 | }; | 241 | }; |