Commit 9b82ec85 authored by Linus Walleij's avatar Linus Walleij
Browse files

Merge branch 'ib-sophgo-pintrl' into devel



Immutable branch for the SoC tree, merge to pinctrl devel
proper.

Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parents e8807544 e7a4141f
Loading
Loading
Loading
Loading
+122 −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/pinctrl/sophgo,cv1800-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Sophgo CV1800 Pin Controller

maintainers:
  - Inochi Amaoto <inochiama@outlook.com>

properties:
  compatible:
    enum:
      - sophgo,cv1800b-pinctrl
      - sophgo,cv1812h-pinctrl
      - sophgo,sg2000-pinctrl
      - sophgo,sg2002-pinctrl

  reg:
    items:
      - description: pinctrl for system domain
      - description: pinctrl for rtc domain

  reg-names:
    items:
      - const: sys
      - const: rtc

  resets:
    maxItems: 1

patternProperties:
  '-cfg$':
    type: object
    description:
      A pinctrl node should contain at least one subnode representing the
      pinctrl groups available on the machine.

    additionalProperties: false

    patternProperties:
      '-pins$':
        type: object
        description: |
          Each subnode will list the pins it needs, and how they should
          be configured, with regard to muxer configuration, bias, input
          enable/disable, input schmitt trigger, slew-rate, drive strength
          and bus hold state. In addition, all pins in the same subnode
          should have the same power domain. For configuration detail,
          refer to https://github.com/sophgo/sophgo-doc/.

        allOf:
          - $ref: pincfg-node.yaml#
          - $ref: pinmux-node.yaml#

        properties:
          pinmux:
            description: |
              The list of GPIOs and their mux settings that properties in the
              node apply to. This should be set using the GPIOMUX or GPIOMUX2
              macro.

          bias-pull-up:
            type: boolean

          bias-pull-down:
            type: boolean

          drive-strength-microamp:
            description: typical current when output high level.

          input-schmitt-microvolt:
            description: typical threshold for schmitt trigger.

          power-source:
            description: power supplies at X mV.
            enum: [ 1800, 3300 ]

          slew-rate:
            description: slew rate for output buffer (0 is fast, 1 is slow)
            enum: [ 0, 1 ]

          bias-bus-hold: true

        required:
          - pinmux
          - power-source

        additionalProperties: false

required:
  - compatible
  - reg
  - reg-names

additionalProperties: false

examples:
  - |
    #include <dt-bindings/pinctrl/pinctrl-cv1800b.h>

    pinctrl@3001000 {
        compatible = "sophgo,cv1800b-pinctrl";
        reg = <0x03001000 0x1000>,
              <0x05027000 0x1000>;
        reg-names = "sys", "rtc";

        uart0_cfg: uart0-cfg {
            uart0-pins {
                pinmux = <PINMUX(PIN_UART0_TX, 0)>,
                         <PINMUX(PIN_UART0_RX, 0)>;
                bias-pull-up;
                drive-strength-microamp = <10800>;
                input-schmitt-microvolt = <0>;
                power-source = <3300>;
                slew-rate = <0>;
            };
        };
    };

...
+1 −0
Original line number Diff line number Diff line
@@ -598,6 +598,7 @@ source "drivers/pinctrl/qcom/Kconfig"
source "drivers/pinctrl/realtek/Kconfig"
source "drivers/pinctrl/renesas/Kconfig"
source "drivers/pinctrl/samsung/Kconfig"
source "drivers/pinctrl/sophgo/Kconfig"
source "drivers/pinctrl/spear/Kconfig"
source "drivers/pinctrl/sprd/Kconfig"
source "drivers/pinctrl/starfive/Kconfig"
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ obj-y += qcom/
obj-$(CONFIG_ARCH_REALTEK)      += realtek/
obj-$(CONFIG_PINCTRL_RENESAS)	+= renesas/
obj-$(CONFIG_PINCTRL_SAMSUNG)	+= samsung/
obj-y				+= sophgo/
obj-$(CONFIG_PINCTRL_SPEAR)	+= spear/
obj-y				+= sprd/
obj-$(CONFIG_SOC_STARFIVE)	+= starfive/
+54 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
#
# Sophgo SoC PINCTRL drivers
#

config PINCTRL_SOPHGO_CV18XX
	bool
	select GENERIC_PINCTRL_GROUPS
	select GENERIC_PINMUX_FUNCTIONS
	select GENERIC_PINCONF

config PINCTRL_SOPHGO_CV1800B
	tristate "Sophgo CV1800B SoC Pinctrl driver"
	depends on ARCH_SOPHGO || COMPILE_TEST
	depends on OF
	select PINCTRL_SOPHGO_CV18XX
	help
	  Say Y to select the pinctrl driver for CV1800B SoC.
	  This pin controller allows selecting the mux function for
	  each pin. This driver can also be built as a module called
	  pinctrl-cv1800b.

config PINCTRL_SOPHGO_CV1812H
	tristate "Sophgo CV1812H SoC Pinctrl driver"
	depends on ARCH_SOPHGO || COMPILE_TEST
	depends on OF
	select PINCTRL_SOPHGO_CV18XX
	help
	  Say Y to select the pinctrl driver for CV1812H SoC.
	  This pin controller allows selecting the mux function for
	  each pin. This driver can also be built as a module called
	  pinctrl-cv1812h.

config PINCTRL_SOPHGO_SG2000
	tristate "Sophgo SG2000 SoC Pinctrl driver"
	depends on ARCH_SOPHGO || COMPILE_TEST
	depends on OF
	select PINCTRL_SOPHGO_CV18XX
	help
	  Say Y to select the pinctrl driver for SG2000 SoC.
	  This pin controller allows selecting the mux function for
	  each pin. This driver can also be built as a module called
	  pinctrl-sg2000.

config PINCTRL_SOPHGO_SG2002
	tristate "Sophgo SG2000 SoC Pinctrl driver"
	depends on ARCH_SOPHGO || COMPILE_TEST
	depends on OF
	select PINCTRL_SOPHGO_CV18XX
	help
	  Say Y to select the pinctrl driver for SG2002 SoC.
	  This pin controller allows selecting the mux function for
	  each pin. This driver can also be built as a module called
	  pinctrl-sg2002.
+7 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0

obj-$(CONFIG_PINCTRL_SOPHGO_CV18XX)	+= pinctrl-cv18xx.o
obj-$(CONFIG_PINCTRL_SOPHGO_CV1800B)	+= pinctrl-cv1800b.o
obj-$(CONFIG_PINCTRL_SOPHGO_CV1812H)	+= pinctrl-cv1812h.o
obj-$(CONFIG_PINCTRL_SOPHGO_SG2000)	+= pinctrl-sg2000.o
obj-$(CONFIG_PINCTRL_SOPHGO_SG2002)	+= pinctrl-sg2002.o
Loading