aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/lis3lv02d
AgeCommit message (Collapse)AuthorFilesLines
2012-01-24MISC: convert drivers/misc/* to use module_i2c_driver()Axel Lin1-12/+1
This patch converts the drivers in drivers/misc/* to use the module_i2c_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <[email protected]> Cc: Michael Hennerich <[email protected]> Cc: Anantha Narayanan <[email protected]> Cc: Hemanth V <[email protected]> Cc: Christoph Mair <[email protected]> Cc: Grant Likely <[email protected]> Cc: Ben Gardner <[email protected]> Cc: Minkyu Kang <[email protected]> Cc: Kalhan Trisal <[email protected]> Cc: Darrick J. Wong <[email protected]> Cc: Daniel Mack <[email protected]> Cc: Rodolfo Giometti <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-01-13module_param: check type correctness for module_param_arrayRusty Russell1-0/+2
module_param_array(), unlike its non-array cousins, didn't check the type of the variable. Fixing this found two bugs. Cc: Luca Risolia <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Cc: Eric Piel <[email protected]> Cc: [email protected] Signed-off-by: Rusty Russell <[email protected]>
2011-10-31lis3lv02d: make regulator API usage unconditionalMark Brown1-22/+12
The regulator API contains a range of features for stubbing itself out when not in use and for transparently restricting the actual effect of regulator API calls where they can't be supported on a particular system so that drivers don't need to individually implement this. Simplify the driver slightly by making use of this idiom. The only in tree user is ecovec24 which does not use the regulator API. Signed-off-by: Mark Brown <[email protected]> Cc: Éric Piel <[email protected]> Cc: Ilkka Koskinen <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-10-31lis3: remove the references to the global variable in core driverÉric Piel2-103/+133
[[email protected]: fix arg to lis3->read()] Signed-off-by: Ilkka Koskinen <[email protected]> Signed-off-by: Éric Piel <[email protected]> Cc: Matthew Garrett <[email protected]> Cc: Witold Pilat <[email protected]> Cc: Lyall Pearce <[email protected]> Cc: Malte Starostik <[email protected]> Cc: Thadeu Lima de Souza Cascardo <[email protected]> Cc: Christian Lamparter <[email protected]> Subject: lis3-remove-the-references-to-the-global-variable-in-core-driver-fix Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-10-31lis3: change exported function to use passed parameterÉric Piel4-7/+7
Change exported functions to use the device given as parameter instead of the global one. Signed-off-by: Ilkka Koskinen <[email protected]> Signed-off-by: Éric Piel <[email protected]> Cc: Matthew Garrett <[email protected]> Cc: Witold Pilat <[email protected]> Cc: Lyall Pearce <[email protected]> Cc: Malte Starostik <[email protected]> Cc: Thadeu Lima de Souza Cascardo <[email protected]> Cc: Christian Lamparter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-10-31lis3: use consistent naming of variablesÉric Piel1-60/+60
Signed-off-by: Ilkka Koskinen <[email protected]> Signed-off-by: Éric Piel <[email protected]> Cc: Matthew Garrett <[email protected]> Cc: Witold Pilat <[email protected]> Cc: Lyall Pearce <[email protected]> Cc: Malte Starostik <[email protected]> Cc: Thadeu Lima de Souza Cascardo <[email protected]> Cc: Christian Lamparter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-10-31lis3: free regulators if probe() failsÉric Piel1-2/+7
Signed-off-by: Ilkka Koskinen <[email protected]> Signed-off-by: Éric Piel <[email protected]> Cc: Matthew Garrett <[email protected]> Cc: Witold Pilat <[email protected]> Cc: Lyall Pearce <[email protected]> Cc: Malte Starostik <[email protected]> Cc: Thadeu Lima de Souza Cascardo <[email protected]> Cc: Christian Lamparter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-10-31lis3lv02d: avoid divide by zero due to uncheckedÉric Piel2-7/+31
After an "unexpected" reboot, I found this Oops in my logs: divide error: 0000 [#1] PREEMPT SMP=20 CPU 0=20 Modules linked in: lis3lv02d hp_wmi input_polldev [...] Pid: 390, comm: modprobe Tainted: G C 2.6.39-rc7-wl+=20 RIP: 0010:[<ffffffffa014b427>] [<ffffffffa014b427>] lis3lv02d_poweron+0x4e/0x94 [lis3lv02d] RSP: 0018:ffff8801d6407cf8 EFLAGS: 00010246 RAX: 0000000000000bb8 RBX: ffffffffa014e000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffea00066e4708 RDI: ffff8801df002700 RBP: ffff8801d6407d18 R08: ffffea00066c5a30 R09: ffffffff812498c9 R10: ffff8801d7bfcea0 R11: ffff8801d7bfce10 R12: 0000000000000bb8 R13: 00000000ffffffda R14: ffffffffa0154120 R15: ffffffffa0154030 =46S: 00007fc0705db700(0000) GS:ffff8801dfa00000(0000) knlGS:0 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 00007f33549174f0 CR3: 00000001d65c9000 CR4: 00000000000406f0 Process modprobe (pid: 390, threadinfo ffff8801d6406000, task ffff8801d6b40= 000) Stack: ffffffffa0154120 62ffffffa0154030 ffffffffa014e000 00000000ffffffea ffff8801d6407d58 ffffffffa014bcc1 0000000000000000 0000000000000048 ffff8801d8bae800 00000000ffffffea 00000000ffffffda ffffffffa0154120 Call Trace: [<ffffffffa014bcc1>] lis3lv02d_init_device+0x1ce/0x496 [lis3lv02d] [<ffffffffa01522ff>] lis3lv02d_add+0x10f/0x17c [hp_accel] [<ffffffff81233e11>] acpi_device_probe+0x49/0x117 [...] Code: 3a 75 06 80 4d ef 50 eb 04 80 4d ef 40 0f b6 55 ef be 21 00 00 00 48 89 df ff 53 18 44 8b 63 6c e8 3e fc ff ff 89 c1 44 89 e0 99 <f7> f9 89 c7 e8 93 82 ef e0 48 83 7b 30 00 74 2d 45 31 e4 80 7b=20 RIP [<ffffffffa014b427>] lis3lv02d_poweron+0x4e/0x94 [lis3lv02d] RSP <ffff8801d6407cf8> >From my POV, it looks like the hardware is not working as expected and returns a bogus data rate. The driver doesn't check the result and directly uses it as some sort of divisor in some places: msleep(lis3->pwron_delay / lis3lv02d_get_odr()); Under this circumstances, this could very well cause the "divide by zero" exception from above. For now, I fixed it the easiest and most obvious way: Check if the result is sane and if it isn't use a sane default instead. I went for "100" in the latter case, simply because /sys/devices/platform/lis3lv02d/rate returns it on a successful boot. Signed-off-by: Christian Lamparter <[email protected]> Signed-off-by: Éric Piel <[email protected]> Cc: Matthew Garrett <[email protected]> Cc: Witold Pilat <[email protected]> Cc: Lyall Pearce <[email protected]> Cc: Malte Starostik <[email protected]> Cc: Ilkka Koskinen <[email protected]> Cc: Thadeu Lima de Souza Cascardo <[email protected]> Cc: Christian Lamparter <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-10-03lis3: fix regression of HP DriveGuard with 8bit chipTakashi Iwai1-6/+8
Commit 2a7fade7e03 ("hwmon: lis3: Power on corrections") caused a regression on HP laptops with 8bit chip. Writing CTRL2_BOOT_8B bit seems clearing the BIOS setup, and no proper interrupt for DriveGuard will be triggered any more. Since the init code there is basically only for embedded devices, put a pdata check so that the problematic initialization will be skipped for hp_accel stuff. Signed-off-by: Takashi Iwai <[email protected]> Cc: Eric Piel <[email protected]> Cc: Samu Onkalo <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-21Move lis3lv02d drivers to drivers/miscJean Delvare6-0/+1758
The lis3lv02d drivers aren't hardware monitoring drivers, so the don't belong to drivers/hwmon. Move them to drivers/misc, short of a better home. Signed-off-by: Jean Delvare <[email protected]> Acked-by: Guenter Roeck <[email protected]> Acked-by: Eric Piel <[email protected]> Acked-by: Jonathan Cameron <[email protected]> Tested-by: Eric Piel <[email protected]> Tested-by: Takashi Iwai <[email protected]>