Commit d7017821 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'gpio-updates-for-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio updates from Bartosz Golaszewski:
 "There are two new drivers and some changes to GPIO core but mostly
  just GPIO driver updates across a wide array of files, adding support
  for new models as well as various refactoring changes. Nothing
  controversial and everything has spent a good measure of time in
  linux-next.

  GPIOLIB core:
   - shrink the GPIO bus driver stub code
   - rework software node support for "undefined" software nodes
   - provide and use devm_fwnode_gpiod_get_optional()
   - only compile the OF quirk for MT2701 when needed

  New drivers:
   - add the GPIO driver for ROHM bd72720
   - add the gpio-line-mux driver providing 1-to-many mapping for a
     single real GPIO

  Driver changes:
   - refactor gpio-pca9570: use lock guard, add missing headers, use
     devres consistently
   - add support for a new model (G7 Aspeed sgpiom) to the aspeed-sgpio
     driver along with some prerequisite refactoring
   - use device_get_match_data() where applicable and save some lines
   - add support for more models to gpio-cadence
   - add the compatible property to reset-gpio and use it in shared GPIO
     management
   - drop unnecessary use of irqd_get_trigger_type() in gpio-max77759
   - add support for a new variant to gpio-pca953x
   - extend build coverage with COMPILE_TEST for more drivers
   - constify configfs structures in gpio-sim and gpio-virtuser
   - add support for the K3 SoC to gpio-spacemit
   - implement the missing .get_direction() callback in gpio-max77620
   - add support for Tegra264 to gpio-tegra186
   - drop unneeded MODULE_ALIAS() from gpio-menz127

  DT bindings:
   - document support for the opencores GPIO controller in gpio-mmio
   - document new variants for gpio-pca953x

  Documentation:
   - extensively describe interrupt source detection for gpio-pca953x
     and add more models to the list of supported variants"

* tag 'gpio-updates-for-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (59 commits)
  gpio: tegra186: Add support for Tegra264
  dt-bindings: gpio: Add Tegra264 support
  gpio: spacemit-k1: Use PDR for pin direction, not SDR/CDR
  gpio: max77620: Implement .get_direction() callback
  gpio: aspeed-sgpio: Support G7 Aspeed sgpiom controller
  dt-bindings: gpio: aspeed,sgpio: Support ast2700
  gpio: aspeed-sgpio: Convert IRQ functions to use llops callbacks
  gpio: aspeed-sgpio: Create llops to handle hardware access
  gpio: aspeed-sgpio: Remove unused bank name field
  gpio: aspeed-sgpio: Change the macro to support deferred probe
  regulator: bd71815: switch to devm_fwnode_gpiod_get_optional
  gpiolib: introduce devm_fwnode_gpiod_get_optional() wrapper
  gpio: mmio: Add compatible for opencores GPIO
  dt-bindings: gpio-mmio: Correct opencores GPIO
  gpio: pca9570: use lock guards
  gpio: pca9570: Don't use "proxy" headers
  gpio: pca9570: Use devm_mutex_init() for mutex initialization
  MAINTAINERS: Add ROHM BD72720 PMIC
  power: supply: bd71828-power: Support ROHM BD72720
  power: supply: bd71828: Support wider register addresses
  ...
parents 893ace4d af9b4a56
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -10,7 +10,8 @@ maintainers:
  - Andrew Jeffery <andrew@aj.id.au>

description:
  This SGPIO controller is for ASPEED AST2400, AST2500 and AST2600 SoC,
  This SGPIO controller is for ASPEED AST2400, AST2500, AST2600 and AST2700 SoC,
  AST2700 have two sgpio master both with 256 pins,
  AST2600 have two sgpio master one with 128 pins another one with 80 pins,
  AST2500/AST2400 have one sgpio master with 80 pins. Each of the Serial
  GPIO pins can be programmed to support the following options
@@ -27,6 +28,7 @@ properties:
      - aspeed,ast2400-sgpio
      - aspeed,ast2500-sgpio
      - aspeed,ast2600-sgpiom
      - aspeed,ast2700-sgpiom

  reg:
    maxItems: 1
+107 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/gpio/gpio-line-mux.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: GPIO line mux

maintainers:
  - Jonas Jelonek <jelonek.jonas@gmail.com>

description: |
  A GPIO controller to provide virtual GPIOs for a 1-to-many input-only mapping
  backed by a single shared GPIO and a multiplexer. A simple illustrated
  example is:

            +----- A
    IN     /
    <-----o------- B
        / |\
        | | +----- C
        | |  \
        | |   +--- D
        | |
       M1 M0

    MUX CONTROL

     M1 M0   IN
      0  0   A
      0  1   B
      1  0   C
      1  1   D

  This can be used in case a real GPIO is connected to multiple inputs and
  controlled by a multiplexer, and another subsystem/driver does not work
  directly with the multiplexer subsystem.

properties:
  compatible:
    const: gpio-line-mux

  gpio-controller: true

  "#gpio-cells":
    const: 2

  gpio-line-mux-states:
    description: Mux states corresponding to the virtual GPIOs.
    $ref: /schemas/types.yaml#/definitions/uint32-array

  gpio-line-names: true

  mux-controls:
    maxItems: 1
    description:
      Phandle to the multiplexer to control access to the GPIOs.

  ngpios: false

  muxed-gpios:
    maxItems: 1
    description:
      GPIO which is the '1' in 1-to-many and is shared by the virtual GPIOs
      and controlled via the mux.

required:
  - compatible
  - gpio-controller
  - gpio-line-mux-states
  - mux-controls
  - muxed-gpios

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/mux/mux.h>

    sfp_gpio_mux: mux-controller-1 {
        compatible = "gpio-mux";
        mux-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>,
                    <&gpio0 1 GPIO_ACTIVE_HIGH>;
        #mux-control-cells = <0>;
        idle-state = <MUX_IDLE_AS_IS>;
    };

    sfp1_gpio: sfp-gpio-1 {
        compatible = "gpio-line-mux";
        gpio-controller;
        #gpio-cells = <2>;

        mux-controls = <&sfp_gpio_mux>;
        muxed-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;

        gpio-line-mux-states = <0>, <1>, <3>;
    };

    sfp1: sfp-p1 {
        compatible = "sff,sfp";

        i2c-bus = <&sfp1_i2c>;
        los-gpios = <&sfp1_gpio 0 GPIO_ACTIVE_HIGH>;
        mod-def0-gpios = <&sfp1_gpio 1 GPIO_ACTIVE_LOW>;
        tx-fault-gpios = <&sfp1_gpio 2 GPIO_ACTIVE_HIGH>;
    };
+2 −1
Original line number Diff line number Diff line
@@ -20,9 +20,10 @@ properties:
  compatible:
    enum:
      - brcm,bcm6345-gpio
      - intel,ixp4xx-expansion-bus-mmio-gpio
      - ni,169445-nand-gpio
      - opencores,gpio
      - wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller
      - intel,ixp4xx-expansion-bus-mmio-gpio

  big-endian: true

+2 −0
Original line number Diff line number Diff line
@@ -74,6 +74,8 @@ properties:
              - ti,tca9538
              - ti,tca9539
              - ti,tca9554
              - ti,tcal6408
              - ti,tcal6416

  reg:
    maxItems: 1
+22 −0
Original line number Diff line number Diff line
@@ -86,6 +86,9 @@ properties:
      - nvidia,tegra234-gpio
      - nvidia,tegra234-gpio-aon
      - nvidia,tegra256-gpio
      - nvidia,tegra264-gpio
      - nvidia,tegra264-gpio-uphy
      - nvidia,tegra264-gpio-aon

  reg-names:
    items:
@@ -110,6 +113,10 @@ properties:
      ports, in the order the HW manual describes them. The number of entries
      required varies depending on compatible value.

  wakeup-parent:
    description: Phandle to the parent interrupt controller used for wake-up. On
      Tegra, this typically references the PMC interrupt controller.

  gpio-controller: true

  gpio-ranges:
@@ -157,6 +164,8 @@ allOf:
              - nvidia,tegra194-gpio
              - nvidia,tegra234-gpio
              - nvidia,tegra256-gpio
              - nvidia,tegra264-gpio
              - nvidia,tegra264-gpio-uphy
    then:
      properties:
        interrupts:
@@ -171,12 +180,25 @@ allOf:
              - nvidia,tegra186-gpio-aon
              - nvidia,tegra194-gpio-aon
              - nvidia,tegra234-gpio-aon
              - nvidia,tegra264-gpio-aon
    then:
      properties:
        interrupts:
          minItems: 1
          maxItems: 4

  - if:
      properties:
        compatible:
          contains:
            enum:
              - nvidia,tegra264-gpio
              - nvidia,tegra264-gpio-uphy
              - nvidia,tegra264-gpio-aon
    then:
      required:
        - wakeup-parent

required:
  - compatible
  - reg
Loading