19 Apr, 2014

1 commit

  • shiraz.hashim@st.com email-id doesn't exist anymore as he has left the
    company. Replace ST's id with shiraz.linux.kernel@gmail.com.

    It also updates .mailmap file to fix address for 'git shortlog'.

    Signed-off-by: Viresh Kumar
    Cc: Shiraz Hashim
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Viresh Kumar
     

08 Apr, 2014

1 commit

  • Pull MFD updates from Lee Jones:
    "Changes to existing drivers:
    - Use of managed resources - omap, twl4030, ti_am335x_tscadc
    - Advanced error handling - omap
    - Rework clk management - omap
    - Device Tree (re-)work - tc3589x, pm8921, da9055, sec
    - IRC management overhaul and !BROKEN - pm8921
    - Convert to regmap - ssbi, pm8921
    - Use simple power-management ops - ucb1x00
    - Include file clean-up - adp5520, cs5535, janz, lpc_ich,
    - lpc_sch, max14577, mcp-sa11x0, pcf50633-adc, rc5t583,
    rdc321x-southbridge, retu, smsc-ece1099, ti-ssp, ti_am335x_tscadc,
    tps65912, vexpress-config, wm8350, ywm8350
    - Various bug fixes across the subsystem
    - NULL/invalid pointer dereference prevention
    - Resource leak mitigation,
    - Variable used initialised
    - Staticise various containers
    - Enforce return value checks

    New drivers/supported devices:
    - Add support for s2mps14 and s2mpa01 to sec
    - Add support for da9063 (v5) to da9063
    - Add support for atom-c2000 to gpio-ich
    - Add support for come-{mbt10,cbt6,chl6} to kempld
    - Add support for da9053 to da9052
    - Add support for itco-wdt (v3) and baytrail to lpc_ich
    - Add new drivers for tps65218, rtsx_usb, bcm590xx

    (Re-)moved drivers:
    - twl4030 ==> drivers/iio
    - ti-ssp ==> /dev/null"

    * tag 'mfd-for-linus-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (103 commits)
    mfd: wm5110: Correct default for HEADPHONE_DETECT_1
    mfd: arizona: Correct small errors in the DT binding documentation
    mfd: arizona: Mark DSP clocking register as volatile
    mfd: devicetree: bindings: Add pm8xxx RTC description
    mfd: kempld-core: Fix potential hang-up during boot
    mfd: sec-core: Fix uninitialized 'regmap_rtc' on S2MPA01
    mfd: tps65910: Fix regmap_irq_chip_data leak on mfd_add_devices fail
    mfd: tps65910: Fix possible invalid pointer dereference on regmap_add_irq_chip fail
    mfd: sec-core: Fix I2C dummy device resource leak on probe failure
    mfd: sec-core: Add of_compatible strings for clock MFD cells
    mfd: Remove obsolete ti-ssp driver
    Documentation: mfd: s2mps11: Describe S5M8767 and S2MPS14 clocks
    mfd: bcm590xx: Fix type argument for module device table
    mfd: lpc_ich: Add support for Intel Bay Trail SoC
    mfd: lpc_ich: Add support for NM10 GPIO
    mfd: lpc_ich: Change Avoton to iTCO v3
    watchdog: iTCO_wdt: Add support for v3 silicon
    mfd: lpc_ich: Add support for iTCO v3
    mfd: lpc_ich: Remove lpc_ich_cfg struct use
    mfd: lpc_ich: Only configure watchdog or GPIO when present
    ...

    Linus Torvalds
     

06 Apr, 2014

1 commit

  • Pull ARM SoC driver changes from Arnd Bergmann:
    "These changes are mostly for ARM specific device drivers that either
    don't have an upstream maintainer, or that had the maintainer ask us
    to pick up the changes to avoid conflicts.

    A large chunk of this are clock drivers (bcm281xx, exynos, versatile,
    shmobile), aside from that, reset controllers for STi as well as a
    large rework of the Marvell Orion/EBU watchdog driver are notable"

    * tag 'drivers-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (99 commits)
    Revert "dts: socfpga: Add DTS entry for adding the stmmac glue layer for stmmac."
    Revert "net: stmmac: Add SOCFPGA glue driver"
    ARM: shmobile: r8a7791: Fix SCIFA3-5 clocks
    ARM: STi: Add reset controller support to mach-sti Kconfig
    drivers: reset: stih416: add softreset controller
    drivers: reset: stih415: add softreset controller
    drivers: reset: Reset controller driver for STiH416
    drivers: reset: Reset controller driver for STiH415
    drivers: reset: STi SoC system configuration reset controller support
    dts: socfpga: Add sysmgr node so the gmac can use to reference
    dts: socfpga: Add support for SD/MMC on the SOCFPGA platform
    reset: Add optional resets and stubs
    ARM: shmobile: r7s72100: fix bus clock calculation
    Power: Reset: Generalize qnap-poweroff to work on Synology devices.
    dts: socfpga: Update clock entry to support multiple parents
    ARM: socfpga: Update socfpga_defconfig
    dts: socfpga: Add DTS entry for adding the stmmac glue layer for stmmac.
    net: stmmac: Add SOCFPGA glue driver
    watchdog: orion_wdt: Use %pa to print 'phys_addr_t'
    drivers: cci: Export CCI PMU revision
    ...

    Linus Torvalds
     

04 Apr, 2014

1 commit

  • Pull bulk of gpio updates from Linus Walleij:
    "A pretty big chunk of changes this time, but it has all been on
    rotation in linux-next and had some testing. Of course there will be
    some amount of fixes on top...

    - Merged in a branch of irqchip changes from Thomas Gleixner: we need
    to have new callbacks from the irqchip to determine if the GPIO
    line will be eligible for IRQs, and this callback must be able to
    say "no". After some thinking I got the branch from tglx and have
    switched all current users over to use this.

    - Based on tglx patches, we have added some generic irqchip helpers
    in the gpiolib core. These will help centralize code when GPIO
    drivers have simple chained/cascaded IRQs. Drivers will still
    define their irqchip vtables, but the gpiolib core will take care
    of irqdomain set-up, mapping from local offsets to Linux irqs, and
    reserve resources by marking the GPIO lines for IRQs.

    - Initially the PL061 and Nomadik GPIO/pin control drivers have been
    switched over to use the new gpiochip-to-irqchip infrastructure
    with more drivers expected for the next kernel cycle. The
    factoring of just two drivers still makes it worth it so it is
    already a win.

    - A new driver for the Synopsys DesignWare APB GPIO block.

    - Modify the DaVinci GPIO driver to be reusable also for the new TI
    Keystone architecture.

    - A new driver for the LSI ZEVIO SoCs.

    - Delete the obsolte tnetv107x driver.

    - Some incremental work on GPIO descriptors: have
    gpiod_direction_output() use a logical level, respecting assertion
    polarity through ACTIVE_LOW flags, adding gpiod_direction_output_raw()
    for the case where you want to set that very value. Add
    gpiochip_get_desc() to fetch a GPIO descriptor from a specific
    offset on a certain chip inside driver code.

    - Switch ACPI GPIO code over to using gpiochip_get_desc() and get rid
    of gpio_to_desc().

    - The ACPI GPIO event handling code has been reworked after
    encountering an actual real life implementation.

    - Support for ACPI GPIO operation regions.

    - Generic GPIO chips can now be assigned labels/names from platform
    data.

    - We now clamp values returned from GPIO drivers to the boolean [0,1]
    range.

    - Some improved documentation on how to use the polarity flag was
    added.

    - a large slew of incremental driver updates and non-critical fixes.
    Some targeted for stable"

    * tag 'gpio-v3.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (80 commits)
    gpio: rcar: Add helper variable dev = &pdev->dev
    gpio-lynxpoint: force gpio_get() to return "1" and "0" only
    gpio: unmap gpio irqs properly
    pch_gpio: set value before enabling output direction
    gpio: moxart: Actually set output state in moxart_gpio_direction_output()
    gpio: moxart: Avoid forward declaration
    gpio: mxs: Allow for recursive enable_irq_wake() call
    gpio: samsung: Add missing "break" statement
    gpio: twl4030: Remove redundant assignment
    gpio: dwapb: correct gpio-cells in binding document
    gpio: iop: fix devm_ioremap_resource() return value checking
    pinctrl: coh901: convert driver to use gpiolib irqchip
    pinctrl: nomadik: convert driver to use gpiolib irqchip
    gpio: pl061: convert driver to use gpiolib irqchip
    gpio: add IRQ chip helpers in gpiolib
    pinctrl: nomadik: factor in platform data container
    pinctrl: nomadik: rename secondary to latent
    gpio: Driver for SYSCON-based GPIOs
    gpio: generic: Use platform_device_id->driver_data field for driver flags
    pinctrl: coh901: move irq line locking to resource callbacks
    ...

    Linus Torvalds
     

01 Apr, 2014

1 commit

  • When an IRQ is started on a GPIO line, mark this GPIO as IRQ in
    the gpiolib so we can keep track of the usage centrally.

    Signed-off-by: Linus Walleij
    Cc: Ralf Baechle
    Cc: linux-mips@linux-mips.org
    Cc: linux-gpio@vger.kernel.org
    Cc: Alexandre Courbot
    Patchwork: https://patchwork.linux-mips.org/patch/6417/
    Signed-off-by: Ralf Baechle

    Linus Walleij
     

29 Mar, 2014

3 commits


27 Mar, 2014

6 commits

  • This ensures that the output signal does not toggle if set to high.

    Signed-off-by: Daniel Krueger
    Signed-off-by: Alexander Stein
    Signed-off-by: Linus Walleij

    Daniel Krueger
     
  • moxart_gpio_direction_output() ignored the state passed into it. Fix it.

    Signed-off-by: Axel Lin
    Reviewed-by: Alexandre Courbot
    Signed-off-by: Linus Walleij

    Axel Lin
     
  • Slightly adjust the code to avoid forward declaration as we need to call
    moxart_gpio_set() in moxart_gpio_direction_output() to properly set the
    output state.

    Signed-off-by: Axel Lin
    Reviewed-by: Alexandre Courbot
    Signed-off-by: Linus Walleij

    Axel Lin
     
  • The scenario here is that someone calls enable_irq_wake() from somewhere
    in the code. This will result in the lockdep producing a backtrace as can
    be seen below. In my case, this problem is triggered when using the wl1271
    (TI WlCore) driver found in drivers/net/wireless/ti/ .

    The problem cause is rather obvious from the backtrace, but let's outline
    the dependency. enable_irq_wake() grabs the IRQ buslock in irq_set_irq_wake(),
    which in turns calls mxs_gpio_set_wake_irq() . But mxs_gpio_set_wake_irq()
    calls enable_irq_wake() again on the one-level-higher IRQ , thus it tries to
    grab the IRQ buslock again in irq_set_irq_wake() . Because the spinlock in
    irq_set_irq_wake()->irq_get_desc_buslock()->__irq_get_desc_lock() is not
    marked as recursive, lockdep will spew the stuff below.

    We know we can safely re-enter the lock, so use IRQ_GC_INIT_NESTED_LOCK to
    fix the spew.

    =============================================
    [ INFO: possible recursive locking detected ]
    3.10.33-00012-gf06b763-dirty #61 Not tainted
    ---------------------------------------------
    kworker/0:1/18 is trying to acquire lock:
    (&irq_desc_lock_class){-.-...}, at: [] __irq_get_desc_lock+0x48/0x88

    but task is already holding lock:
    (&irq_desc_lock_class){-.-...}, at: [] __irq_get_desc_lock+0x48/0x88

    other info that might help us debug this:
    Possible unsafe locking scenario:

    CPU0
    ----
    lock(&irq_desc_lock_class);
    lock(&irq_desc_lock_class);

    *** DEADLOCK ***

    May be due to missing lock nesting notation

    3 locks held by kworker/0:1/18:
    #0: (events){.+.+.+}, at: [] process_one_work+0x134/0x4a4
    #1: ((&fw_work->work)){+.+.+.}, at: [] process_one_work+0x134/0x4a4
    #2: (&irq_desc_lock_class){-.-...}, at: [] __irq_get_desc_lock+0x48/0x88

    stack backtrace:
    CPU: 0 PID: 18 Comm: kworker/0:1 Not tainted 3.10.33-00012-gf06b763-dirty #61
    Workqueue: events request_firmware_work_func
    [] (unwind_backtrace+0x0/0xf0) from [] (show_stack+0x10/0x14)
    [] (show_stack+0x10/0x14) from [] (__lock_acquire+0x140c/0x1a64)
    [] (__lock_acquire+0x140c/0x1a64) from [] (lock_acquire+0x9c/0x104)
    [] (lock_acquire+0x9c/0x104) from [] (_raw_spin_lock_irqsave+0x44/0x58)
    [] (_raw_spin_lock_irqsave+0x44/0x58) from [] (__irq_get_desc_lock+0x48/0x88)
    [] (__irq_get_desc_lock+0x48/0x88) from [] (irq_set_irq_wake+0x20/0xf4)
    [] (irq_set_irq_wake+0x20/0xf4) from [] (mxs_gpio_set_wake_irq+0x1c/0x24)
    [] (mxs_gpio_set_wake_irq+0x1c/0x24) from [] (set_irq_wake_real+0x30/0x44)
    [] (set_irq_wake_real+0x30/0x44) from [] (irq_set_irq_wake+0x8c/0xf4)
    [] (irq_set_irq_wake+0x8c/0xf4) from [] (wlcore_nvs_cb+0x10c/0x97c)
    [] (wlcore_nvs_cb+0x10c/0x97c) from [] (request_firmware_work_func+0x38/0x58)
    [] (request_firmware_work_func+0x38/0x58) from [] (process_one_work+0x1c0/0x4a4)
    [] (process_one_work+0x1c0/0x4a4) from [] (worker_thread+0x138/0x394)
    [] (worker_thread+0x138/0x394) from [] (kthread+0xa4/0xb0)
    [] (kthread+0xa4/0xb0) from [] (ret_from_fork+0x14/0x34)
    wlcore: loaded

    Cc: stable@vger.kernel.org
    Signed-off-by: Marek Vasut
    Acked-by: Shawn Guo
    Signed-off-by: Linus Walleij

    Marek Vasut
     
  • Signed-off-by: Alexander Shiyan
    Signed-off-by: Linus Walleij

    Alexander Shiyan
     
  • Variable "status" is never used, so remove it and add warning if
    any error happen.

    Signed-off-by: Alexander Shiyan
    Signed-off-by: Linus Walleij

    Alexander Shiyan
     

26 Mar, 2014

3 commits

  • devm_ioremap_resource() returns a pointer to the remapped memory or
    an ERR_PTR() encoded error code on failure. Fix the check inside
    iop3xx_gpio_probe() accordingly.

    Cc: Lennert Buytenhek
    Cc: Mikael Pettersson
    Cc: Aaro Koskinen
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Acked-by: Alexandre Courbot
    Acked-by: Dan Williams
    Signed-off-by: Linus Walleij

    Bartlomiej Zolnierkiewicz
     
  • This converts the PL061 driver to register its chained irq
    handler and irqchip using the helpers in the gpiolib core.

    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • This provides a function gpiochip_irqchip_add() to set
    up an irqchip for a GPIO controller, and a function
    gpiochip_set_chained_irqchip() to chain it to a parent
    irqchip.

    Most GPIOs are of the type where a number of lines form
    a cascaded interrupt controller chained onto
    the primary system interrupt controller (or further down the
    chain) so let's add this helper and factor the code to
    request the lines to be used as IRQs, the .to_irq() function
    and the irqdomain into the core as well.

    Acked-by: Thomas Gleixner
    Acked-by: Alexandre Courbot
    Signed-off-by: Linus Walleij

    Linus Walleij
     

19 Mar, 2014

4 commits


18 Mar, 2014

3 commits


15 Mar, 2014

1 commit

  • GPIO operation regions is a new feature introduced in ACPI 5.0
    specification. This feature adds a way for platform ASL code to call back
    to OS GPIO driver and toggle GPIO pins.

    An example ASL code from Lenovo Miix 2 tablet with only relevant part
    listed:

    Device (\_SB.GPO0)
    {
    Name (AVBL, Zero)
    Method (_REG, 2, NotSerialized)
    {
    If (LEqual (Arg0, 0x08))
    {
    // Marks the region available
    Store (Arg1, AVBL)
    }
    }

    OperationRegion (GPOP, GeneralPurposeIo, Zero, 0x0C)
    Field (GPOP, ByteAcc, NoLock, Preserve)
    {
    Connection (
    GpioIo (Exclusive, PullDefault, 0, 0, IoRestrictionOutputOnly,
    "\\_SB.GPO0", 0x00, ResourceConsumer,,)
    {
    0x003B
    }
    ),
    SHD3, 1,
    }
    }

    Device (SHUB)
    {
    Method (_PS0, 0, Serialized)
    {
    If (LEqual (\_SB.GPO0.AVBL, One))
    {
    Store (One, \_SB.GPO0.SHD3)
    Sleep (0x32)
    }
    }
    Method (_PS3, 0, Serialized)
    {
    If (LEqual (\_SB.GPO0.AVBL, One))
    {
    Store (Zero, \_SB.GPO0.SHD3)
    }
    }
    }

    How this works is that whenever _PS0 or _PS3 method is run (typically when
    SHUB device is transitioned to D0 or D3 respectively), ASL code checks if
    the GPIO operation region is available (\_SB.GPO0.AVBL). If it is we go and
    store either 0 or 1 to \_SB.GPO0.SHD3.

    Now, when ACPICA notices ACPI GPIO operation region access (the store
    above) it will call acpi_gpio_adr_space_handler() that then toggles the
    GPIO accordingly using standard gpiolib interfaces.

    Implement the support by registering GPIO operation region handlers for all
    GPIO devices that have an ACPI handle. First time the GPIO is used by the
    ASL code we make sure that the GPIO stays requested until the GPIO chip
    driver itself is unloaded. If we find out that the GPIO is already
    requested we just toggle it according to the value got from ASL code.

    Signed-off-by: Mika Westerberg
    Signed-off-by: Linus Walleij

    Mika Westerberg
     

14 Mar, 2014

2 commits

  • Linux 3.14-rc6

    Linus Walleij
     
  • Nothing prevents GPIO drivers from returning values outside the
    boolean range, and as it turns out a few drivers are actually doing so.
    These values were passed as-is to unsuspecting consumers and created
    confusion.

    This patch makes the internal _gpiod_get_raw_value() function return a
    bool, effectively clamping the GPIO value to the boolean range no
    matter what the driver does.

    While we are at it, we also change the value parameter of
    _gpiod_set_raw_value() to bool type before drivers start doing funny
    things with it as well.

    Another way to fix this would be to change the prototypes of the driver
    interface to use bool directly, but this would require a huge
    cross-systems patch so this simpler solution is preferred.

    Changes since v1:
    - Change local variable type to bool as well, use boolean values in
    code
    - Also change prototype of open drain/open source setting functions
    since they are only called from _gpiod_set_raw_value()

    This probably calls for a larger booleanization of gpiolib, but let's
    keep that for a latter change - right now we need to address the issue
    of non-boolean values returned by drivers.

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

    Alexandre Courbot
     

13 Mar, 2014

4 commits

  • The current ACPI GPIO event handling code was never tested against real
    hardware with functioning GPIO triggered events (at the time such hardware
    wasn't available). Thus it misses certain things like requesting the GPIOs
    properly, passing correct flags to the interrupt handler and so on.

    This patch reworks ACPI GPIO event handling so that we:

    1) Use struct acpi_gpio_event for all GPIO signaled events.
    2) Switch to use GPIO descriptor API and request GPIOs by calling
    gpiochip_request_own_desc() that we added in a previous patch.
    3) Pass proper flags from ACPI GPIO resource to request_threaded_irq().

    Also instead of open-coding the _AEI iteration loop we can use
    acpi_walk_resources(). This simplifies the code a bit and fixes memory leak
    that was caused by missing kfree() for buffer returned by
    acpi_get_event_resources().

    Since the remove path now calls gpiochip_free_own_desc() which takes GPIO
    spinlock we need to call acpi_gpiochip_remove() outside of that lock
    (analogous to acpi_gpiochip_add() path where the lock is released before
    those funtions are called).

    Signed-off-by: Mika Westerberg
    Reviewed-by: Rafael J. Wysocki
    Signed-off-by: Linus Walleij

    Mika Westerberg
     
  • In order to consolidate _Exx, _Lxx and _EVT to use the same structure make
    the structure name to reflect that we are dealing with any event, not just
    _EVT.

    This is just rename, no functional changes.

    Signed-off-by: Mika Westerberg
    Signed-off-by: Linus Walleij

    Mika Westerberg
     
  • We are going to add more ACPI specific data to accompany GPIO chip so
    instead of allocating it per each use-case we allocate it once when
    acpi_gpiochip_add() is called and release it when acpi_gpiochip_remove() is
    called.

    Doing this allows us to add more ACPI specific data by merely adding new
    fields to struct acpi_gpio_chip.

    In addition we embed evt_pins member directly to the structure instead of
    having it as a pointer. This simplifies the code a bit since we don't need
    to check against NULL.

    Signed-off-by: Mika Westerberg
    Signed-off-by: Linus Walleij

    Mika Westerberg
     
  • Sometimes it is useful to allow GPIO chips themselves to request GPIOs they
    own through gpiolib API. One use case is ACPI ASL code that should be able
    to toggle GPIOs through GPIO operation regions.

    We can't use gpio_request() because it will pin the module to the kernel
    forever (it calls try_module_get()). To solve this we move module refcount
    manipulation to gpiod_request() and let __gpiod_request() handle the actual
    request. This changes the sequence a bit as now try_module_get() is called
    outside of gpio_lock (I think this is safe, try_module_get() handles
    serialization it needs already).

    Then we provide gpiolib internal functions gpiochip_request/free_own_desc()
    that do the same as gpio_request() but don't manipulate module refrence
    count. This allows the GPIO chip driver to request and free descriptors it
    owns without being pinned to the kernel forever.

    Signed-off-by: Mika Westerberg
    Reviewed-by: Alexandre Courbot
    Signed-off-by: Linus Walleij

    Mika Westerberg
     

12 Mar, 2014

5 commits


11 Mar, 2014

1 commit

  • The driver missed an of_xlate function to translate gpio numbers
    as found in the DT to the correct chip and number.

    While there I've set #gpio_cells to a fixed value of 2.

    I've used gpio-pxa.c as template for those changes and tested my changes
    successfully on a da850 board using entries for gpio-leds in a DT. So I didn't
    reinvent the wheel but just copied and tested stuff.

    Thanks to Grygorii Strashko for the hint to the existing code in gpio-pxa.

    Signed-off-by: Alexander Holler
    Signed-off-by: Grygorii Strashko
    Signed-off-by: Linus Walleij

    Alexander Holler
     

07 Mar, 2014

3 commits

  • Replace commas with semicolons between irqchip callback initialisation
    statements in tz1090_gpio_bank_probe. The commas appear to be a subtle
    remnant of when the irqchips were statically initialised.

    Thanks to Thomas Gleixner for spotting it while whipping up a coccinelle
    script.

    Reported-by: Thomas Gleixner
    Signed-off-by: James Hogan
    Cc: Alexandre Courbot
    Cc: linux-gpio@vger.kernel.org
    Cc: linux-metag@vger.kernel.org
    Signed-off-by: Linus Walleij

    James Hogan
     
  • It is currently debated where the functions to lock a certain
    GPIO line as used for IRQs should be called. Delete all
    misleading documentation.

    Reported-by: Thomas Gleixner
    Cc: Jean-Jacques Hiblot
    Acked-by: Alexandre Courbot
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • The following build warning is generated when building multi_v7_defconfig with
    LPAE option selected:

    drivers/gpio/gpio-pl061.c:358:2: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t' [-Wformat=]

    Fix it by using %pa to print 'resource_size_t'.

    Reported-by: Olof's autobuilder
    Signed-off-by: Fabio Estevam
    Signed-off-by: Linus Walleij

    Fabio Estevam