Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d2faea6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull GPIO updates from Linus Walleij:
 "This is the bulk of GPIO changes for the v4.3 kernel cycle.

  There is quite a lot going on in the GPIO subsystem this merge window,
  so the main matter is decribed below.

  The hits in other subsystems when making the GPIO flags optional are
  all ACKed by their respective subsystem maintainers.

  Core changes:

   - Root out the wrapper devm_gpiod_get() and gpiod_get() etc versions
     of the descriptor calls that did not use the flags argument on the
     end.  This was around for too long and eventually Uwe Kleine-König
     took the time to clean it out and the last users are removed along
     with the macros in this tag.  In several cases the use of flags
     simplifies the code.  For this reason we have (ACKed) patches
     hitting in DRM, IIO, media, NFC, USB+PHY up until we hammer in the
     nail with removing the macros.

   - Add a fat document describing how much ready-made GPIO stuff we
     have i the kernel to discourage people from reinventing a square
     wheel in userspace, as so often happens.

   - Create a separate lockdep class for each instance of a GPIO IRQ
     chip instead of using one class for all chips, as the current code
     will not work with systems with several GPIO chips doing lockdep
     debugging.

   - Protect against driver unloading also when a GPIO line is only used
     as IRQ for the GPIOLIB_IRQCHIP helpers.

   - If the GPIO chip has no designated owner, assign the parent device
     driver owner as owner.

   - Consolidation of chained IRQ handler install/remove replacing all
     call sites where irq_set_handler_data() and
     irq_set_chained_handler() were done in succession with a combined
     call to irq_set_chained_handler_and_data().

     This series was created by Thomas Gleixner after the problem was
     observed by Russell King.

   - Tglx also made another series of patches switching
     __irq_set_handler_locked() for irq_set_handler_locked() which is
     way cleaner.

   - Tglx and Jiang Liu wrote a good bunch of patches to make use of
     irq_desc_get_xxx() accessors and avoid looking up irq_descs from
     IRQ numbers.  The goal is to get rid of the irq number from the
     handlers in the IRQ flow which is nice.

   - Rob Herring killed off the set_irq_flags() for all GPIO drivers.
     This was an ARM specific function that is replaced with the generic
     irq_modify_status() where special flags are actually needed.

   - When an OF node has a pin range for its GPIOs, return -EPROBE_DEFER
     if the pin controller isn't available.  Pretty logical, yet needed
     to be fixed.

   - If a driver using GPIOLIB_IRQCHIP has its own irq_*_resources call
     back, then call these instead of the defaults provided by the
     GPIOLIB.

   - Fix an undocumented ABI hole: named GPIOs were not properly
     documented.

  Driver improvements:

   - Add get_direction() support to the generic GPIO driver, it's
     strange that we didn't have that before.

   - Make it possible to have input-only GPIO chips using the generic
     GPIO driver.

   - Clean out platform data support from the Emma Mobile (EM) driver

   - Finegrained runtime PM support for the RCAR driver.

   - Support r8a7795 (R-car H3) in the RCAR driver.

   - Support interrupts on GPIOs 16 thru 31 in the DaVinci driver.

   - Some consolidation and new support in the MPC8xxx driver, we now
     support MPC5125.

   - Preempt-RT-friendly patches: the OMAP, MPC8xxx, drivers uses raw
     spinlocks making it work better with the realime patches.

   - Interrupt support for the EXTRAXFS GPIO driver.

   - Make the ETRAXFS GPIO driver support also ARTPEC-3.

   - Interrupt and wakeup support for the BRCMSTB driver, also for
     wakeup from S5 cold boot.

   - Mask MXC IRQs during suspend.

   - Improve OMAP2 GPIO set_debounce() to work according to spec.

   - The VF610 driver handles IRQs properly.

  New drivers:

   - ZTE ZX GPIO driver"

* tag 'gpio-v4.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (87 commits)
  Revert "gpio: extraxfs: fix returnvar.cocci warnings"
  gpio: tc3589x: use static container helper
  gpio: xlp: fix error return code
  gpio: vf610: handle level IRQ's properly
  gpio: max732x: Fix error handling in probe()
  gpio: omap: fix clk_prepare/unprepare usage
  gpio: omap: protect regs access in omap_gpio_irq_handler
  gpio: omap: fix omap2_set_gpio_debounce
  gpio: omap: switch to use platform_get_irq
  gpio: omap: remove wrong irq_domain_remove usage in probe
  gpiolib: add description for gpio irqchip fields in struct gpio_chip
  gpio: extraxfs: fix returnvar.cocci warnings
  gpiolib: irqchip: use different lockdep class for each gpio irqchip
  gpio/grgpio: fix deadlock in grgpio_irq_unmap()
  Documentation: gpio: consumer: describe active low property
  gpio: mxc: fix section mismatch warning
  gpio/mxc: mask gpio interrupts in suspend
  gpio: omap: Fix missing raw locks conversion
  gpio: brcmstb: support wakeup from S5 cold boot
  gpio: brcmstb: Add interrupt and wakeup source support
  ...
parents 02cf1da2 01e2dae9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -16,7 +16,8 @@ Description:
    /sys/class/gpio
	/export ... asks the kernel to export a GPIO to userspace
	/unexport ... to return a GPIO to the kernel
	/gpioN ... for each exported GPIO #N
	/gpioN ... for each exported GPIO #N OR
	/<LINE-NAME> ... for a properly named GPIO line
	    /value ... always readable, writes fail for input GPIOs
	    /direction ... r/w as: in, out (default low); write: high, low
	    /edge ... r/w as: none, falling, rising, both
+28 −7
Original line number Diff line number Diff line
@@ -33,6 +33,13 @@ Optional properties:
- interrupt-parent:
    phandle of the parent interrupt controller

- interrupts-extended:
    Alternate form of specifying interrupts and parents that allows for
    multiple parents.  This takes precedence over 'interrupts' and
    'interrupt-parent'.  Wakeup-capable GPIO controllers often route their
    wakeup interrupt lines through a different interrupt controller than the
    primary interrupt line, making this property necessary.

- #interrupt-cells:
    Should be <2>.  The first cell is the GPIO number, the second should specify
    flags.  The following subset of flags is supported:
@@ -47,19 +54,33 @@ Optional properties:
- interrupt-controller:
    Marks the device node as an interrupt controller

- interrupt-names:
    The name of the IRQ resource used by this controller
- wakeup-source:
    GPIOs for this controller can be used as a wakeup source

Example:
	upg_gio: gpio@f040a700 {
		#gpio-cells = <0x2>;
		#interrupt-cells = <0x2>;
		#gpio-cells = <2>;
		#interrupt-cells = <2>;
		compatible = "brcm,bcm7445-gpio", "brcm,brcmstb-gpio";
		gpio-controller;
		interrupt-controller;
		reg = <0xf040a700 0x80>;
		interrupt-parent = <0xf>;
		interrupt-parent = <&irq0_intc>;
		interrupts = <0x6>;
		brcm,gpio-bank-widths = <32 32 32 24>;
	};

	upg_gio_aon: gpio@f04172c0 {
		#gpio-cells = <2>;
		#interrupt-cells = <2>;
		compatible = "brcm,bcm7445-gpio", "brcm,brcmstb-gpio";
		gpio-controller;
		interrupt-controller;
		reg = <0xf04172c0 0x40>;
		interrupt-parent = <&irq0_aon_intc>;
		interrupts = <0x6>;
		interrupt-names = "upg_gio";
		brcm,gpio-bank-widths = <0x20 0x20 0x20 0x18>;
		interrupts-extended = <&irq0_aon_intc 0x6>,
			<&aon_pm_l2_intc 0x5>;
		wakeup-source;
		brcm,gpio-bank-widths = <18 4>;
	};
+2 −1
Original line number Diff line number Diff line
@@ -2,8 +2,9 @@ Axis ETRAX FS General I/O controller bindings

Required properties:

- compatible:
- compatible: one of:
  - "axis,etraxfs-gio"
  - "axis,artpec3-gio"
- reg: Physical base address and length of the controller's registers.
- #gpio-cells: Should be 3
  - The first cell is the gpio offset number.
+22 −0
Original line number Diff line number Diff line
* Freescale MPC512x/MPC8xxx GPIO controller

Required properties:
- compatible : Should be "fsl,<soc>-gpio"
  The following <soc>s are known to be supported:
    mpc5121, mpc5125, mpc8349, mpc8572, mpc8610, pq3, qoriq
- reg : Address and length of the register set for the device
- interrupts : Should be the port interrupt shared by all 32 pins.
- #gpio-cells : Should be two.  The first cell is the pin number and
  the second cell is used to specify the gpio polarity:
      0 = active high
      1 = active low

Example:

gpio0: gpio@1100 {
	compatible = "fsl,mpc5125-gpio";
	#gpio-cells = <2>;
	reg = <0x1100 0x080>;
	interrupts = <78 0x8>;
	status = "okay";
};
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ Required Properties:
    - "renesas,gpio-r8a7791": for R8A7791 (R-Car M2-W) compatible GPIO controller.
    - "renesas,gpio-r8a7793": for R8A7793 (R-Car M2-N) compatible GPIO controller.
    - "renesas,gpio-r8a7794": for R8A7794 (R-Car E2) compatible GPIO controller.
    - "renesas,gpio-r8a7795": for R8A7795 (R-Car H3) compatible GPIO controller.
    - "renesas,gpio-rcar": for generic R-Car GPIO controller.

  - reg: Base address and length of each memory resource used by the GPIO
Loading