Commit ea125ded 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.18 development cycle.

  Core changes:

   - We have killed off VLA from the core library and all drivers.

     The background should be clear for everyone at this point:

        https://lwn.net/Articles/749064/

     Also I just don't like VLA's, kernel developers hate it when
     compilers do things behind their back. It's as simple as that.

     I'm sorry that they even slipped in to begin with. Kudos to Laura
     Abbott for exorcising them.

   - Support GPIO hogs in machines/board files.

  New drivers and chip support:

   - R-Car r8a77470 (RZ/G1C)

   - R-Car r8a77965 (M3-N)

   - R-Car r8a77990 (E3)

   - PCA953x driver improvements to accomodate more variants.

  Improvements and new features:

   - Support one interrupt per line on port A in the DesignWare dwapb
     driver.

  Misc:

   - Random cleanups, right header files in the drivers, some size
     optimizations etc"

* tag 'gpio-v4.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (73 commits)
  gpio: davinci: fix build warning when !CONFIG_OF
  gpio: dwapb: Fix rework support for 1 interrupt per port A GPIO
  gpio: pxa: Include the right header
  gpio: pl061: Include the right header
  gpio: pch: Include the right header
  gpio: pcf857x: Include the right header
  gpio: pca953x: Include the right header
  gpio: palmas: Include the right header
  gpio: omap: Include the right header
  gpio: octeon: Include the right header
  gpio: mxs: Switch to SPDX identifier
  gpio: Remove VLA from stmpe driver
  gpio: mxc: Switch to SPDX identifier
  gpio: mxc: add clock operation
  gpio: Remove VLA from gpiolib
  gpio: aspeed: Use a cache of output data registers
  gpio: aspeed: Set output latch before changing direction
  gpio: pca953x: fix address calculation for pcal6524
  gpio: pca953x: define masks for addressing common and extended registers
  gpio: pca953x: set the PCA_PCAL flag also when matching by DT
  ...
parents fdea70d2 6310b930
Loading
Loading
Loading
Loading
+34 −0
Original line number Diff line number Diff line
@@ -31,10 +31,15 @@ Required properties:
	ti,tca9554
	onnn,pca9654
	exar,xra1202
 - gpio-controller: if used as gpio expander.
 - #gpio-cells: if used as gpio expander.
 - interrupt-controller: if to be used as interrupt expander.
 - #interrupt-cells: if to be used as interrupt expander.

Optional properties:
 - reset-gpios: GPIO specification for the RESET input. This is an
		active low signal to the PCA953x.
 - vcc-supply:	power supply regulator.

Example:

@@ -47,3 +52,32 @@ Example:
		interrupt-parent = <&gpio3>;
		interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
	};


Example with Interrupts:


	gpio99: gpio@22 {
		compatible = "nxp,pcal6524";
		reg = <0x22>;
		interrupt-parent = <&gpio6>;
		interrupts = <1 IRQ_TYPE_EDGE_FALLING>;	/* gpio6_161 */
		interrupt-controller;
		#interrupt-cells = <2>;
		vcc-supply = <&vdds_1v8_main>;
		gpio-controller;
		#gpio-cells = <2>;
		gpio-line-names =
			"hdmi-ct-hpd", "hdmi.ls-oe", "p02", "p03", "vibra", "fault2", "p06", "p07",
			"en-usb", "en-host1", "en-host2", "chg-int", "p14", "p15", "mic-int", "en-modem",
			"shdn-hs-amp", "chg-status+red", "green", "blue", "en-esata", "fault1", "p26", "p27";
	};

	ts3a227@3b {
		compatible = "ti,ts3a227e";
		reg = <0x3b>;
		interrupt-parent = <&gpio99>;
		interrupts = <14 IRQ_TYPE_EDGE_RISING>;
		ti,micbias = <0>;	/* 2.1V */
	};
+3 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ Required Properties:
  - compatible: should contain one or more of the following:
    - "renesas,gpio-r8a7743": for R8A7743 (RZ/G1M) compatible GPIO controller.
    - "renesas,gpio-r8a7745": for R8A7745 (RZ/G1E) compatible GPIO controller.
    - "renesas,gpio-r8a77470": for R8A77470 (RZ/G1C) compatible GPIO controller.
    - "renesas,gpio-r8a7778": for R8A7778 (R-Car M1) compatible GPIO controller.
    - "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller.
    - "renesas,gpio-r8a7790": for R8A7790 (R-Car H2) compatible GPIO controller.
@@ -14,7 +15,9 @@ Required Properties:
    - "renesas,gpio-r8a7794": for R8A7794 (R-Car E2) compatible GPIO controller.
    - "renesas,gpio-r8a7795": for R8A7795 (R-Car H3) compatible GPIO controller.
    - "renesas,gpio-r8a7796": for R8A7796 (R-Car M3-W) compatible GPIO controller.
    - "renesas,gpio-r8a77965": for R8A77965 (R-Car M3-N) compatible GPIO controller.
    - "renesas,gpio-r8a77970": for R8A77970 (R-Car V3M) compatible GPIO controller.
    - "renesas,gpio-r8a77990": for R8A77990 (R-Car E3) compatible GPIO controller.
    - "renesas,gpio-r8a77995": for R8A77995 (R-Car D3) compatible GPIO controller.
    - "renesas,rcar-gen1-gpio": for a generic R-Car Gen1 GPIO controller.
    - "renesas,rcar-gen2-gpio": for a generic R-Car Gen2 or RZ/G1 GPIO controller.
+7 −2
Original line number Diff line number Diff line
@@ -26,8 +26,13 @@ controller.
  the second encodes the triger flags encoded as described in
  Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
- interrupt-parent : The parent interrupt controller.
- interrupts : The interrupt to the parent controller raised when GPIOs
  generate the interrupts.
- interrupts : The interrupts to the parent controller raised when GPIOs
  generate the interrupts. If the controller provides one combined interrupt
  for all GPIOs, specify a single interrupt. If the controller provides one
  interrupt for each GPIO, provide a list of interrupts that correspond to each
  of the GPIO pins. When specifying multiple interrupts, if any are unconnected,
  use the interrupts-extended property to specify the interrupts and set the
  interrupt controller handle for unused interrupts to 0.
- snps,nr-gpios : The number of pins in the port, a single cell.
- resets : Reset line for the controller.

+16 −0
Original line number Diff line number Diff line
@@ -177,3 +177,19 @@ mapping and is thus transparent to GPIO consumers.

A set of functions such as gpiod_set_value() is available to work with
the new descriptor-oriented interface.

Boards using platform data can also hog GPIO lines by defining GPIO hog tables.

.. code-block:: c

        struct gpiod_hog gpio_hog_table[] = {
                GPIO_HOG("gpio.0", 10, "foo", GPIO_ACTIVE_LOW, GPIOD_OUT_HIGH),
                { }
        };

And the table can be added to the board code as follows::

        gpiod_add_hogs(gpio_hog_table);

The line will be hogged as soon as the gpiochip is created or - in case the
chip was created earlier - when the hog table is registered.
+4 −0
Original line number Diff line number Diff line
@@ -85,6 +85,10 @@ hardware descriptions such as device tree or ACPI:
  any other serio bus to the system and makes it possible to connect drivers
  for e.g. keyboards and other PS/2 protocol based devices.

- cec-gpio: drivers/media/platform/cec-gpio/ is used to interact with a CEC
  Consumer Electronics Control bus using only GPIO. It is used to communicate
  with devices on the HDMI bus.

Apart from this there are special GPIO drivers in subsystems like MMC/SD to
read card detect and write protect GPIO lines, and in the TTY serial subsystem
to emulate MCTRL (modem control) signals CTS/RTS by using two GPIO lines. The
Loading