13 Aug, 2015

1 commit

  • Uses the gpiolib irqchip helpers. For this to work, the irq setup
    function is called once per bank instead of once per device. Note
    that all known uses of this block have a BCM7120 L2 interrupt
    controller as a parent. Supports interrupts for all GPIOs.

    In the IRQ handler, we check for raised IRQs for invalid GPIOs and
    warn (ratelimited) if they're encountered.

    Also, several drivers (e.g. gpio-keys) allow for GPIOs to be
    configured as wakeup sources, and this GPIO controller supports that
    through a separate interrupt path.

    The de-facto standard DT property "wakeup-source" is checked, since
    that indicates whether the GPIO controller hardware can wake. Uses
    the IRQCHIP_MASK_ON_SUSPEND irq_chip flag because UPG GIO doesn't have
    any of its own wakeup source configuration.

    Aside regarding gpiolib irqchip helpers: It wasn't obvious (to me)
    that you can have multiple chained irqchips and associated IRQ domains
    for a single parent IRQ, and as long as the xlate function is written
    correctly, a GPIO IRQ request end up checking the correct domain and
    will get associated with the correct IRQ. What helps make this clear
    is to read
    drivers/gpio/gpiolib-of.c:
    - of_gpiochip_find_and_xlate()
    - of_get_named_gpiod_flags()
    drivers/gpio/gpiolib.c:
    - gpiochip_find()

    Signed-off-by: Gregory Fong
    Reviewed-by: Florian Fainelli
    Signed-off-by: Linus Walleij

    Gregory Fong
     

03 Aug, 2015

1 commit

  • On ETRAX FS, all pins on the first port (and only the first port) have
    interrupt support.

    On ARTPEC-3, all pins on all ports have interrupt support. However,
    there are only eight interrupts. Each of the interrupts is associated
    with a group of pins and for each interrupt the one pin from the group
    which will trigger it can be selected.

    Signed-off-by: Rabin Vincent
    Signed-off-by: Linus Walleij

    Rabin Vincent
     

16 Jul, 2015

3 commits


10 Jun, 2015

2 commits


02 Jun, 2015

1 commit

  • This adds support for the GPIO IP "UPG GIO" used on
    Broadcom STB SoCs (BCM7XXX and some others). Uses
    basic_mmio_gpio to instantiate a gpio_chip for each bank.
    The driver assumes that it handles the base set of GPIOs
    on the system and that it can start its numbering sequence
    from 0, so any GPIO expanders used with it must dynamically
    assign GPIO numbers after this driver has finished
    registering its GPIOs.

    Does not implement the interrupt-controller portion yet,
    will be done in a future commit.

    v2:
    - change include to use instead of

    - get rid of unnecessary imask member in struct bank
    - rename GPIO_PER_BANK -> MAX_GPIO_PER_BANK
    - always have 32 GPIOs per bank and add 'width' member in
    struct bank to hold actual number of GPIOs in use
    - mark of_match table as const

    List-usage-fixed-by: Brian Norris
    Signed-off-by: Gregory Fong
    Signed-off-by: Linus Walleij

    Gregory Fong
     

06 May, 2015

2 commits

  • Add GPIO controller driver for Netlogic XLP MIPS64 SOCs.

    This driver is instantiated by device tree and supports interrupts
    for GPIOs.

    Signed-off-by: Kamlakant Patel
    Signed-off-by: Linus Walleij

    Kamlakant Patel
     
  • We currently get all kinds of errors building the omap gpio driver
    as a module starting with:

    undefined reference to `omap2_gpio_resume_after_idle'
    undefined reference to `omap2_gpio_prepare_for_idle'
    ...

    Let's fix the issue by adding inline functions to the header.
    Note that we can now also remove the two unused functions for
    omap_set_gpio_debounce and omap_set_gpio_debounce_time.

    Then doing rmmod on the module produces further warnings
    because of missing exit related functions. Let's add those.

    And finally, we can make the Kconfig entry just a tristate
    option that's selected for omaps.

    Cc: Javier Martinez Canillas
    Cc: Kevin Hilman
    Cc: Nishanth Menon
    Signed-off-by: Tony Lindgren
    Reviewed-by: Grygorii Strashko
    Acked-by: Santosh Shilimkar
    Reviewed-by: Felipe Balbi
    Signed-off-by: Linus Walleij

    Tony Lindgren
     

05 May, 2015

1 commit


23 Apr, 2015

1 commit

  • Pull ARM SoC cleanups from Olof Johansson:
    "We've got a fairly large cleanup branch this time. The bulk of this
    is removal of non-DT platforms of several flavors:

    - Atmel at91 platforms go full-DT, with removal of remaining
    board-file based support

    - OMAP removes legacy board files for three more platforms

    - removal of non-DT mach-msm, newer Qualcomm platforms now live in
    mach-qcom

    - Freescale i.MX25 also removes non-DT platform support"

    Most of the rest of the changes here are fallout from the above, i.e. for
    example removal of drivers that now lack platforms, etc.

    * tag 'armsoc-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (58 commits)
    mmc: Remove msm_sdcc driver
    gpio: Remove gpio-msm-v1 driver
    ARM: Remove mach-msm and associated ARM architecture code
    ARM: shmobile: cpuidle: Remove the pointless default driver
    ARM: davinci: dm646x: Add interrupt resource for McASPs
    ARM: davinci: irqs: Correct McASP1 TX interrupt definition for DM646x
    ARM: davinci: dm646x: Clean up the McASP DMA resources
    ARM: davinci: devices-da8xx: Add support for McASP2 on da830
    ARM: davinci: devices-da8xx: Clean up and correct the McASP device creation
    ARM: davinci: devices-da8xx: Add interrupt resource to McASP structs
    ARM: davinci: devices-da8xx: Add resource name for the McASP DMA request
    ARM: OMAP2+: Remove legacy support for omap3 TouchBook
    ARM: OMAP3: Remove legacy support for devkit8000
    ARM: OMAP3: Remove legacy support for EMA-Tech Stalker board
    ARM: shmobile: Consolidate the pm code for R-Car Gen2
    ARM: shmobile: r8a7791: Correct SYSCIER value
    ARM: shmobile: r8a7790: Correct SYSCIER value
    ARM: at91: remove old setup
    ARM: at91: sama5d4: remove useless map_io
    ARM: at91: sama5 use SoC detection infrastructure
    ...

    Linus Torvalds
     

18 Apr, 2015

1 commit

  • Pull GPIO updates from Linus Walleij:
    "This is the bulk of GPIO changes for the v4.1 development cycle:

    - A new GPIO hogging mechanism has been added. This can be used on
    boards that want to drive some GPIO line high, low, or set it as
    input on boot and then never touch it again. For some embedded
    systems this is bliss and simplifies things to a great extent.

    - Some API cleanup and closure: gpiod_get_array() and
    gpiod_put_array() has been added to get and put GPIOs in bulk as
    was possible with the non-descriptor API.

    - Encapsulate cross-calls to the pin control subsystem in
    . Now this should be the only header any GPIO
    driver needs to include or something is wrong. Cleanups
    restricting drivers to this include are welcomed if tested.

    - Sort the GPIO Kconfig and split it into submenus, as it was
    becoming and unstructured, illogical and unnavigatable mess. I
    hope this is easier to follow. Menus that require a certain
    subsystem like I2C can now be hidden nicely for example, still
    working on others.

    - New drivers:

    - New driver for the Altera Soft GPIO.

    - The F7188x driver now handles the F71869 and F71869A variants.

    - The MIPS Loongson driver has been moved to drivers/gpio for
    consolidation and cleanup.

    - Cleanups:

    - The MAX732x is converted to use the GPIOLIB_IRQCHIP
    infrastructure.

    - The PCF857x is converted to use the GPIOLIB_IRQCHIP
    infrastructure.

    - Radical cleanup of the OMAP driver.

    - Misc:

    - Enable the DWAPB GPIO for all architectures. This is a "hard
    IP" block from Synopsys which has started to turn up in so
    diverse architectures as X86 Quark, ARC and a slew of ARM
    systems. So even though it's not an expander, it's generic
    enough to be available for all.

    - We add a mock GPIO on Crystalcove PMIC after a long discussion
    with Daniel Vetter et al, tracing back to the shootout at the
    kernel summit where DRM drivers and sub-componentization was
    discussed. In this case a mock GPIO is assumed to be the best
    compromise gaining some reuse of infrastructure without making
    DRM drivers overly complex at the same time. Let's see"

    * tag 'gpio-v4.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (62 commits)
    Revert "gpio: sch: use uapi/linux/pci_ids.h directly"
    gpio: dwapb: remove dependencies
    gpio: dwapb: enable for ARC
    gpio: removing kfree remove functionality
    gpio: mvebu: Fix mask/unmask managment per irq chip type
    gpio: split GPIO drivers in submenus
    gpio: move MFD GPIO drivers under their own comment
    gpio: move BCM Kona Kconfig option
    gpio: arrange SPI Kconfig symbols alphabetically
    gpio: arrange PCI GPIO controllers alphabetically
    gpio: arrange I2C Kconfig symbols alphabetically
    gpio: arrange Kconfig symbols alphabetically
    gpio: ich: Implement get_direction function
    gpio: use (!foo) instead of (foo == NULL)
    gpio: arizona: drop owner assignment from platform_drivers
    gpio: max7300: remove 'ret' variable
    gpio: use devm_kzalloc
    gpio: sch: use uapi/linux/pci_ids.h directly
    gpio: x-gene: fix devm_ioremap_resource() check
    gpio: loongson: Add Loongson-3A/3B GPIO driver support
    ...

    Linus Torvalds
     

09 Apr, 2015

1 commit

  • The Synopsys DesignWare DWAPB GPIO block is popular to
    synthesize amongst many architectures: X86, ARM, ARC.
    The driver was restricted to only these archs due to
    using [read|write]l_relaxed() accessors that were not
    universally available in the past,
    but as of commit 9439eb3ab9d1ece6e4ad7baaa4a7f534f9b9dab0
    "asm-generic: io: implement relaxed accessor macros as
    conditional wrappers" these accessors are available on all
    archs so this should not be a problem any more. Enable the
    driver for all archs.

    Cc: Alexey Brodkin
    Cc: Will Deacon
    Signed-off-by: Linus Walleij

    Linus Walleij
     

08 Apr, 2015

9 commits


07 Apr, 2015

1 commit


28 Mar, 2015

1 commit

  • This driver is orphaned now that mach-msm has been removed.
    Delete it.

    Cc: David Brown
    Cc: Bryan Huntsman
    Cc: Daniel Walker
    Cc: Linus Walleij
    Cc: Alexandre Courbot
    Signed-off-by: Stephen Boyd
    Acked-by: Linus Walleij
    Signed-off-by: Kumar Gala

    Stephen Boyd
     

26 Mar, 2015

1 commit


19 Mar, 2015

1 commit

  • The Intel Quark SoC contains the DW GPIO on board. While fixing the build error
    the commit 1972c97db5b0 (gpio: dwapb: fix compile errors) disables the
    possibility to build the driver on X86, i.e. Intel Quark.

    The patch reenables it for Intel Quark as well.

    Since we have Intel Quark SoC introduced in 4.0-rc1 I would like to make this
    fix available there as well, though the actual MFD driver [1] is applied only
    for next version.

    [1] https://lkml.org/lkml/2015/2/1/217

    Fixes: 1972c97db5b0 (gpio: dwapb: fix compile errors)
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Linus Walleij

    Andy Shevchenko
     

18 Mar, 2015

2 commits


09 Mar, 2015

1 commit


08 Mar, 2015

1 commit

  • Adds a new driver for Altera soft GPIO IP. The driver is able to do
    read/write and allows GPIO to be a interrupt controller.

    Tested on Altera GHRD on interrupt handling and IO.

    v10:
    - Updated conflicting device tree parameters
    - Removed unused headers
    - Used macro instead of magic numbers for ngpio
    - Code readability cleanup using ?: and temporal variables
    - Removed leftover garbage and unnecessary function calls
    - Checked bgpio_init but unusable because Altera GPIO may not
    be a multiple of 8 bits

    v9:
    - Removed duplicated initialization on set_type using temporals
    to improve code readability in calling generic_handle_irq
    - Using ?: ternary to reduce code size

    v8:
    - Using for_each_set_bit
    - Added const for struct definition
    - Removed naggy pr_err
    - Sort alpha header
    - Remove unused macros
    - Use fixed width data types instead of unsigned long
    - Whitespace issue fixes
    - Removed _relaxed function for better compatibility across different
    CPU
    - Changed irq_create_mapping to platform_get_irq updated implementation
    to use gpiochip_irqchip_add
    - Reserve interrupt-cells number 2 in device tree binding for future
    use
    - Remove confusing sections on devicetree bindings
    - Added tristate Kconfig help text

    v7:
    - Used dev_warn instead of pr_warn
    - Clean up unnecesarry if else indentation

    v6:
    - Added irq_startup and irq_shutdown
    - Changed bitwise clamping style
    - Cleanup bitwise operation to improve readability change naming of
    mapped irqs from virq to mapped_irq

    v5:
    - Dispose irq_domain mapping correctly
    - Update optional binding description in binding docs

    v4:
    - Added vendor prefix to devicetree binding for IP specific properties
    using MMIO GPIO helper library instead of manually map PIO to memory
    - altera_gpio_chip inline struct documentation to kerneldoc
    - Using dev_ print to print a better failure message

    v2, v3:
    - Do not reference NO_IRQ
    - Updated irq_set_type to only allow the hardware configured irq type

    Signed-off-by: Tien Hock Loh
    Signed-off-by: Linus Walleij

    Tien Hock Loh
     

04 Mar, 2015

1 commit

  • Switch the PCF857x GPIO driver to use the gpiolib irqchip helpers.
    This driver uses a nested threaded interrupt, hence handle_nested_irq()
    and gpiochip_set_chained_irqchip() must be used.

    Note that this removes the checks added in commit 21fd3cd1874a2ac8
    ("gpio: pcf857x: call the gpio user handler iff gpio_to_irq is done"),
    as the interrupt mappings are no longer created on-demand by the driver,
    but by gpiochip_irqchip_add() during initialization.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Linus Walleij

    Geert Uytterhoeven
     

02 Mar, 2015

1 commit

  • Take a sweep to bring the irq support for the MAX732x expanders
    into the gpiolib core to cut down on duplicated code.

    Only compile tested! I need some feedback from people using this
    expander with interrupts to tell me if things go right or
    wrong when I do this.

    Cc: Semen Protsenko
    Cc: Mans Rullgard
    Signed-off-by: Linus Walleij

    Linus Walleij
     

04 Feb, 2015

1 commit

  • The PPC_OF is a ppc specific option which is used to mean that the
    firmware device tree access functions are available. Since all the
    ppc platforms have a device tree, it is aways set to 'y' for ppc.
    So it makes no sense to keep a such option in the current kernel.
    Replace it with PPC.

    Signed-off-by: Kevin Hao
    Signed-off-by: Linus Walleij

    Kevin Hao
     

20 Jan, 2015

3 commits


16 Jan, 2015

3 commits