Skip to content

Commit 4a70a41

Browse files
Samu Onkalotorvalds
authored andcommitted
lis3: setup poll interval limits
Set valid adjustment window (0 - 2000ms). Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Acked-by: Eric Piel <eric.piel@tremplin-utc.net> Cc: Daniel Mack <daniel@caiaq.de> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 6d94d40 commit 4a70a41

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/hwmon/lis3lv02d.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141

4242
/* joystick device poll interval in milliseconds */
4343
#define MDPS_POLL_INTERVAL 50
44+
#define MDPS_POLL_MIN 0
45+
#define MDPS_POLL_MAX 2000
4446
/*
4547
* The sensor can also generate interrupts (DRDY) but it's pretty pointless
4648
* because they are generated even if the data do not change. So it's better
@@ -459,6 +461,8 @@ int lis3lv02d_joystick_enable(void)
459461

460462
lis3_dev.idev->poll = lis3lv02d_joystick_poll;
461463
lis3_dev.idev->poll_interval = MDPS_POLL_INTERVAL;
464+
lis3_dev.idev->poll_interval_min = MDPS_POLL_MIN;
465+
lis3_dev.idev->poll_interval_max = MDPS_POLL_MAX;
462466
input_dev = lis3_dev.idev->input;
463467

464468
input_dev->name = "ST LIS3LV02DL Accelerometer";

0 commit comments

Comments
 (0)