diff options
author | Éric Piel <eric.piel@tremplin-utc.net> | 2009-12-14 21:01:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-15 11:53:36 -0500 |
commit | bc62c1471773fc32adcfc05100abd16fa2b6e126 (patch) | |
tree | 34894261672d0c73c01b46ed92ebad7eb75ea8c4 /drivers/hwmon/lis3lv02d.c | |
parent | 66c8569bf990064b3f11e0f211a81a46e0b627ff (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.c')
-rw-r--r-- | drivers/hwmon/lis3lv02d.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/hwmon/lis3lv02d.c b/drivers/hwmon/lis3lv02d.c index dbd0b055d4b9..1c8f10817e69 100644 --- a/drivers/hwmon/lis3lv02d.c +++ b/drivers/hwmon/lis3lv02d.c | |||
@@ -43,7 +43,7 @@ | |||
43 | #define MDPS_POLL_INTERVAL 50 | 43 | #define MDPS_POLL_INTERVAL 50 |
44 | /* | 44 | /* |
45 | * The sensor can also generate interrupts (DRDY) but it's pretty pointless | 45 | * The sensor can also generate interrupts (DRDY) but it's pretty pointless |
46 | * because their are generated even if the data do not change. So it's better | 46 | * because they are generated even if the data do not change. So it's better |
47 | * to keep the interrupt for the free-fall event. The values are updated at | 47 | * to keep the interrupt for the free-fall event. The values are updated at |
48 | * 40Hz (at the lowest frequency), but as it can be pretty time consuming on | 48 | * 40Hz (at the lowest frequency), but as it can be pretty time consuming on |
49 | * some low processor, we poll the sensor only at 20Hz... enough for the | 49 | * some low processor, we poll the sensor only at 20Hz... enough for the |
@@ -65,7 +65,7 @@ static s16 lis3lv02d_read_8(struct lis3lv02d *lis3, int reg) | |||
65 | return lo; | 65 | return lo; |
66 | } | 66 | } |
67 | 67 | ||
68 | static s16 lis3lv02d_read_16(struct lis3lv02d *lis3, int reg) | 68 | static s16 lis3lv02d_read_12(struct lis3lv02d *lis3, int reg) |
69 | { | 69 | { |
70 | u8 lo, hi; | 70 | u8 lo, hi; |
71 | 71 | ||
@@ -411,20 +411,20 @@ EXPORT_SYMBOL_GPL(lis3lv02d_remove_fs); | |||
411 | 411 | ||
412 | /* | 412 | /* |
413 | * Initialise the accelerometer and the various subsystems. | 413 | * Initialise the accelerometer and the various subsystems. |
414 | * Should be rather independant of the bus system. | 414 | * Should be rather independent of the bus system. |
415 | */ | 415 | */ |
416 | int lis3lv02d_init_device(struct lis3lv02d *dev) | 416 | int lis3lv02d_init_device(struct lis3lv02d *dev) |
417 | { | 417 | { |
418 | dev->whoami = lis3lv02d_read_8(dev, WHO_AM_I); | 418 | dev->whoami = lis3lv02d_read_8(dev, WHO_AM_I); |
419 | 419 | ||
420 | switch (dev->whoami) { | 420 | switch (dev->whoami) { |
421 | case LIS_DOUBLE_ID: | 421 | case WAI_12B: |
422 | printk(KERN_INFO DRIVER_NAME ": 2-byte sensor found\n"); | 422 | printk(KERN_INFO DRIVER_NAME ": 12 bits sensor found\n"); |
423 | dev->read_data = lis3lv02d_read_16; | 423 | dev->read_data = lis3lv02d_read_12; |
424 | dev->mdps_max_val = 2048; | 424 | dev->mdps_max_val = 2048; |
425 | break; | 425 | break; |
426 | case LIS_SINGLE_ID: | 426 | case WAI_8B: |
427 | printk(KERN_INFO DRIVER_NAME ": 1-byte sensor found\n"); | 427 | printk(KERN_INFO DRIVER_NAME ": 8 bits sensor found\n"); |
428 | dev->read_data = lis3lv02d_read_8; | 428 | dev->read_data = lis3lv02d_read_8; |
429 | dev->mdps_max_val = 128; | 429 | dev->mdps_max_val = 128; |
430 | break; | 430 | break; |
@@ -445,7 +445,7 @@ int lis3lv02d_init_device(struct lis3lv02d *dev) | |||
445 | if (dev->pdata) { | 445 | if (dev->pdata) { |
446 | struct lis3lv02d_platform_data *p = dev->pdata; | 446 | struct lis3lv02d_platform_data *p = dev->pdata; |
447 | 447 | ||
448 | if (p->click_flags && (dev->whoami == LIS_SINGLE_ID)) { | 448 | if (p->click_flags && (dev->whoami == WAI_8B)) { |
449 | dev->write(dev, CLICK_CFG, p->click_flags); | 449 | dev->write(dev, CLICK_CFG, p->click_flags); |
450 | dev->write(dev, CLICK_TIMELIMIT, p->click_time_limit); | 450 | dev->write(dev, CLICK_TIMELIMIT, p->click_time_limit); |
451 | dev->write(dev, CLICK_LATENCY, p->click_latency); | 451 | dev->write(dev, CLICK_LATENCY, p->click_latency); |
@@ -456,7 +456,7 @@ int lis3lv02d_init_device(struct lis3lv02d *dev) | |||
456 | (p->click_thresh_y << 4)); | 456 | (p->click_thresh_y << 4)); |
457 | } | 457 | } |
458 | 458 | ||
459 | if (p->wakeup_flags && (dev->whoami == LIS_SINGLE_ID)) { | 459 | if (p->wakeup_flags && (dev->whoami == WAI_8B)) { |
460 | dev->write(dev, FF_WU_CFG_1, p->wakeup_flags); | 460 | dev->write(dev, FF_WU_CFG_1, p->wakeup_flags); |
461 | dev->write(dev, FF_WU_THS_1, p->wakeup_thresh & 0x7f); | 461 | dev->write(dev, FF_WU_THS_1, p->wakeup_thresh & 0x7f); |
462 | /* default to 2.5ms for now */ | 462 | /* default to 2.5ms for now */ |