dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

582 Commits

Author SHA1 Message Date
Linus Torvalds ce53044c68 arm-soc: driver specific updates
These changes are specific to some driver that may be used by multiple
 boards or socs. The most significant change in here is the move of the
 samsung iommu code from a platform specific in-kernel interface to the
 generic iommu subsystem.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPuevXAAoJEIwa5zzehBx3D8YQAKfoY3TFjJ9KmJgk69/pc7cf
 Of0rvX+35NezGFljIyRdspz+DsV+vhJravwdVxOagRKvVBOb9qnZIXnl3gkLnTw4
 dCVMFMqCwXhBeXlXCzHSeRmt2+4/fmJnr7jr4xh9omOAJ9BZv5ftmKNW4zP5wr1L
 +9HBwzkxlVisR4NCz2q66YBjsV2dXA3dv2hZxEFkUdQFYJGqZoUXLYHF9yno20i3
 knKNXEyAFYFUKHiFVBQJ1tYGmZlaIjw14g+GTqzZay2Pi/HjUXfrPd0VwNkBzZf/
 H1N3/cf4GJ2+K/zYqh+H/Xjf/Fjkp1dFNhlUQ7+l5Jwbu7C1B2euvwTO4OaqrfdD
 7eqG3+uIKhPO2Z8ZySLFgx4ghybtwgZrAwOjsa+ymTugqPbiWYB/zZR1iWu5DMk/
 TnNb6P3ciP+WMpoMFh1kXRc/eCCCHtuQ0rLRxizSX6HIpxWvjYFNLH7L3wS+KtlB
 7vsS764d1JFW318bsdBi+V/LWRVXeSWWetTzdzDcM/Syz3ZqfPy7e3Ge6qx0lvYe
 5ojgzKwVqpJenZdt91UC16cMXNqDTzmZObz6LOCmVm1mB5kYSgEHYxAQQvuGFjXT
 28kGyBQNsBboJGaYh2O/CTsVXnHnaPXrtDDWMDacWNwwPYnnA2L8lUNfAg1DgA1j
 Z6CO8Knfct01EpQLtybK
 =hgkg
 -----END PGP SIGNATURE-----

Merge tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull arm-soc driver specific updates from Olof Johansson:
 "These changes are specific to some driver that may be used by multiple
  boards or socs.  The most significant change in here is the move of
  the samsung iommu code from a platform specific in-kernel interface to
  the generic iommu subsystem."

Fix up trivial conflicts in arch/arm/mach-exynos/Kconfig

* tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (28 commits)
  mmc: dt: Consolidate DT bindings
  iommu/exynos: Add iommu driver for EXYNOS Platforms
  ARM: davinci: optimize the DMA ISR
  ARM: davinci: implement DEBUG_LL port choice
  ARM: tegra: Add SMMU enabler in AHB
  ARM: tegra: Add Tegra AHB driver
  Input: pxa27x_keypad add choice to set direct_key_mask
  Input: pxa27x_keypad direct key may be low active
  Input: pxa27x_keypad bug fix for direct_key_mask
  Input: pxa27x_keypad keep clock on as wakeup source
  ARM: dt: tegra: pinmux changes for USB ULPI
  ARM: tegra: add USB ULPI PHY reset GPIO to device tree
  ARM: tegra: don't hard-code USB ULPI PHY reset_gpio
  ARM: tegra: change pll_p_out4's rate to 24MHz
  ARM: tegra: fix pclk rate
  ARM: tegra: reparent sclk to pll_c_out1
  ARM: tegra: Add pllc clock init table
  ARM: dt: tegra cardhu: basic audio support
  ARM: dt: tegra30.dtsi: Add audio-related nodes
  ARM: tegra: add AUXDATA required for audio
  ...
2012-05-26 12:22:27 -07:00
Viresh Kumar 829c4f9690 Input: spear-keyboard - add device tree bindings
This adds simple DT bindings for spear-keyboard controller.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-05-10 22:40:02 -07:00
Dmitry Torokhov b45c8f35a7 Input: matrix-keymap - wire up device tree support
When platform keymap is not supplied to matrix_keypad_build_keymap()
and device tree support is enabled, try locating specified property
and load keymap from it. If property name is not defined, try using
"linux,keymap".

Based on earlier patch by Viresh Kumar <viresh.kumar@st.com>

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-05-10 22:39:43 -07:00
Dmitry Torokhov 1932811f42 Input: matrix-keymap - uninline and prepare for device tree support
Change matrix-keymap helper to be out-of-line, like sparse keymap,
allow the helper perform basic keymap validation and return errors,
and prepare for device tree support.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-05-10 22:38:47 -07:00
Jean-François Dagenais d0a3457d38 Input: adp5588 - add support for gpio names
Signed-off-by: Jean-François Dagenais <jeff.dagenais@gmail.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-05-10 22:34:16 -07:00
Poddar, Sourav f77621cc64 Input: omap-keypad - dynamically handle register offsets
Hi Dmitry,

On Wed, May 9, 2012 at 3:14 PM, Poddar, Sourav <sourav.poddar@ti.com> wrote:
> Hi Dmitry,
>
> I did some minor fixes to the patch which you suggested above and
> the keypad is functional now.
>
> Changes:
> - Move "pm_runtime_enable" before using "pm_runtime_get_sync".
>
> Sending the patch inlined..(also attached).
>
> From: G, Manjunath Kondaiah <manjugk@ti.com>
> Date: Mon, 10 Oct 2011 20:52:05 +0530
> Subject: [PATCH] Input: omap-keypad: dynamically handle register offsets
>
> Keypad controller register offsets are different for omap4
> and omap5. Handle these offsets through static mapping and
> assign these mappings during run time.
>
> Tested on omap4430 sdp with 3.4-rc3.
> Tested on omap5430evm with 3.1-custom kernel.
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
> Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
> ---
>  drivers/input/keyboard/Kconfig        |    4 +-
>  drivers/input/keyboard/omap4-keypad.c |  120 +++++++++++++++++++++++++-------
>  2 files changed, 95 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
> index f354813..33bbdee 100644
> --- a/drivers/input/keyboard/Kconfig
> +++ b/drivers/input/keyboard/Kconfig
> @@ -512,9 +512,9 @@ config KEYBOARD_OMAP
>          module will be called omap-keypad.
>
>  config KEYBOARD_OMAP4
> -       tristate "TI OMAP4 keypad support"
> +       tristate "TI OMAP4+ keypad support"
>        help
> -         Say Y here if you want to use the OMAP4 keypad.
> +         Say Y here if you want to use the OMAP4+ keypad.
>
>          To compile this driver as a module, choose M here: the
>          module will be called omap4-keypad.
> diff --git a/drivers/input/keyboard/omap4-keypad.c
> b/drivers/input/keyboard/omap4-keypad.c
> index e809ac0..d7102e8 100644
> --- a/drivers/input/keyboard/omap4-keypad.c
> +++ b/drivers/input/keyboard/omap4-keypad.c
> @@ -68,19 +68,52 @@
>
>  #define OMAP4_MASK_IRQSTATUSDISABLE    0xFFFF
>
> +enum {
> +       KBD_REVISION_OMAP4 = 0,
> +       KBD_REVISION_OMAP5,
> +};
> +
>  struct omap4_keypad {
>        struct input_dev *input;
>
>        void __iomem *base;
> -       int irq;
> +       unsigned int irq;
>
>        unsigned int rows;
>        unsigned int cols;
> +       u32 reg_offset;
> +       u32 irqreg_offset;
>        unsigned int row_shift;
>        unsigned char key_state[8];
>        unsigned short keymap[];
>  };
>
> +static int kbd_readl(struct omap4_keypad *keypad_data, u32 offset)
> +{
> +       return __raw_readl(keypad_data->base +
> +                               keypad_data->reg_offset + offset);
> +}
> +
> +static void kbd_writel(struct omap4_keypad *keypad_data, u32 offset, u32 value)
> +{
> +       __raw_writel(value,
> +                    keypad_data->base + keypad_data->reg_offset + offset);
> +}
> +
> +static int kbd_read_irqreg(struct omap4_keypad *keypad_data, u32 offset)
> +{
> +       return __raw_readl(keypad_data->base +
> +                               keypad_data->irqreg_offset + offset);
> +}
> +
> +static void kbd_write_irqreg(struct omap4_keypad *keypad_data,
> +                            u32 offset, u32 value)
> +{
> +       __raw_writel(value,
> +                    keypad_data->base + keypad_data->irqreg_offset + offset);
> +}
> +
> +
>  /* Interrupt handler */
>  static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
>  {
> @@ -91,12 +124,11 @@ static irqreturn_t omap4_keypad_interrupt(int
> irq, void *dev_id)
>        u32 *new_state = (u32 *) key_state;
>
>        /* Disable interrupts */
> -       __raw_writel(OMAP4_VAL_IRQDISABLE,
> -                    keypad_data->base + OMAP4_KBD_IRQENABLE);
> +       kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
> +                        OMAP4_VAL_IRQDISABLE);
>
> -       *new_state = __raw_readl(keypad_data->base + OMAP4_KBD_FULLCODE31_0);
> -       *(new_state + 1) = __raw_readl(keypad_data->base
> -                                               + OMAP4_KBD_FULLCODE63_32);
> +       *new_state = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE31_0);
> +       *(new_state + 1) = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE63_32);
>
>        for (row = 0; row < keypad_data->rows; row++) {
>                changed = key_state[row] ^ keypad_data->key_state[row];
> @@ -121,12 +153,13 @@ static irqreturn_t omap4_keypad_interrupt(int
> irq, void *dev_id)
>                sizeof(keypad_data->key_state));
>
>        /* clear pending interrupts */
> -       __raw_writel(__raw_readl(keypad_data->base + OMAP4_KBD_IRQSTATUS),
> -                       keypad_data->base + OMAP4_KBD_IRQSTATUS);
> +       kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
> +                        kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
>
>        /* enable interrupts */
> -       __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
> -                       keypad_data->base + OMAP4_KBD_IRQENABLE);
> +       kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
> +               OMAP4_DEF_IRQENABLE_EVENTEN |
> +                               OMAP4_DEF_IRQENABLE_LONGKEY);
>
>        return IRQ_HANDLED;
>  }
> @@ -139,16 +172,17 @@ static int omap4_keypad_open(struct input_dev *input)
>
>        disable_irq(keypad_data->irq);
>
> -       __raw_writel(OMAP4_VAL_FUNCTIONALCFG,
> -                       keypad_data->base + OMAP4_KBD_CTRL);
> -       __raw_writel(OMAP4_VAL_DEBOUNCINGTIME,
> -                       keypad_data->base + OMAP4_KBD_DEBOUNCINGTIME);
> -       __raw_writel(OMAP4_VAL_IRQDISABLE,
> -                       keypad_data->base + OMAP4_KBD_IRQSTATUS);
> -       __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
> -                       keypad_data->base + OMAP4_KBD_IRQENABLE);
> -       __raw_writel(OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA,
> -                       keypad_data->base + OMAP4_KBD_WAKEUPENABLE);
> +       kbd_writel(keypad_data, OMAP4_KBD_CTRL,
> +                       OMAP4_VAL_FUNCTIONALCFG);
> +       kbd_writel(keypad_data, OMAP4_KBD_DEBOUNCINGTIME,
> +                       OMAP4_VAL_DEBOUNCINGTIME);
> +       kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
> +                       OMAP4_VAL_IRQDISABLE);
> +       kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
> +                       OMAP4_DEF_IRQENABLE_EVENTEN |
> +                               OMAP4_DEF_IRQENABLE_LONGKEY);
> +       kbd_writel(keypad_data, OMAP4_KBD_WAKEUPENABLE,
> +                       OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA);
>
>        enable_irq(keypad_data->irq);
>
> @@ -162,12 +196,12 @@ static void omap4_keypad_close(struct input_dev *input)
>        disable_irq(keypad_data->irq);
>
>        /* Disable interrupts */
> -       __raw_writel(OMAP4_VAL_IRQDISABLE,
> -                    keypad_data->base + OMAP4_KBD_IRQENABLE);
> +       kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
> +                        OMAP4_VAL_IRQDISABLE);
>
>        /* clear pending interrupts */
> -       __raw_writel(__raw_readl(keypad_data->base + OMAP4_KBD_IRQSTATUS),
> -                       keypad_data->base + OMAP4_KBD_IRQSTATUS);
> +       kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
> +                        kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
>
>        enable_irq(keypad_data->irq);
>
> @@ -182,6 +216,7 @@ static int __devinit omap4_keypad_probe(struct
> platform_device *pdev)
>        struct resource *res;
>        resource_size_t size;
>        unsigned int row_shift, max_keys;
> +       int rev;
>        int irq;
>        int error;
>
> @@ -241,11 +276,40 @@ static int __devinit omap4_keypad_probe(struct
> platform_device *pdev)
>        keypad_data->rows = pdata->rows;
>        keypad_data->cols = pdata->cols;
>
> +       /*
> +       * Enable clocks for the keypad module so that we can read
> +       * revision register.
> +       */
> +       pm_runtime_enable(&pdev->dev);
> +       error = pm_runtime_get_sync(&pdev->dev);
> +       if (error) {
> +               dev_err(&pdev->dev, "pm_runtime_get_sync() failed\n");
> +               goto err_unmap;
> +       }
> +       rev = __raw_readl(keypad_data->base + OMAP4_KBD_REVISION);
> +       rev &= 0x03 << 30;
> +       rev >>= 30;
> +       switch (rev) {
> +       case KBD_REVISION_OMAP4:
> +               keypad_data->reg_offset = 0x00;
> +               keypad_data->irqreg_offset = 0x00;
> +               break;
> +       case KBD_REVISION_OMAP5:
> +               keypad_data->reg_offset = 0x10;
> +               keypad_data->irqreg_offset = 0x0c;
> +               break;
> +       default:
> +               dev_err(&pdev->dev,
> +                       "Keypad reports unsupported revision %d", rev);
> +               error = -EINVAL;
> +               goto err_pm_put_sync;
> +       }
> +
>        /* input device allocation */
>        keypad_data->input = input_dev = input_allocate_device();
>        if (!input_dev) {
>                error = -ENOMEM;
> -               goto err_unmap;
> +               goto err_pm_put_sync;
>        }
>
>        input_dev->name = pdev->name;
> @@ -273,14 +337,14 @@ static int __devinit omap4_keypad_probe(struct
> platform_device *pdev)
>                        input_dev->keycode, input_dev->keybit);
>
>        error = request_irq(keypad_data->irq, omap4_keypad_interrupt,
> -                            IRQF_TRIGGER_RISING,
> +                           IRQF_DISABLED | IRQF_TRIGGER_RISING,
Sorry, " IRQF_DISABLED" got included by mistake.
Removing this stray change and sending it again.

>                             "omap4-keypad", keypad_data);
>        if (error) {
>                dev_err(&pdev->dev, "failed to register interrupt\n");
>                goto err_free_input;
>        }
>
> -       pm_runtime_enable(&pdev->dev);
> +       pm_runtime_put_sync(&pdev->dev);
>
>        error = input_register_device(keypad_data->input);
>        if (error < 0) {
> @@ -296,6 +360,8 @@ err_pm_disable:
>        free_irq(keypad_data->irq, keypad_data);
>  err_free_input:
>        input_free_device(input_dev);
> +err_pm_put_sync:
> +       pm_runtime_put_sync(&pdev->dev);
>  err_unmap:
>        iounmap(keypad_data->base);
>  err_release_mem:
>
>
> ~Sourav
>
> On Wed, May 9, 2012 at 1:15 PM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
>>> Hi Dmitry ,
>>>
>>>
>>> On Wed, May 9, 2012 at 10:48 AM, Dmitry Torokhov
>>> <dmitry.torokhov@gmail.com> wrote:
>>> > Ho Sourav,
>>> >
>>> > On Thu, Apr 26, 2012 at 11:24:37AM +0530, Sourav Poddar wrote:
>>> >>
>>> >> -config KEYBOARD_OMAP4
>>> >> -     tristate "TI OMAP4 keypad support"
>>> >> +config KEYBOARD_OMAP4+
>>> >
>>> > I think this works purely by accident - '+' sign getting dropped by
>>> > parser...
>>> >
>>> >> @@ -139,16 +192,33 @@ static int omap4_keypad_open(struct input_dev *input)
>>> >>
>>> >>       disable_irq(keypad_data->irq);
>>> >>
>>> >> -     __raw_writel(OMAP4_VAL_FUNCTIONALCFG,
>>> >> -                     keypad_data->base + OMAP4_KBD_CTRL);
>>> >> -     __raw_writel(OMAP4_VAL_DEBOUNCINGTIME,
>>> >> -                     keypad_data->base + OMAP4_KBD_DEBOUNCINGTIME);
>>> >> -     __raw_writel(OMAP4_VAL_IRQDISABLE,
>>> >> -                     keypad_data->base + OMAP4_KBD_IRQSTATUS);
>>> >> -     __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
>>> >> -                     keypad_data->base + OMAP4_KBD_IRQENABLE);
>>> >> -     __raw_writel(OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA,
>>> >> -                     keypad_data->base + OMAP4_KBD_WAKEUPENABLE);
>>> >> +     keypad_data->revision = kbd_read_revision(keypad_data,
>>> >> +                     OMAP4_KBD_REVISION);
>>> >> +     switch (keypad_data->revision) {
>>> >> +     case 1:
>>> >> +             keypad_data->irqstatus = OMAP4_KBD_IRQSTATUS + 0x0c;
>>> >> +             keypad_data->irqenable = OMAP4_KBD_IRQENABLE + 0x0c;
>>> >> +             keypad_data->reg_offset = 0x10;
>>> >> +             break;
>>> >
>>> > This should be done in probe().
>>> >
>>> Dont we then require "pm_runtime_put_sync" in probe, since we are trying
>>> to read the keypad revision register.?
>>
>> Ah, indeed, but I think not pm_runtime_get_sync() but
>> pm_runtime_set_active().
>>
>> Not sure if this will fix the crash...
>>
>> --
>> Dmitry
>>
>>
>> Input: omap-keypad - dynamically handle register offsets
>>
>> From: G, Manjunath Kondaiah <manjugk@ti.com>
>>
>> Keypad controller register offsets are different for omap4
>> and omap5. Handle these offsets through static mapping and
>> assign these mappings during run time.
>>
>> Tested on omap4430 sdp with 3.4-rc3.
>> Tested on omap5430evm with 3.1-custom kernel.
>>
>> Signed-off-by: Felipe Balbi <balbi@ti.com>
>> Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
>> Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
>> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
>> ---
>>
>>  drivers/input/keyboard/Kconfig        |    4 +
>>  drivers/input/keyboard/omap4-keypad.c |  117 ++++++++++++++++++++++++++-------
>>  2 files changed, 94 insertions(+), 27 deletions(-)
>>
>>
>> diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
>> index 20a3753..84ee155 100644
>> --- a/drivers/input/keyboard/Kconfig
>> +++ b/drivers/input/keyboard/Kconfig
>> @@ -531,9 +531,9 @@ config KEYBOARD_OMAP
>>          module will be called omap-keypad.
>>
>>  config KEYBOARD_OMAP4
>> -       tristate "TI OMAP4 keypad support"
>> +       tristate "TI OMAP4+ keypad support"
>>        help
>> -         Say Y here if you want to use the OMAP4 keypad.
>> +         Say Y here if you want to use the OMAP4+ keypad.
>>
>>          To compile this driver as a module, choose M here: the
>>          module will be called omap4-keypad.
>> diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
>> index e809ac0..c9fd0df 100644
>> --- a/drivers/input/keyboard/omap4-keypad.c
>> +++ b/drivers/input/keyboard/omap4-keypad.c
>> @@ -68,19 +68,52 @@
>>
>>  #define OMAP4_MASK_IRQSTATUSDISABLE    0xFFFF
>>
>> +enum {
>> +       KBD_REVISION_OMAP4 = 0,
>> +       KBD_REVISION_OMAP5,
>> +};
>> +
>>  struct omap4_keypad {
>>        struct input_dev *input;
>>
>>        void __iomem *base;
>> -       int irq;
>> +       unsigned int irq;
>>
>>        unsigned int rows;
>>        unsigned int cols;
>> +       u32 reg_offset;
>> +       u32 irqreg_offset;
>>        unsigned int row_shift;
>>        unsigned char key_state[8];
>>        unsigned short keymap[];
>>  };
>>
>> +static int kbd_readl(struct omap4_keypad *keypad_data, u32 offset)
>> +{
>> +       return __raw_readl(keypad_data->base +
>> +                               keypad_data->reg_offset + offset);
>> +}
>> +
>> +static void kbd_writel(struct omap4_keypad *keypad_data, u32 offset, u32 value)
>> +{
>> +       __raw_writel(value,
>> +                    keypad_data->base + keypad_data->reg_offset + offset);
>> +}
>> +
>> +static int kbd_read_irqreg(struct omap4_keypad *keypad_data, u32 offset)
>> +{
>> +       return __raw_readl(keypad_data->base +
>> +                               keypad_data->irqreg_offset + offset);
>> +}
>> +
>> +static void kbd_write_irqreg(struct omap4_keypad *keypad_data,
>> +                            u32 offset, u32 value)
>> +{
>> +       __raw_writel(value,
>> +                    keypad_data->base + keypad_data->irqreg_offset + offset);
>> +}
>> +
>> +
>>  /* Interrupt handler */
>>  static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
>>  {
>> @@ -91,12 +124,11 @@ static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
>>        u32 *new_state = (u32 *) key_state;
>>
>>        /* Disable interrupts */
>> -       __raw_writel(OMAP4_VAL_IRQDISABLE,
>> -                    keypad_data->base + OMAP4_KBD_IRQENABLE);
>> +       kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
>> +                        OMAP4_VAL_IRQDISABLE);
>>
>> -       *new_state = __raw_readl(keypad_data->base + OMAP4_KBD_FULLCODE31_0);
>> -       *(new_state + 1) = __raw_readl(keypad_data->base
>> -                                               + OMAP4_KBD_FULLCODE63_32);
>> +       *new_state = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE31_0);
>> +       *(new_state + 1) = kbd_readl(keypad_data, OMAP4_KBD_FULLCODE63_32);
>>
>>        for (row = 0; row < keypad_data->rows; row++) {
>>                changed = key_state[row] ^ keypad_data->key_state[row];
>> @@ -121,12 +153,13 @@ static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
>>                sizeof(keypad_data->key_state));
>>
>>        /* clear pending interrupts */
>> -       __raw_writel(__raw_readl(keypad_data->base + OMAP4_KBD_IRQSTATUS),
>> -                       keypad_data->base + OMAP4_KBD_IRQSTATUS);
>> +       kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
>> +                        kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
>>
>>        /* enable interrupts */
>> -       __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
>> -                       keypad_data->base + OMAP4_KBD_IRQENABLE);
>> +       kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
>> +               OMAP4_DEF_IRQENABLE_EVENTEN |
>> +                               OMAP4_DEF_IRQENABLE_LONGKEY);
>>
>>        return IRQ_HANDLED;
>>  }
>> @@ -139,16 +172,17 @@ static int omap4_keypad_open(struct input_dev *input)
>>
>>        disable_irq(keypad_data->irq);
>>
>> -       __raw_writel(OMAP4_VAL_FUNCTIONALCFG,
>> -                       keypad_data->base + OMAP4_KBD_CTRL);
>> -       __raw_writel(OMAP4_VAL_DEBOUNCINGTIME,
>> -                       keypad_data->base + OMAP4_KBD_DEBOUNCINGTIME);
>> -       __raw_writel(OMAP4_VAL_IRQDISABLE,
>> -                       keypad_data->base + OMAP4_KBD_IRQSTATUS);
>> -       __raw_writel(OMAP4_DEF_IRQENABLE_EVENTEN | OMAP4_DEF_IRQENABLE_LONGKEY,
>> -                       keypad_data->base + OMAP4_KBD_IRQENABLE);
>> -       __raw_writel(OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA,
>> -                       keypad_data->base + OMAP4_KBD_WAKEUPENABLE);
>> +       kbd_writel(keypad_data, OMAP4_KBD_CTRL,
>> +                       OMAP4_VAL_FUNCTIONALCFG);
>> +       kbd_writel(keypad_data, OMAP4_KBD_DEBOUNCINGTIME,
>> +                       OMAP4_VAL_DEBOUNCINGTIME);
>> +       kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
>> +                       OMAP4_VAL_IRQDISABLE);
>> +       kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
>> +                       OMAP4_DEF_IRQENABLE_EVENTEN |
>> +                               OMAP4_DEF_IRQENABLE_LONGKEY);
>> +       kbd_writel(keypad_data, OMAP4_KBD_WAKEUPENABLE,
>> +                       OMAP4_DEF_WUP_EVENT_ENA | OMAP4_DEF_WUP_LONG_KEY_ENA);
>>
>>        enable_irq(keypad_data->irq);
>>
>> @@ -162,12 +196,12 @@ static void omap4_keypad_close(struct input_dev *input)
>>        disable_irq(keypad_data->irq);
>>
>>        /* Disable interrupts */
>> -       __raw_writel(OMAP4_VAL_IRQDISABLE,
>> -                    keypad_data->base + OMAP4_KBD_IRQENABLE);
>> +       kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
>> +                        OMAP4_VAL_IRQDISABLE);
>>
>>        /* clear pending interrupts */
>> -       __raw_writel(__raw_readl(keypad_data->base + OMAP4_KBD_IRQSTATUS),
>> -                       keypad_data->base + OMAP4_KBD_IRQSTATUS);
>> +       kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS,
>> +                        kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS));
>>
>>        enable_irq(keypad_data->irq);
>>
>> @@ -182,6 +216,7 @@ static int __devinit omap4_keypad_probe(struct platform_device *pdev)
>>        struct resource *res;
>>        resource_size_t size;
>>        unsigned int row_shift, max_keys;
>> +       int rev;
>>        int irq;
>>        int error;
>>
>> @@ -241,11 +276,40 @@ static int __devinit omap4_keypad_probe(struct platform_device *pdev)
>>        keypad_data->rows = pdata->rows;
>>        keypad_data->cols = pdata->cols;
>>
>> +       /*
>> +        * Mark device as active (and wake up its parent) so we can read
>> +        * revision register.
>> +        */
>> +       error = pm_runtime_set_active(&pdev->dev);
>> +       if (error) {
>> +               dev_err(&pdev->dev, "pm_runtime_set_active() failed\n");
>> +               goto err_unmap;
>> +       }
>> +
>> +       rev = __raw_readl(keypad_data->base + OMAP4_KBD_REVISION);
>> +       rev &= 0x03 << 30;
>> +       rev >>= 30;
>> +       switch (rev) {
>> +       case KBD_REVISION_OMAP4:
>> +               keypad_data->reg_offset = 0x00;
>> +               keypad_data->irqreg_offset = 0x00;
>> +               break;
>> +       case KBD_REVISION_OMAP5:
>> +               keypad_data->reg_offset = 0x10;
>> +               keypad_data->irqreg_offset = 0x0c;
>> +               break;
>> +       default:
>> +               dev_err(&pdev->dev,
>> +                       "Keypad reports unsupported revision %d", rev);
>> +               error = -EINVAL;
>> +               goto err_pm_suspended;
>> +       }
>> +
>>        /* input device allocation */
>>        keypad_data->input = input_dev = input_allocate_device();
>>        if (!input_dev) {
>>                error = -ENOMEM;
>> -               goto err_unmap;
>> +               goto err_pm_suspended;
>>        }
>>
>>        input_dev->name = pdev->name;
>> @@ -281,6 +345,7 @@ static int __devinit omap4_keypad_probe(struct platform_device *pdev)
>>        }
>>
>>        pm_runtime_enable(&pdev->dev);
>> +       pm_runtime_put_sync(&pdev->dev);
>>
>>        error = input_register_device(keypad_data->input);
>>        if (error < 0) {
>> @@ -296,6 +361,8 @@ err_pm_disable:
>>        free_irq(keypad_data->irq, keypad_data);
>>  err_free_input:
>>        input_free_device(input_dev);
>> +err_pm_suspended:
>> +       pm_runtime_set_suspended(&pdev->dev);
>>  err_unmap:
>>        iounmap(keypad_data->base);
>>  err_release_mem:

From: G, Manjunath Kondaiah <manjugk@ti.com>
Date: Mon, 10 Oct 2011 20:52:05 +0530
Subject: [PATCH] Input: omap-keypad: dynamically handle register offsets

Keypad controller register offsets are different for omap4
and omap5. Handle these offsets through static mapping and
assign these mappings during run time.

Tested on omap4430 sdp with 3.4-rc3.
Tested on omap5430evm with 3.1-custom kernel.

Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com>
Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-05-10 22:33:58 -07:00
Chao Xie fb054bf269 Input: pxa27x_keypad add choice to set direct_key_mask
Direct keys usage may not start from KP_DKIN0, add a msk option
to configure the specifics for platforms that can skip some keys.

Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
2012-04-27 16:50:05 +08:00
Chao Xie ee1d8040a6 Input: pxa27x_keypad direct key may be low active
KPDK_DK only indicates the pin level of direct key.
So it is related to board, and low level may be active which
indicates that a key is pressed.

Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
2012-04-27 16:49:07 +08:00
Chao Xie 5545fa897a Input: pxa27x_keypad bug fix for direct_key_mask
When direcct_key_num is 0, the mask should be 0.
When direcct_key_num is 1, the mask should be 0b1.

Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
2012-04-27 16:48:33 +08:00
Chao Xie 6ce34a5fb4 Input: pxa27x_keypad keep clock on as wakeup source
When the keypad is used as wake up source, the clock can not
be disabled. Or it can not detect key pressing.
If the keypad is used as wake up source, when resume back,
do not enable the clock and configure it again because the
register content is retained.

Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
2012-04-27 16:48:09 +08:00
Jesper Juhl f57fe78ee4 Input: atkbd - fix language in a printed message
I believe that "trying to access hardware" is more correct English
than "trying access hardware".

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-04-23 23:35:53 -07:00
Dmitry Torokhov 57b8628bb0 Merge commit 'v3.4-rc4' into next 2012-04-21 23:28:35 -07:00
Dmitry Torokhov 71f3d070a3 Input: tc3589x-keypad - remove unnecessary checks
settle_time and debounce_period are u8 and thus can not be greater than
TC3589x_MAX_DEBOUNCE_SETTLE which is 255.

There also no need to mask out nibbles form board->krow and board->kcol
as we validate that they are in correct range.

Reported-by: Werner <w.landgraf@ru.ru>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-04-20 23:08:48 -07:00
Dmitry Torokhov b83643ebf2 Input: matrix-keypad - undo GPIO setup if input_register_device fails
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-04-20 23:06:52 -07:00
Dmitry Torokhov 01111fcd42 Input: matrix-keypad - allocate keycodes with keypad structure
Instead of allocating and managing keymap separately from the keypad
structure stick it at the end as a variable-length array.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-04-20 23:06:49 -07:00
Dmitry Torokhov 0508c19a6f Input: matrix-keypad - fix 'duplicate const' sparse warning
SIMPLE_DEV_PM_OPS already defines constant dev_pm_ops.

Also guard PM methods with CONFIG_PM_SLEEP and get rid of some
unneeded #ifdefs.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-04-20 23:06:45 -07:00
Dmitry Torokhov b5e9528bd1 Input: ep93xx_keypad - switch to using dev_pm_ops
Also use CONFIG_PM_SLEEP instead of CONFIG_PM to guard PM methods.

Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-04-11 00:14:16 -07:00
Axel Lin 65ac9f7a23 Input: serio - use module_serio_driver
This patch converts the drivers in drivers/input/* to use
module_serio_driver() macro which makes the code smaller and
a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-04-04 09:25:43 -07:00
Wolfram Sang 0bf25a4538 Input: add support for LM8333 keypads
This driver adds support for the keypad part of the LM8333 and is
prepared for possible GPIO/PWM drivers. Note that this is not a MFD
because you cannot disable the keypad functionality which, thus,
has to be handled by the core anyhow.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-04-04 09:25:39 -07:00
Linus Torvalds 2f7fa1be66 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull 2nd round of input updates from Dmitry Torokhov:
 - update to Wacom driver to support wireless devices
 - update to Sentelci touchpad driver to support newer hardware
 - update to gpio-keys driver to support "interrupt-only" keys
 - fixups to earlier commits

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: wacom - check for allocation failure in probe()
  Input: tegra-kbc - allocate pdata before using it
  Input: amijoy - add missing platform check
  Input: wacom - wireless battery status
  Input: wacom - create inputs when wireless connect
  Input: wacom - wireless monitor framework
  Input: wacom - isolate input registration
  Input: sentelic - improve packet debugging information
  Input: sentelic - minor code cleanup
  Input: sentelic - enabling absolute coordinates output for newer hardware
  Input: sentelic - refactor code for upcoming new hardware support
  Input: gpio_keys - add support for interrupt only keys
  Input: gpio_keys - consolidate key destructor code
  Input: revert "gpio_keys - switch to using threaded IRQs"
  Input: gpio_keys - constify platform data
  Input: spear-keyboard - remove kbd_set_plat_data()
2012-03-29 23:17:44 -07:00
Linus Torvalds 9e4db1c3ee Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm
Pull ARM platform updates from Russell King:
 "This covers platform stuff for platforms I have a direct interest in
  (iow, I have the hardware).  Essentially:
   - as we no longer support any other Acorn platforms other than RiscPC
     anymore, we can collect all that code into mach-rpc.
   - convert Acorn expansion card stuff to use IRQ allocation functions,
     and get rid of NO_IRQ from there.
   - cleanups to the ebsa110 platform to move some private stuff out of
     its header files.
   - large amount of SA11x0 updates:
   - conversion of private DMA implementation to DMA engine support
     (this actually gives us greater flexibility in drivers over the old
     API.)
   - re-worked ucb1x00 updates - convert to genirq, remove sa11x0
     dependencies, fix various minor issues
   - move platform specific sa11x0 framebuffer data into platform files
     in arch/arm instead of keeping this in the driver itself
   - update sa11x0 IrDA driver for DMA engine, and allow it to use DMA
     for SIR transmissions as well as FIR
   - rework sa1111 support for genirq, and irq allocation
   - fix sa1111 IRQ support so it works again
   - use sparse IRQ support

  After this, I have one more pull request remaining from my current
  set, which I think is going to be the most problematical as it
  generates 8 conflicts."

Fixed up the trivial conflict in arch/arm/mach-rpc/Makefile as per
Russell.

* 'platforms' of git://git.linaro.org/people/rmk/linux-arm: (125 commits)
  ARM: 7343/1: sa11x0: convert to sparse IRQ
  ARM: 7342/2: sa1100: prepare for sparse irq conversion
  ARM: 7341/1: input: prepare jornada720 keyboard and ts for sa11x0 sparse irq
  ARM: 7340/1: rtc: sa1100: include mach/irqs.h instead of asm/irq.h
  ARM: sa11x0: remove unused DMA controller definitions
  ARM: sa11x0: remove old SoC private DMA driver
  USB: sa1111: add hcd .reset method
  USB: sa1111: add OHCI shutdown methods
  USB: sa1111: reorganize ohci-sa1111.c
  USB: sa1111: get rid of nasty printk(KERN_DEBUG "%s: ...", __FILE__)
  USB: sa1111: sparse and checkpatch cleanups
  ARM: sa11x0: don't static map sa1111
  ARM: sa1111: use dev_err() rather than printk()
  ARM: sa1111: cleanup sub-device registration and unregistration
  ARM: sa1111: only setup DMA for DMA capable devices
  ARM: sa1111: register sa1111 devices with dmabounce in bus notifier
  ARM: sa1111: move USB interface register definitions to ohci-sa1111.c
  ARM: sa1111: move PCMCIA interface register definitions to sa1111_generic.c
  ARM: sa1111: move PS/2 interface register definitions to sa1111p2.c
  ARM: sa1111: delete unused physical GPIO register definitions
  ...
2012-03-27 18:17:02 -07:00
Viresh Kumar 131c713fd9 Input: tegra-kbc - allocate pdata before using it
Following commit broke DT support for tegra-kbc by removing pdata
allocation completely:

   commit 023cea0ecf
   Author: Shridhar Rasal <srasal@nvidia.com>
   Date:   Fri Feb 3 00:27:30 2012 -0800

       Input: tegra-kbc - allow skipping setting up some of GPIO pins

This patch restores it.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-03-27 00:14:35 -07:00
Rob Herring 3638dd2b45 ARM: 7341/1: input: prepare jornada720 keyboard and ts for sa11x0 sparse irq
In preparation for sa11x0 sparse irq conversion, explicitly include
mach/irqs.h as it will not be included for sparse irq.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-03-25 23:57:19 +01:00
Laxman Dewangan d8ee4a1c90 Input: gpio_keys - add support for interrupt only keys
Some of buttons, like power-on key or onkey, may only generate interrupts
when pressed and not actually be mapped as gpio in the system. Allow
setting gpio to invalid value and specify IRQ instead to support such
keys. The debounce timer is used not to debounce but to ignore new IRQs
coming while button is kept pressed.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-03-19 17:56:18 -07:00
Dmitry Torokhov a16ca23935 Input: gpio_keys - consolidate key destructor code
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-03-19 17:56:14 -07:00
David Jander 6709c9a5d8 Input: revert "gpio_keys - switch to using threaded IRQs"
request_any_context_irq() should handle the case when using GPIO expanders
that themselves use threaded IRQs, and so the premise of change
7e2ecdf438 is incorrect.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-03-19 17:56:04 -07:00
Dmitry Torokhov d9080921aa Input: gpio_keys - constify platform data
The platform data should not be altered and therefore should be
accessed through const pointers.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-03-19 17:55:45 -07:00
Axel Lin 1b92c1cf6b Input: convert I2C drivers to use module_i2c_driver()
This patch converts the drivers in drivers/input/* to use the
module_i2c_driver() macro which makes the code smaller and a bit
simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-03-16 23:06:19 -07:00
Felipe Balbi 0f1142a514 Input: omap4-keypad - move platform_data to <linux/platform_data>
This patch allows us to drop the OMAP dependency from the OMAP4 keypad
driver.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-03-16 22:49:46 -07:00
Olof Johansson 145e97348a Input: tegra-kbc - revise device tree support
This is an incremental patch updating to the revised bindings for
matrix keyboards.

This includes an optional "linux,fn-keymap" binding that is not yet
implemented, that will be used to specify the Fn-key modifier layout
if needed.

Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-03-13 21:37:07 -07:00
Olof Johansson 2cd36877ad Input: of_keymap - add device tree bindings for simple key matrices
This adds a simple device tree binding for simple key matrix data and
a helper to fill in the platform data.

Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-03-13 21:37:04 -07:00
Dmitry Torokhov b675b3667f Merge commit 'v3.3-rc6' into next 2012-03-09 10:55:17 -08:00
Viresh Kumar f79e30a809 Input: spear-keyboard - provide thaw and poweroff routines
Thaw and poweroff routines are missing for spear-keyboard. They are
required for:
- Error case scenarios during freeze
- Using test features, of hibernate.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-02-28 01:18:32 -08:00
Rajeev Kumar f8354c60ca Input: spear-keyboard - configure device according to supplied mode
Let platform pass mode information to keyboard driver according to which
it configures itself. The mode can be
 - KEYPAD_9x9     0
 - KEYPAD_6x6     1
 - KEYPAD_2x2     2

Signed-off-by: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-02-28 01:18:32 -08:00
Linus Torvalds 31c150a11c 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:
  Input: i8042 - add Lenovo Ideapad U455 to 'reset' blacklist
  Input: serio_raw - return proper result when serio_raw_read fails
  Input: document device properties
  Input: twl4030_keypad - fix comment (trivial)
  Input: gpio_keys - fix struct device declared inside parameter list
  Input: evdev - fix variable initialisation
2012-02-04 10:57:42 -08:00
Shridhar Rasal 023cea0ecf Input: tegra-kbc - allow skipping setting up some of GPIO pins
Allow marking some of GPIO pins as ignored to to avoid continuously
generating KBC input events.

Signed-off-by: Shridhar Rasal <srasal@nvidia.com>

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-02-03 00:29:06 -08:00
Felipe Contreras 4936f97cbb Input: twl4030_keypad - fix comment (trivial)
And trivial whitespace fixes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-02-01 09:14:03 -08:00
Rakesh Iyer b6834b02e4 Input: tegra-kbc - enable key interrupt for wakeup
Enable keypress interrupt to support wakeup from low power state.

Signed-off-by: Rakesh Iyer <riyer@nvidia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-01-23 00:02:46 -08:00
Mark Brown 69898e512a Input: samsung-keypad - don't synchronise with runtime PM put
We don't actually care if the device has been runtime suspended immediately
so we can just drop the reference without waiting for any state change to
be implemented. This may allow us to avoid some suspend/resume cycles and
is a bit more friendly to the rest of the system.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-01-23 00:02:36 -08:00
Dmitry Torokhov 89f0f170fb Input: nomadik-ske-keypad - convert to using SIMPLE_DEV_PM_OPS
Also proper guard for system suspend/resume methods is CONFIG_PM_SLEEP,
not CONFIG_PM.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-01-23 00:02:18 -08:00
Dmitry Torokhov db3dbd093a Input: nomadik-ske-keypad - do not assign driver's probe() method
Because we are using platform_device_probe() to register the driver
we do not need to assign driver's probe method. We also can mark
ske_keypad_probe(), together with ske_keypad_chip_init(), as __init
instead of __devinit.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-01-23 00:02:12 -08:00
Linus Torvalds 2485a4b610 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:
  Input: bcm5974 - set BUTTONPAD property
  Input: serio_raw - return proper result when serio_raw_write fails
  Input: serio_raw - really signal HUP upon disconnect
  Input: serio_raw - remove stray semicolon
  Input: revert some over-zealous conversions to module_platform_driver()
2012-01-12 12:40:41 -08:00
Dmitry Torokhov d3d25808df Input: revert some over-zealous conversions to module_platform_driver()
Recent conversion to module_platform_driver() went a bit too far and
converted not only drivers that used platform_driver_register() but
also ones using platform_driver_probe(), breaking them in process.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-01-10 23:12:46 -08:00
Linus Torvalds dbe950f201 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: (64 commits)
  Input: tc3589x-keypad - add missing kerneldoc
  Input: ucb1400-ts - switch to using dev_xxx() for diagnostic messages
  Input: ucb1400_ts - convert to threaded IRQ
  Input: ucb1400_ts - drop inline annotations
  Input: usb1400_ts - add __devinit/__devexit section annotations
  Input: ucb1400_ts - set driver owner
  Input: ucb1400_ts - convert to use dev_pm_ops
  Input: psmouse - make sure we do not use stale methods
  Input: evdev - do not block waiting for an event if fd is nonblock
  Input: evdev - if no events and non-block, return EAGAIN not 0
  Input: evdev - only allow reading events if a full packet is present
  Input: add driver for pixcir i2c touchscreens
  Input: samsung-keypad - implement runtime power management support
  Input: tegra-kbc - report wakeup key for some platforms
  Input: tegra-kbc - add device tree bindings
  Input: add driver for AUO In-Cell touchscreens using pixcir ICs
  Input: mpu3050 - configure the sampling method
  Input: mpu3050 - ensure we enable interrupts
  Input: mpu3050 - add of_match table for device-tree probing
  Input: sentelic - document the latest hardware
  ...

Fix up fairly trivial conflicts (device tree matching conflicting with
some independent cleanups) in drivers/input/keyboard/samsung-keypad.c
2012-01-10 10:55:52 -08:00
Naga Radhesh dab78d7924 Input: tc3589x-keypad - add missing kerneldoc
This adds two missing kerneldoc entries for the TC3589x
keypad driver.

Signed-off-by: Naga Radhesh <naga.radheshy@stericsson.com>
Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2012-01-04 22:20:09 -08:00
Mark Brown 48c98b1bb8 Input: samsung-keypad - implement runtime power management support
When runtime power management is enabled put the Samsung keypad driver
into suspend mode with wakeups disabled whenever the device is open but
a key is not actually been pressed. As well as saving a trivial amount of
power this will support the use of SoC wide idle modes which put the entire
device into a retention mode and use explicit wakeup sources to exit.

Since not all of the interrupt controllers used with the driver support
set_irq_wake() (though they all do the right thing) and there's a nasty
WARN() when we disable wake after failing to enable it keep track of the
current wake status from runtime PM and only disable wake if we managed
to enable it; I'm not entirely sure why this doesn't affect the existing
uses of the API in the driver.

System suspend is unaffected as the driver core will runtime resume any
suspended devices prior to system suspend.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

Conflicts:

	drivers/input/keyboard/samsung-keypad.c
2011-12-30 00:39:19 -08:00
Rakesh Iyer fd0fc21350 Input: tegra-kbc - report wakeup key for some platforms
Tegra kbc cannot detect exact keypress causing wakeup in interrupt mode.
Allow wakeup keypress to be reported for certain platforms.

Signed-off-by: Rakesh Iyer <riyer@nvidia.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-12-30 00:27:00 -08:00
Olof Johansson a445c7f0af Input: tegra-kbc - add device tree bindings
This adds a simple device tree binding to the tegra keyboard controller.

Also, mark the default keymap as __devinitdata since it is not referenced
after boot.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-12-30 00:26:00 -08:00
Thomas Abraham b3d6ac3e5f input: samsung-keypad: Add device tree support
Add device tree based discovery support for Samsung's keypad controller.

Cc: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: Donghwa Lee <dh09.lee@samsung.com>
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
2011-12-23 10:07:10 +09:00
Axel Lin aeec05171d Input: keyboard - staticise non-exported symbols
These symbols are not used outside it's driver so no need to
make the symbol global.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2011-12-12 00:03:00 -08:00