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

Commit a1df7efe authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull GPIO changes from Linus Walleij:
 "This is the GPIO bulk changes for the v3.20 series:

  GPIOLIB core changes:
   - Create and use of_mm_gpiochip_remove() for removing memory-mapped
     OF GPIO chips
   - GPIO MMIO library suppports bgpio_set_multiple for switching
     several lines at once, a feature merged in the last cycle.

  New drivers:
   - New driver for the APM X-gene standby GPIO controller
   - New driver for the Fujitsu MB86S7x GPIO controller

  Cleanups:
   - Moved rcar driver to use gpiolib irqchip
   - Moxart converted to the GPIO MMIO library
   - GE driver converted to GPIO MMIO library
   - Move sx150x to irqdomain
   - Move max732x to irqdomain
   - Move vx855 to use managed resources
   - Move dwapb to use managed resources
   - Clean tc3589x from platform data
   - Clean stmpe driver to use device tree only probe

  New subtypes:
   - sx1506 support in the sx150x driver
   - Quark 1000 SoC support in the SCH driver
   - Support X86 in the Xilinx driver
   - Support PXA1928 in the PXA driver

  Extended drivers:
   - max732x supports device tree probe
   - sx150x supports device tree probe

  Various minor cleanups and bug fixes"

* tag 'gpio-v3.20-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (61 commits)
  gpio: kconfig: replace PPC_OF with PPC
  gpio: pxa: add PXA1928 gpio type support
  dt/bindings: gpio: add compatible string for marvell,pxa1928-gpio
  gpio: pxa: remove mach IRQ includes
  gpio: max732x: use an inline function for container cast
  gpio: use sizeof() instead of hardcoded values
  gpio: max732x: add set_multiple function
  gpio: sch: Consolidate similar algorithms
  gpio: tz1090-pdc: Use resource_size to fix off-by-one resource size calculation
  gpio: ge: Convert to use devm_kstrdup
  gpio: correctly use const char * const
  gpio: sx150x: fixup OF support
  gpio: mpc8xxx: Use of_mm_gpiochip_remove
  gpio: Add Fujitsu MB86S7x GPIO driver
  gpio: mpc8xxx: Convert to platform device interface.
  gpio: zevio: Use of_mm_gpiochip_remove
  gpio: gpio-mm-lantiq: Use of_mm_gpiochip_remove
  gpio: gpio-mm-lantiq: Use of_property_read_u32
  gpio: gpio-mm-lantiq: Do not replicate code
  gpio :gpio-mm-lantiq: Use devm_kzalloc
  ...
parents aa7ed01f 0a4a3529
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
Fujitsu MB86S7x GPIO Controller
-------------------------------

Required properties:
- compatible: Should be "fujitsu,mb86s70-gpio"
- reg: Base address and length of register space
- clocks: Specify the clock
- gpio-controller: Marks the device node as a gpio controller.
- #gpio-cells: Should be <2>. The first cell is the pin number and the
  second cell is used to specify optional parameters:
   - bit 0 specifies polarity (0 for normal, 1 for inverted).

Examples:
	gpio0: gpio@31000000 {
		compatible = "fujitsu,mb86s70-gpio";
		reg = <0 0x31000000 0x10000>;
		gpio-controller;
		#gpio-cells = <2>;
		clocks = <&clk 0 2 1>;
	};
+59 −0
Original line number Diff line number Diff line
* MAX732x-compatible I/O expanders

Required properties:
  - compatible: Should be one of the following:
    - "maxim,max7319": For the Maxim MAX7319
    - "maxim,max7320": For the Maxim MAX7320
    - "maxim,max7321": For the Maxim MAX7321
    - "maxim,max7322": For the Maxim MAX7322
    - "maxim,max7323": For the Maxim MAX7323
    - "maxim,max7324": For the Maxim MAX7324
    - "maxim,max7325": For the Maxim MAX7325
    - "maxim,max7326": For the Maxim MAX7326
    - "maxim,max7327": For the Maxim MAX7327
  - reg: I2C slave address for this device.
  - gpio-controller: Marks the device node as a GPIO controller.
  - #gpio-cells: Should be 2.
    - first cell is the GPIO number
    - second cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.
      Only the GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.

Optional properties:

  The I/O expander can detect input state changes, and thus optionally act as
  an interrupt controller. When the expander interrupt line is connected all the
  following properties must be set. For more information please see the
  interrupt controller device tree bindings documentation available at
  Documentation/devicetree/bindings/interrupt-controller/interrupts.txt.

  - interrupt-controller: Identifies the node as an interrupt controller.
  - #interrupt-cells: Number of cells to encode an interrupt source, shall be 2.
    - first cell is the pin number
    - second cell is used to specify flags
  - interrupt-parent: phandle of the parent interrupt controller.
  - interrupts: Interrupt specifier for the controllers interrupt.

Please refer to gpio.txt in this directory for details of the common GPIO
bindings used by client devices.

Example 1. MAX7325 with interrupt support enabled (CONFIG_GPIO_MAX732X_IRQ=y):

	expander: max7325@6d {
		compatible = "maxim,max7325";
		reg = <0x6d>;
		gpio-controller;
		#gpio-cells = <2>;
		interrupt-controller;
		#interrupt-cells = <2>;
		interrupt-parent = <&gpio4>;
		interrupts = <29 IRQ_TYPE_EDGE_FALLING>;
	};

Example 2. MAX7325 with interrupt support disabled (CONFIG_GPIO_MAX732X_IRQ=n):

	expander: max7325@6d {
		compatible = "maxim,max7325";
		reg = <0x6d>;
		gpio-controller;
		#gpio-cells = <2>;
	};
+40 −0
Original line number Diff line number Diff line
SEMTECH SX150x GPIO expander bindings


Required properties:

- compatible: should be "semtech,sx1506q",
			"semtech,sx1508q",
			"semtech,sx1509q".

- reg: The I2C slave address for this device.

- interrupt-parent: phandle of the parent interrupt controller.

- interrupts: Interrupt specifier for the controllers interrupt.

- #gpio-cells: Should be 2. The first cell is the GPIO number and the
		second cell is used to specify optional parameters:
		bit 0: polarity (0: normal, 1: inverted)

- gpio-controller: Marks the device as a GPIO controller.

- interrupt-controller: Marks the device as a interrupt controller.

The GPIO expander can optionally be used as an interrupt controller, in
which case it uses the default two cell specifier as described in
Documentation/devicetree/bindings/interrupt-controller/interrupts.txt.

Example:

	i2c_gpio_expander@20{
		#gpio-cells = <2>;
		#interrupt-cells = <2>;
		compatible = "semtech,sx1506q";
		reg = <0x20>;
		interrupt-parent = <&gpio_1>;
		interrupts = <16 0>;

		gpio-controller;
		interrupt-controller;
	};
+32 −0
Original line number Diff line number Diff line
APM X-Gene Standby GPIO controller bindings

This is a gpio controller in the standby domain.

There are 20 GPIO pins from 0..21. There is no GPIO_DS14 or GPIO_DS15,
only GPIO_DS8..GPIO_DS13 support interrupts. The IRQ mapping
is currently 1-to-1 on interrupts 0x28 thru 0x2d.

Required properties:
- compatible: "apm,xgene-gpio-sb" for the X-Gene Standby GPIO controller
- reg: Physical base address and size of the controller's registers
- #gpio-cells: Should be two.
	- first cell is the pin number
	- second cell is used to specify the gpio polarity:
		0 = active high
		1 = active low
- gpio-controller: Marks the device node as a GPIO controller.
- interrupts: Shall contain exactly 6 interrupts.

Example:
	sbgpio: sbgpio@17001000 {
		compatible = "apm,xgene-gpio-sb";
		reg = <0x0 0x17001000 0x0 0x400>;
		#gpio-cells = <2>;
		gpio-controller;
		interrupts = 	<0x0 0x28 0x1>,
				<0x0 0x29 0x1>,
				<0x0 0x2a 0x1>,
				<0x0 0x2b 0x1>,
				<0x0 0x2c 0x1>,
				<0x0 0x2d 0x1>;
	};
+3 −2
Original line number Diff line number Diff line
@@ -69,7 +69,8 @@ GPIO pin number, and GPIO flags as accepted by the "qe_pio_e" gpio-controller.
----------------------------------

A gpio-specifier should contain a flag indicating the GPIO polarity; active-
high or active-low. If it does, the follow best practices should be followed:
high or active-low. If it does, the following best practices should be
followed:

The gpio-specifier's polarity flag should represent the physical level at the
GPIO controller that achieves (or represents, for inputs) a logically asserted
@@ -147,7 +148,7 @@ contains information structures as follows:
	numeric-gpio-range ::=
			<pinctrl-phandle> <gpio-base> <pinctrl-base> <count>
	named-gpio-range ::= <pinctrl-phandle> <gpio-base> '<0 0>'
	gpio-phandle : phandle to pin controller node.
	pinctrl-phandle : phandle to pin controller node
	gpio-base : Base GPIO ID in the GPIO controller
	pinctrl-base : Base pinctrl pin ID in the pin controller
	count : The number of GPIOs/pins in this range
Loading