- 31 3月, 2014 1 次提交
-
-
由 Alexander Shiyan 提交于
This patch adds a new driver for keypad for Cirrus Logic CLPS711X CPUs. Target CPU contain keyboard interface which can scan 8 column lines, so we can read row GPIOs to read status and determine asserted state. Signed-off-by: NAlexander Shiyan <shc_work@mail.ru> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 28 3月, 2014 1 次提交
-
-
由 Arnd Bergmann 提交于
The tnetv107x platform is getting removed, so the touchscreen and keypad drivers for this platform will no longer be needed either. Signed-off-by: NArnd Bergmann <arnd@arndb.de> Acked-by: NSekhar Nori <nsekhar@ti.com> Acked-by: NKevin Hilman <khilman@linaro.org> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: linux-input@vger.kernel.org Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 06 12月, 2013 1 次提交
-
-
由 Laurent Pinchart 提交于
Hardware supported by the driver is only found on SUPERH or ARCH_SHMOBILE platforms. Restrict non-COMPILE_TEST compilation to them. Signed-off-by: NLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: NSimon Horman <horms+renesas@verge.net.au> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 31 10月, 2013 2 次提交
-
-
由 Laurent Pinchart 提交于
Renesas ARM platforms are transitioning from single-platform to multi-platform kernels using the new ARCH_SHMOBILE_MULTI. Make the driver available on all ARM platforms to enable it on both ARCH_SHMOBILE and ARCH_SHMOBILE_MULTI, and increase build testing coverage with COMPILE_TEST. Signed-off-by: NLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: NSimon Horman <horms@verge.net.au> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
由 Tom Gundersen 提交于
There is plenty of consumer hardware (e.g., mac books) that does not use AT keyboards or PS/2 mice. It therefore makes sense for distro kernels to build the related drivers as modules to avoid loading them on hardware that does not need them. As such, these options should no longer be protected by EXPERT. Moreover, building these drivers as modules gets rid of the following ugly error during boot: [ 2.337745] i8042: PNP: No PS/2 controller found. Probing ports directly. [ 3.439537] i8042: No controller found Signed-off-by: NTom Gundersen <teg@jklm.no> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 13 9月, 2013 1 次提交
-
-
由 Martin Schwidefsky 提交于
After the last architecture switched to generic hard irqs the config options HAVE_GENERIC_HARDIRQS & GENERIC_HARDIRQS and the related code for !CONFIG_GENERIC_HARDIRQS can be removed. Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
-
- 19 6月, 2013 1 次提交
-
-
由 Chao Xie 提交于
pxa27x-keypad includes matrix keys. Make use of matrix_keymap for the matrix keys. Signed-off-by: NChao Xie <chao.xie@marvell.com> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 11 6月, 2013 1 次提交
-
-
由 Ben Hutchings 提交于
Several drivers don't build on s390 with CONFIG_PCI disabled as they require MMIO functions. Signed-off-by: NBen Hutchings <ben@decadent.org.uk> Cc: stable@vger.kernel.org # 3.9 Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 05 6月, 2013 1 次提交
-
-
由 Daniel Tang 提交于
This is a driver for the keypads found on the TI-Nspire series calculators. Signed-off-by: NDaniel Tang <dt.tangr@gmail.com> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 16 4月, 2013 1 次提交
-
-
由 Alexandre Courbot 提交于
GENERIC_GPIO is now equivalent to GPIOLIB and features that depended on GENERIC_GPIO can now depend on GPIOLIB to allow removal of this option. Signed-off-by: NAlexandre Courbot <acourbot@nvidia.com> Acked-by: NLinus Walleij <linus.walleij@linaro.org> Acked-by: NGrant Likely <grant.likely@secretlab.ca>
-
- 05 4月, 2013 1 次提交
-
-
由 Simon Glass 提交于
Use the key-matrix layer to interpret key scan information from the EC and inject input based on the FDT-supplied key map. This driver registers itself with the ChromeOS EC driver to perform communications. The matrix-keypad FDT binding is used with a small addition to control ghosting. Signed-off-by: NSimon Glass <sjg@chromium.org> Signed-off-by: NLuigi Semenzato <semenzato@chromium.org> Signed-off-by: NVincent Palatin <vpalatin@chromium.org> Acked-by: NDmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
-
- 16 2月, 2013 1 次提交
-
-
由 Stephen Warren 提交于
Tegra only supports, and always enables, device tree. Remove all ifdefs and runtime checks for DT support from the driver. Platform data is therefore no longer required. Delete the header that defines it, and rework the driver to parse the device tree directly into struct tegra_kbc. Signed-off-by: NStephen Warren <swarren@nvidia.com> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 14 2月, 2013 2 次提交
-
-
由 Heiko Carstens 提交于
When removing the !S390 dependency from drivers/input/Kconfig a couple of drivers don't compile because they have a dependency on GENERIC_HARDIRQS. So add the missing dependencies. Fixes e.g. this one: drivers/input/keyboard/lm8323.c: In function ‘lm8323_suspend’: drivers/input/keyboard/lm8323.c:801:2: error: implicit declaration of function ‘irq_set_irq_wake’ [-Werror=implicit-function-declaration] Cc: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
-
由 Heiko Carstens 提交于
When removing the !S390 dependency from drivers/input/Kconfig a couple of drivers don't compile because they have a dependency on GENERIC_HARDIRQS. So add the missing dependencies. Fixes e.g. this one: drivers/input/keyboard/lm8323.c: In function ‘lm8323_suspend’: drivers/input/keyboard/lm8323.c:801:2: error: implicit declaration of function ‘irq_set_irq_wake’ [-Werror=implicit-function-declaration] Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 07 2月, 2013 1 次提交
-
-
由 Joe Millenbach 提交于
Backing out changes made in earlier TTY removal patch. Switched to only one dependency in SERPORT on TTY instead of many incorrect dependencies. Signed-off-by: NJoe Millenbach <jmillenbach@gmail.com> Reported-by: NDmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 25 1月, 2013 1 次提交
-
-
由 Brian Swetland 提交于
This device is a direct pipe from "hardware" to the input event subsystem, allowing us to avoid having to route "keypad" style events through an AT keyboard driver (gross!). As with the other submissions this driver is cross architecture. Signed-off-by: NMike A. Chan <mikechan@google.com> [Tided up to work on x86] Signed-off-by: NSheng Yang <sheng@linux.intel.com> Signed-off-by: NYunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: NXiaohui Xin <xiaohui.xin@intel.com> Signed-off-by: NJun Nakajima <jun.nakajima@intel.com> Signed-off-by: NBruce Beare <bruce.j.beare@intel.com> [Ported to 3.4] Signed-off-by: NTom Keel <thomas.keel@intel.com> [Cleaned up for 3.7 and submission] Signed-off-by: NAlan Cox <alan@linux.intel.com> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 19 1月, 2013 1 次提交
-
-
由 Joe Millenbach 提交于
The option allows you to remove TTY and compile without errors. This saves space on systems that won't support TTY interfaces anyway. bloat-o-meter output is below. The bulk of this patch consists of Kconfig changes adding "depends on TTY" to various serial devices and similar drivers that require the TTY layer. Ideally, these dependencies would occur on a common intermediate symbol such as SERIO, but most drivers "select SERIO" rather than "depends on SERIO", and "select" does not respect dependencies. bloat-o-meter output comparing our previous minimal to new minimal by removing TTY. The list is filtered to not show removed entries with awk '$3 != "-"' as the list was very long. add/remove: 0/226 grow/shrink: 2/14 up/down: 6/-35356 (-35350) function old new delta chr_dev_init 166 170 +4 allow_signal 80 82 +2 static.__warned 143 142 -1 disallow_signal 63 62 -1 __set_special_pids 95 94 -1 unregister_console 126 121 -5 start_kernel 546 541 -5 register_console 593 588 -5 copy_from_user 45 40 -5 sys_setsid 128 120 -8 sys_vhangup 32 19 -13 do_exit 1543 1526 -17 bitmap_zero 60 40 -20 arch_local_irq_save 137 117 -20 release_task 674 652 -22 static.spin_unlock_irqrestore 308 260 -48 Signed-off-by: NJoe Millenbach <jmillenbach@gmail.com> Reviewed-by: NJamey Sharp <jamey@minilop.net> Reviewed-by: NJosh Triplett <josh@joshtriplett.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 17 12月, 2012 1 次提交
-
-
由 Tony Lindgren 提交于
These devices are not available on other architectures, so let's limit them to omap. If the driver subsystem maintainers want to build test system wide changes without building for each target, it's easy to carry a test patch that just strips out the depends entries from Kconfig files. Signed-off-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 05 11月, 2012 1 次提交
-
-
由 Linus Walleij 提交于
This moves the MTU timer driver from arch/arm/plat-nomadik to drivers/clocksource and moves the header file to the platform_data directory. As this moves the last file being compiled to an object out of arch/arm/plat-nomadik, we have to "turn off the light" and delete the plat-nomadik directory, because it is not allowed to have an empty Makefile in a plat-* directory. This is probably also a desired side effect of depopulating the arch/arm directory of drivers. Luckily we have just deleted all the <plat/*> include files prior to this so by moving the last one we may delete the directory. After this all the Ux500 and Nomadik device drivers live outside of the arch/arm hierarchy. Cc: Alessandro Rubini <rubini@unipv.it> Acked-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 30 10月, 2012 1 次提交
-
-
由 Roland Stigge 提交于
This adds a "select" dependency of KEYBOARD_LPC32XX on INPUT_MATRIXKMAP, as the other drivers are doing in this regard. This fixes the following compile error if KEYBOARD_LPC32XX is enabled but INPUT_MATRIXKMAP is not: drivers/input/keyboard/lpc32xx-keys.c:230: undefined reference to `matrix_keypad_build_keymap' Signed-off-by: NRoland Stigge <stigge@antcom.de> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 25 10月, 2012 1 次提交
-
-
由 Kees Cook 提交于
This config item has not carried much meaning for a while now and is almost always enabled by default. As agreed during the Linux kernel summit, remove it. Signed-off-by: NKees Cook <keescook@chromium.org> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 13 9月, 2012 1 次提交
-
-
由 Tony Lindgren 提交于
Remove support for omap2+ as it's no longer needed since it's using matrix-keypad. This way we can remove depency to plat and mach headers which is needed for ARM common zImage support. Also remove INT_KEYBOARD by using omap_kp->irq. Note that this patch depends on an earlier patch "ARM: OMAP: Move gpio.h to include/linux/platform_data". Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: linux-input@vger.kernel.org Acked-by: NSourav Poddar <sourav.poddar@ti.com> Reviewed-by: NFelipe Balbi <balbi@ti.com> Signed-off-by: NTony Lindgren <tony@atomide.com>
-
- 18 7月, 2012 1 次提交
-
-
由 Roland Stigge 提交于
This is a driver for the key scan interface of the LPC32xx SoC Signed-off-by: NRoland Stigge <stigge@antcom.de> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 11 5月, 2012 2 次提交
-
-
由 Dmitry Torokhov 提交于
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: NDmitry Torokhov <dtor@mail.ru>
-
由 Poddar, Sourav 提交于
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: NFelipe Balbi <balbi@ti.com> Signed-off-by: NG, Manjunath Kondaiah <manjugk@ti.com> Signed-off-by: NSourav Poddar <sourav.poddar@ti.com> Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
-
- 05 4月, 2012 1 次提交
-
-
由 Wolfram Sang 提交于
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: NWolfram Sang <w.sang@pengutronix.de> Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
-
- 17 3月, 2012 1 次提交
-
-
由 Felipe Balbi 提交于
This patch allows us to drop the OMAP dependency from the OMAP4 keypad driver. Signed-off-by: NFelipe Balbi <balbi@ti.com> Signed-off-by: NSourav Poddar <sourav.poddar@ti.com> Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
-
- 14 3月, 2012 1 次提交
-
-
由 Olof Johansson 提交于
This adds a simple device tree binding for simple key matrix data and a helper to fill in the platform data. Signed-off-by: NOlof Johansson <olof@lixom.net> Acked-by: NStephen Warren <swarren@nvidia.com> Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
-
- 16 11月, 2011 1 次提交
-
-
由 Dmitry Torokhov 提交于
There is nothing in keypad platform definitions that requires the driver be complied on Samsung platform only, so let's move them out of the platform subdirectory and relax the dependencies. Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
-
- 30 10月, 2011 1 次提交
-
-
由 Kyle Manna 提交于
This driver has been tested with hardware and works as expected. To use it add the platform data as appropriate and register it with the corresponding I2C bus. Signed-off-by: NKyle Manna <kyle.manna@fuel7.com> Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
-
- 19 10月, 2011 1 次提交
-
-
由 Michael Hennerich 提交于
The ADP5585 family keypad decoder and IO expander is similar to the ADP5589, however it features less IO pins, and lacks hardware assisted key-lock functionality. Unfortunately the register addresses are different, as well as the event codes and bit organization within the port related registers. Move ADP5589 Register defines from the header file into the main source file. Add new defines while making sure we don't break existing platform_data. Add register address translation, and turn device specific defines into variables. Introduce some helper functions and disable functions that doesn't exist on the added devices. Signed-off-by: NMichael Hennerich <michael.hennerich@analog.com> Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
-
- 27 5月, 2011 1 次提交
-
-
由 Trilok Soni 提交于
Add Qualcomm PMIC8XXX based keypad controller driver supporting upto 18x8 matrix configuration. Acked-by: NDmitry Torokhov <dtor@mail.ru> Signed-off-by: NTrilok Soni <tsoni@codeaurora.org> Signed-off-by: NAnirudh Ghayal <aghayal@codeaurora.org> Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
-
- 19 5月, 2011 1 次提交
-
-
由 Michael Hennerich 提交于
From http://www.analog.com/ADP5589: The ADP5589 is an I/O port expander and keypad matrix decoder designed for QWERTY type phones that require a large keypad matrix and expanded I/O lines. Signed-off-by: NMichael Hennerich <michael.hennerich@analog.com> Signed-off-by: NMike Frysinger <vapier@gentoo.org> Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
-
- 12 5月, 2011 1 次提交
-
-
由 Zhang Jiejing 提交于
This patch adds basic support for Freescale MPR121 capacitive touch sensor. It's an i2c controller with up to 12 capacitance sensing inputs. Product information (data sheet, application notes) can be found here: http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPR121Signed-off-by: NZhang Jiejing <jiejing.zhang@freescale.com> Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
-
- 14 3月, 2011 1 次提交
-
-
由 Bo Shen 提交于
The AT42QT1070 QTouch sensor supports up to 7 keys. The driver has been tested on Atmel AT91SAM9M10-G45-EK board, and it should work fine on other platforms. Signed-off-by: NBo Shen <voice.shen@atmel.com> Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
-
- 21 1月, 2011 2 次提交
-
-
由 Rakesh Iyer 提交于
This patch adds support for the internal matrix keyboard controller for Nvidia Tegra platforms. Signed-off-by: NRakesh Iyer <riyer@nvidia.com> Reviewed-by: NTrilok Soni <tsoni@codeaurora.org> Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
-
由 David Rientjes 提交于
The meaning of CONFIG_EMBEDDED has long since been obsoleted; the option is used to configure any non-standard kernel with a much larger scope than only small devices. This patch renames the option to CONFIG_EXPERT in init/Kconfig and fixes references to the option throughout the kernel. A new CONFIG_EMBEDDED option is added that automatically selects CONFIG_EXPERT when enabled and can be used in the future to isolate options that should only be considered for embedded systems (RISC architectures, SLOB, etc). Calling the option "EXPERT" more accurately represents its intention: only expert users who understand the impact of the configuration changes they are making should enable it. Reviewed-by: NIngo Molnar <mingo@elte.hu> Acked-by: NDavid Woodhouse <david.woodhouse@intel.com> Signed-off-by: NDavid Rientjes <rientjes@google.com> Cc: Greg KH <gregkh@suse.de> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jens Axboe <axboe@kernel.dk> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Robin Holt <holt@sgi.com> Cc: <linux-arch@vger.kernel.org> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 08 1月, 2011 1 次提交
-
-
由 Jamie Iles 提交于
The only platform using this driver (mach-aaec2000) is no longer in the kernel so remove the driver. Signed-off-by: NJamie Iles <jamie@jamieiles.com> Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
-
- 30 12月, 2010 1 次提交
-
-
由 Sundar Iyer 提交于
Add support for the keypad controller module found on the TC3589X devices. This driver default adds the support for TC35893 device. Signed-off-by: NSundar Iyer <sundar.iyer@stericsson.com> Acked-by: NDmitry Torokhov <dtor@mail.ru> [Some minor fixups for compilation] Signed-off-by: NLinus Walleij <linus.walleij@stericsson.com>
-
- 08 12月, 2010 1 次提交
-
-
由 Tony SIM 提交于
Support 8-bit tca6408a I/O expander as a keypad. Signed-off-by: NTony SIM <chinyeow.sim.xt@renesas.com> Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
-