diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 17:41:52 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 17:41:52 (GMT) |
commit | fe445c6e2cb62a566e1a89f8798de11459975710 (patch) | |
tree | db1f2c0c19f488992fb5b9371476b4e7701c49a0 /drivers/input/serio | |
parent | f63b759c44b0561c76a67894c734157df3313b42 (diff) | |
parent | d01d0756f75e7a5b4b43764ad45b83c4340f11d6 (diff) | |
download | linux-fe445c6e2cb62a566e1a89f8798de11459975710.tar.xz |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (57 commits)
Input: adp5588-keypad - fix NULL dereference in adp5588_gpio_add()
Input: cy8ctmg110 - capacitive touchscreen support
Input: keyboard - also match braille-only keyboards
Input: adp5588-keys - export unused GPIO pins
Input: xpad - add product ID for Hori Fighting Stick EX2
Input: adxl34x - fix leak and use after free
Input: samsung-keypad - Add samsung keypad driver
Input: i8042 - reset keyboard controller wehen resuming from S2R
Input: synaptics - set min/max for finger width
Input: synaptics - only report width on hardware that supports it
Input: evdev - signal that device is writable in evdev_poll()
Input: mousedev - signal that device is writable in mousedev_poll()
Input: change input handlers to use bool when possible
Input: document the MT event slot protocol
Input: introduce MT event slots
Input: usbtouchscreen - implement reset_resume
Input: usbtouchscreen - implement runtime power management
Input: usbtouchscreen - implement basic suspend/resume
Input: Add ATMEL QT602240 touchscreen driver
Input: fix signedness warning in input_set_keycode()
...
Diffstat (limited to 'drivers/input/serio')
-rw-r--r-- | drivers/input/serio/i8042-ppcio.h | 75 | ||||
-rw-r--r-- | drivers/input/serio/i8042.c | 65 |
2 files changed, 41 insertions, 99 deletions
diff --git a/drivers/input/serio/i8042-ppcio.h b/drivers/input/serio/i8042-ppcio.h index 2906e1b..f708c75 100644 --- a/drivers/input/serio/i8042-ppcio.h +++ b/drivers/input/serio/i8042-ppcio.h @@ -52,81 +52,6 @@ static inline void i8042_platform_exit(void) { } -#elif defined(CONFIG_SPRUCE) - -#define I8042_KBD_IRQ 22 -#define I8042_AUX_IRQ 21 - -#define I8042_KBD_PHYS_DESC "spruceps2/serio0" -#define I8042_AUX_PHYS_DESC "spruceps2/serio1" -#define I8042_MUX_PHYS_DESC "spruceps2/serio%d" - -#define I8042_COMMAND_REG 0xff810000 -#define I8042_DATA_REG 0xff810001 - -static inline int i8042_read_data(void) -{ - unsigned long kbd_data; - - __raw_writel(0x00000088, 0xff500008); - eieio(); - - __raw_writel(0x03000000, 0xff50000c); - eieio(); - - asm volatile("lis 7,0xff88 \n\ - lswi 6,7,0x8 \n\ - mr %0,6" - : "=r" (kbd_data) :: "6", "7"); - - __raw_writel(0x00000000, 0xff50000c); - eieio(); - - return (unsigned char)(kbd_data >> 24); -} - -static inline int i8042_read_status(void) -{ - unsigned long kbd_status; - - __raw_writel(0x00000088, 0xff500008); - eieio(); - - __raw_writel(0x03000000, 0xff50000c); - eieio(); - - asm volatile("lis 7,0xff88 \n\ - ori 7,7,0x8 \n\ - lswi 6,7,0x8 \n\ - mr %0,6" - : "=r" (kbd_status) :: "6", "7"); - - __raw_writel(0x00000000, 0xff50000c); - eieio(); - - return (unsigned char)(kbd_status >> 24); -} - -static inline void i8042_write_data(int val) -{ - *((unsigned char *)0xff810000) = (char)val; -} - -static inline void i8042_write_command(int val) -{ - *((unsigned char *)0xff810001) = (char)val; -} - -static inline int i8042_platform_init(void) -{ - i8042_reset = 1; - return 0; -} - -static inline void i8042_platform_exit(void) -{ -} - #else #include "i8042-io.h" diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 6440a8f..258b98b 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c @@ -861,9 +861,6 @@ static int i8042_controller_selftest(void) unsigned char param; int i = 0; - if (!i8042_reset) - return 0; - /* * We try this 5 times; on some really fragile systems this does not * take the first time... @@ -1020,7 +1017,8 @@ static void i8042_controller_reset(void) * Reset the controller if requested. */ - i8042_controller_selftest(); + if (i8042_reset) + i8042_controller_selftest(); /* * Restore the original control register setting. @@ -1094,23 +1092,11 @@ static void i8042_dritek_enable(void) #ifdef CONFIG_PM /* - * Here we try to restore the original BIOS settings to avoid - * upsetting it. - */ - -static int i8042_pm_reset(struct device *dev) -{ - i8042_controller_reset(); - - return 0; -} - -/* * Here we try to reset everything back to a state we had * before suspending. */ -static int i8042_pm_restore(struct device *dev) +static int i8042_controller_resume(bool force_reset) { int error; @@ -1118,9 +1104,11 @@ static int i8042_pm_restore(struct device *dev) if (error) return error; - error = i8042_controller_selftest(); - if (error) - return error; + if (i8042_reset || force_reset) { + error = i8042_controller_selftest(); + if (error) + return error; + } /* * Restore original CTR value and disable all ports @@ -1162,6 +1150,28 @@ static int i8042_pm_restore(struct device *dev) return 0; } +/* + * Here we try to restore the original BIOS settings to avoid + * upsetting it. + */ + +static int i8042_pm_reset(struct device *dev) +{ + i8042_controller_reset(); + + return 0; +} + +static int i8042_pm_resume(struct device *dev) +{ + /* + * On resume from S2R we always try to reset the controller + * to bring it in a sane state. (In case of S2D we expect + * BIOS to reset the controller for us.) + */ + return i8042_controller_resume(true); +} + static int i8042_pm_thaw(struct device *dev) { i8042_interrupt(0, NULL); @@ -1169,9 +1179,14 @@ static int i8042_pm_thaw(struct device *dev) return 0; } +static int i8042_pm_restore(struct device *dev) +{ + return i8042_controller_resume(false); +} + static const struct dev_pm_ops i8042_pm_ops = { .suspend = i8042_pm_reset, - .resume = i8042_pm_restore, + .resume = i8042_pm_resume, .thaw = i8042_pm_thaw, .poweroff = i8042_pm_reset, .restore = i8042_pm_restore, @@ -1389,9 +1404,11 @@ static int __init i8042_probe(struct platform_device *dev) i8042_platform_device = dev; - error = i8042_controller_selftest(); - if (error) - return error; + if (i8042_reset) { + error = i8042_controller_selftest(); + if (error) + return error; + } error = i8042_controller_init(); if (error) |