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

Commit 1b2951dd 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.17 kernel cycle:

  New drivers:

   - Nintendo Wii GameCube GPIO, known as "Hollywood"

   - Raspberry Pi mailbox service GPIO expander

   - Spreadtrum main SC9860 SoC and IEC GPIO controllers.

  Improvements:

   - Implemented .get_multiple() callback for most of the
     high-performance industrial GPIO cards for the ISA bus.

   - ISA GPIO drivers now select the ISA_BUS_API instead of depending on
     it. This is merged with the same pattern for all the ISA drivers
     and some other Kconfig cleanups related to this.

  Cleanup:

   - Delete the TZ1090 GPIO drivers following the deletion of this SoC
     from the ARM tree.

   - Move the documentation over to driver-api to conform with the rest
     of the kernel documentation build.

   - Continue to make the GPIO drivers include only
     <linux/gpio/driver.h> and not the too broad <linux/gpio.h> that we
     want to get rid of.

   - Managed to remove VLA allocation from two drivers pending more
     fixes in this area for the next merge window.

   - Misc janitorial fixes"

* tag 'gpio-v4.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (77 commits)
  gpio: Add Spreadtrum PMIC EIC driver support
  gpio: Add Spreadtrum EIC driver support
  dt-bindings: gpio: Add Spreadtrum EIC controller documentation
  gpio: ath79: Fix potential NULL dereference in ath79_gpio_probe()
  pinctrl: qcom: Don't allow protected pins to be requested
  gpiolib: Support 'gpio-reserved-ranges' property
  gpiolib: Change bitmap allocation to kmalloc_array
  gpiolib: Extract mask allocation into subroutine
  dt-bindings: gpio: Add a gpio-reserved-ranges property
  gpio: mockup: fix a potential crash when creating debugfs entries
  gpio: pca953x: add compatibility for pcal6524 and pcal9555a
  gpio: dwapb: Add support for a bus clock
  gpio: Remove VLA from xra1403 driver
  gpio: Remove VLA from MAX3191X driver
  gpio: ws16c48: Implement get_multiple callback
  gpio: gpio-mm: Implement get_multiple callback
  gpio: 104-idi-48: Implement get_multiple callback
  gpio: 104-dio-48e: Implement get_multiple callback
  gpio: pcie-idio-24: Implement get_multiple/set_multiple callbacks
  gpio: pci-idio-16: Implement get_multiple callback
  ...
parents 06dd3dfe 348f3cde
Loading
Loading
Loading
Loading
+97 −0
Original line number Diff line number Diff line
Spreadtrum EIC controller bindings

The EIC is the abbreviation of external interrupt controller, which can
be used only in input mode. The Spreadtrum platform has 2 EIC controllers,
one is in digital chip, and another one is in PMIC. The digital chip EIC
controller contains 4 sub-modules: EIC-debounce, EIC-latch, EIC-async and
EIC-sync. But the PMIC EIC controller contains only one EIC-debounce sub-
module.

The EIC-debounce sub-module provides up to 8 source input signal
connections. A debounce mechanism is used to capture the input signals'
stable status (millisecond resolution) and a single-trigger mechanism
is introduced into this sub-module to enhance the input event detection
reliability. In addition, this sub-module's clock can be shut off
automatically to reduce power dissipation. Moreover the debounce range
is from 1ms to 4s with a step size of 1ms. The input signal will be
ignored if it is asserted for less than 1 ms.

The EIC-latch sub-module is used to latch some special power down signals
and generate interrupts, since the EIC-latch does not depend on the APB
clock to capture signals.

The EIC-async sub-module uses a 32kHz clock to capture the short signals
(microsecond resolution) to generate interrupts by level or edge trigger.

The EIC-sync is similar with GPIO's input function, which is a synchronized
signal input register. It can generate interrupts by level or edge trigger
when detecting input signals.

Required properties:
- compatible: Should be one of the following:
  "sprd,sc9860-eic-debounce",
  "sprd,sc9860-eic-latch",
  "sprd,sc9860-eic-async",
  "sprd,sc9860-eic-sync",
  "sprd,sc27xx-eic".
- reg: Define the base and range of the I/O address space containing
  the GPIO controller registers.
- gpio-controller: Marks the device node as a GPIO controller.
- #gpio-cells: Should be <2>. The first cell is the gpio number and
  the second cell is used to specify optional parameters.
- interrupt-controller: Marks the device node as an interrupt controller.
- #interrupt-cells: Should be <2>. Specifies the number of cells needed
  to encode interrupt source.
- interrupts: Should be the port interrupt shared by all the gpios.

Example:
	eic_debounce: gpio@40210000 {
		compatible = "sprd,sc9860-eic-debounce";
		reg = <0 0x40210000 0 0x80>;
		gpio-controller;
		#gpio-cells = <2>;
		interrupt-controller;
		#interrupt-cells = <2>;
		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
	};

	eic_latch: gpio@40210080 {
		compatible = "sprd,sc9860-eic-latch";
		reg = <0 0x40210080 0 0x20>;
		gpio-controller;
		#gpio-cells = <2>;
		interrupt-controller;
		#interrupt-cells = <2>;
		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
	};

	eic_async: gpio@402100a0 {
		compatible = "sprd,sc9860-eic-async";
		reg = <0 0x402100a0 0 0x20>;
		gpio-controller;
		#gpio-cells = <2>;
		interrupt-controller;
		#interrupt-cells = <2>;
		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
	};

	eic_sync: gpio@402100c0 {
		compatible = "sprd,sc9860-eic-sync";
		reg = <0 0x402100c0 0 0x20>;
		gpio-controller;
		#gpio-cells = <2>;
		interrupt-controller;
		#interrupt-cells = <2>;
		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
	};

	pmic_eic: gpio@300 {
		compatible = "sprd,sc27xx-eic";
		reg = <0x300>;
		interrupt-parent = <&sc2731_pmic>;
		interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
		gpio-controller;
		#gpio-cells = <2>;
		interrupt-controller;
		#interrupt-cells = <2>;
	};
+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@ Required properties:
	nxp,pca9574
	nxp,pca9575
	nxp,pca9698
	nxp,pcal6524
	nxp,pcal9555a
	maxim,max7310
	maxim,max7312
	maxim,max7313
+28 −0
Original line number Diff line number Diff line
Spreadtrum GPIO controller bindings

The controller's registers are organized as sets of sixteen 16-bit
registers with each set controlling a bank of up to 16 pins. A single
interrupt is shared for all of the banks handled by the controller.

Required properties:
- compatible: Should be "sprd,sc9860-gpio".
- reg: Define the base and range of the I/O address space containing
the GPIO controller registers.
- gpio-controller: Marks the device node as a GPIO controller.
- #gpio-cells: Should be <2>. The first cell is the gpio number and
the second cell is used to specify optional parameters.
- interrupt-controller: Marks the device node as an interrupt controller.
- #interrupt-cells: Should be <2>. Specifies the number of cells needed
to encode interrupt source.
- interrupts: Should be the port interrupt shared by all the gpios.

Example:
	ap_gpio: gpio@40280000 {
		compatible = "sprd,sc9860-gpio";
		reg = <0 0x40280000 0 0x1000>;
		gpio-controller;
		#gpio-cells = <2>;
		interrupt-controller;
		#interrupt-cells = <2>;
		interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
	};
+0 −45
Original line number Diff line number Diff line
ImgTec TZ1090 PDC GPIO Controller

Required properties:
- compatible: Compatible property value should be "img,tz1090-pdc-gpio".

- reg: Physical base address of the controller and length of memory mapped
  region. This starts at and cover the SOC_GPIO_CONTROL registers.

- gpio-controller: Specifies that the node is a gpio controller.

- #gpio-cells: Should be 2. The syntax of the gpio specifier used by client
  nodes should have the following values.
     <[phandle of the gpio controller node]
      [PDC gpio number]
      [gpio flags]>

  Values for gpio specifier:
  - GPIO number: a value in the range 0 to 6.
  - GPIO flags: bit field of flags, as defined in <dt-bindings/gpio/gpio.h>.
    Only the following flags are supported:
      GPIO_ACTIVE_HIGH
      GPIO_ACTIVE_LOW

Optional properties:
- gpio-ranges: Mapping to pin controller pins (as described in
  Documentation/devicetree/bindings/gpio/gpio.txt)

- interrupts: Individual syswake interrupts (other GPIOs cannot interrupt)


Example:

	pdc_gpios: gpio-controller@2006500 {
		gpio-controller;
		#gpio-cells = <2>;

		compatible = "img,tz1090-pdc-gpio";
		reg = <0x02006500 0x100>;

		interrupt-parent = <&pdc>;
		interrupts =	<8  IRQ_TYPE_NONE>,	/* Syswake 0 */
				<9  IRQ_TYPE_NONE>,	/* Syswake 1 */
				<10 IRQ_TYPE_NONE>;	/* Syswake 2 */
		gpio-ranges = <&pdc_pinctrl 0 0 7>;
	};
+0 −88
Original line number Diff line number Diff line
ImgTec TZ1090 GPIO Controller

Required properties:
- compatible: Compatible property value should be "img,tz1090-gpio".

- reg: Physical base address of the controller and length of memory mapped
  region.

- #address-cells: Should be 1 (for bank subnodes)

- #size-cells: Should be 0 (for bank subnodes)

- Each bank of GPIOs should have a subnode to represent it.

  Bank subnode required properties:
  - reg: Index of bank in the range 0 to 2.

  - gpio-controller: Specifies that the node is a gpio controller.

  - #gpio-cells: Should be 2. The syntax of the gpio specifier used by client
    nodes should have the following values.
       <[phandle of the gpio controller node]
        [gpio number within the gpio bank]
        [gpio flags]>

    Values for gpio specifier:
    - GPIO number: a value in the range 0 to 29.
    - GPIO flags: bit field of flags, as defined in <dt-bindings/gpio/gpio.h>.
      Only the following flags are supported:
        GPIO_ACTIVE_HIGH
        GPIO_ACTIVE_LOW

  Bank subnode optional properties:
  - gpio-ranges: Mapping to pin controller pins (as described in
    Documentation/devicetree/bindings/gpio/gpio.txt)

  - interrupts: Interrupt for the entire bank

  - interrupt-controller: Specifies that the node is an interrupt controller

  - #interrupt-cells: Should be 2. The syntax of the interrupt specifier used by
    client nodes should have the following values.
       <[phandle of the interurupt controller]
        [gpio number within the gpio bank]
        [irq flags]>

    Values for irq specifier:
    - GPIO number: a value in the range 0 to 29
    - IRQ flags: value to describe edge and level triggering, as defined in
      <dt-bindings/interrupt-controller/irq.h>. Only the following flags are
      supported:
        IRQ_TYPE_EDGE_RISING
        IRQ_TYPE_EDGE_FALLING
        IRQ_TYPE_EDGE_BOTH
        IRQ_TYPE_LEVEL_HIGH
        IRQ_TYPE_LEVEL_LOW



Example:

	gpios: gpio-controller@2005800 {
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "img,tz1090-gpio";
		reg = <0x02005800 0x90>;

		/* bank 0 with an interrupt */
		gpios0: bank@0 {
			#gpio-cells = <2>;
			#interrupt-cells = <2>;
			reg = <0>;
			interrupts = <13 IRQ_TYPE_LEVEL_HIGH>;
			gpio-controller;
			gpio-ranges = <&pinctrl 0 0 30>;
			interrupt-controller;
		};

		/* bank 2 without interrupt */
		gpios2: bank@2 {
			#gpio-cells = <2>;
			reg = <2>;
			gpio-controller;
			gpio-ranges = <&pinctrl 0 60 30>;
		};
	};

Loading