aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/lis3lv02d.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-10-01 17:14:25 -0400
committerGuenter Roeck <guenter.roeck@ericsson.com>2010-10-25 17:11:20 -0400
commit2ee321440e3a594dcdd9981e68e5e302447047a2 (patch)
treec2dde23d160339ff713f9fd12f7922cca0c8c6d3 /drivers/hwmon/lis3lv02d.h
parent37394050b5be0fe87f96ed8848f11c3c2cd4d556 (diff)
hwmon: (lis3) add axes module parameter for custom axis-mapping
The axis-mapping of lis3dev device on many (rather most) HP machines doesn't follow the standard. When each new model appears, users need to adjust again. Testing this requires the rebuild of kernel, thus it's not trivial for end-users. This patch adds a module parameter "axes" to allow a custom axis-mapping without patching and recompiling the kernel driver. User can pass the parameter such as axes=3,2,1. Also it can be changed via sysfs. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Eric Piel <eric.piel@tremplin-utc.net> Cc: Jean Delvare <khali@linux-fr.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon/lis3lv02d.h')
-rw-r--r--drivers/hwmon/lis3lv02d.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/hwmon/lis3lv02d.h b/drivers/hwmon/lis3lv02d.h
index 62c6652eb9d5..eb5db584eb0e 100644
--- a/drivers/hwmon/lis3lv02d.h
+++ b/drivers/hwmon/lis3lv02d.h
@@ -223,10 +223,11 @@ enum lis3lv02d_click_src_8b {
223 CLICK_IA = 0x40, 223 CLICK_IA = 0x40,
224}; 224};
225 225
226struct axis_conversion { 226union axis_conversion {
227 s8 x; 227 struct {
228 s8 y; 228 int x, y, z;
229 s8 z; 229 };
230 int as_array[3];
230}; 231};
231 232
232struct lis3lv02d { 233struct lis3lv02d {
@@ -249,7 +250,7 @@ struct lis3lv02d {
249 struct input_polled_dev *idev; /* input device */ 250 struct input_polled_dev *idev; /* input device */
250 struct platform_device *pdev; /* platform device */ 251 struct platform_device *pdev; /* platform device */
251 atomic_t count; /* interrupt count after last read */ 252 atomic_t count; /* interrupt count after last read */
252 struct axis_conversion ac; /* hw -> logical axis */ 253 union axis_conversion ac; /* hw -> logical axis */
253 int mapped_btns[3]; 254 int mapped_btns[3];
254 255
255 u32 irq; /* IRQ number */ 256 u32 irq; /* IRQ number */