Since there are uses for I2C_M_NOSTART which are much more sensible and
standard than most of the protocol mangling functionality (the main one
being gather writes to devices where something like a register address
needs to be inserted before a block of data) create a new I2C_FUNC_NOSTART
for this feature and update all the users to use it.
Also strengthen the disrecommendation of the protocol mangling while we're
at it.
In the case of regmap-i2c we remove the requirement for mangling as
I2C_M_NOSTART is the only mangling feature which is being used.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQIcBAABAgAGBQJPw2QKAAoJEIqAPN1PVmxKfv8P/2L5d38tc3+9wYuGI1l+k7Mz
xQt2PdAx/kHQGTjLE1DSoeOD6dn4aodFbPaTcsLsU9Eo4IiJnT68b8adr/bqYHKU
Cod6NSPJMaBxLBJZxXsA7nY69Z6O5SMjXxEQsiDc24gaP0jjwaeY35KJSfMug8nF
DA6rvEpchkF8QXzBmkO2t2/uPYr1YWqDZQkauLDnLRG01JnGXFz5ajv9N5pYhiFt
QyYtheg8yEnfwnQ6AlmRtGK75jZRVmrj0kOzRjE9UL7ZwtzswWJes+RE3tlgk89m
JQ7KASRmmqLpvcVJ9fG9SlGX//yBO6OEp5Km06RTxgmt0XftBDVqBTjk1EG2tfMR
SR0NIz6gJ0twKAe6U0d+5HMYalOU45H5ha9e3vCqZ8vl9JfmM95RS+TmWbGcRIqj
04Y5x3I4zq6e9D0u+211BeuRfzkQiefwWJmdPpn0oac3u5LeYbRj/aQ85fqwJWzG
f99D9VU5xgfFHPAtL3SLFiwgd9yOiMBar6eeIva+okDyOW3KaEUzs8Y4dgDyvYcg
IU//JGK51vLVmI5kXtGCwYkgRLF/Y7WKZ8TwypT+SY6iv6tPQVvApOZljq7RC9GI
mXx2z2slA90jlg3TlEFZfxr1WqbZ3TCbonU1riLeMEtkiXUpLtmKC8gbhOqfGvvn
Nzgt+YqRJXafZdELb/S+
=Rh0r
-----END PGP SIGNATURE-----
Merge tag 'mfd-3.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Pull MFD changes from Samuel Ortiz:
"Besides the usual cleanups, this one brings:
* Support for 5 new chipsets: Intel's ICH LPC and SCH Centerton,
ST-E's STAX211, Samsung's MAX77693 and TI's LM3533.
* Device tree support for the twl6040, tps65910, da9502 and ab8500
drivers.
* Fairly big tps56910, ab8500 and db8500 updates.
* i2c support for mc13xxx.
* Our regular update for the wm8xxx driver from Mark."
Fix up various conflicts with other trees, largely due to ab5500 removal
etc.
* tag 'mfd-3.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (106 commits)
mfd: Fix build break of max77693 by adding REGMAP_I2C option
mfd: Fix twl6040 build failure
mfd: Fix max77693 build failure
mfd: ab8500-core should depend on MFD_DB8500_PRCMU
gpio: tps65910: dt: process gpio specific device node info
mfd: Remove the parsing of dt info for tps65910 gpio
mfd: Save device node parsed platform data for tps65910 sub devices
mfd: Add r_select to lm3533 platform data
gpio: Add Intel Centerton support to gpio-sch
mfd: Emulate active low IRQs as well as active high IRQs for wm831x
mfd: Mark two lm3533 zone registers as volatile
mfd: Fix return type of lm533 attribute is_visible
mfd: Enable Device Tree support in the ab8500-pwm driver
mfd: Enable Device Tree support in the ab8500-sysctrl driver
mfd: Add support for Device Tree to twl6040
mfd: Register the twl6040 child for the ASoC codec unconditionally
mfd: Allocate twl6040 IRQ numbers dynamically
mfd: twl6040 code cleanup in interrupt initialization part
mfd: Enable ab8500-gpadc driver for Device Tree
mfd: Prevent unassigned pointer from being used in ab8500-gpadc driver
...
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
...
Pull input layer updates from Dmitry Torokhov:
- a bunch of new drivers (DA9052/53 touchscreenn controller, Synaptics
Navpoint, LM8333 keypads, Wacom I2C touhscreen);
- updates to existing touchpad drivers (ALPS, Sntelic);
- Wacom driver now supports Intuos5;
- device-tree bindings in numerous drivers;
- other cleanups and fixes.
Fix annoying conflict in drivers/input/tablet/wacom_wac.c that I think
implies that the input layer device naming is broken, but let's see. I
brough it up with Dmitry.
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (57 commits)
Input: matrix-keymap - fix building keymaps
Input: spear-keyboard - document DT bindings
Input: spear-keyboard - add device tree bindings
Input: matrix-keymap - wire up device tree support
Input: matrix-keymap - uninline and prepare for device tree support
Input: adp5588 - add support for gpio names
Input: omap-keypad - dynamically handle register offsets
Input: synaptics - fix compile warning
MAINTAINERS: adjust input-related patterns
Input: ALPS - switch to using input_mt_report_finger_count
Input: ALPS - add semi-MT support for v4 protocol
Input: Add Synaptics NavPoint (PXA27x SSP/SPI) driver
Input: atmel_mxt_ts - dump each message on just 1 line
Input: atmel_mxt_ts - do not read extra (checksum) byte
Input: atmel_mxt_ts - verify object size in mxt_write_object
Input: atmel_mxt_ts - only allow root to update firmware
Input: atmel_mxt_ts - use CONFIG_PM_SLEEP
Input: sentelic - report device's production serial number
Input: tl6040-vibra - Device Tree support
Input: evdev - properly handle read/write with count 0
...
Pull media updates from Mauro Carvalho Chehab:
- some V4L2 API updates needed by embedded devices
- DVB API extensions for ATSC-MH delivery system, used in US for mobile
TV
- new tuners for fc0011/0012/0013 and tua9001
- a new dvb driver for af9033/9035
- a new ATSC-MH frontend (lg2160)
- new remote controller keymaps
- Removal of a few legacy webcam driver that got replaced by gspca on
several kernel versions ago
- a new driver for Exynos 4/5 webcams(s5pp fimc-lite)
- a new webcam sensor driver (smiapp)
- a new video input driver for embedded (sta2x1xx)
- several improvements, fixes, cleanups, etc inside the drivers.
Manually fix up conflicts due to err() -> dev_err() conversion in
drivers/staging/media/easycap/easycap_main.c
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (484 commits)
[media] saa7134-cards: Remove a PCI entry added by mistake
[media] radio-sf16fmi: add support for SF16-FMD
[media] rc-loopback: remove duplicate line
[media] patch for Asus My Cinema PS3-100 (1043:48cd)
[media] au0828: Move the Kconfig knob under V4L_USB_DRIVERS
[media] em28xx: simple comment fix
[media] [resend] radio-sf16fmr2: add PnP support for SF16-FMD2
[media] smiapp: Use v4l2_ctrl_new_int_menu() instead of v4l2_ctrl_new_custom()
[media] smiapp: Add support for 8-bit uncompressed formats
[media] smiapp: Allow generic quirk registers
[media] smiapp: Use non-binning limits if the binning limit is zero
[media] smiapp: Initialise rval in smiapp_read_nvm()
[media] smiapp: Round minimum pre_pll up rather than down in ip_clk_freq check
[media] smiapp: Use 8-bit reads only before identifying the sensor
[media] smiapp: Quirk for sensors that only do 8-bit reads
[media] smiapp: Pass struct sensor to register writing commands instead of i2c_client
[media] smiapp: Allow using external clock from the clock framework
[media] zl10353: change .read_snr() to report SNR as a 0.1 dB
[media] media: add support to gspca/pac7302.c for 093a:2627 (Genius FaceCam 300)
[media] m88rs2000 - only flip bit 2 on reg 0x70 on 16th try
...
Keymaps used by drivers based on matrix-keymap facilities are arrays of
unsigned shorts, not chars. Treating them otherwise produces corrupted
keymaps.
Reported-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Here is the big USB 3.5-rc1 pull request for the 3.5-rc1 merge window.
It's touches a lot of different parts of the kernel, all USB drivers,
due to some API cleanups (getting rid of the ancient err() macro) and
some changes that are needed for USB 3.0 power management updates.
There are also lots of new drivers, pimarily gadget, but others as well.
We deleted a staging driver, which was nice, and finally dropped the
obsolete usbfs code, which will make Al happy to never have to touch
that again.
There were some build errors in the tree that linux-next found a few
days ago, but those were fixed by the most recent changes (all were due
to us not building with CONFIG_PM disabled.)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
iEYEABECAAYFAk+7qs0ACgkQMUfUDdst+ymjOgCfeoWqWk1bsKKt6SZULvQois5i
3csAn1Uapcm8Uswwpnj2v1/2Zh4rBHLA
=4jM1
-----END PGP SIGNATURE-----
Merge tag 'usb-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB 3.5-rc1 changes from Greg Kroah-Hartman:
"Here is the big USB 3.5-rc1 pull request for the 3.5-rc1 merge window.
It's touches a lot of different parts of the kernel, all USB drivers,
due to some API cleanups (getting rid of the ancient err() macro) and
some changes that are needed for USB 3.0 power management updates.
There are also lots of new drivers, pimarily gadget, but others as
well. We deleted a staging driver, which was nice, and finally
dropped the obsolete usbfs code, which will make Al happy to never
have to touch that again.
There were some build errors in the tree that linux-next found a few
days ago, but those were fixed by the most recent changes (all were
due to us not building with CONFIG_PM disabled.)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
* tag 'usb-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (477 commits)
xhci: Fix DIV_ROUND_UP compile error.
xhci: Fix compile with CONFIG_USB_SUSPEND=n
USB: Fix core compile with CONFIG_USB_SUSPEND=n
brcm80211: Fix compile error for .disable_hub_initiated_lpm.
Revert "USB: EHCI: work around bug in the Philips ISP1562 controller"
MAINTAINERS: Add myself as maintainer to the USB PHY Layer
USB: EHCI: fix command register configuration lost problem
USB: Remove races in devio.c
USB: ehci-platform: remove update_device
USB: Disable hub-initiated LPM for comms devices.
xhci: Add Intel U1/U2 timeout policy.
xhci: Add infrastructure for host-specific LPM policies.
USB: Add macros for interrupt endpoint types.
xhci: Reserve one command for USB3 LPM disable.
xhci: Some Evaluate Context commands must succeed.
USB: Disable USB 3.0 LPM in critical sections.
USB: Add support to enable/disable USB3 link states.
USB: Allow drivers to disable hub-initiated LPM.
USB: Calculate USB 3.0 exit latencies for LPM.
USB: Refactor code to set LPM support flag.
...
Conflicts:
arch/arm/mach-exynos/mach-nuri.c
arch/arm/mach-exynos/mach-universal_c210.c
drivers/net/wireless/ath/ath6kl/usb.c
The modern idiom is to use irq_domain to allocate interrupts. This is
useful partly to allow further infrastructure to be based on the domains
and partly because it makes it much easier to allocate virtual interrupts
to devices as we don't need to allocate a contiguous range of interrupt
numbers.
Convert the wm831x driver over to this infrastructure, using a legacy
IRQ mapping if an irq_base is specified in platform data and otherwise
using a linear mapping, always registering the interrupts even if they
won't ever be used. Only boards which need to use the GPIOs as
interrupts should need to use an irq_base.
This means that we can't use the MFD irq_base management since the
unless we're using an explicit irq_base from platform data we can't rely
on a linear mapping of interrupts. Instead we need to map things via
the irq_domain - provide a conveniencem function wm831x_irq() to save a
small amount of typing when doing so. Looking at this I couldn't clearly
see anything the MFD core could do to make this nicer.
Since we're not supporting device tree yet there's no meaningful
advantage if we don't do this conversion in one, the fact that the
interrupt resources are used for repeated IP blocks makes accessor
functions for the irq_domain more trouble to do than they're worth.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* linus/master: (805 commits)
tty: Fix LED error return
openvswitch: checking wrong variable in queue_userspace_packet()
bonding: Fix LACPDU rx_dropped commit.
Linux 3.4-rc7
ARM: EXYNOS: fix ctrlbit for exynos5_clk_pdma1
ARM: EXYNOS: use s5p-timer for UniversalC210 board
ARM / mach-shmobile: Invalidate caches when booting secondary cores
ARM / mach-shmobile: sh73a0 SMP TWD boot regression fix
ARM / mach-shmobile: r8a7779 SMP TWD boot regression fix
ARM: mach-shmobile: convert ag5evm to use the generic MMC GPIO hotplug helper
ARM: mach-shmobile: convert mackerel to use the generic MMC GPIO hotplug helper
MAINTAINERS: Add myself as the cpufreq maintainer
dm mpath: check if scsi_dh module already loaded before trying to load
dm thin: correct module description
dm thin: fix unprotected use of prepared_discards list
dm thin: reinstate missing mempool_free in cell_release_singleton
gpio/exynos: Fix compiler warnings when non-exynos machines are selected
gpio: pch9: Use proper flow type handlers
powerpc/irq: Fix another case of lazy IRQ state getting out of sync
ks8851: Update link status during link change interrupt
...
Conflicts:
drivers/media/common/tuners/xc5000.c
drivers/media/common/tuners/xc5000.h
drivers/usb/gadget/uvc_queue.c
Move drivers/input/fixp-arith.h to include/linux so that the functions
defined there can be used by other subsystems, for instance some video
devices ISPs can control the output HUE value by setting registers for
sin(HUE) and cos(HUE).
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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>
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>
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>
Move synaptics_invert_y() inside CONFIG_MOUSE_PS2_SYNAPTICS to get rid of
a compile warning when we don't select synaptics support.
drivers/input/mouse/synaptics.c:53:12: warning: ‘synaptics_invert_y’ defined but not used [-Wunused-function]
Signed-off-by: JJ Ding <dgdunix@gmail.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Instead of open-coded reporting number of fingers on the touchpad
let's use input_mt_report_finger_count() helper.
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This patch adds semi-MT support for ALPS v4 protocol touchpads.
It is based on the work by Seth Forshee for ALPS v3 and v4 protocol
support. Three packets are required to assemble and process the MT
data. ST events are reported at once to avoid latency. If there
were two contacts or more, report MT data instead of ST events.
Thanks to Seth Forshee for providing most of the code, guidance
and insight for producing this patch.
Signed-off-by: George Pantalos <gpantalos@gmail.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This driver adds support for the Synaptics NavPoint touchpad connected
to a PXA27x SSP port in SPI slave mode. The device emulates a mouse;
a tap or tap-and-a-half drag gesture emulates the left mouse button.
For example, use the xf86-input-evdev driver for an X pointing device.
Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Tested-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Helps ensure all bytes for a single message together in the system log.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Nick Dyer <nick.dyer@itdev.co.uk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
atmel_mxt devices will send a checksum byte at the end of a message if
the MSB of the object address is set.
However, since this driver does not set this bit, the checksum byte
isn't actually sent, so don't even try to read it.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Restrict permissions on the update_fw sysfs entry to read only for root
only.
Also, update object permission to use a macro S_IRUGO macro instead of
hard coded 0444.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Nick Dyer <nick.dyer@itdev.co.uk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Hardware since Cx supports an unique identity (used to identify OEM vendors
and released lot number) which is very helpful for diagnostic purpose.
This revision tries to make it as a part of driver boot up message.
Whilst here, also bumping fsp_drv_ver to acknowledge recent addition of
absolute coordinates output.
Signed-off-by: Tai-hwa Liang <avatar@sentelic.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This pull request updates the DaVinci SoC support to implement DEBUG_LL port
choice and optimizes the DMA ISR by removing unnecessary register reads.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iQIcBAABAgAGBQJPqq+jAAoJEGFBu2jqvgRNs1MP/R1z0/h7nrN26aspSS9kxIJr
M8HpG+qSmfLg+h6RSpQYY8SoMJ5mN7vA1AJQr9M2zUZXDYMy+AXYXdlJ2Q9p5ene
A3Iz4yTfHgosrj9fd6fY7vH/Bd9v2T7H366SKPdk0gsSufzkSzEHvVkIROGLIQF2
2kKgBdp94Vdgi+9nimePePIE5EyLxsMW3BNcFLVNkcdfZTFGlbtSav5zT4OCJoIm
d/WI1Xh34nvzkHZptLqUwPF0u62YTcGY+Z6n6KhYk6mSJ2JHWfycwGOf7V9CFVkZ
k7wdSaGfZbPrGQbKjK66Oahq+RN5kIklVB/GIyF5ZectxX+E+Mr8XLO8wKtCMxnf
SvB9jy/LBIqPQlzodEy2FWryzh5gRB/KnDC3sYonpm81scYLEr9T1sw1k4yzR0cS
ZgV2WfaqgfY9HoHzhoxwNB7hCo7VVHGL3r6BsB/30NUk8rnN/SGcDHdu5cTPT7gW
qFfz4uGRC40kvUm2gq3yJh95r3iAnKmawFGjqhBSSMjHcPEVhEgsa913uSclR99w
uKDWqsbhJN7h+W3nLPU7H4qq1PA+d3UGm7eWI8FBXxwf7qng00XJINBAssfxVRvJ
xR0jC7/VeVypcvICPiKdDt2wxl80ptTF80461P0ieXKZsu/PXltLJXd+m7U/gq1u
mhkE90gNGeSH7EsKC2A2
=/we3
-----END PGP SIGNATURE-----
Merge tag 'v3.5-soc' of git://gitorious.org/linux-davinci/linux-davinci into next/drivers
DaVinci SoC updates for v3.5
This pull request updates the DaVinci SoC support to implement DEBUG_LL port
choice and optimizes the DMA ISR by removing unnecessary register reads.
* tag 'v3.5-soc' of git://gitorious.org/linux-davinci/linux-davinci:
ARM: davinci: optimize the DMA ISR
ARM: davinci: implement DEBUG_LL port choice
+ sync with Linux 3.4-rc6
Signed-off-by: Olof Johansson <olof@lixom.net>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
iQEcBAABAgAGBQJPpvY9AAoJEHm+PkMAQRiGpEoIAJgbu+Y8gITnBK/wh9O6zy3S
5jie5KK4YWdbJsvO58WbNr3CyVIwGIqQ2dUZLiU59aBVLarlGw8xor0MmW+cZwhp
6fBHaf0qDYAV0MZjD+mnnExOiCRyISa2lPmsfu9dAWywh5KGe6/oAP6/qcXIyok3
KZyl3qQf4ENpaZPHwZPXCEkUvtuyHgNiszN+QXEadA3s19Ot4VGe9A3VGw+GNrSm
JqFIq3acQAbKa5BYaqf7TQC02v2FI7//eqt6QHxTqbE6a7LGbTvLfX3HlJ2mnfqa
1R6QHhM4y4OZDHbaMT2raHZ8WuLXzhehJzhP8Co7AHFOKwVKOb5XbcUr2RrukMU=
=HkMd
-----END PGP SIGNATURE-----
Merge tag 'v3.4-rc6' into next/cleanup
Linux 3.4-rc6
Resolve conflict where an u5500 file had a bugfix go in, but was
deleted in the branch staged for next merge window.
Signed-off-by: Olof Johansson <olof@lixom.net>
My last patch fixing up the dev_* messages caused a compiler warning
accidentally for an unused variable. Fix this up, as it was my fault.
Cc: Alessandro Rubini <rubini@ipvvis.unipv.it>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: Henrik Rydberg <rydberg@euromail.se>
CC: Rusty Russell <rusty@rustcorp.com.au>
CC: Viresh Kumar <viresh.kumar@st.com>
CC: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: Ping Cheng <pingc@wacom.com>
CC: Chris Bagwell <chris@cnpbagwell.com>
CC: Eduard Hasenleithner <eduard@hasenleithner.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: Jesper Juhl <jj@chaosbits.net>
CC: JJ Ding <dgdunix@gmail.com>
CC: Edwin van Vliet <edwin@cheatah.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.
CC: Henrik Rydberg <rydberg@euromail.se>
CC: Alessandro Rubini <rubini@ipvvis.unipv.it>
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.
CC: Alessandro Rubini <rubini@ipvvis.unipv.it>
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.
CC: Henk Vergonet <Henk.Vergonet@gmail.com>
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: "Magnus Hörlin" <magnus@alefors.se>
CC: Rusty Russell <rusty@rustcorp.com.au>
CC: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABCAAGBQJPoPBUAAoJEPFlmONMx+ez+x8P/1v4GU2XzwG2XBLrOeF1xzjO
P1i3mYVN2aWGZ3ZGeVPvHd/X6Q2FiaajwFoiRVe1dOHCJwBDf0mFvYkQgaqAlk+D
ZkhCPvshWtBG9uOSq47SAa4+Bw0O29kxPfTGsA1fyZoj/B0ZiyuTbPw53Fvgylmz
7Jkl6Jh9dALI1Nb7P/xhGaeg4e7Out3U5f0ZITMuAJhMd1r2ikkV7BeQd77e/8hY
xbzmQVCmWFtjK4iodHDrqKXgL7CVlAno8y6xiKtELipd1p+5Ao1BBlHkHg3bpjmb
/G6YX86W9CVPU3jMhqLSoywiMX/PiElR559DPxPf/+8d5EaU1QsJyAU/D/zEb5D1
Y5yi5jfrJFi2zEFYYDv5xHn/6M72JJT0HDQB8YBfs8n6uksDk+rZtoBZVlIbWBxC
7vzvJ31712uxAtVeD5fbKOyVOgHRf6df8GByLR8Xi3Ak9ntMRfJSiEcxIrcqZ3dx
M+A5S8g5Tbue5xDUu7cQG50OTu0t9JgoaSN3yHXnIesOXyMUylkatMEwpUamyGiD
jX/DBmV7trwbe3re8SF7c2TTi2AfJsSFk840Ot9zfvuk7VaaZBjuC0tqmp0RyKIY
kRlN0QGwn0+aNqRF74MWhDYsfnOXjdArcheW2szO5MiaUK9+85MLCQnvSoiV0Gkp
flqaXKbjiUe/Oe83u+mC
=7B/b
-----END PGP SIGNATURE-----
Merge tag 'imx-cleanup' of git://git.pengutronix.de/git/imx/linux-2.6 into next/cleanup
From: Sascha Hauer <s.hauer@pengutronix.de>
ARM: i.MX cleanups for 3.5
* tag 'imx-cleanup' of git://git.pengutronix.de/git/imx/linux-2.6: (5 commits)
ARM: mx53: fix pad definitions for MX53_PAD_EIM_D28__I2C1_SDA and MX53_PAD_GPIO_8__CAN1_RXCAN
ARM: imx/eukrea_mbimx27-baseboard: fix typo in error message
ARM: i.MX51 iomux: add missed definitions for SION-bit and mode for some pads
arm: imx: add missing select IMX_HAVE_PLATFORM for MACH_MX35_3DS in Kconfig
arm: imx: make various struct sys_timer static
Includes an update to 3.4-rc4
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
According to the standard count 0 is special - no IO should happen but we
can check error conditions (device gone away, etc), and return 0 if there
are no errors. We used to return -EINVAL instead and we also could return 0
if an event was "stolen" by another thread.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
We should use rcu_dereference_protected() when checking if given client
is the one that grabbed the device. This fixes warnings produced by
sparse.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Commit 1c6c695 "genirq: Reject bogus threaded irq requests" requires
that request_threaded_irq() either be passed an explicit handler, or
that IRQF_ONESHOT be set. Set this flag.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
When copy_to/from_user fails in the middle of transfer we should not
report to the user that read/write partially succeeded but rather
report -EFAULT right away, so that application will know that it got
its buffers all wrong.
If application messed up its buffers we can't trust the data fetched
from userspace and successfully written to the device or if data read
from the device and transferred to userspace ended up where application
expected it to end.
If serio_write() fails we still going to report partial writes if failure
happens in the middle of the transfer.
This is basically a revert of 7a0a27d2ce
and 4fa0771138.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>