14 Aug, 2012

1 commit

  • Commit 7212157267 ("GPIO: gpio-pxa: fix devicetree functions") added an
    "xlate" function pointer to the irq_domain_ops, but this function is nor
    declared or defined anywhere when CONFIG_OF is disabled, causing the
    build error:

    drivers/gpio/gpio-pxa.c:532:11: error: 'irq_domain_xlate_twocell' undeclared here (not in a function)

    Extending the DT-only code section to cover the irq_domain_ops and the
    pxa_gpio_dt_ids solves this problem and makes it clearer which code is
    actually used without DT.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     

13 Aug, 2012

1 commit

  • Pull gpio fixes from Linus Walleij:
    - Fix a resource leak in the SCH driver
    - Fix the register address calculation in the MSIC driver
    - Fix the PXA driver's devicetree functions
    - Delete redundant shadow variable leftovers in the MXC driver
    - Specify the GPIO base for the device tree probe in the MXC driver
    - Add a modalias for the i.MX driver
    - Fix off-by-one bug in the Samsung driver
    - Fix erroneous errorpath in the Langwell driver

    * tag 'gpio-fixes-v3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
    drivers/gpio/gpio-langwell.c: fix error return code
    gpio: samsung: Fix off-by-one bug in gpio addresses
    ARM: dts: imx: add alias for gpio
    gpio/mxc: specify gpio base for device tree probe
    gpio/mxc: remove redundant shadow variables initialization
    GPIO: gpio-pxa: fix devicetree functions
    gpio: msic: Fix calculating register address in msic_gpio_to_oreg()
    gpio-sch: Fix leak of resource

    Linus Torvalds
     

10 Aug, 2012

1 commit

  • The newly added gpio-em driver marks its em_gio_irq_domain_cleanup
    function as __devexit, which would lead to that function being
    discarded in case CONFIG_HOTPLUG is disabled. However, the function
    is also called by the error handling logic em_gio_probe, which
    would cause a jump into a NULL pointer if it was removed from the
    kernel or module.

    Without this patch, building kzm9d_defconfig results in:

    WARNING: drivers/gpio/built-in.o(.devinit.text+0x330): Section mismatch in reference from the function em_gio_probe() to the function .devexit.text:em_gio_irq_domain_cleanup()
    The function __devinit em_gio_probe() references
    a function __devexit em_gio_irq_domain_cleanup().
    This is often seen when error handling in the init function
    uses functionality in the exit path.
    The fix is often to remove the __devexit annotation of
    em_gio_irq_domain_cleanup() so it may be used outside an exit section.

    Signed-off-by: Arnd Bergmann
    Cc: Magnus Damm
    Cc: Linus Walleij
    Cc: Rafael J. Wysocki

    Arnd Bergmann
     

07 Aug, 2012

4 commits

  • Convert a 0 error return code to a negative one, as returned elsewhere in the
    function.

    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/)

    //
    @@
    identifier ret;
    expression e,e1,e2,e3,e4,x;
    @@

    (
    if (\(ret != 0\|ret < 0\) || ...) { ... return ...; }
    |
    ret = 0
    )
    ... when != ret = e1
    *x = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\|ioremap\|ioremap_nocache\|devm_ioremap\|devm_ioremap_nocache\)(...);
    ... when != x = e2
    when != ret = e3
    *if (x == NULL || ...)
    {
    ... when != ret = e4
    * return ret;
    }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Linus Walleij

    Julia Lawall
     
  • Move gpc4 to the end of the automatically processed gpio controllers so
    we don't taint the automatic offset calculation.

    This bug caused all controllers coming after gpc4 to map to the
    incorrect address. The result is would actually map to
    GPIO 0 in gpd0.

    Signed-off-by: Sean Paul
    Reviewed-by: Thomas Abraham
    Acked-by: Doug Anderson
    Acked-by: Kukjin Kim
    Signed-off-by: Linus Walleij

    Sean Paul
     
  • Currently, unlike the non-DT probe where the gpio base is specified
    with pdev->id, the DT probe uses the base dynamically allocated by
    gpio core, which uses a completely different numbering scheme. This
    causes two issues to user space applications which access sysfs entry
    /sys/class/gpio/gpioN.

    * It breaks the compatibility with user space applications between
    non-DT and DT kernels.

    * It's not intuitive and sometimes hard for users to map the Linux
    gpio number to the actual hardware pin.

    Use alias to identify the gpio port/bank, and then the gpio base
    can be specified with port id to solve above issues. If alias is not
    defined in device tree, the base number dynamically allocated by gpio
    core will be used.

    Signed-off-by: Shawn Guo
    Tested-by: Uwe Kleine-König
    Signed-off-by: Linus Walleij

    Shawn Guo
     
  • With commit 3e11f7b (gpio/generic: initialize basic_mmio_gpio shadow
    variables properly) in place, the shadow variables initialization is
    being done in generic driver bgpio_init call.

    Remove the redundant shadow variables initialization from gpio-mxc
    driver.

    Signed-off-by: Shawn Guo
    Tested-by: Dirk Behme
    Signed-off-by: Linus Walleij

    Shawn Guo
     

05 Aug, 2012

3 commits


31 Jul, 2012

1 commit

  • Pull MFD bits from Samuel Ortiz:
    "We have support for a few new drivers:
    - Samsung s2mps11
    - Wolfson Microelectronics wm5102 and wm5110
    - Marvell 88PM800 and 88PM805
    - TI twl6041

    We also have our regular driver improvements:
    - Device tree and IRQ domain support for STE AB8500
    - Regmap and devm_* API conversion for TI tps6586x
    - Device tree support for Samsung max77686
    - devm_* API conversion for STE AB3100

    Besides that, quite a lot of fixing and cleanup for mc13xxx, tps65910,
    tps65090, da9052 and twl-core."

    Fix up mostly trivial conflicts, with the exception of
    drivers/usb/host/ehci-omap.c in particular, which had some
    re-organization of the reset sequence (commit 1a49e2ac9651: "EHCI:
    centralize controller initialization") that clashed with commit
    2761a6394516 ("mfd: USB: Fix the omap-usb EHCI ULPI PHY reset fix
    issues").

    In particular, commit 2761a6394516 moved the usb_add_hcd() to the
    *middle* of the reset sequence, which clashes fairly badly with the
    reset sequence re-organization (although it could have been done inside
    the new omap_ehci_init() function).

    I left that part of commit 2761a6394516 just undone.

    * tag 'mfd-3.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (110 commits)
    mfd: Ensure AB8500 platform data is passed through db8500-prcmu to MFD Core
    mfd: Arizone core should select MFD_CORE
    mfd: Fix arizona-irq.c build by selecting REGMAP_IRQ
    mfd: Add debug trace on entering and leaving arizone runtime suspend
    mfd: Correct tps65090 cell names
    mfd: Remove gpio support from tps6586x core driver
    ARM: tegra: defconfig: Enable tps6586x gpio
    gpio: tps6586x: Add gpio support through platform driver
    mfd: Cache tps6586x register through regmap
    mfd: Use regmap for tps6586x register access.
    mfd: Use devm managed resources for tps6586x
    input: Add onkey support for 88PM80X PMIC
    mfd: Add support for twl6041
    mfd: Fix twl6040 revision information
    mfd: Matches should be NULL when populate anatop child devices
    input: ab8500-ponkey: Create AB8500 domain IRQ mapping
    mfd: Add missing out of memory check for pcf50633
    Documentation: Describe the AB8500 Device Tree bindings
    mfd: Add tps65910 32-kHz-crystal-input init
    mfd: Drop modifying mc13xxx driver's id_table in probe
    ...

    Linus Torvalds
     

27 Jul, 2012

1 commit

  • Pull GPIO changes from Linus Walleij:
    - New driver for AMD-8111 southbridge GPIOs
    - New driver for Wolfson Micro Arizona devices
    - Propagate device tree parse errors
    - Probe deferral finalizations - all expected calls to GPIO will now
    hopefully request deferral where apropriate
    - Misc updates to TCA6424, WM8994, LPC32xx, PCF857x, Samsung MXC, OMAP
    and PCA953X drivers.

    Fix up gpio_idx conflicts in drivers/gpio/gpio-mxc.c

    * tag 'gpio-for-v3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
    gpio: of_get_named_gpio_flags() return -EPROBE_DEFER if GPIO not yet available
    gpiolib: Defer failed gpio requests by default
    MAINTAINERS: add entry OMAP GPIO driver
    gpio/pca953x: increase variables size to support 24 bit of data
    GPIO: PCA953X: Increase size of invert variable to support 24 bit
    gpio/omap: move bank->dbck initialization to omap_gpio_mod_init()
    gpio/mxc: use the edge_sel feature if available
    gpio: propagate of_parse_phandle_with_args errors
    gpio: samsung: add flags specifier to device-tree binding
    gpiolib: Add support for Wolfson Microelectronics Arizona class devices
    gpio: gpio-lpc32xx: Add gpio_to_irq mapping
    gpio: pcf857x: share 8/16 bit access functions
    gpio: LPC32xx: Driver cleanup
    MAINTAINERS: Add Wolfson gpiolib drivers to the Wolfson entry
    gpiolib: wm8994: Convert to devm_kzalloc()
    gpiolib: wm8994: Use irq_domain mappings for gpios
    gpio: add a driver for GPIO pins found on AMD-8111 south bridge chips
    gpio/tca6424: merge I2C transactions, remove cast
    gpio/of: fix a typo of comment message

    Linus Torvalds
     

25 Jul, 2012

1 commit

  • Converting the gpio driver of tps6586x to a platform
    driver in place of registering the gpio through core
    driver.
    The motivation of the change is:
    - This is inline with the mfd drivers implementation.
    - This will move the related gpio support to gpio driver
    folder where all gpio related drivers are available.
    This will be easy the maintenance and enhancement is
    anything done for gpio.
    - The gpio functionality can be selected through config
    variable.

    Signed-off-by: Laxman Dewangan
    Reviewed-by: Linus Walleij
    Signed-off-by: Samuel Ortiz

    Laxman Dewangan
     

24 Jul, 2012

1 commit

  • Pull arm-soc sparse IRQ conversion from Arnd Bergmann:
    "The I.MX platform is getting converted to use sparse IRQs. We are
    doing this for all platforms over time, because this is one of the
    requirements for building a multiplatform kernel, and generally a good
    idea."

    * tag 'irq' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    ARM: imx: select USE_OF
    ARM: imx: Fix build error due to missing irqs.h include
    ARM: imx: enable SPARSE_IRQ for imx platform
    ARM: fiq: change FIQ_START to a variable
    tty: serial: imx: remove the use of MXC_INTERNAL_IRQS
    ARM: imx: remove unneeded mach/irq.h inclusion
    i2c: imx: remove unneeded mach/irqs.h inclusion
    ARM: imx: add a legacy irqdomain for mx31ads
    ARM: imx: add a legacy irqdomain for 3ds_debugboard
    ARM: imx: pass gpio than irq number into mxc_expio_init
    ARM: imx: leave irq_base of wm8350_platform_data uninitialized
    dma: ipu: remove the use of ipu_platform_data
    ARM: imx: move irq_domain_add_legacy call into avic driver
    ARM: imx: move irq_domain_add_legacy call into tzic driver
    gpio/mxc: move irq_domain_add_legacy call into gpio driver
    ARM: imx: eliminate macro IRQ_GPIOx()
    ARM: imx: eliminate macro IOMUX_TO_IRQ()
    ARM: imx: eliminate macro IMX_GPIO_TO_IRQ()

    Linus Torvalds
     

18 Jul, 2012

9 commits

  • of_get_named_gpio_flags() and of_get_named_gpio() return -EPROBE_DEFER if the
    respective GPIO is not (yet) available. This is useful if driver's probe()
    functions try to get a GPIO whose controller isn't probed yet. Thus, the driver
    can be probed again later on.

    The function still returns -EINVAL on other errors (parse error or node doesn't
    exist). This way, the case of an optional/intentionally missing GPIO is handled
    appropriately.

    Signed-off-by: Roland Stigge
    Acked-by: Alexandre Pereira da Silva
    Signed-off-by: Linus Walleij

    Roland Stigge
     
  • Since users must be explicitly provided with a GPIO number in order to
    request one the overwhelmingly common case for failing to request will
    be that the required GPIO driver has not yet registered and we should
    therefore defer until it has registered.

    In order to avoid having to code this logic in individual drivers have
    gpio_request() return -EPROBE_DEFER when failing to look up the GPIO.
    Drivers which don't want this behaviour can override it if they desire.

    Signed-off-by: Mark Brown
    Signed-off-by: Linus Walleij

    Mark Brown
     
  • Increase variable size from u16 to u32 to allocate 24 bit of data required for
    the TCA6424 I/O expander device type.

    Signed-off-by: Leed Aguilar
    Signed-off-by: Chandrabhanu Mahapatra
    Signed-off-by: Linus Walleij

    Leed Aguilar
     
  • TCA6424 is a low voltage 24 bit I2C and SMBus I/O expander of pca953x family
    similar to its 16 bit predecessor TCA6416. It comes with three 8-bit active
    Input, Output, Polarity Inversion and Configuration registers each. The polarity
    of Input ports can be reversed by setting the appropiate bit in Polarity
    Inversion registers.

    The variables corresponding to Input, Output and Configuration registers have
    already been updated to support 24 bit values. This patch thus updates the
    invert variable of PCA953X platform data to support 24 bit.

    Signed-off-by: Chandrabhanu Mahapatra
    Signed-off-by: Linus Walleij

    Chandrabhanu Mahapatra
     
  • Since the bank->dbck initialization in a one time operation there
    is no need to keep this within gpio_debounce(). Therefore, moving
    clk_get(bank->dbck) to omap_gpio_mod_init(). Since the value of
    bank->dbck would be NULL at the beginning, this check has been
    removed.

    Signed-off-by: Tarun Kanti DebBarma
    Reported-by: Paul Walmsley
    Reviewed-by: Jon Hunter
    Cc: Kevin Hilman
    Cc: Rajendra Nayak
    Cc: Santosh Shilimkar
    Cc: Cousson, Benoit
    Reviewed-by: Paul Walmsley
    Signed-off-by: Linus Walleij

    Tarun Kanti DebBarma
     
  • Some mxc processors have an edge_sel feature, which allows the IRQ to be
    triggered by any edge.

    This patch makes use of this feature if available, which skips mxc_flip_edge().

    Cc: Grant Likely
    Cc: Linus Walleij
    Acked-by: Sascha Hauer
    Cc:
    Signed-off-by: Benoît Thébaudeau
    Signed-off-by: Linus Walleij

    Benoît Thébaudeau
     
  • Make of_get_named_gpio_flags propagate any error it receives from
    of_parse_phandle_with_args instead of inconditionally returning -EINVAL.

    Signed-off-by: Alexandre Courbot
    Signed-off-by: Linus Walleij

    Alexandre Courbot
     
  • This adds a flags field to the gpio specifier for Samsung. I didn't
    want to add yet another field in the already quite long specifier, so
    I decided to compress it together with the Pull Up/Down settings instead.

    This is needed to, for example, have a gpio-keys input that is active low.

    Signed-off-by: Olof Johansson
    Signed-off-by: Linus Walleij

    Olof Johansson
     
  • The Arizona class devices provide some GPIOs for use in the system. This
    driver provides support for these via gpiolib. Currently interrupts are
    not supported, normally the GPIOs are outputs only.

    Signed-off-by: Mark Brown
    [Fold in WM5110 support patch]
    Signed-off-by: Linus Walleij

    Mark Brown
     

12 Jul, 2012

6 commits


11 Jul, 2012

1 commit


10 Jul, 2012

1 commit


05 Jul, 2012

7 commits


04 Jul, 2012

1 commit

  • Currently the gpio _runtime_resume/suspend functions are calling the
    get_context_loss_count() platform function if the function is populated for
    a gpio bank. This function is used to determine if the gpio bank logic state
    needs to be restored due to a power transition. This function will be populated
    for all banks, but it should only be called for banks that have the
    "loses_context" variable set. It is pointless to call this if loses_context is
    false as we know the context will never be lost and will not need restoring.

    For all OMAP2+ devices gpio bank-0 is in an always-on power domain and so will
    never lose context. We found that the get_context_loss_count() was being called
    for bank-0 during the probe and returning 1 instead of 0 indicating that the
    context had been lost. This was causing the context restore function to be
    called at probe time for this bank and because the context had never been saved,
    was restoring an invalid state. This ultimately resulted in a crash [1].

    This issue is a regression that was exposed by commit 1b1287032 (gpio/omap: fix
    missing check in *_runtime_suspend()).

    There are multiple bugs here that need to be addressed ...

    1. Why the always-on power domain returns a context loss count of 1? This needs
    to be fixed in the power domain code [2]. However, the gpio driver should not
    assume the loss count is 0 to begin with.
    2. The omap gpio driver should never be calling get_context_loss_count for a
    gpio bank in a always-on domain. This is pointless and adds unneccessary
    overhead.
    3. The OMAP gpio driver assumes that the initial power domain context loss count
    will be 0 at the time the gpio driver is probed. However, it could be
    possible that this is not the case and an invalid context restore could be
    performed during the probe. To avoid this only populate the
    get_context_loss_count() function pointer after the initial call to
    pm_runtime_get() has occurred. This will ensure that the first
    pm_runtime_put() initialised the loss count correctly.

    This patch addresses issues 2 and 3 above.

    [1] http://marc.info/?l=linux-omap&m=134065775323775&w=2
    [2] http://marc.info/?l=linux-omap&m=134100413303810&w=2

    Cc: Kevin Hilman
    Cc: Grant Likely
    Cc: Linus Walleij
    Cc: Tarun Kanti DebBarma
    Cc: Franky Lin
    Cc: Santosh Shilimkar
    Cc: NeilBrown

    Reported-by: Franky Lin
    Reviewed-by: Santosh Shilimkar
    Tested-by: Franky Lin
    Acked-by: Kevin Hilman
    Tested-by: NeilBrown
    Signed-off-by: Jon Hunter
    Signed-off-by: Kevin Hilman

    Jon Hunter
     

01 Jul, 2012

1 commit

  • Move irq_domain_add_legacy call from imx*-dt.c into gpio driver and
    have the gpio driver adopt irqdomain support for both DT and non-DT
    boot.

    With all imx platform code converted from static gpio irq number
    computation to use run-time gpio_to_irq call, we can now use
    irq_alloc_descs and irqdomain support to dynamically get irq_base
    and have the mapping between gpio and irq number available without
    using virtual_irq_start and MXC_GPIO_IRQ_START.

    Signed-off-by: Shawn Guo
    Cc: Grant Likely
    Acked-by: Sascha Hauer
    Acked-by: Dong Aisheng

    Shawn Guo