Commit e2b2ed83 authored by AnilKumar Ch's avatar AnilKumar Ch Committed by Greg Kroah-Hartman

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: default avatarAnilKumar Ch <anilkumar@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bcdee04e
...@@ -81,9 +81,10 @@ ...@@ -81,9 +81,10 @@
#define LIS3_SENSITIVITY_8B (18 * LIS3_ACCURACY) #define LIS3_SENSITIVITY_8B (18 * LIS3_ACCURACY)
/* /*
* LIS3331DLH spec says 1LSBs corresponds 4G/1024 -> 1LSB is 1000/1024 mG. * LIS331DLH spec says 1LSBs corresponds 4G/4096 -> 1LSB is 1000/1024 mG.
* Sensitivity values for +/-2G, outdata in 12 bits for +/-2G scale. so 4 * Below macros defines sensitivity values for +/-2G. Dataout bits for
* bits adjustment is required * +/-2G range is 12 bits so 4 bits adjustment must be done to get 12bit
* data from 16bit value. Currently this driver supports only 2G range.
*/ */
#define LIS3DLH_SENSITIVITY_2G ((LIS3_ACCURACY * 1000) / 1024) #define LIS3DLH_SENSITIVITY_2G ((LIS3_ACCURACY * 1000) / 1024)
#define SHIFT_ADJ_2G 4 #define SHIFT_ADJ_2G 4
...@@ -144,7 +145,7 @@ static s16 lis3lv02d_read_12(struct lis3lv02d *lis3, int reg) ...@@ -144,7 +145,7 @@ static s16 lis3lv02d_read_12(struct lis3lv02d *lis3, int reg)
} }
/* 12bits for 2G range, 13 bits for 4G range and 14 bits for 8G range */ /* 12bits for 2G range, 13 bits for 4G range and 14 bits for 8G range */
static s16 lis3lv02d_read_16(struct lis3lv02d *lis3, int reg) static s16 lis331dlh_read_data(struct lis3lv02d *lis3, int reg)
{ {
u8 lo, hi; u8 lo, hi;
int v; int v;
...@@ -987,8 +988,8 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3) ...@@ -987,8 +988,8 @@ int lis3lv02d_init_device(struct lis3lv02d *lis3)
lis3->scale = LIS3_SENSITIVITY_8B; lis3->scale = LIS3_SENSITIVITY_8B;
break; break;
case WAI_3DLH: case WAI_3DLH:
pr_info("16 bits 3DLH sensor found\n"); pr_info("16 bits lis331dlh sensor found\n");
lis3->read_data = lis3lv02d_read_16; lis3->read_data = lis331dlh_read_data;
lis3->mdps_max_val = 2048; /* 12 bits for 2G */ lis3->mdps_max_val = 2048; /* 12 bits for 2G */
lis3->shift_adj = SHIFT_ADJ_2G; lis3->shift_adj = SHIFT_ADJ_2G;
lis3->pwron_delay = LIS3_PWRON_DELAY_WAI_8B; lis3->pwron_delay = LIS3_PWRON_DELAY_WAI_8B;
......
...@@ -104,9 +104,9 @@ enum lis3_who_am_i { ...@@ -104,9 +104,9 @@ enum lis3_who_am_i {
}; };
enum lis3_type { enum lis3_type {
LIS3LV02D,
LIS3DC, LIS3DC,
HP3DC, HP3DC,
LIS3LV02D,
LIS2302D, LIS2302D,
LIS331DLF, LIS331DLF,
LIS331DLH, LIS331DLH,
......
...@@ -235,7 +235,7 @@ static int lis3_i2c_runtime_resume(struct device *dev) ...@@ -235,7 +235,7 @@ static int lis3_i2c_runtime_resume(struct device *dev)
#endif /* CONFIG_PM_RUNTIME */ #endif /* CONFIG_PM_RUNTIME */
static const struct i2c_device_id lis3lv02d_id[] = { static const struct i2c_device_id lis3lv02d_id[] = {
{"lis3lv02d", 0 }, {"lis3lv02d", LIS3LV02D},
{"lis331dlh", LIS331DLH}, {"lis331dlh", LIS331DLH},
{} {}
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment