This is the bulk of the pin control changes for v6.13:

No core changes this time.
 
 New drivers:
 
 - Xlinix Versal pin control driver.
 
 - Ocelot LAN969x pin control driver.
 
 - T-Head TH1520 RISC-V SoC pin control driver.
 
 - Qualcomm SM8750, IPQ5424, QCS8300, SAR2130P and QCS615 SoC
   pin control drivers.
 
 - Qualcomm SM8750 LPASS (low power audio subsystem)
   pin control driver.
 
 - Qualcomm PM8937 mixsig IC pin control support, GPIO and
   MPP (multi-purpose-pin).
 
 - Samsung Exynos8895 and Exynos9810 SoC pin control driver.
 
 - SpacemiT K1 SoC pin control driver.
 
 - Airhoa EN7581 IC pin control driver.
 
 Improvements:
 
 - The Renesas subdriver now supports schmitt-trigger and
   open drain pin configurations if the hardware supports it.
 
 - Support GPIOF and GPIOG banks in the Aspeed G6 SoC.
 
 - Support the DSW community in the Intel Elkhartlake SoC.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmdAhqsACgkQQRCzN7AZ
 XXOX/BAAkTh2Xwh4t9u9p0wjvXcY9bu+O204vUaQNJr3zphqLegJihChriU8LiQN
 7BTQcYMHMsoVXRzFsoRBSocfJmcFE6amoHemSkCaYDCrr0fchk61AzkivUMvMHBi
 8qBFB1kYbk/Cmk2JwOEpf16gT45wTdIIOfqB6X9ikRdIUwCgjMH77OYHilXF0zPO
 vmikY8fnIj/0r9hdVqD5bcpeHo8XHZpHBMvr1NfMUehfhGoJNLZF+xyg+fosnoDH
 om92ugKC856jVP0Hl9kfL58ggKuBI2YPlm2OW9VxAQZu7EMvlCeUjv8R+sNpXrpI
 rod84A62/K8OYcQLW+UIA2ykty3LFfh90wKtpkKV0z/7jtEfBBzCMsln/mCUVHEl
 3zoo0n6n68r0i1zKAFf45JGJExeJv5U0lBfFGm8PnOOouZW3IYJcgHQfBswaPzRD
 lEsT37jUEF+qE0VWqBx3xTz/w2Kxs5XHoF4P5UwE5TCAA90hjMLPdXXzn6bNiuww
 4T8iOT5NFwHqlIKJxRBYJDDuc+EtQksmKhbDXilKgg0h+n/YmQN12CFKy5d+Ch57
 mT/M6bP4FCsTOioUEALUVLMzUN7FJjPHN7GO1nwpA6Rmb8yMaYZJHxglfjduo83y
 PNOsaLRY3BhukBh74B6OTq7SKgvH1Bj1VwEY87JhYZLmDE49xjw=
 =F7bj
 -----END PGP SIGNATURE-----

Merge tag 'pinctrl-v6.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control updates from Linus Walleij:
 "No core changes this time.

  New drivers:

   - Xlinix Versal pin control driver

   - Ocelot LAN969x pin control driver

   - T-Head TH1520 RISC-V SoC pin control driver

   - Qualcomm SM8750, IPQ5424, QCS8300, SAR2130P and QCS615 SoC pin
     control drivers

   - Qualcomm SM8750 LPASS (low power audio subsystem) pin control
     driver

   - Qualcomm PM8937 mixsig IC pin control support, GPIO and MPP
     (multi-purpose-pin)

   - Samsung Exynos8895 and Exynos9810 SoC pin control driver

   - SpacemiT K1 SoC pin control driver

   - Airhoa EN7581 IC pin control driver

  Improvements:

   - The Renesas subdriver now supports schmitt-trigger and open drain
     pin configurations if the hardware supports it

   - Support GPIOF and GPIOG banks in the Aspeed G6 SoC

   - Support the DSW community in the Intel Elkhartlake SoC"

* tag 'pinctrl-v6.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (105 commits)
  pinctrl: airoha: Use unsigned long for bit search
  pinctrl: k210: Undef K210_PC_DEFAULT
  pinctrl: qcom: spmi: fix debugfs drive strength
  pinctrl: qcom: Add sm8750 pinctrl driver
  dt-bindings: pinctrl: qcom: Add sm8750 pinctrl
  pinctrl: cy8c95x0: remove unneeded goto labels
  pinctrl: cy8c95x0: embed iterator to the for-loop
  pinctrl: cy8c95x0: Use temporary variable for struct device
  pinctrl: cy8c95x0: use flexible sleeping in reset function
  pinctrl: cy8c95x0: switch to using devm_regulator_get_enable()
  pinctrl: cy8c95x0: Use 2-argument strscpy()
  dt-bindings: pinctrl: sx150xq: allow gpio line naming
  pinctrl: single: add marvell,pxa1908-padconf compatible
  dt-bindings: pinctrl: pinctrl-single: add marvell,pxa1908-padconf compatible
  dt-bindings: pinctrl: correct typo of description for cv1800
  pinctrl: qcom: spmi-mpp: Add PM8937 compatible
  dt-bindings: pinctrl: qcom,pmic-mpp: Document PM8937 compatible
  pinctrl: qcom-pmic-gpio: add support for PM8937
  dt-bindings: pinctrl: qcom,pmic-gpio: add PM8937
  pinctrl: Use of_property_present() for non-boolean properties
  ...
This commit is contained in:
Linus Torvalds 2024-11-25 17:24:51 -08:00
commit 2d32fba02e
161 changed files with 15902 additions and 1170 deletions

View File

@ -0,0 +1,42 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/arm/airoha,en7581-chip-scu.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Airoha Chip SCU Controller for EN7581 SoC
maintainers:
- Lorenzo Bianconi <lorenzo@kernel.org>
description:
The airoha chip-scu block provides a configuration interface for clock,
io-muxing and other functionalities used by multiple controllers (e.g. clock,
pinctrl, ecc) on EN7581 SoC.
properties:
compatible:
items:
- enum:
- airoha,en7581-chip-scu
- const: syscon
reg:
maxItems: 1
required:
- compatible
- reg
additionalProperties: false
examples:
- |
soc {
#address-cells = <2>;
#size-cells = <2>;
syscon@1fa20000 {
compatible = "airoha,en7581-chip-scu", "syscon";
reg = <0x0 0x1fa20000 0x0 0x388>;
};
};

View File

@ -0,0 +1,90 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/airoha,en7581-gpio-sysctl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Airoha EN7581 GPIO System Controller
maintainers:
- Christian Marangi <ansuelsmth@gmail.com>
- Lorenzo Bianconi <lorenzo@kernel.org>
description:
Airoha EN7581 SoC GPIO system controller which provided a register map
for controlling the GPIO, pins and PWM of the SoC.
properties:
compatible:
items:
- const: airoha,en7581-gpio-sysctl
- const: syscon
- const: simple-mfd
reg:
maxItems: 1
pinctrl:
type: object
$ref: /schemas/pinctrl/airoha,en7581-pinctrl.yaml
description:
Child node definition for EN7581 Pin controller
pwm:
type: object
$ref: /schemas/pwm/airoha,en7581-pwm.yaml
description:
Child node definition for EN7581 PWM controller
required:
- compatible
- reg
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
system-controller@1fbf0200 {
compatible = "airoha,en7581-gpio-sysctl", "syscon", "simple-mfd";
reg = <0x1fbf0200 0xc0>;
pinctrl {
compatible = "airoha,en7581-pinctrl";
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
mmc-pins {
mux {
function = "emmc";
groups = "emmc";
};
};
mdio-pins {
mux {
function = "mdio";
groups = "mdio";
};
conf {
pins = "gpio2";
output-enable;
};
};
};
pwm {
compatible = "airoha,en7581-pwm";
#pwm-cells = <3>;
};
};

View File

@ -0,0 +1,400 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/airoha,en7581-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Airoha EN7581 Pin Controller
maintainers:
- Lorenzo Bianconi <lorenzo@kernel.org>
description:
The Airoha's EN7581 Pin controller is used to control SoC pins.
properties:
compatible:
const: airoha,en7581-pinctrl
interrupts:
maxItems: 1
gpio-controller: true
'#gpio-cells':
const: 2
interrupt-controller: true
'#interrupt-cells':
const: 2
allOf:
- $ref: pinctrl.yaml#
required:
- compatible
- interrupts
- gpio-controller
- "#gpio-cells"
- interrupt-controller
- "#interrupt-cells"
patternProperties:
'-pins$':
type: object
patternProperties:
'^mux(-|$)':
type: object
description:
pinmux configuration nodes.
$ref: /schemas/pinctrl/pinmux-node.yaml
properties:
function:
description:
A string containing the name of the function to mux to the group.
enum: [pon, tod_1pps, sipo, mdio, uart, i2c, jtag, pcm, spi,
pcm_spi, i2s, emmc, pnand, pcie_reset, pwm, phy1_led0,
phy2_led0, phy3_led0, phy4_led0, phy1_led1, phy2_led1,
phy3_led1, phy4_led1]
groups:
description:
An array of strings. Each string contains the name of a group.
required:
- function
- groups
allOf:
- if:
properties:
function:
const: pon
then:
properties:
groups:
enum: [pon]
- if:
properties:
function:
const: tod_1pps
then:
properties:
groups:
enum: [pon_tod_1pps, gsw_tod_1pps]
- if:
properties:
function:
const: sipo
then:
properties:
groups:
enum: [sipo, sipo_rclk]
- if:
properties:
function:
const: mdio
then:
properties:
groups:
enum: [mdio]
- if:
properties:
function:
const: uart
then:
properties:
groups:
items:
enum: [uart2, uart2_cts_rts, hsuart, hsuart_cts_rts,
uart4, uart5]
maxItems: 2
- if:
properties:
function:
const: i2c
then:
properties:
groups:
enum: [i2c1]
- if:
properties:
function:
const: jtag
then:
properties:
groups:
enum: [jtag_udi, jtag_dfd]
- if:
properties:
function:
const: pcm
then:
properties:
groups:
enum: [pcm1, pcm2]
- if:
properties:
function:
const: spi
then:
properties:
groups:
items:
enum: [spi_quad, spi_cs1]
maxItems: 2
- if:
properties:
function:
const: pcm_spi
then:
properties:
groups:
items:
enum: [pcm_spi, pcm_spi_int, pcm_spi_rst, pcm_spi_cs1,
pcm_spi_cs2_p156, pcm_spi_cs2_p128, pcm_spi_cs3,
pcm_spi_cs4]
maxItems: 7
- if:
properties:
function:
const: i2c
then:
properties:
groups:
enum: [i2s]
- if:
properties:
function:
const: emmc
then:
properties:
groups:
enum: [emmc]
- if:
properties:
function:
const: pnand
then:
properties:
groups:
enum: [pnand]
- if:
properties:
function:
const: pcie_reset
then:
properties:
groups:
enum: [pcie_reset0, pcie_reset1, pcie_reset2]
- if:
properties:
function:
const: pwm
then:
properties:
groups:
enum: [gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6,
gpio7, gpio8, gpio9, gpio10, gpio11, gpio12, gpio13,
gpio14, gpio15, gpio16, gpio17, gpio18, gpio19,
gpio20, gpio21, gpio22, gpio23, gpio24, gpio25,
gpio26, gpio27, gpio28, gpio29, gpio30, gpio31,
gpio36, gpio37, gpio38, gpio39, gpio40, gpio41,
gpio42, gpio43, gpio44, gpio45, gpio46, gpio47]
- if:
properties:
function:
const: phy1_led0
then:
properties:
groups:
enum: [gpio33, gpio34, gpio35, gpio42]
- if:
properties:
function:
const: phy2_led0
then:
properties:
groups:
enum: [gpio33, gpio34, gpio35, gpio42]
- if:
properties:
function:
const: phy3_led0
then:
properties:
groups:
enum: [gpio33, gpio34, gpio35, gpio42]
- if:
properties:
function:
const: phy4_led0
then:
properties:
groups:
enum: [gpio33, gpio34, gpio35, gpio42]
- if:
properties:
function:
const: phy1_led1
then:
properties:
groups:
enum: [gpio43, gpio44, gpio45, gpio46]
- if:
properties:
function:
const: phy2_led1
then:
properties:
groups:
enum: [gpio43, gpio44, gpio45, gpio46]
- if:
properties:
function:
const: phy3_led1
then:
properties:
groups:
enum: [gpio43, gpio44, gpio45, gpio46]
- if:
properties:
function:
const: phy4_led1
then:
properties:
groups:
enum: [gpio43, gpio44, gpio45, gpio46]
additionalProperties: false
'^conf(-|$)':
type: object
description:
pinconf configuration nodes.
$ref: /schemas/pinctrl/pincfg-node.yaml
properties:
pins:
description:
An array of strings. Each string contains the name of a pin.
items:
enum: [uart1_txd, uart1_rxd, i2c_scl, i2c_sda, spi_cs0, spi_clk,
spi_mosi, spi_miso, gpio0, gpio1, gpio2, gpio3, gpio4,
gpio5, gpio6, gpio7, gpio8, gpio9, gpio10, gpio11, gpio12,
gpio13, gpio14, gpio15, gpio16, gpio17, gpio18, gpio19,
gpio20, gpio21, gpio22, gpio23, gpio24, gpio25, gpio26,
gpio27, gpio28, gpio29, gpio30, gpio31, gpio32, gpio33,
gpio34, gpio35, gpio36, gpio37, gpio38, gpio39, gpio40,
gpio41, gpio42, gpio43, gpio44, gpio45, gpio46,
pcie_reset0, pcie_reset1, pcie_reset2]
minItems: 1
maxItems: 58
bias-disable: true
bias-pull-up: true
bias-pull-down: true
input-enable: true
output-enable: true
output-low: true
output-high: true
drive-open-drain: true
drive-strength:
description:
Selects the drive strength for MIO pins, in mA.
enum: [2, 4, 6, 8]
required:
- pins
additionalProperties: false
additionalProperties: false
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
pinctrl {
compatible = "airoha,en7581-pinctrl";
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
pcie1-rst-pins {
conf {
pins = "pcie_reset1";
drive-open-drain = <1>;
};
};
pwm-pins {
mux {
function = "pwm";
groups = "gpio18";
};
};
spi-pins {
mux {
function = "spi";
groups = "spi_quad", "spi_cs1";
};
};
uart2-pins {
mux {
function = "uart";
groups = "uart2", "uart2_cts_rts";
};
};
uar5-pins {
mux {
function = "uart";
groups = "uart5";
};
};
mmc-pins {
mux {
function = "emmc";
groups = "emmc";
};
};
mdio-pins {
mux {
function = "mdio";
groups = "mdio";
};
conf {
pins = "gpio2";
output-enable;
};
};
};

View File

@ -46,7 +46,7 @@ patternProperties:
- const: gpio
gpio-line-names:
minItems: 86 # AXG
minItems: 83 # Meson8b
maxItems: 120 # Meson8
unevaluatedProperties:

View File

@ -0,0 +1,127 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/canaan,k230-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Canaan Kendryte K230 Pin Controller
maintainers:
- Ze Huang <18771902331@163.com>
description:
The Canaan Kendryte K230 platform includes 64 IO pins, each capable of
multiplexing up to 5 different functions. Pin function configuration is
performed on a per-pin basis.
properties:
compatible:
const: canaan,k230-pinctrl
reg:
maxItems: 1
patternProperties:
'-pins$':
type: object
additionalProperties: false
description:
A pinctrl node should contain at least one subnode representing the
pinctrl groups available on the machine.
patternProperties:
'-cfg$':
type: object
allOf:
- $ref: /schemas/pinctrl/pincfg-node.yaml
- $ref: /schemas/pinctrl/pinmux-node.yaml
additionalProperties: false
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 enable/disable,
slew-rate, drive strength.
properties:
pinmux:
description:
The list of GPIOs and their mux settings that properties in
the node apply to. This should be set with the macro
'K230_PINMUX(pin, mode)'
bias-disable: true
bias-pull-up: true
bias-pull-down: true
drive-strength:
minimum: 0
maximum: 15
input-enable: true
output-enable: true
input-schmitt-enable: true
slew-rate:
description: |
slew rate control enable
0: disable
1: enable
enum: [0, 1]
power-source:
description: |
Specifies the power source voltage for the IO bank that the
pin belongs to. Each bank of IO pins operate at a specific,
fixed voltage levels. Incorrect voltage configuration can
damage the chip. The defined constants represent the
possible voltage configurations:
- K230_MSC_3V3 (value 0): 3.3V power supply
- K230_MSC_1V8 (value 1): 1.8V power supply
The following banks have the corresponding voltage
configurations:
- bank IO0 to IO1: Fixed at 1.8V
- bank IO2 to IO13: Fixed at 1.8V
- bank IO14 to IO25: Fixed at 1.8V
- bank IO26 to IO37: Fixed at 1.8V
- bank IO38 to IO49: Fixed at 1.8V
- bank IO50 to IO61: Fixed at 3.3V
- bank IO62 to IO63: Fixed at 1.8V
enum: [0, 1]
required:
- pinmux
required:
- compatible
- reg
additionalProperties: false
examples:
- |
pinctrl@91105000 {
compatible = "canaan,k230-pinctrl";
reg = <0x91105000 0x100>;
uart2-pins {
uart2-pins-cfg {
pinmux = <0x503>, /* uart2 txd */
<0x603>; /* uart2 rxd */
slew-rate = <0>;
drive-strength = <4>;
power-source = <1>;
input-enable;
output-enable;
bias-disable;
};
};
};

View File

@ -1,33 +0,0 @@
* Freescale IMX35 IOMUX Controller
Please refer to fsl,imx-pinctrl.txt in this directory for common binding part
and usage.
Required properties:
- compatible: "fsl,imx35-iomuxc"
- fsl,pins: two integers array, represents a group of pins mux and config
setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a
pin working on a specific function, CONFIG is the pad setting value like
pull-up for this pin. Please refer to imx35 datasheet for the valid pad
config settings.
CONFIG bits definition:
PAD_CTL_DRIVE_VOLAGAGE_18 (1 << 13)
PAD_CTL_DRIVE_VOLAGAGE_33 (0 << 13)
PAD_CTL_HYS (1 << 8)
PAD_CTL_PKE (1 << 7)
PAD_CTL_PUE (1 << 6)
PAD_CTL_PUS_100K_DOWN (0 << 4)
PAD_CTL_PUS_47K_UP (1 << 4)
PAD_CTL_PUS_100K_UP (2 << 4)
PAD_CTL_PUS_22K_UP (3 << 4)
PAD_CTL_ODE_CMOS (0 << 3)
PAD_CTL_ODE_OPENDRAIN (1 << 3)
PAD_CTL_DSE_NOMINAL (0 << 1)
PAD_CTL_DSE_HIGH (1 << 1)
PAD_CTL_DSE_MAX (2 << 1)
PAD_CTL_SRE_FAST (1 << 0)
PAD_CTL_SRE_SLOW (0 << 0)
Refer to imx35-pinfunc.h in device tree source folder for all available
imx35 PIN_FUNC_ID.

View File

@ -1,10 +1,10 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/fsl,imx6ul-pinctrl.yaml#
$id: http://devicetree.org/schemas/pinctrl/fsl,imx35-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Freescale IMX6UL IOMUX Controller
title: Freescale IMX35/IMX5x/IMX6 IOMUX Controller
maintainers:
- Dong Aisheng <aisheng.dong@nxp.com>
@ -18,9 +18,21 @@ allOf:
properties:
compatible:
enum:
- fsl,imx6ul-iomuxc
- fsl,imx6ull-iomuxc-snvs
oneOf:
- enum:
- fsl,imx35-iomuxc
- fsl,imx51-iomuxc
- fsl,imx53-iomuxc
- fsl,imx6dl-iomuxc
- fsl,imx6q-iomuxc
- fsl,imx6sl-iomuxc
- fsl,imx6sll-iomuxc
- fsl,imx6sx-iomuxc
- fsl,imx6ul-iomuxc
- fsl,imx6ull-iomuxc-snvs
- items:
- const: fsl,imx50-iomuxc
- const: fsl,imx53-iomuxc
reg:
maxItems: 1
@ -39,9 +51,9 @@ patternProperties:
each entry consists of 6 integers and represents the mux and config
setting for one pin. The first 5 integers <mux_reg conf_reg input_reg
mux_val input_val> are specified using a PIN_FUNC_ID macro, which can
be found in <arch/arm/boot/dts/imx6ul-pinfunc.h>. The last integer
be found in <arch/arm/boot/dts/nxp/imx/imx*-pinfunc.h>. The last integer
CONFIG is the pad setting value like pull-up on this pin. Please
refer to i.MX6UL Reference Manual for detailed CONFIG settings.
refer to matching i.MX Reference Manual for detailed CONFIG settings.
$ref: /schemas/types.yaml#/definitions/uint32-matrix
items:
items:
@ -56,7 +68,41 @@ patternProperties:
- description: |
"input_val" indicates the select input value to be applied.
- description: |
"pad_setting" indicates the pad configuration value to be applied:
"pad_setting" indicates the pad configuration value to be applied.
Common i.MX35
PAD_CTL_DRIVE_VOLAGAGE_18 (1 << 13)
PAD_CTL_DRIVE_VOLAGAGE_33 (0 << 13)
PAD_CTL_HYS (1 << 8)
PAD_CTL_PKE (1 << 7)
PAD_CTL_PUE (1 << 6)
PAD_CTL_PUS_100K_DOWN (0 << 4)
PAD_CTL_PUS_47K_UP (1 << 4)
PAD_CTL_PUS_100K_UP (2 << 4)
PAD_CTL_PUS_22K_UP (3 << 4)
PAD_CTL_ODE_CMOS (0 << 3)
PAD_CTL_ODE_OPENDRAIN (1 << 3)
PAD_CTL_DSE_NOMINAL (0 << 1)
PAD_CTL_DSE_HIGH (1 << 1)
PAD_CTL_DSE_MAX (2 << 1)
PAD_CTL_SRE_FAST (1 << 0)
PAD_CTL_SRE_SLOW (0 << 0)
Common i.MX50/i.MX51/i.MX53 bits
PAD_CTL_HVE (1 << 13)
PAD_CTL_HYS (1 << 8)
PAD_CTL_PKE (1 << 7)
PAD_CTL_PUE (1 << 6)
PAD_CTL_PUS_100K_DOWN (0 << 4)
PAD_CTL_PUS_47K_UP (1 << 4)
PAD_CTL_PUS_100K_UP (2 << 4)
PAD_CTL_PUS_22K_UP (3 << 4)
PAD_CTL_ODE (1 << 3)
PAD_CTL_DSE_LOW (0 << 1)
PAD_CTL_DSE_MED (1 << 1)
PAD_CTL_DSE_HIGH (2 << 1)
PAD_CTL_DSE_MAX (3 << 1)
PAD_CTL_SRE_FAST (1 << 0)
PAD_CTL_SRE_SLOW (0 << 0)
Common i.MX6 bits
PAD_CTL_HYS (1 << 16)
PAD_CTL_PUS_100K_DOWN (0 << 14)
PAD_CTL_PUS_47K_UP (1 << 14)
@ -69,6 +115,11 @@ patternProperties:
PAD_CTL_SPEED_MED (1 << 6)
PAD_CTL_SPEED_HIGH (3 << 6)
PAD_CTL_DSE_DISABLE (0 << 3)
PAD_CTL_SRE_FAST (1 << 0)
PAD_CTL_SRE_SLOW (0 << 0)
i.MX6SL/MX6SLL specific bits
PAD_CTL_LVE (1 << 22) (MX6SL/SLL only)
i.MX6SLL/i.MX6SX/i.MX6UL/i.MX6ULL specific bits
PAD_CTL_DSE_260ohm (1 << 3)
PAD_CTL_DSE_130ohm (2 << 3)
PAD_CTL_DSE_87ohm (3 << 3)
@ -76,8 +127,14 @@ patternProperties:
PAD_CTL_DSE_52ohm (5 << 3)
PAD_CTL_DSE_43ohm (6 << 3)
PAD_CTL_DSE_37ohm (7 << 3)
PAD_CTL_SRE_FAST (1 << 0)
PAD_CTL_SRE_SLOW (0 << 0)
i.MX6DL/i.MX6Q/i.MX6SL specific bits
PAD_CTL_DSE_240ohm (1 << 3)
PAD_CTL_DSE_120ohm (2 << 3)
PAD_CTL_DSE_80ohm (3 << 3)
PAD_CTL_DSE_60ohm (4 << 3)
PAD_CTL_DSE_48ohm (5 << 3)
PAD_CTL_DSE_40ohm (6 << 3)
PAD_CTL_DSE_34ohm (7 << 3)
required:
- fsl,pins
@ -114,3 +171,14 @@ examples:
>;
};
};
- |
iomuxc_mx6q: pinctrl@20e0000 {
compatible = "fsl,imx6q-iomuxc";
reg = <0x20e0000 0x4000>;
pinctrl_uart4: uart4grp {
fsl,pins =
<0x288 0x658 0x000 0x3 0x0 0x140>,
<0x28c 0x65c 0x938 0x3 0x3 0x140>;
};
};

View File

@ -1,32 +0,0 @@
* Freescale IMX50 IOMUX Controller
Please refer to fsl,imx-pinctrl.txt in this directory for common binding part
and usage.
Required properties:
- compatible: "fsl,imx50-iomuxc"
- fsl,pins: two integers array, represents a group of pins mux and config
setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a
pin working on a specific function, CONFIG is the pad setting value like
pull-up for this pin. Please refer to imx50 datasheet for the valid pad
config settings.
CONFIG bits definition:
PAD_CTL_HVE (1 << 13)
PAD_CTL_HYS (1 << 8)
PAD_CTL_PKE (1 << 7)
PAD_CTL_PUE (1 << 6)
PAD_CTL_PUS_100K_DOWN (0 << 4)
PAD_CTL_PUS_47K_UP (1 << 4)
PAD_CTL_PUS_100K_UP (2 << 4)
PAD_CTL_PUS_22K_UP (3 << 4)
PAD_CTL_ODE (1 << 3)
PAD_CTL_DSE_LOW (0 << 1)
PAD_CTL_DSE_MED (1 << 1)
PAD_CTL_DSE_HIGH (2 << 1)
PAD_CTL_DSE_MAX (3 << 1)
PAD_CTL_SRE_FAST (1 << 0)
PAD_CTL_SRE_SLOW (0 << 0)
Refer to imx50-pinfunc.h in device tree source folder for all available
imx50 PIN_FUNC_ID.

View File

@ -1,32 +0,0 @@
* Freescale IMX51 IOMUX Controller
Please refer to fsl,imx-pinctrl.txt in this directory for common binding part
and usage.
Required properties:
- compatible: "fsl,imx51-iomuxc"
- fsl,pins: two integers array, represents a group of pins mux and config
setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a
pin working on a specific function, CONFIG is the pad setting value like
pull-up for this pin. Please refer to imx51 datasheet for the valid pad
config settings.
CONFIG bits definition:
PAD_CTL_HVE (1 << 13)
PAD_CTL_HYS (1 << 8)
PAD_CTL_PKE (1 << 7)
PAD_CTL_PUE (1 << 6)
PAD_CTL_PUS_100K_DOWN (0 << 4)
PAD_CTL_PUS_47K_UP (1 << 4)
PAD_CTL_PUS_100K_UP (2 << 4)
PAD_CTL_PUS_22K_UP (3 << 4)
PAD_CTL_ODE (1 << 3)
PAD_CTL_DSE_LOW (0 << 1)
PAD_CTL_DSE_MED (1 << 1)
PAD_CTL_DSE_HIGH (2 << 1)
PAD_CTL_DSE_MAX (3 << 1)
PAD_CTL_SRE_FAST (1 << 0)
PAD_CTL_SRE_SLOW (0 << 0)
Refer to imx51-pinfunc.h in device tree source folder for all available
imx51 PIN_FUNC_ID.

View File

@ -1,32 +0,0 @@
* Freescale IMX53 IOMUX Controller
Please refer to fsl,imx-pinctrl.txt in this directory for common binding part
and usage.
Required properties:
- compatible: "fsl,imx53-iomuxc"
- fsl,pins: two integers array, represents a group of pins mux and config
setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a
pin working on a specific function, CONFIG is the pad setting value like
pull-up for this pin. Please refer to imx53 datasheet for the valid pad
config settings.
CONFIG bits definition:
PAD_CTL_HVE (1 << 13)
PAD_CTL_HYS (1 << 8)
PAD_CTL_PKE (1 << 7)
PAD_CTL_PUE (1 << 6)
PAD_CTL_PUS_100K_DOWN (0 << 4)
PAD_CTL_PUS_47K_UP (1 << 4)
PAD_CTL_PUS_100K_UP (2 << 4)
PAD_CTL_PUS_22K_UP (3 << 4)
PAD_CTL_ODE (1 << 3)
PAD_CTL_DSE_LOW (0 << 1)
PAD_CTL_DSE_MED (1 << 1)
PAD_CTL_DSE_HIGH (2 << 1)
PAD_CTL_DSE_MAX (3 << 1)
PAD_CTL_SRE_FAST (1 << 0)
PAD_CTL_SRE_SLOW (0 << 0)
Refer to imx53-pinfunc.h in device tree source folder for all available
imx53 PIN_FUNC_ID.

View File

@ -1,38 +0,0 @@
* Freescale IMX6 DualLite/Solo IOMUX Controller
Please refer to fsl,imx-pinctrl.txt in this directory for common binding part
and usage.
Required properties:
- compatible: "fsl,imx6dl-iomuxc"
- fsl,pins: two integers array, represents a group of pins mux and config
setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a
pin working on a specific function, CONFIG is the pad setting value like
pull-up for this pin. Please refer to imx6dl datasheet for the valid pad
config settings.
CONFIG bits definition:
PAD_CTL_HYS (1 << 16)
PAD_CTL_PUS_100K_DOWN (0 << 14)
PAD_CTL_PUS_47K_UP (1 << 14)
PAD_CTL_PUS_100K_UP (2 << 14)
PAD_CTL_PUS_22K_UP (3 << 14)
PAD_CTL_PUE (1 << 13)
PAD_CTL_PKE (1 << 12)
PAD_CTL_ODE (1 << 11)
PAD_CTL_SPEED_LOW (1 << 6)
PAD_CTL_SPEED_MED (2 << 6)
PAD_CTL_SPEED_HIGH (3 << 6)
PAD_CTL_DSE_DISABLE (0 << 3)
PAD_CTL_DSE_240ohm (1 << 3)
PAD_CTL_DSE_120ohm (2 << 3)
PAD_CTL_DSE_80ohm (3 << 3)
PAD_CTL_DSE_60ohm (4 << 3)
PAD_CTL_DSE_48ohm (5 << 3)
PAD_CTL_DSE_40ohm (6 << 3)
PAD_CTL_DSE_34ohm (7 << 3)
PAD_CTL_SRE_FAST (1 << 0)
PAD_CTL_SRE_SLOW (0 << 0)
Refer to imx6dl-pinfunc.h in device tree source folder for all available
imx6dl PIN_FUNC_ID.

View File

@ -1,38 +0,0 @@
* Freescale IMX6Q IOMUX Controller
Please refer to fsl,imx-pinctrl.txt in this directory for common binding part
and usage.
Required properties:
- compatible: "fsl,imx6q-iomuxc"
- fsl,pins: two integers array, represents a group of pins mux and config
setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a
pin working on a specific function, CONFIG is the pad setting value like
pull-up for this pin. Please refer to imx6q datasheet for the valid pad
config settings.
CONFIG bits definition:
PAD_CTL_HYS (1 << 16)
PAD_CTL_PUS_100K_DOWN (0 << 14)
PAD_CTL_PUS_47K_UP (1 << 14)
PAD_CTL_PUS_100K_UP (2 << 14)
PAD_CTL_PUS_22K_UP (3 << 14)
PAD_CTL_PUE (1 << 13)
PAD_CTL_PKE (1 << 12)
PAD_CTL_ODE (1 << 11)
PAD_CTL_SPEED_LOW (1 << 6)
PAD_CTL_SPEED_MED (2 << 6)
PAD_CTL_SPEED_HIGH (3 << 6)
PAD_CTL_DSE_DISABLE (0 << 3)
PAD_CTL_DSE_240ohm (1 << 3)
PAD_CTL_DSE_120ohm (2 << 3)
PAD_CTL_DSE_80ohm (3 << 3)
PAD_CTL_DSE_60ohm (4 << 3)
PAD_CTL_DSE_48ohm (5 << 3)
PAD_CTL_DSE_40ohm (6 << 3)
PAD_CTL_DSE_34ohm (7 << 3)
PAD_CTL_SRE_FAST (1 << 0)
PAD_CTL_SRE_SLOW (0 << 0)
Refer to imx6q-pinfunc.h in device tree source folder for all available
imx6q PIN_FUNC_ID.

View File

@ -1,39 +0,0 @@
* Freescale IMX6 SoloLite IOMUX Controller
Please refer to fsl,imx-pinctrl.txt in this directory for common binding part
and usage.
Required properties:
- compatible: "fsl,imx6sl-iomuxc"
- fsl,pins: two integers array, represents a group of pins mux and config
setting. The format is fsl,pins = <PIN_FUNC_ID CONFIG>, PIN_FUNC_ID is a
pin working on a specific function, CONFIG is the pad setting value like
pull-up for this pin. Please refer to imx6sl datasheet for the valid pad
config settings.
CONFIG bits definition:
PAD_CTL_LVE (1 << 22)
PAD_CTL_HYS (1 << 16)
PAD_CTL_PUS_100K_DOWN (0 << 14)
PAD_CTL_PUS_47K_UP (1 << 14)
PAD_CTL_PUS_100K_UP (2 << 14)
PAD_CTL_PUS_22K_UP (3 << 14)
PAD_CTL_PUE (1 << 13)
PAD_CTL_PKE (1 << 12)
PAD_CTL_ODE (1 << 11)
PAD_CTL_SPEED_LOW (1 << 6)
PAD_CTL_SPEED_MED (2 << 6)
PAD_CTL_SPEED_HIGH (3 << 6)
PAD_CTL_DSE_DISABLE (0 << 3)
PAD_CTL_DSE_240ohm (1 << 3)
PAD_CTL_DSE_120ohm (2 << 3)
PAD_CTL_DSE_80ohm (3 << 3)
PAD_CTL_DSE_60ohm (4 << 3)
PAD_CTL_DSE_48ohm (5 << 3)
PAD_CTL_DSE_40ohm (6 << 3)
PAD_CTL_DSE_34ohm (7 << 3)
PAD_CTL_SRE_FAST (1 << 0)
PAD_CTL_SRE_SLOW (0 << 0)
Refer to imx6sl-pinfunc.h in device tree source folder for all available
imx6sl PIN_FUNC_ID.

View File

@ -1,40 +0,0 @@
* Freescale i.MX6 SLL IOMUX Controller
Please refer to fsl,imx-pinctrl.txt in this directory for common binding part
and usage.
Required properties:
- compatible: "fsl,imx6sll-iomuxc"
- fsl,pins: each entry consists of 6 integers and represents the mux and config
setting for one pin. The first 5 integers <mux_reg conf_reg input_reg mux_val
input_val> are specified using a PIN_FUNC_ID macro, which can be found in
imx6sll-pinfunc.h under device tree source folder. The last integer CONFIG is
the pad setting value like pull-up on this pin. Please refer to i.MX6SLL
Reference Manual for detailed CONFIG settings.
CONFIG bits definition:
PAD_CTL_LVE (1 << 22)
PAD_CTL_HYS (1 << 16)
PAD_CTL_PUS_100K_DOWN (0 << 14)
PAD_CTL_PUS_47K_UP (1 << 14)
PAD_CTL_PUS_100K_UP (2 << 14)
PAD_CTL_PUS_22K_UP (3 << 14)
PAD_CTL_PUE (1 << 13)
PAD_CTL_PKE (1 << 12)
PAD_CTL_ODE (1 << 11)
PAD_CTL_SPEED_LOW (0 << 6)
PAD_CTL_SPEED_MED (1 << 6)
PAD_CTL_SPEED_HIGH (3 << 6)
PAD_CTL_DSE_DISABLE (0 << 3)
PAD_CTL_DSE_260ohm (1 << 3)
PAD_CTL_DSE_130ohm (2 << 3)
PAD_CTL_DSE_87ohm (3 << 3)
PAD_CTL_DSE_65ohm (4 << 3)
PAD_CTL_DSE_52ohm (5 << 3)
PAD_CTL_DSE_43ohm (6 << 3)
PAD_CTL_DSE_37ohm (7 << 3)
PAD_CTL_SRE_FAST (1 << 0)
PAD_CTL_SRE_SLOW (0 << 0)
Refer to imx6sll-pinfunc.h in device tree source folder for all available
imx6sll PIN_FUNC_ID.

View File

@ -1,36 +0,0 @@
* Freescale i.MX6 SoloX IOMUX Controller
Please refer to fsl,imx-pinctrl.txt in this directory for common binding part
and usage.
Required properties:
- compatible: "fsl,imx6sx-iomuxc"
- fsl,pins: each entry consists of 6 integers and represents the mux and config
setting for one pin. The first 5 integers <mux_reg conf_reg input_reg mux_val
input_val> are specified using a PIN_FUNC_ID macro, which can be found in
imx6sx-pinfunc.h under device tree source folder. The last integer CONFIG is
the pad setting value like pull-up on this pin. Please refer to i.MX6 SoloX
Reference Manual for detailed CONFIG settings.
CONFIG bits definition:
PAD_CTL_HYS (1 << 16)
PAD_CTL_PUS_100K_DOWN (0 << 14)
PAD_CTL_PUS_47K_UP (1 << 14)
PAD_CTL_PUS_100K_UP (2 << 14)
PAD_CTL_PUS_22K_UP (3 << 14)
PAD_CTL_PUE (1 << 13)
PAD_CTL_PKE (1 << 12)
PAD_CTL_ODE (1 << 11)
PAD_CTL_SPEED_LOW (0 << 6)
PAD_CTL_SPEED_MED (1 << 6)
PAD_CTL_SPEED_HIGH (3 << 6)
PAD_CTL_DSE_DISABLE (0 << 3)
PAD_CTL_DSE_260ohm (1 << 3)
PAD_CTL_DSE_130ohm (2 << 3)
PAD_CTL_DSE_87ohm (3 << 3)
PAD_CTL_DSE_65ohm (4 << 3)
PAD_CTL_DSE_52ohm (5 << 3)
PAD_CTL_DSE_43ohm (6 << 3)
PAD_CTL_DSE_37ohm (7 << 3)
PAD_CTL_SRE_FAST (1 << 0)
PAD_CTL_SRE_SLOW (0 << 0)

View File

@ -0,0 +1,161 @@
# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/microchip,mcp23s08.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Microchip I/O expander with serial interface (I2C/SPI)
maintainers:
- Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>
description:
Microchip MCP23008, MCP23017, MCP23S08, MCP23S17, MCP23S18 GPIO expander
chips.These chips provide 8 or 16 GPIO pins with either I2C or SPI interface.
allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
properties:
compatible:
enum:
- microchip,mcp23s08
- microchip,mcp23s17
- microchip,mcp23s18
- microchip,mcp23008
- microchip,mcp23017
- microchip,mcp23018
reg:
maxItems: 1
gpio-controller: true
'#gpio-cells':
const: 2
interrupt-controller: true
'#interrupt-cells':
const: 2
interrupts:
maxItems: 1
reset-gpios:
description: GPIO specifier for active-low reset pin.
maxItems: 1
microchip,spi-present-mask:
description:
Multiple SPI chips can share the same SPI chipselect. Set a bit in
bit0-7 in this mask to 1 if there is a chip connected with the
corresponding spi address set. For example if you have a chip with
address 3 connected, you have to set bit3 to 1, which is 0x08. mcp23s08
chip variant only supports bits 0-3. It is not possible to mix mcp23s08
and mcp23s17 on the same chipselect. Set at least one bit to 1 for SPI
chips.
$ref: /schemas/types.yaml#/definitions/uint8
microchip,irq-mirror:
type: boolean
description:
Sets the mirror flag in the IOCON register. Devices with two interrupt
outputs (these are the devices ending with 17 and those that have 16 IOs)
have two IO banks IO 0-7 form bank 1 and IO 8-15 are bank 2. These chips
have two different interrupt outputs One for bank 1 and another for
bank 2. If irq-mirror is set, both interrupts are generated regardless of
the bank that an input change occurred on. If it is not set,the interrupt
are only generated for the bank they belong to.
microchip,irq-active-high:
type: boolean
description:
Sets the INTPOL flag in the IOCON register.This configures the IRQ output
polarity as active high.
drive-open-drain:
type: boolean
description:
Sets the ODR flag in the IOCON register. This configures the IRQ output as
open drain active low.
pinmux:
type: object
properties:
pins:
description:
The list of GPIO pins controlled by this node. Each pin name
corresponds to a physical pin on the GPIO expander.
items:
pattern: '^gpio([0-9]|[1][0-5])$'
maxItems: 16
bias-pull-up:
type: boolean
description:
Configures pull-up resistors for the GPIO pins. Absence of this
property will leave the configuration in its default state.
required:
- pins
additionalProperties: false
required:
- compatible
- reg
- gpio-controller
- '#gpio-cells'
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
gpio@21 {
compatible = "microchip,mcp23017";
reg = <0x21>;
gpio-controller;
#gpio-cells = <2>;
interrupt-parent = <&gpio1>;
interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
interrupt-controller;
#interrupt-cells = <2>;
microchip,irq-mirror;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c_gpio0>, <&gpiopullups>;
reset-gpios = <&gpio6 15 GPIO_ACTIVE_LOW>;
gpiopullups: pinmux {
pins = "gpio0", "gpio1", "gpio2", "gpio3",
"gpio4", "gpio5", "gpio6", "gpio7",
"gpio8", "gpio9", "gpio10", "gpio11",
"gpio12", "gpio13", "gpio14", "gpio15";
bias-pull-up;
};
};
};
- |
spi {
#address-cells = <1>;
#size-cells = <0>;
gpio@0 {
compatible = "microchip,mcp23s17";
reg = <0>;
gpio-controller;
#gpio-cells = <2>;
spi-max-frequency = <1000000>;
microchip,spi-present-mask = /bits/ 8 <0x01>;
};
};

View File

@ -12,14 +12,24 @@ maintainers:
properties:
compatible:
enum:
- microchip,lan966x-pinctrl
- microchip,sparx5-pinctrl
- mscc,jaguar2-pinctrl
- mscc,luton-pinctrl
- mscc,ocelot-pinctrl
- mscc,serval-pinctrl
- mscc,servalt-pinctrl
oneOf:
- enum:
- microchip,lan966x-pinctrl
- microchip,lan9691-pinctrl
- microchip,sparx5-pinctrl
- mscc,jaguar2-pinctrl
- mscc,luton-pinctrl
- mscc,ocelot-pinctrl
- mscc,serval-pinctrl
- mscc,servalt-pinctrl
- items:
- enum:
- microchip,lan9698-pinctrl
- microchip,lan9696-pinctrl
- microchip,lan9694-pinctrl
- microchip,lan9693-pinctrl
- microchip,lan9692-pinctrl
- const: microchip,lan9691-pinctrl
reg:
items:
@ -85,6 +95,7 @@ allOf:
contains:
enum:
- microchip,lan966x-pinctrl
- microchip,lan9691-pinctrl
- microchip,sparx5-pinctrl
then:
properties:

View File

@ -1,148 +0,0 @@
Microchip MCP2308/MCP23S08/MCP23017/MCP23S17 driver for
8-/16-bit I/O expander with serial interface (I2C/SPI)
Required properties:
- compatible : Should be
- "mcp,mcp23s08" (DEPRECATED) for 8 GPIO SPI version
- "mcp,mcp23s17" (DEPRECATED) for 16 GPIO SPI version
- "mcp,mcp23008" (DEPRECATED) for 8 GPIO I2C version or
- "mcp,mcp23017" (DEPRECATED) for 16 GPIO I2C version of the chip
- "microchip,mcp23s08" for 8 GPIO SPI version
- "microchip,mcp23s17" for 16 GPIO SPI version
- "microchip,mcp23s18" for 16 GPIO SPI version
- "microchip,mcp23008" for 8 GPIO I2C version or
- "microchip,mcp23017" for 16 GPIO I2C version of the chip
- "microchip,mcp23018" for 16 GPIO I2C version
NOTE: Do not use the old mcp prefix any more. It is deprecated and will be
removed.
- #gpio-cells : Should be two.
- first cell is the pin number
- second cell is used to specify flags as described in
'Documentation/devicetree/bindings/gpio/gpio.txt'. Allowed values defined by
'include/dt-bindings/gpio/gpio.h' (e.g. GPIO_ACTIVE_LOW).
- gpio-controller : Marks the device node as a GPIO controller.
- reg : For an address on its bus. I2C uses this a the I2C address of the chip.
SPI uses this to specify the chipselect line which the chip is
connected to. The driver and the SPI variant of the chip support
multiple chips on the same chipselect. Have a look at
microchip,spi-present-mask below.
Required device specific properties (only for SPI chips):
- mcp,spi-present-mask (DEPRECATED)
- microchip,spi-present-mask : This is a present flag, that makes only sense for SPI
chips - as the name suggests. Multiple SPI chips can share the same
SPI chipselect. Set a bit in bit0-7 in this mask to 1 if there is a
chip connected with the corresponding spi address set. For example if
you have a chip with address 3 connected, you have to set bit3 to 1,
which is 0x08. mcp23s08 chip variant only supports bits 0-3. It is not
possible to mix mcp23s08 and mcp23s17 on the same chipselect. Set at
least one bit to 1 for SPI chips.
NOTE: Do not use the old mcp prefix any more. It is deprecated and will be
removed.
- spi-max-frequency = The maximum frequency this chip is able to handle
Optional properties:
- #interrupt-cells : Should be two.
- first cell is the pin number
- second cell is used to specify flags.
- interrupt-controller: Marks the device node as a interrupt controller.
- drive-open-drain: Sets the ODR flag in the IOCON register. This configures
the IRQ output as open drain active low.
- reset-gpios: Corresponds to the active-low RESET# pin for the chip
Optional device specific properties:
- microchip,irq-mirror: Sets the mirror flag in the IOCON register. Devices
with two interrupt outputs (these are the devices ending with 17 and
those that have 16 IOs) have two IO banks: IO 0-7 form bank 1 and
IO 8-15 are bank 2. These chips have two different interrupt outputs:
One for bank 1 and another for bank 2. If irq-mirror is set, both
interrupts are generated regardless of the bank that an input change
occurred on. If it is not set, the interrupt are only generated for the
bank they belong to.
On devices with only one interrupt output this property is useless.
- microchip,irq-active-high: Sets the INTPOL flag in the IOCON register. This
configures the IRQ output polarity as active high.
Example I2C (with interrupt):
gpiom1: gpio@20 {
compatible = "microchip,mcp23017";
gpio-controller;
#gpio-cells = <2>;
reg = <0x20>;
interrupt-parent = <&gpio1>;
interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
interrupt-controller;
#interrupt-cells=<2>;
microchip,irq-mirror;
};
Example SPI:
gpiom1: gpio@0 {
compatible = "microchip,mcp23s17";
gpio-controller;
#gpio-cells = <2>;
microchip,spi-present-mask = <0x01>;
reg = <0>;
spi-max-frequency = <1000000>;
};
Pull-up configuration
=====================
If pins are used as output, they can also be configured with pull-ups. This is
done with pinctrl.
Please refer file <devicetree/bindings/pinctrl/pinctrl-bindings.txt>
for details of the common pinctrl bindings used by client devices,
including the meaning of the phrase "pin configuration node".
Optional Pinmux properties:
--------------------------
Following properties are required if default setting of pins are required
at boot.
- pinctrl-names: A pinctrl state named per <pinctrl-bindings.txt>.
- pinctrl[0...n]: Properties to contain the phandle for pinctrl states per
<pinctrl-bindings.txt>.
The pin configurations are defined as child of the pinctrl states node. Each
sub-node have following properties:
Required properties:
------------------
- pins: List of pins. Valid values of pins properties are:
gpio0 ... gpio7 for the devices with 8 GPIO pins and
gpio0 ... gpio15 for the devices with 16 GPIO pins.
Optional properties:
-------------------
The following optional property is defined in the pinmux DT binding document
<pinctrl-bindings.txt>. Absence of this property will leave the configuration
in its default state.
bias-pull-up
Example with pinctrl to pull-up output pins:
gpio21: gpio@21 {
compatible = "microchip,mcp23017";
gpio-controller;
#gpio-cells = <0x2>;
reg = <0x21>;
interrupt-parent = <&socgpio>;
interrupts = <0x17 0x8>;
interrupt-names = "mcp23017@21 irq";
interrupt-controller;
#interrupt-cells = <0x2>;
microchip,irq-mirror;
pinctrl-names = "default";
pinctrl-0 = <&i2cgpio0irq>, <&gpio21pullups>;
reset-gpios = <&gpio6 15 GPIO_ACTIVE_LOW>;
gpio21pullups: pinmux {
pins = "gpio0", "gpio1", "gpio2", "gpio3",
"gpio4", "gpio5", "gpio6", "gpio7",
"gpio8", "gpio9", "gpio10", "gpio11",
"gpio12", "gpio13", "gpio14", "gpio15";
bias-pull-up;
};
};

View File

@ -33,6 +33,10 @@ properties:
- ti,omap5-padconf
- ti,j7200-padconf
- const: pinctrl-single
- items:
- enum:
- marvell,pxa1908-padconf
- const: pinconf-single
reg:
maxItems: 1

View File

@ -0,0 +1,114 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/qcom,ipq5424-tlmm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm IPQ5424 TLMM pin controller
maintainers:
- Bjorn Andersson <andersson@kernel.org>
description:
Top Level Mode Multiplexer pin controller in Qualcomm IPQ5424 SoC.
allOf:
- $ref: /schemas/pinctrl/qcom,tlmm-common.yaml#
properties:
compatible:
const: qcom,ipq5424-tlmm
reg:
maxItems: 1
interrupts:
maxItems: 1
gpio-reserved-ranges:
minItems: 1
maxItems: 25
gpio-line-names:
maxItems: 50
patternProperties:
"-state$":
oneOf:
- $ref: "#/$defs/qcom-ipq5424-tlmm-state"
- patternProperties:
"-pins$":
$ref: "#/$defs/qcom-ipq5424-tlmm-state"
additionalProperties: false
$defs:
qcom-ipq5424-tlmm-state:
type: object
description:
Pinctrl node's client devices use subnodes for desired pin configuration.
Client device subnodes use below standard properties.
$ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state
unevaluatedProperties: false
properties:
pins:
description:
List of gpio pins affected by the properties specified in this
subnode.
items:
pattern: "^gpio([0-9]|[1-4][0-9])$"
minItems: 1
maxItems: 50
function:
description:
Specify the alternative function to be configured for the specified
pins.
enum: [ atest_char, atest_char0, atest_char1, atest_char2, atest_char3,
atest_tic, audio_pri, audio_pri0, audio_pri1, audio_sec,
audio_sec0, audio_sec1, core_voltage, cri_trng0, cri_trng1,
cri_trng2, cri_trng3, cxc_clk, cxc_data, dbg_out, gcc_plltest,
gcc_tlmm, gpio, i2c0_scl, i2c0_sda, i2c1_scl, i2c1_sda, i2c11,
mac0, mac1, mdc_mst, mdc_slv, mdio_mst, mdio_slv, pcie0_clk,
pcie0_wake, pcie1_clk, pcie1_wake, pcie2_clk, pcie2_wake,
pcie3_clk, pcie3_wake, pll_test, prng_rosc0, prng_rosc1,
prng_rosc2, prng_rosc3, PTA0_0, PTA0_1, PTA0_2, PTA10, PTA11,
pwm0, pwm1, pwm2, qdss_cti_trig_in_a0, qdss_cti_trig_out_a0,
qdss_cti_trig_in_a1, qdss_cti_trig_out_a1, qdss_cti_trig_in_b0,
qdss_cti_trig_out_b0, qdss_cti_trig_in_b1, qdss_cti_trig_out_b1,
qdss_traceclk_a, qdss_tracectl_a, qdss_tracedata_a, qspi_clk,
qspi_cs, qspi_data, resout, rx0, rx1, rx2, sdc_clk, sdc_cmd,
sdc_data, spi0, spi1, spi10, spi11, tsens_max, uart0, uart1,
wci_txd, wci_rxd, wsi_clk, wsi_data ]
required:
- pins
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
tlmm: pinctrl@1000000 {
compatible = "qcom,ipq5424-tlmm";
reg = <0x01000000 0x300000>;
gpio-controller;
#gpio-cells = <0x2>;
gpio-ranges = <&tlmm 0 0 50>;
interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
interrupt-controller;
#interrupt-cells = <0x2>;
uart1_pins: uart1-state {
pins = "gpio43", "gpio44";
function = "uart1";
drive-strength = <8>;
bias-pull-up;
};
};

View File

@ -48,6 +48,7 @@ properties:
- qcom,pm8916-gpio
- qcom,pm8917-gpio
- qcom,pm8921-gpio
- qcom,pm8937-gpio
- qcom,pm8941-gpio
- qcom,pm8950-gpio
- qcom,pm8953-gpio
@ -184,6 +185,7 @@ allOf:
- qcom,pm8226-gpio
- qcom,pm8350b-gpio
- qcom,pm8550ve-gpio
- qcom,pm8937-gpio
- qcom,pm8950-gpio
- qcom,pm8953-gpio
- qcom,pmi632-gpio
@ -468,6 +470,7 @@ $defs:
- gpio1-gpio6 for pm8550vs
- gpio1-gpio38 for pm8917
- gpio1-gpio44 for pm8921
- gpio1-gpio8 for pm8937 (hole on gpio3, gpio4 and gpio6)
- gpio1-gpio36 for pm8941
- gpio1-gpio8 for pm8950 (hole on gpio3)
- gpio1-gpio8 for pm8953 (hole on gpio3 and gpio6)

View File

@ -22,6 +22,7 @@ properties:
- qcom,pm8226-mpp
- qcom,pm8841-mpp
- qcom,pm8916-mpp
- qcom,pm8937-mpp
- qcom,pm8941-mpp
- qcom,pm8950-mpp
- qcom,pmi8950-mpp
@ -92,6 +93,7 @@ $defs:
this subnode. Valid pins are
- mpp1-mpp4 for pm8841
- mpp1-mpp4 for pm8916
- mpp1-mpp4 for pm8937
- mpp1-mpp8 for pm8941
- mpp1-mpp4 for pm8950
- mpp1-mpp4 for pmi8950

View File

@ -0,0 +1,124 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/qcom,qcs615-tlmm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Technologies, Inc. QCS615 TLMM block
maintainers:
- Lijuan Gao <quic_lijuang@quicinc.com>
description:
Top Level Mode Multiplexer pin controller in Qualcomm QCS615 SoC.
allOf:
- $ref: /schemas/pinctrl/qcom,tlmm-common.yaml#
properties:
compatible:
const: qcom,qcs615-tlmm
reg:
maxItems: 3
reg-names:
items:
- const: east
- const: west
- const: south
interrupts:
maxItems: 1
gpio-reserved-ranges:
minItems: 1
maxItems: 62
gpio-line-names:
maxItems: 123
patternProperties:
"-state$":
oneOf:
- $ref: "#/$defs/qcom-qcs615-tlmm-state"
- type: object
patternProperties:
"-pins$":
$ref: "#/$defs/qcom-qcs615-tlmm-state"
additionalProperties: false
$defs:
qcom-qcs615-tlmm-state:
type: object
description:
Pinctrl node's client devices use subnodes for desired pin configuration.
Client device subnodes use below standard properties.
$ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state
unevaluatedProperties: false
properties:
pins:
description:
List of gpio pins affected by the properties specified in this
subnode.
items:
oneOf:
- pattern: "^gpio([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-2])$"
- enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc1_rclk,
sdc2_clk, sdc2_cmd, sdc2_data, ufs_reset ]
minItems: 1
maxItems: 36
function:
description:
Specify the alternative function to be configured for the specified
pins.
enum: [ gpio, adsp_ext, agera_pll, aoss_cti, atest_char, atest_tsens,
atest_usb, cam_mclk, cci_async, cci_i2c, cci_timer, copy_gp,
copy_phase, cri_trng, dbg_out_clk, ddr_bist, ddr_pxi, dp_hot,
edp_hot, edp_lcd, emac_gcc, emac_phy_intr, forced_usb, gcc_gp,
gp_pdm, gps_tx, hs0_mi2s, hs1_mi2s, jitter_bist, ldo_en,
ldo_update, m_voc, mclk1, mclk2, mdp_vsync, mdp_vsync0_out,
mdp_vsync1_out, mdp_vsync2_out, mdp_vsync3_out, mdp_vsync4_out,
mdp_vsync5_out, mi2s_1, mss_lte, nav_pps_in, nav_pps_out,
pa_indicator_or, pcie_clk_req, pcie_ep_rst, phase_flag, pll_bist,
pll_bypassnl, pll_reset_n, prng_rosc, qdss_cti, qdss_gpio,
qlink_enable, qlink_request, qspi, qup0, qup1, rgmii,
sd_write_protect, sp_cmu, ter_mi2s, tgu_ch, uim1, uim2, usb0_hs,
usb1_hs, usb_phy_ps, vfr_1, vsense_trigger_mirnat, wlan, wsa_clk,
wsa_data ]
required:
- pins
required:
- compatible
- reg
- reg-names
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
tlmm: pinctrl@3000000 {
compatible = "qcom,qcs615-tlmm";
reg = <0x03100000 0x300000>,
<0x03500000 0x300000>,
<0x03c00000 0x300000>;
reg-names = "east", "west", "south";
interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
gpio-ranges = <&tlmm 0 0 123>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
qup3-uart2-state {
pins ="gpio16", "gpio17";
function = "qup0";
};
};
...

View File

@ -0,0 +1,118 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/qcom,qcs8300-tlmm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Technologies, Inc. QCS8300 TLMM block
maintainers:
- Jingyi Wang <quic_jingyw@quicinc.com>
description: |
Top Level Mode Multiplexer pin controller in Qualcomm QCS8300 SoC.
allOf:
- $ref: /schemas/pinctrl/qcom,tlmm-common.yaml#
properties:
compatible:
const: qcom,qcs8300-tlmm
reg:
maxItems: 1
interrupts:
maxItems: 1
gpio-reserved-ranges:
minItems: 1
maxItems: 67
gpio-line-names:
maxItems: 133
patternProperties:
"-state$":
oneOf:
- $ref: "#/$defs/qcom-qcs8300-tlmm-state"
- patternProperties:
"-pins$":
$ref: "#/$defs/qcom-qcs8300-tlmm-state"
additionalProperties: false
$defs:
qcom-qcs8300-tlmm-state:
type: object
description:
Pinctrl node's client devices use subnodes for desired pin configuration.
Client device subnodes use below standard properties.
$ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state
unevaluatedProperties: false
properties:
pins:
description:
List of gpio pins affected by the properties specified in this
subnode.
items:
oneOf:
- pattern: "^gpio([0-9]|[1-9][0-9]|1[0-2][0-9]|13[0-2])$"
- enum: [ ufs_reset, sdc1_rclk, sdc1_clk, sdc1_cmd, sdc1_data ]
minItems: 1
maxItems: 36
function:
description:
Specify the alternative function to be configured for the specified
pins.
enum: [ aoss_cti, atest_char, atest_usb2, audio_ref, cam_mclk,
cci_async, cci_i2c_scl, cci_i2c_sda, cci_timer, cri_trng,
dbg_out, ddr_bist, ddr_pxi0, ddr_pxi1, ddr_pxi2, ddr_pxi3,
edp0_hot, edp0_lcd, edp1_lcd, egpio, emac0_mcg0, emac0_mcg1,
emac0_mcg2, emac0_mcg3, emac0_mdc, emac0_mdio, emac0_ptp_aux,
emac0_ptp_pps, gcc_gp1, gcc_gp2, gcc_gp3, gcc_gp4, gcc_gp5,
gpio, hs0_mi2s, hs1_mi2s, hs2_mi2s, ibi_i3c, jitter_bist,
mdp0_vsync0, mdp0_vsync1, mdp0_vsync3, mdp0_vsync6, mdp0_vsync7,
mdp_vsync, mi2s1_data0, mi2s1_data1, mi2s1_sck, mi2s1_ws,
mi2s2_data0, mi2s2_data1, mi2s2_sck, mi2s2_ws, mi2s_mclk0,
mi2s_mclk1, pcie0_clkreq, pcie1_clkreq, phase_flag, pll_bist,
pll_clk, prng_rosc0, prng_rosc1, prng_rosc2, prng_rosc3,
qdss_cti, qdss_gpio, qup0_se0, qup0_se1, qup0_se2, qup0_se3,
qup0_se4, qup0_se5, qup0_se6, qup0_se7, qup1_se0, qup1_se1,
qup1_se2, qup1_se3, qup1_se4, qup1_se5, qup1_se6, qup1_se7,
qup2_se0, sailss_emac0, sailss_ospi, sail_top, sgmii_phy,
tb_trig, tgu_ch0, tgu_ch1, tgu_ch2, tgu_ch3, tsense_pwm1,
tsense_pwm2, tsense_pwm3, tsense_pwm4, usb2phy_ac,
vsense_trigger ]
required:
- pins
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
tlmm: pinctrl@f100000 {
compatible = "qcom,qcs8300-tlmm";
reg = <0x0f100000 0x300000>;
interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
gpio-controller;
#gpio-cells = <2>;
gpio-ranges = <&tlmm 0 0 133>;
interrupt-controller;
#interrupt-cells = <2>;
qup-uart7-state {
pins = "gpio43", "gpio44";
function = "qup0_se7";
};
};
...

View File

@ -17,7 +17,13 @@ allOf:
properties:
compatible:
const: qcom,sa8775p-tlmm
oneOf:
- items:
- enum:
- qcom,sa8255p-tlmm
- const: qcom,sa8775p-tlmm
- items:
- const: qcom,sa8775p-tlmm
reg:
maxItems: 1

View File

@ -0,0 +1,138 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/qcom,sar2130p-tlmm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Technologies, Inc. SAR2130P TLMM block
maintainers:
- Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
description:
Top Level Mode Multiplexer pin controller in Qualcomm SAR2130P SoC.
allOf:
- $ref: /schemas/pinctrl/qcom,tlmm-common.yaml#
properties:
compatible:
const: qcom,sar2130p-tlmm
reg:
maxItems: 1
interrupts:
maxItems: 1
gpio-reserved-ranges:
minItems: 1
maxItems: 78
gpio-line-names:
maxItems: 156
patternProperties:
"-state$":
oneOf:
- $ref: "#/$defs/qcom-sar2130p-tlmm-state"
- patternProperties:
"-pins$":
$ref: "#/$defs/qcom-sar2130p-tlmm-state"
additionalProperties: false
$defs:
qcom-sar2130p-tlmm-state:
type: object
description:
Pinctrl node's client devices use subnodes for desired pin configuration.
Client device subnodes use below standard properties.
$ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state
unevaluatedProperties: false
properties:
pins:
description:
List of gpio pins affected by the properties specified in this
subnode.
items:
oneOf:
- pattern: "^gpio([0-9]|[1-9][0-9]|1[0-4][0-9]|15[0-5])$"
- enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc1_rclk ]
minItems: 1
maxItems: 36
function:
description:
Specify the alternative function to be configured for the specified
pins.
enum: [ aoss_cti, atest_char, atest_char0, atest_char1, atest_char2,
atest_char3, atest_usb0, atest_usb00, atest_usb01, atest_usb02,
atest_usb03, audio_ref, cam_mclk, cci_async, cci_i2c,
cci_timer0, cci_timer1, cci_timer2, cci_timer3, cci_timer4,
cri_trng, cri_trng0, cri_trng1, dbg_out, ddr_bist, ddr_pxi0,
ddr_pxi1, ddr_pxi2, ddr_pxi3, dp0_hot, ext_mclk0, ext_mclk1,
gcc_gp1, gcc_gp2, gcc_gp3, gpio, host2wlan_sol, i2s0_data0,
i2s0_data1, i2s0_sck, i2s0_ws, ibi_i3c, jitter_bist, mdp_vsync,
mdp_vsync0, mdp_vsync1, mdp_vsync2, mdp_vsync3, pcie0_clkreqn,
pcie1_clkreqn, phase_flag0, phase_flag1, phase_flag10,
phase_flag11, phase_flag12, phase_flag13, phase_flag14,
phase_flag15, phase_flag16, phase_flag17, phase_flag18,
phase_flag19, phase_flag2, phase_flag20, phase_flag21,
phase_flag22, phase_flag23, phase_flag24, phase_flag25,
phase_flag26, phase_flag27, phase_flag28, phase_flag29,
phase_flag3, phase_flag30, phase_flag31, phase_flag4,
phase_flag5, phase_flag6, phase_flag7, phase_flag8,
phase_flag9, pll_bist, pll_clk, prng_rosc0, prng_rosc1,
prng_rosc2, prng_rosc3, qdss_cti, qdss_gpio, qdss_gpio0,
qdss_gpio1, qdss_gpio10, qdss_gpio11, qdss_gpio12, qdss_gpio13,
qdss_gpio14, qdss_gpio15, qdss_gpio2, qdss_gpio3, qdss_gpio4,
qdss_gpio5, qdss_gpio6, qdss_gpio7, qdss_gpio8, qdss_gpio9,
qspi0, qspi1, qspi2, qspi3, qspi_clk, qspi_cs0, qspi_cs1, qup0,
qup1, qup2, qup3, qup4, qup5, qup6, qup7, qup8, qup9, qup10,
qup11, tb_trig, tgu_ch0, tgu_ch1, tgu_ch2, tgu_ch3,
tmess_prng0, tmess_prng1, tmess_prng2, tmess_prng3,
tsense_pwm1, tsense_pwm2, usb0_phy, vsense_trigger ]
required:
- pins
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
pinctrl@f100000 {
compatible = "qcom,sar2130p-tlmm";
reg = <0x0f100000 0x300000>;
gpio-controller;
#gpio-cells = <2>;
gpio-ranges = <&tlmm 0 0 156>;
interrupt-controller;
#interrupt-cells = <2>;
interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
gpio-wo-state {
pins = "gpio1";
function = "gpio";
};
uart-w-state {
rx-pins {
pins = "gpio26";
function = "qup7";
bias-pull-up;
};
tx-pins {
pins = "gpio27";
function = "qup7";
bias-disable;
};
};
};
...

View File

@ -16,7 +16,11 @@ description:
properties:
compatible:
const: qcom,sm8650-lpass-lpi-pinctrl
oneOf:
- const: qcom,sm8650-lpass-lpi-pinctrl
- items:
- const: qcom,sm8750-lpass-lpi-pinctrl
- const: qcom,sm8650-lpass-lpi-pinctrl
reg:
items:

View File

@ -0,0 +1,138 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/qcom,sm8750-tlmm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Technologies, Inc. SM8750 TLMM block
maintainers:
- Melody Olvera <quic_molvera@quicinc.com>
description:
Top Level Mode Multiplexer pin controller in Qualcomm SM8750 SoC.
allOf:
- $ref: /schemas/pinctrl/qcom,tlmm-common.yaml#
properties:
compatible:
const: qcom,sm8750-tlmm
reg:
maxItems: 1
interrupts:
maxItems: 1
gpio-reserved-ranges:
minItems: 1
maxItems: 108
gpio-line-names:
maxItems: 215
patternProperties:
"-state$":
oneOf:
- $ref: "#/$defs/qcom-sm8750-tlmm-state"
- patternProperties:
"-pins$":
$ref: "#/$defs/qcom-sm8750-tlmm-state"
additionalProperties: false
$defs:
qcom-sm8750-tlmm-state:
type: object
description:
Pinctrl node's client devices use subnodes for desired pin configuration.
Client device subnodes use below standard properties.
$ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state
unevaluatedProperties: false
properties:
pins:
description:
List of gpio pins affected by the properties specified in this
subnode.
items:
oneOf:
- pattern: "^gpio([0-9]|[1-9][0-9]|1[0-9][0-9]|20[0-9]|21[0-4])$"
- enum: [ ufs_reset, sdc2_clk, sdc2_cmd, sdc2_data ]
minItems: 1
maxItems: 36
function:
description:
Specify the alternative function to be configured for the specified
pins.
enum: [ gpio, aoss_cti, atest_char, atest_usb, audio_ext_mclk0,
audio_ext_mclk1, audio_ref_clk, cam_aon_mclk2, cam_aon_mclk4,
cam_mclk, cci_async_in, cci_i2c_scl, cci_i2c_sda, cci_timer,
cmu_rng, coex_uart1_rx, coex_uart1_tx, coex_uart2_rx,
coex_uart2_tx, dbg_out_clk, ddr_bist_complete, ddr_bist_fail,
ddr_bist_start, ddr_bist_stop, ddr_pxi0, ddr_pxi1, ddr_pxi2,
ddr_pxi3, dp_hot, egpio, gcc_gp1, gcc_gp2, gcc_gp3, gnss_adc0,
gnss_adc1, i2chub0_se0, i2chub0_se1, i2chub0_se2, i2chub0_se3,
i2chub0_se4, i2chub0_se5, i2chub0_se6, i2chub0_se7, i2chub0_se8,
i2chub0_se9, i2s0_data0, i2s0_data1, i2s0_sck, i2s0_ws,
i2s1_data0, i2s1_data1, i2s1_sck, i2s1_ws, ibi_i3c, jitter_bist,
mdp_esync0_out, mdp_esync1_out, mdp_vsync, mdp_vsync0_out,
mdp_vsync1_out, mdp_vsync2_out, mdp_vsync3_out, mdp_vsync5_out,
mdp_vsync_e, nav_gpio0, nav_gpio1, nav_gpio2, nav_gpio3,
pcie0_clk_req_n, phase_flag, pll_bist_sync, pll_clk_aux,
prng_rosc0, prng_rosc1, prng_rosc2, prng_rosc3, qdss_cti,
qlink_big_enable, qlink_big_request, qlink_little_enable,
qlink_little_request, qlink_wmss, qspi0, qspi1, qspi2, qspi3,
qspi_clk, qspi_cs, qup1_se0, qup1_se1, qup1_se2, qup1_se3,
qup1_se4, qup1_se5, qup1_se6, qup1_se7, qup2_se0, qup2_se1,
qup2_se2, qup2_se3, qup2_se4, qup2_se5, qup2_se6, qup2_se7,
sd_write_protect, sdc40, sdc41, sdc42, sdc43, sdc4_clk,
sdc4_cmd, tb_trig_sdc2, tb_trig_sdc4, tmess_prng0, tmess_prng1,
tmess_prng2, tmess_prng3, tsense_pwm1, tsense_pwm2, tsense_pwm3,
tsense_pwm4, uim0_clk, uim0_data, uim0_present, uim0_reset,
uim1_clk, uim1_data, uim1_present, uim1_reset, usb1_hs, usb_phy,
vfr_0, vfr_1, vsense_trigger_mirnat, wcn_sw, wcn_sw_ctrl ]
required:
- pins
required:
- compatible
- reg
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
tlmm: pinctrl@f100000 {
compatible = "qcom,sm8750-tlmm";
reg = <0x0f100000 0x300000>;
gpio-controller;
#gpio-cells = <2>;
gpio-ranges = <&tlmm 0 0 216>;
interrupt-controller;
#interrupt-cells = <2>;
interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
gpio-wo-state {
pins = "gpio1";
function = "gpio";
};
uart-w-state {
rx-pins {
pins = "gpio60";
function = "qup1_se7";
bias-pull-up;
};
tx-pins {
pins = "gpio61";
function = "qup1_se7";
bias-disable;
};
};
};
...

View File

@ -119,6 +119,10 @@ additionalProperties:
bias-disable: true
bias-pull-down: true
bias-pull-up: true
input-schmitt-enable: true
input-schmitt-disable: true
drive-open-drain: true
drive-push-pull: true
renesas,output-impedance:
description:
Output impedance for pins on the RZ/V2H(P) SoC. The value provided by this

View File

@ -42,10 +42,13 @@ properties:
- samsung,exynos5433-wakeup-eint
- samsung,exynos7885-wakeup-eint
- samsung,exynos850-wakeup-eint
- samsung,exynos8895-wakeup-eint
- const: samsung,exynos7-wakeup-eint
- items:
- enum:
- google,gs101-wakeup-eint
- samsung,exynos9810-wakeup-eint
- samsung,exynos990-wakeup-eint
- samsung,exynosautov9-wakeup-eint
- const: samsung,exynos850-wakeup-eint
- const: samsung,exynos7-wakeup-eint
@ -91,14 +94,18 @@ allOf:
- if:
properties:
compatible:
# Match without "contains", to skip newer variants which are still
# compatible with samsung,exynos7-wakeup-eint
enum:
- samsung,s5pv210-wakeup-eint
- samsung,exynos4210-wakeup-eint
- samsung,exynos5433-wakeup-eint
- samsung,exynos7-wakeup-eint
- samsung,exynos7885-wakeup-eint
oneOf:
# Match without "contains", to skip newer variants which are still
# compatible with samsung,exynos7-wakeup-eint
- enum:
- samsung,exynos4210-wakeup-eint
- samsung,exynos7-wakeup-eint
- samsung,s5pv210-wakeup-eint
- contains:
enum:
- samsung,exynos5433-wakeup-eint
- samsung,exynos7885-wakeup-eint
- samsung,exynos8895-wakeup-eint
then:
properties:
interrupts:

View File

@ -53,6 +53,9 @@ properties:
- samsung,exynos7-pinctrl
- samsung,exynos7885-pinctrl
- samsung,exynos850-pinctrl
- samsung,exynos8895-pinctrl
- samsung,exynos9810-pinctrl
- samsung,exynos990-pinctrl
- samsung,exynosautov9-pinctrl
- samsung,exynosautov920-pinctrl
- tesla,fsd-pinctrl

View File

@ -26,6 +26,10 @@ properties:
reg:
maxItems: 1
gpio-line-names:
minItems: 5
maxItems: 17
interrupts:
maxItems: 1
@ -87,6 +91,45 @@ required:
allOf:
- $ref: pinctrl.yaml#
- if:
properties:
compatible:
contains:
enum:
- semtech,sx1501q
- semtech,sx1504q
- semtech,sx1507q
then:
properties:
gpio-line-names:
minItems: 5
maxItems: 5
- if:
properties:
compatible:
contains:
enum:
- semtech,sx1502q
- semtech,sx1505q
- semtech,sx1508q
then:
properties:
gpio-line-names:
minItems: 9
maxItems: 9
- if:
properties:
compatible:
contains:
enum:
- semtech,sx1503q
- semtech,sx1506q
- semtech,sx1509q
then:
properties:
gpio-line-names:
minItems: 17
maxItems: 17
- if:
not:
properties:

View File

@ -58,7 +58,7 @@ patternProperties:
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
node apply to. This should be set using the PINMUX or PINMUX2
macro.
bias-pull-up:

View File

@ -0,0 +1,124 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/spacemit,k1-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: SpacemiT K1 SoC Pin Controller
maintainers:
- Yixun Lan <dlan@gentoo.org>
properties:
compatible:
const: spacemit,k1-pinctrl
reg:
items:
- description: pinctrl io memory base
patternProperties:
'-cfg$':
type: object
additionalProperties: false
description:
A pinctrl node should contain at least one subnode representing the
pinctrl groups available on the machine.
patternProperties:
'-pins$':
type: object
additionalProperties: false
description:
Each subnode will list the pins it needs, and how they should
be configured, with regard to muxer configuration, bias pull,
drive strength, input schmitt trigger, slew rate, power source.
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 K1_PADCONF macro to
construct the value.
bias-disable: true
bias-pull-down: true
bias-pull-up:
description: |
typical value for selecting bias pull up or strong pull up.
0: normal bias pull up
1: strong bias pull up
enum: [ 0, 1 ]
drive-strength:
description: |
typical current when output high level.
1.8V output: 11, 21, 32, 42 (mA)
3.3V output: 7, 10, 13, 16, 19, 23, 26, 29 (mA)
input-schmitt:
description: |
typical threshold for schmitt trigger.
0: buffer mode
1: trigger mode
2, 3: trigger mode
$ref: /schemas/types.yaml#/definitions/uint32
enum: [ 0, 1, 2, 3 ]
power-source:
description: external power supplies at 1.8v or 3.3v.
enum: [ 1800, 3300 ]
slew-rate:
description: |
slew rate for output buffer.
0: disable it
1: enable it (via bundled value from drive strength)
2: slow speed 0
3: slow speed 1
4: medium speed
5: fast speed
enum: [ 0, 1, 2, 3, 4, 5 ]
required:
- pinmux
required:
- compatible
- reg
additionalProperties: false
examples:
- |
#define K1_PADCONF(pin, func) (((pin) << 16) | (func))
soc {
#address-cells = <2>;
#size-cells = <2>;
pinctrl@d401e000 {
compatible = "spacemit,k1-pinctrl";
reg = <0x0 0xd401e000 0x0 0x400>;
uart0_2_cfg: uart0-2-cfg {
uart0-2-pins {
pinmux = <K1_PADCONF(68, 2)>,
<K1_PADCONF(69, 2)>;
bias-pull-up = <0>;
drive-strength = <32>;
};
};
};
};
...

View File

@ -0,0 +1,176 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/thead,th1520-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: T-Head TH1520 SoC pin controller
maintainers:
- Emil Renner Berthing <emil.renner.berthing@canonical.com>
description: |
Pinmux and pinconf controller in the T-Head TH1520 RISC-V SoC.
The TH1520 has 3 groups of pads each controlled from different memory ranges.
Confusingly the memory ranges are named
PADCTRL_AOSYS -> PAD Group 1
PADCTRL1_APSYS -> PAD Group 2
PADCTRL0_APSYS -> PAD Group 3
Each pad can be muxed individually to up to 6 different functions. For most
pads only a few of those 6 configurations are valid though, and a few pads in
group 1 does not support muxing at all.
Pinconf is fairly regular except for a few pads in group 1 that either can't
be configured or has some special functions. The rest have configurable drive
strength, input enable, schmitt trigger, slew rate, pull-up and pull-down in
addition to a special strong pull up.
Certain pads in group 1 can be muxed to AUDIO_PA0 - AUDIO_PA30 functions and
are then meant to be used by the audio co-processor. Each such pad can then
be further muxed to either audio GPIO or one of 4 functions such as UART, I2C
and I2S. If the audio pad is muxed to one of the 4 functions then pinconf is
also configured in different registers. All of this is done from a different
AUDIO_IOCTRL memory range and is left to the audio co-processor for now.
properties:
compatible:
enum:
- thead,th1520-pinctrl
reg:
maxItems: 1
clocks:
maxItems: 1
thead,pad-group:
description: |
Select the pad group that is associated with the pin controller instance.
Base Address Name Group
0xFF_FFF4_A000 PADCTRL_AOSYS 1
0xFF_E7F3_C000 PADCTRL1_APSYS 2
0xFF_EC00_7000 PADCTRL0_APSYS 3
$ref: /schemas/types.yaml#/definitions/uint32
enum: [1, 2, 3]
required:
- compatible
- reg
- clocks
patternProperties:
'-[0-9]+$':
type: object
additionalProperties: false
patternProperties:
'-pins$':
type: object
allOf:
- $ref: /schemas/pinctrl/pincfg-node.yaml#
- $ref: /schemas/pinctrl/pinmux-node.yaml#
additionalProperties: false
description:
A pinctrl node should contain at least one subnode describing one
or more pads and their associated pinmux and pinconf settings.
properties:
pins:
description: List of pads that properties in the node apply to.
function:
enum: [ gpio, pwm, uart, ir, i2c, spi, qspi, sdio, audio, i2s,
gmac0, gmac1, dpu0, dpu1, isp, hdmi, bootsel, debug,
clock, jtag, iso7816, efuse, reset ]
description: The mux function to select for the given pins.
bias-disable: true
bias-pull-up:
oneOf:
- type: boolean
description: Enable the regular 48kOhm pull-up
- enum: [ 2100, 48000 ]
description: Enable the strong 2.1kOhm pull-up or regular 48kOhm pull-up
bias-pull-down:
oneOf:
- type: boolean
- const: 44000
description: Enable the regular 44kOhm pull-down
drive-strength:
enum: [ 1, 2, 3, 5, 7, 8, 10, 12, 13, 15, 16, 18, 20, 21, 23, 25 ]
description: Drive strength in mA
input-enable: true
input-disable: true
input-schmitt-enable: true
input-schmitt-disable: true
slew-rate:
maximum: 1
required:
- pins
additionalProperties: false
examples:
- |
padctrl0_apsys: pinctrl@ec007000 {
compatible = "thead,th1520-pinctrl";
reg = <0xec007000 0x1000>;
clocks = <&apb_clk>;
thead,pad-group = <3>;
uart0_pins: uart0-0 {
tx-pins {
pins = "UART0_TXD";
function = "uart";
bias-disable;
drive-strength = <3>;
input-disable;
input-schmitt-disable;
slew-rate = <0>;
};
rx-pins {
pins = "UART0_RXD";
function = "uart";
bias-disable;
drive-strength = <1>;
input-enable;
input-schmitt-enable;
slew-rate = <0>;
};
};
};
padctrl1_apsys: pinctrl@e7f3c000 {
compatible = "thead,th1520-pinctrl";
reg = <0xe7f3c000 0x1000>;
clocks = <&apb_clk>;
thead,pad-group = <2>;
i2c5_pins: i2c5-0 {
i2c-pins {
pins = "QSPI1_CSN0", /* I2C5_SCL */
"QSPI1_D0_MOSI"; /* I2C5_SDA */
function = "i2c";
bias-pull-up = <2100>;
drive-strength = <7>;
input-enable;
input-schmitt-enable;
slew-rate = <0>;
};
};
};

View File

@ -0,0 +1,278 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/xlnx,versal-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Xilinx Versal Pinctrl
maintainers:
- Sai Krishna Potthuri <sai.krishna.potthuri@amd.com>
description: |
Please refer to pinctrl-bindings.txt in this directory for details of the
common pinctrl bindings used by client devices, including the meaning of the
phrase "pin configuration node".
Versal's pin configuration nodes act as a container for an arbitrary number of
subnodes. Each of these subnodes represents some desired configuration for a
pin, a group, or a list of pins or groups. This configuration can include the
mux function to select on those pin(s)/group(s), and various pin configuration
parameters, such as pull-up, slew rate, etc.
Each configuration node can consist of multiple nodes describing the pinmux and
pinconf options. Those nodes can be pinmux nodes or pinconf nodes.
properties:
compatible:
const: xlnx,versal-pinctrl
patternProperties:
'^(.*-)?(default|gpio-grp)$':
type: object
patternProperties:
'^mux':
type: object
description:
Pinctrl node's client devices use subnodes for pin muxes,
which in turn use below standard properties.
$ref: pinmux-node.yaml#
properties:
pins:
description:
List of pins to select (either this or "groups" must be specified)
$ref: "#/$defs/pins/properties/pins"
groups:
description:
List of groups to select (either this or "pins" must be
specified), available groups for this subnode.
anyOf:
- pattern: '^((LPD|PMC)_)MIO([0-9]|[1-6][0-9]|7[0-7])$'
- $ref: "#/$defs/pins/properties/groups"
function:
description:
Specify the alternative function to be configured for the
given pin groups.
enum: [spi0, spi0_ss, spi1, spi1_ss, can0, can1, i2c0, i2c1, i2c_pmc, ttc0_clk,
ttc0_wav, ttc1_clk, ttc1_wav, ttc2_clk, ttc2_wav, ttc3_clk, ttc3_wav, wwdt0,
wwdt1, sysmon_i2c0, sysmon_i2c0_alrt, uart0, uart0_ctrl, uart1, uart1_ctrl,
gpio0, gpio1, gpio2, emio0, gem0, gem1, trace0, trace0_clk, mdio0, mdio1, gem_tsu0,
pcie0, smap0, usb0, sd0, sd0_pc, sd0_cd, sd0_wp, sd1, sd1_pc, sd1_wp, sd1_cd,
ospi0, ospi0_ss, qspi0, qspi0_fbclk, qspi0_ss, test_clk, test_scan, tamper_trigger]
required:
- function
oneOf:
- required: [ groups ]
- required: [ pins ]
additionalProperties: false
'^conf':
type: object
description:
Pinctrl node's client devices use subnodes for pin configurations,
which in turn use the standard properties below.
allOf:
- $ref: pincfg-node.yaml#
- $ref: "#/$defs/pins"
additionalProperties: false
allOf:
- $ref: pinctrl.yaml#
required:
- compatible
additionalProperties: false
$defs:
pins:
properties:
groups:
description:
List of pin groups to select in this subnode.
items:
enum: [spi0_0_grp, spi0_1_grp, spi0_2_grp, spi0_3_grp, spi0_4_grp, spi0_5_grp,
spi0_ss_0_grp, spi0_ss_1_grp, spi0_ss_2_grp, spi0_ss_3_grp, spi0_ss_4_grp,
spi0_ss_5_grp, spi0_ss_6_grp, spi0_ss_7_grp, spi0_ss_8_grp, spi0_ss_9_grp,
spi0_ss_10_grp, spi0_ss_11_grp, spi0_ss_12_grp, spi0_ss_13_grp, spi0_ss_14_grp,
spi0_ss_15_grp, spi0_ss_16_grp, spi0_ss_17_grp, spi1_0_grp, spi1_1_grp,
spi1_2_grp, spi1_3_grp, spi1_4_grp, spi1_5_grp, spi1_ss_0_grp, spi1_ss_1_grp,
spi1_ss_2_grp, spi1_ss_3_grp, spi1_ss_4_grp, spi1_ss_5_grp, spi1_ss_6_grp,
spi1_ss_7_grp, spi1_ss_8_grp, spi1_ss_9_grp, spi1_ss_10_grp, spi1_ss_11_grp,
spi1_ss_12_grp, spi1_ss_13_grp, spi1_ss_14_grp, spi1_ss_15_grp, spi1_ss_16_grp
spi1_ss_17_grp, can0_0_grp, can0_1_grp, can0_2_grp, can0_3_grp, can0_4_grp,
can0_5_grp, can0_6_grp, can0_7_grp, can0_8_grp, can0_9_grp, can0_10_grp,
can0_11_grp, can0_12_grp, can0_13_grp, can0_14_grp, can0_15_grp, can0_16_grp,
can0_17_grp, can1_0_grp, can1_1_grp, can1_2_grp, can1_3_grp, can1_4_grp,
can1_5_grp, can1_6_grp, can1_7_grp, can1_8_grp, can1_9_grp, can1_10_grp,
can1_11_grp, can1_12_grp, can1_13_grp, can1_14_grp, can1_15_grp, can1_16_grp,
can1_17_grp, can1_18_grp, i2c0_0_grp, i2c0_1_grp, i2c0_2_grp, i2c0_3_grp,
i2c0_4_grp, i2c0_5_grp, i2c0_6_grp, i2c0_7_grp, i2c0_8_grp, i2c0_9_grp,
i2c0_10_grp, i2c0_11_grp, i2c0_12_grp, i2c0_13_grp, i2c0_14_grp, i2c0_15_grp,
i2c0_16_grp, i2c0_17_grp, i2c1_0_grp, i2c1_1_grp, i2c1_2_grp, i2c1_3_grp,
i2c1_4_grp, i2c1_5_grp, i2c1_6_grp, i2c1_7_grp, i2c1_8_grp, i2c1_9_grp,
i2c1_10_grp, i2c1_11_grp, i2c1_12_grp, i2c1_13_grp, i2c1_14_grp, i2c1_15_grp,
i2c1_16_grp, i2c1_17_grp, i2c1_18_grp, i2c_pmc_0_grp, i2c_pmc_1_grp,
i2c_pmc_2_grp, i2c_pmc_3_grp, i2c_pmc_4_grp, i2c_pmc_5_grp, i2c_pmc_6_grp,
i2c_pmc_7_grp, i2c_pmc_8_grp, i2c_pmc_9_grp, i2c_pmc_10_grp, i2c_pmc_11_grp,
i2c_pmc_12_grp, ttc0_clk_0_grp, ttc0_clk_1_grp, ttc0_clk_2_grp, ttc0_clk_3_grp,
ttc0_clk_4_grp, ttc0_clk_5_grp, ttc0_clk_6_grp, ttc0_clk_7_grp, ttc0_clk_8_grp,
ttc0_wav_0_grp, ttc0_wav_1_grp, ttc0_wav_2_grp, ttc0_wav_3_grp, ttc0_wav_4_grp,
ttc0_wav_5_grp, ttc0_wav_6_grp, ttc0_wav_7_grp, ttc0_wav_8_grp, ttc1_clk_0_grp,
ttc1_clk_1_grp, ttc1_clk_2_grp, ttc1_clk_3_grp, ttc1_clk_4_grp, ttc1_clk_5_grp,
ttc1_clk_6_grp, ttc1_clk_7_grp, ttc1_clk_8_grp, ttc1_wav_0_grp, ttc1_wav_1_grp,
ttc1_wav_2_grp, ttc1_wav_3_grp, ttc1_wav_4_grp, ttc1_wav_5_grp, ttc1_wav_6_grp,
ttc1_wav_7_grp, ttc1_wav_8_grp, ttc2_clk_0_grp, ttc2_clk_1_grp, ttc2_clk_2_grp,
ttc2_clk_3_grp, ttc2_clk_4_grp, ttc2_clk_5_grp, ttc2_clk_6_grp, ttc2_clk_7_grp,
ttc2_clk_8_grp, ttc2_wav_0_grp, ttc2_wav_1_grp, ttc2_wav_2_grp, ttc2_wav_3_grp,
ttc2_wav_4_grp, ttc2_wav_5_grp, ttc2_wav_6_grp, ttc2_wav_7_grp, ttc2_wav_8_grp,
ttc3_clk_0_grp, ttc3_clk_1_grp, ttc3_clk_2_grp, ttc3_clk_3_grp, ttc3_clk_4_grp,
ttc3_clk_5_grp, ttc3_clk_6_grp, ttc3_clk_7_grp, ttc3_clk_8_grp, ttc3_wav_0_grp,
ttc3_wav_1_grp, ttc3_wav_2_grp, ttc3_wav_3_grp, ttc3_wav_4_grp, ttc3_wav_5_grp,
ttc3_wav_6_grp, ttc3_wav_7_grp, ttc3_wav_8_grp, wwdt0_0_grp, wwdt0_1_grp,
wwdt0_2_grp, wwdt0_3_grp, wwdt0_4_grp, wwdt0_5_grp, wwdt1_0_grp, wwdt1_1_grp,
wwdt1_2_grp, wwdt1_3_grp, wwdt1_4_grp, wwdt1_5_grp, sysmon_i2c0_0_grp,
sysmon_i2c0_1_grp, sysmon_i2c0_2_grp, sysmon_i2c0_3_grp, sysmon_i2c0_4_grp,
sysmon_i2c0_5_grp, sysmon_i2c0_6_grp, sysmon_i2c0_7_grp, sysmon_i2c0_8_grp,
sysmon_i2c0_9_grp, sysmon_i2c0_10_grp, sysmon_i2c0_11_grp, sysmon_i2c0_12_grp,
sysmon_i2c0_13_grp, sysmon_i2c0_14_grp, sysmon_i2c0_15_grp,
sysmon_i2c0_16_grp, sysmon_i2c0_17_grp, sysmon_i2c0_alrt_0_grp,
sysmon_i2c0_alrt_1_grp, sysmon_i2c0_alrt_2_grp, sysmon_i2c0_alrt_3_grp,
sysmon_i2c0_alrt_4_grp, sysmon_i2c0_alrt_5_grp, sysmon_i2c0_alrt_6_grp,
sysmon_i2c0_alrt_7_grp, sysmon_i2c0_alrt_8_grp, sysmon_i2c0_alrt_9_grp,
sysmon_i2c0_alrt_10_grp, sysmon_i2c0_alrt_11_grp, sysmon_i2c0_alrt_12_grp,
sysmon_i2c0_alrt_13_grp, sysmon_i2c0_alrt_14_grp, sysmon_i2c0_alrt_15_grp,
sysmon_i2c0_alrt_16_grp, sysmon_i2c0_alrt_17_grp, uart0_0_grp, uart0_1_grp,
uart0_2_grp, uart0_3_grp, uart0_4_grp, uart0_5_grp, uart0_6_grp, uart0_7_grp,
uart0_8_grp, uart0_ctrl_0_grp, uart0_ctrl_1_grp, uart0_ctrl_2_grp,
uart0_ctrl_3_grp, uart0_ctrl_4_grp, uart0_ctrl_5_grp, uart0_ctrl_6_grp,
uart0_ctrl_7_grp, uart0_ctrl_8_grp, uart1_0_grp, uart1_1_grp, uart1_2_grp,
uart1_3_grp, uart1_4_grp, uart1_5_grp, uart1_6_grp, uart1_7_grp, uart1_8_grp,
uart1_ctrl_0_grp, uart1_ctrl_1_grp, uart1_ctrl_2_grp, uart1_ctrl_3_grp,
uart1_ctrl_4_grp, uart1_ctrl_5_grp, uart1_ctrl_6_grp, uart1_ctrl_7_grp,
uart1_ctrl_8_grp, gpio0_0_grp, gpio0_1_grp, gpio0_2_grp, gpio0_3_grp,
gpio0_4_grp, gpio0_5_grp, gpio0_6_grp, gpio0_7_grp, gpio0_8_grp, gpio0_9_grp,
gpio0_10_grp, gpio0_11_grp, gpio0_12_grp, gpio0_13_grp, gpio0_14_grp,
gpio0_15_grp, gpio0_16_grp, gpio0_17_grp, gpio0_18_grp, gpio0_19_grp,
gpio0_20_grp, gpio0_21_grp, gpio0_22_grp, gpio0_23_grp, gpio0_24_grp,
gpio0_25_grp, gpio1_0_grp, gpio1_1_grp, gpio1_2_grp, gpio1_3_grp, gpio1_4_grp,
gpio1_5_grp, gpio1_6_grp, gpio1_7_grp, gpio1_8_grp, gpio1_9_grp,
gpio1_10_grp, gpio1_11_grp, gpio1_12_grp, gpio1_13_grp, gpio1_14_grp,
gpio1_15_grp, gpio1_16_grp, gpio1_17_grp, gpio1_18_grp, gpio1_19_grp,
gpio1_20_grp, gpio1_21_grp, gpio1_22_grp, gpio1_23_grp, gpio1_24_grp,
gpio1_25_grp, gpio2_0_grp, gpio2_1_grp, gpio2_2_grp, gpio2_3_grp, gpio2_4_grp,
gpio2_5_grp, gpio2_6_grp, gpio2_7_grp, gpio2_8_grp, gpio2_9_grp, gpio2_10_grp,
gpio2_11_grp, gpio2_12_grp, gpio2_13_grp, gpio2_14_grp, gpio2_15_grp,
gpio2_16_grp, gpio2_17_grp, gpio2_18_grp, gpio2_19_grp, gpio2_20_grp,
gpio2_21_grp, gpio2_22_grp, gpio2_23_grp, gpio2_24_grp, gpio2_25_grp,
emio0_0_grp, emio0_1_grp, emio0_2_grp, emio0_3_grp, emio0_4_grp, emio0_5_grp,
emio0_6_grp, emio0_7_grp, emio0_8_grp, emio0_9_grp, emio0_10_grp,
emio0_11_grp, emio0_12_grp, emio0_13_grp, emio0_14_grp, emio0_15_grp,
emio0_16_grp, emio0_17_grp, emio0_18_grp, emio0_19_grp, emio0_20_grp,
emio0_21_grp, emio0_22_grp, emio0_23_grp, emio0_24_grp, emio0_25_grp,
emio0_26_grp, emio0_27_grp, emio0_28_grp, emio0_29_grp, emio0_30_grp,
emio0_31_grp, emio0_32_grp, emio0_33_grp, emio0_34_grp, emio0_35_grp,
emio0_36_grp, emio0_37_grp, emio0_38_grp, emio0_39_grp, emio0_40_grp,
emio0_41_grp, emio0_42_grp, emio0_43_grp, emio0_44_grp, emio0_45_grp,
emio0_46_grp, emio0_47_grp, emio0_48_grp, emio0_49_grp, emio0_50_grp,
emio0_51_grp, emio0_52_grp, emio0_53_grp, emio0_54_grp, emio0_55_grp,
emio0_56_grp, emio0_57_grp, emio0_58_grp, emio0_59_grp, emio0_60_grp,
emio0_61_grp, emio0_62_grp, emio0_63_grp, emio0_64_grp, emio0_65_grp,
emio0_66_grp, emio0_67_grp, emio0_68_grp, emio0_69_grp, emio0_70_grp,
emio0_71_grp, emio0_72_grp, emio0_73_grp, emio0_74_grp, emio0_75_grp,
emio0_76_grp, emio0_77_grp, gem0_0_grp, gem0_1_grp, gem1_0_grp, gem1_1_grp,
trace0_0_grp, trace0_1_grp, trace0_2_grp, trace0_clk_0_grp, trace0_clk_1_grp,
trace0_clk_2_grp, mdio0_0_grp, mdio0_1_grp, mdio1_0_grp, mdio1_1_grp,
gem_tsu0_0_grp, gem_tsu0_1_grp, gem_tsu0_2_grp, gem_tsu0_3_grp, pcie0_0_grp,
pcie0_1_grp, pcie0_2_grp, smap0_0_grp, usb0_0_grp, sd0_0_grp, sd0_1_grp,
sd0_2_grp, sd0_3_grp, sd0_4_grp, sd0_5_grp, sd0_6_grp, sd0_7_grp, sd0_8_grp,
sd0_9_grp, sd0_10_grp, sd0_11_grp, sd0_12_grp, sd0_13_grp, sd0_14_grp,
sd0_15_grp, sd0_16_grp, sd0_17_grp, sd0_18_grp, sd0_19_grp, sd0_20_grp,
sd0_21_grp, sd0_pc_0_grp, sd0_pc_1_grp, sd0_cd_0_grp, sd0_cd_1_grp,
sd0_wp_0_grp, sd0_wp_1_grp, sd1_0_grp, sd1_1_grp, sd1_2_grp, sd1_3_grp,
sd1_4_grp, sd1_5_grp, sd1_6_grp, sd1_7_grp, sd1_8_grp, sd1_9_grp, sd1_10_grp,
sd1_11_grp, sd1_12_grp, sd1_13_grp, sd1_14_grp, sd1_15_grp, sd1_16_grp,
sd1_17_grp, sd1_18_grp, sd1_19_grp, sd1_20_grp, sd1_21_grp, sd1_pc_0_grp,
sd1_pc_1_grp, sd1_cd_0_grp, sd1_cd_1_grp, sd1_wp_0_grp, sd1_wp_1_grp,
ospi0_0_grp, ospi0_ss_0_grp, qspi0_0_grp, qspi0_fbclk_0_grp, qspi0_ss_0_grp,
test_clk_0_grp, test_scan_0_grp, tamper_trigger_0_grp]
minItems: 1
maxItems: 78
pins:
description:
List of pin names to select in this subnode.
items:
pattern: '^((LPD|PMC)_)MIO([0-9]|[1-6][0-9]|7[0-7])$'
minItems: 1
maxItems: 78
bias-pull-up: true
bias-pull-down: true
bias-disable: true
input-schmitt-enable: true
input-schmitt-disable: true
bias-high-impedance: true
low-power-enable: true
low-power-disable: true
slew-rate:
enum: [0, 1]
output-enable:
description:
This will internally disable the tri-state for MIO pins.
drive-strength:
description:
Selects the drive strength for MIO pins, in mA.
enum: [2, 4, 8, 12]
power-source:
enum: [0, 1]
oneOf:
- required: [ groups ]
- required: [ pins ]
additionalProperties: false
examples:
- |
#include <dt-bindings/pinctrl/pinctrl-zynqmp.h>
pinctrl {
compatible = "xlnx,versal-pinctrl";
uart0-default {
mux {
groups = "uart0_4_grp", "uart0_5_grp";
function = "uart0";
};
conf {
groups = "uart0_4_grp";
slew-rate = <SLEW_RATE_SLOW>;
power-source = <IO_STANDARD_LVCMOS18>;
};
conf-rx {
pins = "PMC_MIO42";
bias-pull-up;
};
conf-tx {
pins = "PMC_MIO43";
bias-disable;
input-schmitt-disable;
};
};
};
...

View File

@ -0,0 +1,34 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pwm/airoha,en7581-pwm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Airoha EN7581 PWM Controller
maintainers:
- Lorenzo Bianconi <lorenzo@kernel.org>
allOf:
- $ref: pwm.yaml#
properties:
compatible:
const: airoha,en7581-pwm
"#pwm-cells":
const: 3
required:
- compatible
- "#pwm-cells"
additionalProperties: false
examples:
- |
pwm {
compatible = "airoha,en7581-pwm";
#pwm-cells = <3>;
};

View File

@ -18315,6 +18315,13 @@ F: drivers/pinctrl/
F: include/dt-bindings/pinctrl/
F: include/linux/pinctrl/
PIN CONTROLLER - AIROHA
M: Lorenzo Bianconi <lorenzo@kernel.org>
L: linux-mediatek@lists.infradead.org (moderated for non-subscribers)
S: Maintained
F: Documentation/devicetree/bindings/pinctrl/airoha,en7581-pinctrl.yaml
F: drivers/pinctrl/mediatek/pinctrl-airoha.c
PIN CONTROLLER - AMD
M: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
M: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
@ -20073,9 +20080,11 @@ S: Maintained
T: git https://github.com/pdp7/linux.git
F: Documentation/devicetree/bindings/clock/thead,th1520-clk-ap.yaml
F: Documentation/devicetree/bindings/net/thead,th1520-gmac.yaml
F: Documentation/devicetree/bindings/pinctrl/thead,th1520-pinctrl.yaml
F: arch/riscv/boot/dts/thead/
F: drivers/clk/thead/clk-th1520-ap.c
F: drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c
F: drivers/pinctrl/pinctrl-th1520.c
F: include/dt-bindings/clock/thead,th1520-clk-ap.h
RNBD BLOCK DRIVERS

View File

@ -6,7 +6,6 @@ menuconfig ARCH_MXC
select CLKSRC_IMX_GPT
select GENERIC_IRQ_CHIP
select GPIOLIB
select PINCTRL
select PM_OPP if PM
select SOC_BUS
select SRAM
@ -49,7 +48,6 @@ config SOC_IMX31
config SOC_IMX35
bool "i.MX35 support"
select MXC_AVIC
select PINCTRL_IMX35
help
This enables support for Freescale i.MX35 processor
@ -61,7 +59,6 @@ config SOC_IMX1
bool "i.MX1 support"
select CPU_ARM920T
select MXC_AVIC
select PINCTRL_IMX1
help
This enables support for Freescale i.MX1 processor
@ -73,7 +70,6 @@ config SOC_IMX25
bool "i.MX25 support"
select CPU_ARM926T
select MXC_AVIC
select PINCTRL_IMX25
help
This enables support for Freescale i.MX25 processor
@ -81,7 +77,6 @@ config SOC_IMX27
bool "i.MX27 support"
select CPU_ARM926T
select MXC_AVIC
select PINCTRL_IMX27
help
This enables support for Freescale i.MX27 processor
@ -98,7 +93,6 @@ config SOC_IMX5
config SOC_IMX50
bool "i.MX50 support"
select PINCTRL_IMX50
select SOC_IMX5
help
@ -106,14 +100,12 @@ config SOC_IMX50
config SOC_IMX51
bool "i.MX51 support"
select PINCTRL_IMX51
select SOC_IMX5
help
This enables support for Freescale i.MX51 processor
config SOC_IMX53
bool "i.MX53 support"
select PINCTRL_IMX53
select SOC_IMX5
help
@ -137,7 +129,6 @@ config SOC_IMX6Q
select ARM_ERRATA_775420
select HAVE_ARM_SCU if SMP
select HAVE_ARM_TWD
select PINCTRL_IMX6Q
select SOC_IMX6
help
@ -147,7 +138,6 @@ config SOC_IMX6SL
bool "i.MX6 SoloLite support"
select ARM_ERRATA_754322
select ARM_ERRATA_775420
select PINCTRL_IMX6SL
select SOC_IMX6
help
@ -157,7 +147,6 @@ config SOC_IMX6SLL
bool "i.MX6 SoloLiteLite support"
select ARM_ERRATA_754322
select ARM_ERRATA_775420
select PINCTRL_IMX6SLL
select SOC_IMX6
help
@ -167,7 +156,6 @@ config SOC_IMX6SX
bool "i.MX6 SoloX support"
select ARM_ERRATA_754322
select ARM_ERRATA_775420
select PINCTRL_IMX6SX
select SOC_IMX6
help
@ -175,7 +163,6 @@ config SOC_IMX6SX
config SOC_IMX6UL
bool "i.MX6 UltraLite support"
select PINCTRL_IMX6UL
select SOC_IMX6
select ARM_ERRATA_814220
@ -211,7 +198,6 @@ config SOC_IMX7D_CM4
config SOC_IMX7D
bool "i.MX7 Dual support"
select PINCTRL_IMX7D
select SOC_IMX7D_CA7 if ARCH_MULTI_V7
select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
select ARM_ERRATA_814220 if ARCH_MULTI_V7
@ -221,7 +207,6 @@ config SOC_IMX7D
config SOC_IMX7ULP
bool "i.MX7ULP support"
select CLKSRC_IMX_TPM
select PINCTRL_IMX7ULP
select SOC_IMX7D_CA7 if ARCH_MULTI_V7
select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
help
@ -237,7 +222,6 @@ config SOC_IMXRT
config SOC_VF610
bool "Vybrid Family VF610 support"
select ARM_GIC if ARCH_MULTI_V7
select PINCTRL_VF610
help
This enables support for Freescale Vybrid VF610 processor.

View File

@ -268,6 +268,17 @@ config PINCTRL_K210
Add support for the Canaan Kendryte K210 RISC-V SOC Field
Programmable IO Array (FPIOA) controller.
config PINCTRL_K230
bool "Pinctrl driver for the Canaan Kendryte K230 SoC"
depends on OF
depends on ARCH_CANAAN || COMPILE_TEST
select GENERIC_PINCTRL_GROUPS
select GENERIC_PINMUX_FUNCTIONS
select GENERIC_PINCONF
select REGMAP_MMIO
help
Add support for the Canaan Kendryte K230 RISC-V SOC pin controller.
config PINCTRL_KEEMBAY
tristate "Pinctrl driver for Intel Keem Bay SoC"
depends on ARCH_KEEMBAY || (ARM64 && COMPILE_TEST)
@ -551,6 +562,20 @@ config PINCTRL_TPS6594
This driver can also be built as a module
called tps6594-pinctrl.
config PINCTRL_TH1520
tristate "Pinctrl driver for the T-Head TH1520 SoC"
depends on ARCH_THEAD || COMPILE_TEST
depends on OF
select GENERIC_PINMUX_FUNCTIONS
select GENERIC_PINCONF
select PINMUX
help
This is the driver for the pin controller blocks on the
T-Head TH1520 SoC.
This driver is needed for RISC-V development boards like
the BeagleV Ahead and the LicheePi 4A.
config PINCTRL_ZYNQ
bool "Pinctrl driver for Xilinx Zynq"
depends on ARCH_ZYNQ
@ -606,6 +631,7 @@ source "drivers/pinctrl/realtek/Kconfig"
source "drivers/pinctrl/renesas/Kconfig"
source "drivers/pinctrl/samsung/Kconfig"
source "drivers/pinctrl/sophgo/Kconfig"
source "drivers/pinctrl/spacemit/Kconfig"
source "drivers/pinctrl/spear/Kconfig"
source "drivers/pinctrl/sprd/Kconfig"
source "drivers/pinctrl/starfive/Kconfig"

View File

@ -28,6 +28,7 @@ obj-$(CONFIG_PINCTRL_EYEQ5) += pinctrl-eyeq5.o
obj-$(CONFIG_PINCTRL_GEMINI) += pinctrl-gemini.o
obj-$(CONFIG_PINCTRL_INGENIC) += pinctrl-ingenic.o
obj-$(CONFIG_PINCTRL_K210) += pinctrl-k210.o
obj-$(CONFIG_PINCTRL_K230) += pinctrl-k230.o
obj-$(CONFIG_PINCTRL_KEEMBAY) += pinctrl-keembay.o
obj-$(CONFIG_PINCTRL_LANTIQ) += pinctrl-lantiq.o
obj-$(CONFIG_PINCTRL_FALCON) += pinctrl-falcon.o
@ -54,6 +55,7 @@ obj-$(CONFIG_PINCTRL_STMFX) += pinctrl-stmfx.o
obj-$(CONFIG_PINCTRL_SX150X) += pinctrl-sx150x.o
obj-$(CONFIG_PINCTRL_TB10X) += pinctrl-tb10x.o
obj-$(CONFIG_PINCTRL_TPS6594) += pinctrl-tps6594.o
obj-$(CONFIG_PINCTRL_TH1520) += pinctrl-th1520.o
obj-$(CONFIG_PINCTRL_ZYNQMP) += pinctrl-zynqmp.o
obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o
@ -76,6 +78,7 @@ obj-$(CONFIG_ARCH_REALTEK) += realtek/
obj-$(CONFIG_PINCTRL_RENESAS) += renesas/
obj-$(CONFIG_PINCTRL_SAMSUNG) += samsung/
obj-y += sophgo/
obj-y += spacemit/
obj-$(CONFIG_PINCTRL_SPEAR) += spear/
obj-y += sprd/
obj-$(CONFIG_SOC_STARFIVE) += starfive/

View File

@ -2607,6 +2607,10 @@ static struct aspeed_pin_config aspeed_g6_configs[] = {
{ PIN_CONFIG_DRIVE_STRENGTH, { AB8, AB8 }, SCU454, GENMASK(27, 26)},
/* LAD0 */
{ PIN_CONFIG_DRIVE_STRENGTH, { AB7, AB7 }, SCU454, GENMASK(25, 24)},
/* GPIOF */
{ PIN_CONFIG_DRIVE_STRENGTH, { D22, A23 }, SCU458, GENMASK(9, 8)},
/* GPIOG */
{ PIN_CONFIG_DRIVE_STRENGTH, { E21, B21 }, SCU458, GENMASK(11, 10)},
/* MAC3 */
{ PIN_CONFIG_POWER_SOURCE, { H24, E26 }, SCU458, BIT_MASK(4)},

View File

@ -1091,7 +1091,7 @@ static void madera_pin_remove(struct platform_device *pdev)
static struct platform_driver madera_pin_driver = {
.probe = madera_pin_probe,
.remove_new = madera_pin_remove,
.remove = madera_pin_remove,
.driver = {
.name = "madera-pinctrl",
},

View File

@ -220,6 +220,9 @@ static int pinctrl_register_one_pin(struct pinctrl_dev *pctldev,
/* Set owner */
pindesc->pctldev = pctldev;
#ifdef CONFIG_PINMUX
mutex_init(&pindesc->mux_lock);
#endif
/* Copy basic pin info */
if (pin->name) {

View File

@ -177,6 +177,7 @@ struct pin_desc {
const char *mux_owner;
const struct pinctrl_setting_mux *mux_setting;
const char *gpio_owner;
struct mutex mux_lock;
#endif
};

View File

@ -9,7 +9,7 @@ config PINCTRL_IMX
config PINCTRL_IMX_SCMI
tristate "i.MX95 pinctrl driver using SCMI protocol interface"
depends on ARM_SCMI_PROTOCOL && OF || COMPILE_TEST
depends on ARM_SCMI_PROTOCOL && OF
select PINMUX
select GENERIC_PINCONF
select GENERIC_PINCTRL_GROUPS
@ -20,7 +20,7 @@ config PINCTRL_IMX_SCMI
config PINCTRL_IMX_SCU
tristate
depends on IMX_SCU
depends on IMX_SCU || COMPILE_TEST
select PINCTRL_IMX
config PINCTRL_IMX1_CORE
@ -30,14 +30,18 @@ config PINCTRL_IMX1_CORE
config PINCTRL_IMX1
bool "IMX1 pinctrl driver"
depends on SOC_IMX1
depends on OF
depends on SOC_IMX1 || COMPILE_TEST
default SOC_IMX1
select PINCTRL_IMX1_CORE
help
Say Y here to enable the imx1 pinctrl driver
config PINCTRL_IMX27
bool "IMX27 pinctrl driver"
depends on SOC_IMX27
depends on OF
depends on SOC_IMX27 || COMPILE_TEST
default SOC_IMX27
select PINCTRL_IMX1_CORE
help
Say Y here to enable the imx27 pinctrl driver
@ -46,84 +50,107 @@ config PINCTRL_IMX27
config PINCTRL_IMX25
bool "IMX25 pinctrl driver"
depends on OF
depends on SOC_IMX25
depends on SOC_IMX25 || COMPILE_TEST
default SOC_IMX25
select PINCTRL_IMX
help
Say Y here to enable the imx25 pinctrl driver
config PINCTRL_IMX35
bool "IMX35 pinctrl driver"
depends on SOC_IMX35
depends on OF
depends on SOC_IMX35 || COMPILE_TEST
default SOC_IMX35
select PINCTRL_IMX
help
Say Y here to enable the imx35 pinctrl driver
config PINCTRL_IMX50
bool "IMX50 pinctrl driver"
depends on SOC_IMX50
depends on OF
depends on SOC_IMX50 || COMPILE_TEST
default SOC_IMX50
select PINCTRL_IMX
help
Say Y here to enable the imx50 pinctrl driver
config PINCTRL_IMX51
bool "IMX51 pinctrl driver"
depends on SOC_IMX51
depends on OF
depends on SOC_IMX51 || COMPILE_TEST
default SOC_IMX51
select PINCTRL_IMX
help
Say Y here to enable the imx51 pinctrl driver
config PINCTRL_IMX53
bool "IMX53 pinctrl driver"
depends on SOC_IMX53
depends on OF
depends on SOC_IMX53 || COMPILE_TEST
default SOC_IMX53
select PINCTRL_IMX
help
Say Y here to enable the imx53 pinctrl driver
config PINCTRL_IMX6Q
bool "IMX6Q/DL pinctrl driver"
depends on SOC_IMX6Q
depends on OF
depends on SOC_IMX6Q || COMPILE_TEST
default SOC_IMX6Q
select PINCTRL_IMX
help
Say Y here to enable the imx6q/dl pinctrl driver
config PINCTRL_IMX6SL
bool "IMX6SL pinctrl driver"
depends on SOC_IMX6SL
depends on OF
depends on SOC_IMX6SL || COMPILE_TEST
default SOC_IMX6SL
select PINCTRL_IMX
help
Say Y here to enable the imx6sl pinctrl driver
config PINCTRL_IMX6SLL
bool "IMX6SLL pinctrl driver"
depends on SOC_IMX6SLL
depends on OF
depends on SOC_IMX6SLL || COMPILE_TEST
default SOC_IMX6SLL
select PINCTRL_IMX
help
Say Y here to enable the imx6sll pinctrl driver
config PINCTRL_IMX6SX
bool "IMX6SX pinctrl driver"
depends on SOC_IMX6SX
depends on OF
depends on SOC_IMX6SX || COMPILE_TEST
default SOC_IMX6SX
select PINCTRL_IMX
help
Say Y here to enable the imx6sx pinctrl driver
config PINCTRL_IMX6UL
bool "IMX6UL pinctrl driver"
depends on SOC_IMX6UL
depends on OF
depends on SOC_IMX6UL || COMPILE_TEST
default SOC_IMX6UL
select PINCTRL_IMX
help
Say Y here to enable the imx6ul pinctrl driver
config PINCTRL_IMX7D
bool "IMX7D pinctrl driver"
depends on SOC_IMX7D
depends on OF
depends on SOC_IMX7D || COMPILE_TEST
default SOC_IMX7D
select PINCTRL_IMX
help
Say Y here to enable the imx7d pinctrl driver
config PINCTRL_IMX7ULP
bool "IMX7ULP pinctrl driver"
depends on SOC_IMX7ULP
depends on OF
depends on SOC_IMX7ULP || COMPILE_TEST
default SOC_IMX7ULP
select PINCTRL_IMX
help
Say Y here to enable the imx7ulp pinctrl driver
@ -131,7 +158,7 @@ config PINCTRL_IMX7ULP
config PINCTRL_IMX8MM
tristate "IMX8MM pinctrl driver"
depends on OF
depends on SOC_IMX8M
depends on SOC_IMX8M || COMPILE_TEST
select PINCTRL_IMX
help
Say Y here to enable the imx8mm pinctrl driver
@ -139,7 +166,7 @@ config PINCTRL_IMX8MM
config PINCTRL_IMX8MN
tristate "IMX8MN pinctrl driver"
depends on OF
depends on SOC_IMX8M
depends on SOC_IMX8M || COMPILE_TEST
select PINCTRL_IMX
help
Say Y here to enable the imx8mn pinctrl driver
@ -147,7 +174,7 @@ config PINCTRL_IMX8MN
config PINCTRL_IMX8MP
tristate "IMX8MP pinctrl driver"
depends on OF
depends on SOC_IMX8M
depends on SOC_IMX8M || COMPILE_TEST
select PINCTRL_IMX
help
Say Y here to enable the imx8mp pinctrl driver
@ -155,42 +182,48 @@ config PINCTRL_IMX8MP
config PINCTRL_IMX8MQ
tristate "IMX8MQ pinctrl driver"
depends on OF
depends on SOC_IMX8M
depends on SOC_IMX8M || COMPILE_TEST
select PINCTRL_IMX
help
Say Y here to enable the imx8mq pinctrl driver
config PINCTRL_IMX8QM
tristate "IMX8QM pinctrl driver"
depends on IMX_SCU && ARCH_MXC && ARM64
depends on OF
depends on (IMX_SCU && ARCH_MXC && ARM64) || COMPILE_TEST
select PINCTRL_IMX_SCU
help
Say Y here to enable the imx8qm pinctrl driver
config PINCTRL_IMX8QXP
tristate "IMX8QXP pinctrl driver"
depends on IMX_SCU && ARCH_MXC && ARM64
depends on OF
depends on (IMX_SCU && ARCH_MXC && ARM64) || COMPILE_TEST
select PINCTRL_IMX_SCU
help
Say Y here to enable the imx8qxp pinctrl driver
config PINCTRL_IMX8DXL
tristate "IMX8DXL pinctrl driver"
depends on IMX_SCU && ARCH_MXC && ARM64
depends on OF
depends on (IMX_SCU && ARCH_MXC && ARM64) || COMPILE_TEST
select PINCTRL_IMX_SCU
help
Say Y here to enable the imx8dxl pinctrl driver
config PINCTRL_IMX8ULP
tristate "IMX8ULP pinctrl driver"
depends on ARCH_MXC
depends on OF
depends on ARCH_MXC || COMPILE_TEST
select PINCTRL_IMX
help
Say Y here to enable the imx8ulp pinctrl driver
config PINCTRL_IMXRT1050
bool "IMXRT1050 pinctrl driver"
depends on ARCH_MXC
depends on OF
depends on SOC_IMXRT || COMPILE_TEST
default SOC_IMXRT
select PINCTRL_IMX
help
Say Y here to enable the imxrt1050 pinctrl driver
@ -204,14 +237,17 @@ config PINCTRL_IMX91
config PINCTRL_IMX93
tristate "IMX93 pinctrl driver"
depends on ARCH_MXC
depends on OF
depends on ARCH_MXC || COMPILE_TEST
select PINCTRL_IMX
help
Say Y here to enable the imx93 pinctrl driver
config PINCTRL_VF610
bool "Freescale Vybrid VF610 pinctrl driver"
depends on SOC_VF610
depends on OF
depends on SOC_VF610 || COMPILE_TEST
default SOC_VF610
select PINCTRL_IMX
help
Say Y here to enable the Freescale Vybrid VF610 pinctrl driver
@ -231,7 +267,8 @@ config PINCTRL_IMX28
config PINCTRL_IMXRT1170
bool "IMXRT1170 pinctrl driver"
depends on ARCH_MXC
depends on OF
depends on SOC_IMXRT || COMPILE_TEST
select PINCTRL_IMX
help
Say Y here to enable the imxrt1170 pinctrl driver

View File

@ -633,11 +633,11 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
static bool imx_pinctrl_dt_is_flat_functions(struct device_node *np)
{
for_each_child_of_node_scoped(np, function_np) {
if (of_property_read_bool(function_np, "fsl,pins"))
if (of_property_present(function_np, "fsl,pins"))
return true;
for_each_child_of_node_scoped(function_np, pinctrl_np) {
if (of_property_read_bool(pinctrl_np, "fsl,pins"))
if (of_property_present(pinctrl_np, "fsl,pins"))
return false;
}
}
@ -746,7 +746,7 @@ int imx_pinctrl_probe(struct platform_device *pdev,
if (IS_ERR(ipctl->base))
return PTR_ERR(ipctl->base);
if (of_property_read_bool(dev_np, "fsl,input-sel")) {
if (of_property_present(dev_np, "fsl,input-sel")) {
np = of_parse_phandle(dev_np, "fsl,input-sel", 0);
if (!np) {
dev_err(&pdev->dev, "iomuxc fsl,input-sel property not found\n");

View File

@ -12,122 +12,122 @@
#include "pinctrl-imx1.h"
#define PAD_ID(port, pin) ((port) * 32 + (pin))
#define PA 0
#define PB 1
#define PC 2
#define PD 3
#define IMX1_PA 0
#define IMX1_PB 1
#define IMX1_PC 2
#define IMX1_PD 3
enum imx1_pads {
MX1_PAD_A24 = PAD_ID(PA, 0),
MX1_PAD_TIN = PAD_ID(PA, 1),
MX1_PAD_PWMO = PAD_ID(PA, 2),
MX1_PAD_CSI_MCLK = PAD_ID(PA, 3),
MX1_PAD_CSI_D0 = PAD_ID(PA, 4),
MX1_PAD_CSI_D1 = PAD_ID(PA, 5),
MX1_PAD_CSI_D2 = PAD_ID(PA, 6),
MX1_PAD_CSI_D3 = PAD_ID(PA, 7),
MX1_PAD_CSI_D4 = PAD_ID(PA, 8),
MX1_PAD_CSI_D5 = PAD_ID(PA, 9),
MX1_PAD_CSI_D6 = PAD_ID(PA, 10),
MX1_PAD_CSI_D7 = PAD_ID(PA, 11),
MX1_PAD_CSI_VSYNC = PAD_ID(PA, 12),
MX1_PAD_CSI_HSYNC = PAD_ID(PA, 13),
MX1_PAD_CSI_PIXCLK = PAD_ID(PA, 14),
MX1_PAD_I2C_SDA = PAD_ID(PA, 15),
MX1_PAD_I2C_SCL = PAD_ID(PA, 16),
MX1_PAD_DTACK = PAD_ID(PA, 17),
MX1_PAD_BCLK = PAD_ID(PA, 18),
MX1_PAD_LBA = PAD_ID(PA, 19),
MX1_PAD_ECB = PAD_ID(PA, 20),
MX1_PAD_A0 = PAD_ID(PA, 21),
MX1_PAD_CS4 = PAD_ID(PA, 22),
MX1_PAD_CS5 = PAD_ID(PA, 23),
MX1_PAD_A16 = PAD_ID(PA, 24),
MX1_PAD_A17 = PAD_ID(PA, 25),
MX1_PAD_A18 = PAD_ID(PA, 26),
MX1_PAD_A19 = PAD_ID(PA, 27),
MX1_PAD_A20 = PAD_ID(PA, 28),
MX1_PAD_A21 = PAD_ID(PA, 29),
MX1_PAD_A22 = PAD_ID(PA, 30),
MX1_PAD_A23 = PAD_ID(PA, 31),
MX1_PAD_SD_DAT0 = PAD_ID(PB, 8),
MX1_PAD_SD_DAT1 = PAD_ID(PB, 9),
MX1_PAD_SD_DAT2 = PAD_ID(PB, 10),
MX1_PAD_SD_DAT3 = PAD_ID(PB, 11),
MX1_PAD_SD_SCLK = PAD_ID(PB, 12),
MX1_PAD_SD_CMD = PAD_ID(PB, 13),
MX1_PAD_SIM_SVEN = PAD_ID(PB, 14),
MX1_PAD_SIM_PD = PAD_ID(PB, 15),
MX1_PAD_SIM_TX = PAD_ID(PB, 16),
MX1_PAD_SIM_RX = PAD_ID(PB, 17),
MX1_PAD_SIM_RST = PAD_ID(PB, 18),
MX1_PAD_SIM_CLK = PAD_ID(PB, 19),
MX1_PAD_USBD_AFE = PAD_ID(PB, 20),
MX1_PAD_USBD_OE = PAD_ID(PB, 21),
MX1_PAD_USBD_RCV = PAD_ID(PB, 22),
MX1_PAD_USBD_SUSPND = PAD_ID(PB, 23),
MX1_PAD_USBD_VP = PAD_ID(PB, 24),
MX1_PAD_USBD_VM = PAD_ID(PB, 25),
MX1_PAD_USBD_VPO = PAD_ID(PB, 26),
MX1_PAD_USBD_VMO = PAD_ID(PB, 27),
MX1_PAD_UART2_CTS = PAD_ID(PB, 28),
MX1_PAD_UART2_RTS = PAD_ID(PB, 29),
MX1_PAD_UART2_TXD = PAD_ID(PB, 30),
MX1_PAD_UART2_RXD = PAD_ID(PB, 31),
MX1_PAD_SSI_RXFS = PAD_ID(PC, 3),
MX1_PAD_SSI_RXCLK = PAD_ID(PC, 4),
MX1_PAD_SSI_RXDAT = PAD_ID(PC, 5),
MX1_PAD_SSI_TXDAT = PAD_ID(PC, 6),
MX1_PAD_SSI_TXFS = PAD_ID(PC, 7),
MX1_PAD_SSI_TXCLK = PAD_ID(PC, 8),
MX1_PAD_UART1_CTS = PAD_ID(PC, 9),
MX1_PAD_UART1_RTS = PAD_ID(PC, 10),
MX1_PAD_UART1_TXD = PAD_ID(PC, 11),
MX1_PAD_UART1_RXD = PAD_ID(PC, 12),
MX1_PAD_SPI1_RDY = PAD_ID(PC, 13),
MX1_PAD_SPI1_SCLK = PAD_ID(PC, 14),
MX1_PAD_SPI1_SS = PAD_ID(PC, 15),
MX1_PAD_SPI1_MISO = PAD_ID(PC, 16),
MX1_PAD_SPI1_MOSI = PAD_ID(PC, 17),
MX1_PAD_BT13 = PAD_ID(PC, 19),
MX1_PAD_BT12 = PAD_ID(PC, 20),
MX1_PAD_BT11 = PAD_ID(PC, 21),
MX1_PAD_BT10 = PAD_ID(PC, 22),
MX1_PAD_BT9 = PAD_ID(PC, 23),
MX1_PAD_BT8 = PAD_ID(PC, 24),
MX1_PAD_BT7 = PAD_ID(PC, 25),
MX1_PAD_BT6 = PAD_ID(PC, 26),
MX1_PAD_BT5 = PAD_ID(PC, 27),
MX1_PAD_BT4 = PAD_ID(PC, 28),
MX1_PAD_BT3 = PAD_ID(PC, 29),
MX1_PAD_BT2 = PAD_ID(PC, 30),
MX1_PAD_BT1 = PAD_ID(PC, 31),
MX1_PAD_LSCLK = PAD_ID(PD, 6),
MX1_PAD_REV = PAD_ID(PD, 7),
MX1_PAD_CLS = PAD_ID(PD, 8),
MX1_PAD_PS = PAD_ID(PD, 9),
MX1_PAD_SPL_SPR = PAD_ID(PD, 10),
MX1_PAD_CONTRAST = PAD_ID(PD, 11),
MX1_PAD_ACD_OE = PAD_ID(PD, 12),
MX1_PAD_LP_HSYNC = PAD_ID(PD, 13),
MX1_PAD_FLM_VSYNC = PAD_ID(PD, 14),
MX1_PAD_LD0 = PAD_ID(PD, 15),
MX1_PAD_LD1 = PAD_ID(PD, 16),
MX1_PAD_LD2 = PAD_ID(PD, 17),
MX1_PAD_LD3 = PAD_ID(PD, 18),
MX1_PAD_LD4 = PAD_ID(PD, 19),
MX1_PAD_LD5 = PAD_ID(PD, 20),
MX1_PAD_LD6 = PAD_ID(PD, 21),
MX1_PAD_LD7 = PAD_ID(PD, 22),
MX1_PAD_LD8 = PAD_ID(PD, 23),
MX1_PAD_LD9 = PAD_ID(PD, 24),
MX1_PAD_LD10 = PAD_ID(PD, 25),
MX1_PAD_LD11 = PAD_ID(PD, 26),
MX1_PAD_LD12 = PAD_ID(PD, 27),
MX1_PAD_LD13 = PAD_ID(PD, 28),
MX1_PAD_LD14 = PAD_ID(PD, 29),
MX1_PAD_LD15 = PAD_ID(PD, 30),
MX1_PAD_TMR2OUT = PAD_ID(PD, 31),
MX1_PAD_A24 = PAD_ID(IMX1_PA, 0),
MX1_PAD_TIN = PAD_ID(IMX1_PA, 1),
MX1_PAD_PWMO = PAD_ID(IMX1_PA, 2),
MX1_PAD_CSI_MCLK = PAD_ID(IMX1_PA, 3),
MX1_PAD_CSI_D0 = PAD_ID(IMX1_PA, 4),
MX1_PAD_CSI_D1 = PAD_ID(IMX1_PA, 5),
MX1_PAD_CSI_D2 = PAD_ID(IMX1_PA, 6),
MX1_PAD_CSI_D3 = PAD_ID(IMX1_PA, 7),
MX1_PAD_CSI_D4 = PAD_ID(IMX1_PA, 8),
MX1_PAD_CSI_D5 = PAD_ID(IMX1_PA, 9),
MX1_PAD_CSI_D6 = PAD_ID(IMX1_PA, 10),
MX1_PAD_CSI_D7 = PAD_ID(IMX1_PA, 11),
MX1_PAD_CSI_VSYNC = PAD_ID(IMX1_PA, 12),
MX1_PAD_CSI_HSYNC = PAD_ID(IMX1_PA, 13),
MX1_PAD_CSI_PIXCLK = PAD_ID(IMX1_PA, 14),
MX1_PAD_I2C_SDA = PAD_ID(IMX1_PA, 15),
MX1_PAD_I2C_SCL = PAD_ID(IMX1_PA, 16),
MX1_PAD_DTACK = PAD_ID(IMX1_PA, 17),
MX1_PAD_BCLK = PAD_ID(IMX1_PA, 18),
MX1_PAD_LBA = PAD_ID(IMX1_PA, 19),
MX1_PAD_ECB = PAD_ID(IMX1_PA, 20),
MX1_PAD_A0 = PAD_ID(IMX1_PA, 21),
MX1_PAD_CS4 = PAD_ID(IMX1_PA, 22),
MX1_PAD_CS5 = PAD_ID(IMX1_PA, 23),
MX1_PAD_A16 = PAD_ID(IMX1_PA, 24),
MX1_PAD_A17 = PAD_ID(IMX1_PA, 25),
MX1_PAD_A18 = PAD_ID(IMX1_PA, 26),
MX1_PAD_A19 = PAD_ID(IMX1_PA, 27),
MX1_PAD_A20 = PAD_ID(IMX1_PA, 28),
MX1_PAD_A21 = PAD_ID(IMX1_PA, 29),
MX1_PAD_A22 = PAD_ID(IMX1_PA, 30),
MX1_PAD_A23 = PAD_ID(IMX1_PA, 31),
MX1_PAD_SD_DAT0 = PAD_ID(IMX1_PB, 8),
MX1_PAD_SD_DAT1 = PAD_ID(IMX1_PB, 9),
MX1_PAD_SD_DAT2 = PAD_ID(IMX1_PB, 10),
MX1_PAD_SD_DAT3 = PAD_ID(IMX1_PB, 11),
MX1_PAD_SD_SCLK = PAD_ID(IMX1_PB, 12),
MX1_PAD_SD_CMD = PAD_ID(IMX1_PB, 13),
MX1_PAD_SIM_SVEN = PAD_ID(IMX1_PB, 14),
MX1_PAD_SIM_PD = PAD_ID(IMX1_PB, 15),
MX1_PAD_SIM_TX = PAD_ID(IMX1_PB, 16),
MX1_PAD_SIM_RX = PAD_ID(IMX1_PB, 17),
MX1_PAD_SIM_RST = PAD_ID(IMX1_PB, 18),
MX1_PAD_SIM_CLK = PAD_ID(IMX1_PB, 19),
MX1_PAD_USBD_AFE = PAD_ID(IMX1_PB, 20),
MX1_PAD_USBD_OE = PAD_ID(IMX1_PB, 21),
MX1_PAD_USBD_RCV = PAD_ID(IMX1_PB, 22),
MX1_PAD_USBD_SUSPND = PAD_ID(IMX1_PB, 23),
MX1_PAD_USBD_VP = PAD_ID(IMX1_PB, 24),
MX1_PAD_USBD_VM = PAD_ID(IMX1_PB, 25),
MX1_PAD_USBD_VPO = PAD_ID(IMX1_PB, 26),
MX1_PAD_USBD_VMO = PAD_ID(IMX1_PB, 27),
MX1_PAD_UART2_CTS = PAD_ID(IMX1_PB, 28),
MX1_PAD_UART2_RTS = PAD_ID(IMX1_PB, 29),
MX1_PAD_UART2_TXD = PAD_ID(IMX1_PB, 30),
MX1_PAD_UART2_RXD = PAD_ID(IMX1_PB, 31),
MX1_PAD_SSI_RXFS = PAD_ID(IMX1_PC, 3),
MX1_PAD_SSI_RXCLK = PAD_ID(IMX1_PC, 4),
MX1_PAD_SSI_RXDAT = PAD_ID(IMX1_PC, 5),
MX1_PAD_SSI_TXDAT = PAD_ID(IMX1_PC, 6),
MX1_PAD_SSI_TXFS = PAD_ID(IMX1_PC, 7),
MX1_PAD_SSI_TXCLK = PAD_ID(IMX1_PC, 8),
MX1_PAD_UART1_CTS = PAD_ID(IMX1_PC, 9),
MX1_PAD_UART1_RTS = PAD_ID(IMX1_PC, 10),
MX1_PAD_UART1_TXD = PAD_ID(IMX1_PC, 11),
MX1_PAD_UART1_RXD = PAD_ID(IMX1_PC, 12),
MX1_PAD_SPI1_RDY = PAD_ID(IMX1_PC, 13),
MX1_PAD_SPI1_SCLK = PAD_ID(IMX1_PC, 14),
MX1_PAD_SPI1_SS = PAD_ID(IMX1_PC, 15),
MX1_PAD_SPI1_MISO = PAD_ID(IMX1_PC, 16),
MX1_PAD_SPI1_MOSI = PAD_ID(IMX1_PC, 17),
MX1_PAD_BT13 = PAD_ID(IMX1_PC, 19),
MX1_PAD_BT12 = PAD_ID(IMX1_PC, 20),
MX1_PAD_BT11 = PAD_ID(IMX1_PC, 21),
MX1_PAD_BT10 = PAD_ID(IMX1_PC, 22),
MX1_PAD_BT9 = PAD_ID(IMX1_PC, 23),
MX1_PAD_BT8 = PAD_ID(IMX1_PC, 24),
MX1_PAD_BT7 = PAD_ID(IMX1_PC, 25),
MX1_PAD_BT6 = PAD_ID(IMX1_PC, 26),
MX1_PAD_BT5 = PAD_ID(IMX1_PC, 27),
MX1_PAD_BT4 = PAD_ID(IMX1_PC, 28),
MX1_PAD_BT3 = PAD_ID(IMX1_PC, 29),
MX1_PAD_BT2 = PAD_ID(IMX1_PC, 30),
MX1_PAD_BT1 = PAD_ID(IMX1_PC, 31),
MX1_PAD_LSCLK = PAD_ID(IMX1_PD, 6),
MX1_PAD_REV = PAD_ID(IMX1_PD, 7),
MX1_PAD_CLS = PAD_ID(IMX1_PD, 8),
MX1_PAD_PS = PAD_ID(IMX1_PD, 9),
MX1_PAD_SPL_SPR = PAD_ID(IMX1_PD, 10),
MX1_PAD_CONTRAST = PAD_ID(IMX1_PD, 11),
MX1_PAD_ACD_OE = PAD_ID(IMX1_PD, 12),
MX1_PAD_LP_HSYNC = PAD_ID(IMX1_PD, 13),
MX1_PAD_FLM_VSYNC = PAD_ID(IMX1_PD, 14),
MX1_PAD_LD0 = PAD_ID(IMX1_PD, 15),
MX1_PAD_LD1 = PAD_ID(IMX1_PD, 16),
MX1_PAD_LD2 = PAD_ID(IMX1_PD, 17),
MX1_PAD_LD3 = PAD_ID(IMX1_PD, 18),
MX1_PAD_LD4 = PAD_ID(IMX1_PD, 19),
MX1_PAD_LD5 = PAD_ID(IMX1_PD, 20),
MX1_PAD_LD6 = PAD_ID(IMX1_PD, 21),
MX1_PAD_LD7 = PAD_ID(IMX1_PD, 22),
MX1_PAD_LD8 = PAD_ID(IMX1_PD, 23),
MX1_PAD_LD9 = PAD_ID(IMX1_PD, 24),
MX1_PAD_LD10 = PAD_ID(IMX1_PD, 25),
MX1_PAD_LD11 = PAD_ID(IMX1_PD, 26),
MX1_PAD_LD12 = PAD_ID(IMX1_PD, 27),
MX1_PAD_LD13 = PAD_ID(IMX1_PD, 28),
MX1_PAD_LD14 = PAD_ID(IMX1_PD, 29),
MX1_PAD_LD15 = PAD_ID(IMX1_PD, 30),
MX1_PAD_TMR2OUT = PAD_ID(IMX1_PD, 31),
};
/* Pad names for the pinmux subsystem */

View File

@ -16,188 +16,188 @@
#include "pinctrl-imx1.h"
#define PAD_ID(port, pin) (port*32 + pin)
#define PA 0
#define PB 1
#define PC 2
#define PD 3
#define PE 4
#define PF 5
#define MX27_PA 0
#define MX27_PB 1
#define MX27_PC 2
#define MX27_PD 3
#define MX27_PE 4
#define MX27_PF 5
enum imx27_pads {
MX27_PAD_USBH2_CLK = PAD_ID(PA, 0),
MX27_PAD_USBH2_DIR = PAD_ID(PA, 1),
MX27_PAD_USBH2_DATA7 = PAD_ID(PA, 2),
MX27_PAD_USBH2_NXT = PAD_ID(PA, 3),
MX27_PAD_USBH2_STP = PAD_ID(PA, 4),
MX27_PAD_LSCLK = PAD_ID(PA, 5),
MX27_PAD_LD0 = PAD_ID(PA, 6),
MX27_PAD_LD1 = PAD_ID(PA, 7),
MX27_PAD_LD2 = PAD_ID(PA, 8),
MX27_PAD_LD3 = PAD_ID(PA, 9),
MX27_PAD_LD4 = PAD_ID(PA, 10),
MX27_PAD_LD5 = PAD_ID(PA, 11),
MX27_PAD_LD6 = PAD_ID(PA, 12),
MX27_PAD_LD7 = PAD_ID(PA, 13),
MX27_PAD_LD8 = PAD_ID(PA, 14),
MX27_PAD_LD9 = PAD_ID(PA, 15),
MX27_PAD_LD10 = PAD_ID(PA, 16),
MX27_PAD_LD11 = PAD_ID(PA, 17),
MX27_PAD_LD12 = PAD_ID(PA, 18),
MX27_PAD_LD13 = PAD_ID(PA, 19),
MX27_PAD_LD14 = PAD_ID(PA, 20),
MX27_PAD_LD15 = PAD_ID(PA, 21),
MX27_PAD_LD16 = PAD_ID(PA, 22),
MX27_PAD_LD17 = PAD_ID(PA, 23),
MX27_PAD_REV = PAD_ID(PA, 24),
MX27_PAD_CLS = PAD_ID(PA, 25),
MX27_PAD_PS = PAD_ID(PA, 26),
MX27_PAD_SPL_SPR = PAD_ID(PA, 27),
MX27_PAD_HSYNC = PAD_ID(PA, 28),
MX27_PAD_VSYNC = PAD_ID(PA, 29),
MX27_PAD_CONTRAST = PAD_ID(PA, 30),
MX27_PAD_OE_ACD = PAD_ID(PA, 31),
MX27_PAD_USBH2_CLK = PAD_ID(MX27_PA, 0),
MX27_PAD_USBH2_DIR = PAD_ID(MX27_PA, 1),
MX27_PAD_USBH2_DATA7 = PAD_ID(MX27_PA, 2),
MX27_PAD_USBH2_NXT = PAD_ID(MX27_PA, 3),
MX27_PAD_USBH2_STP = PAD_ID(MX27_PA, 4),
MX27_PAD_LSCLK = PAD_ID(MX27_PA, 5),
MX27_PAD_LD0 = PAD_ID(MX27_PA, 6),
MX27_PAD_LD1 = PAD_ID(MX27_PA, 7),
MX27_PAD_LD2 = PAD_ID(MX27_PA, 8),
MX27_PAD_LD3 = PAD_ID(MX27_PA, 9),
MX27_PAD_LD4 = PAD_ID(MX27_PA, 10),
MX27_PAD_LD5 = PAD_ID(MX27_PA, 11),
MX27_PAD_LD6 = PAD_ID(MX27_PA, 12),
MX27_PAD_LD7 = PAD_ID(MX27_PA, 13),
MX27_PAD_LD8 = PAD_ID(MX27_PA, 14),
MX27_PAD_LD9 = PAD_ID(MX27_PA, 15),
MX27_PAD_LD10 = PAD_ID(MX27_PA, 16),
MX27_PAD_LD11 = PAD_ID(MX27_PA, 17),
MX27_PAD_LD12 = PAD_ID(MX27_PA, 18),
MX27_PAD_LD13 = PAD_ID(MX27_PA, 19),
MX27_PAD_LD14 = PAD_ID(MX27_PA, 20),
MX27_PAD_LD15 = PAD_ID(MX27_PA, 21),
MX27_PAD_LD16 = PAD_ID(MX27_PA, 22),
MX27_PAD_LD17 = PAD_ID(MX27_PA, 23),
MX27_PAD_REV = PAD_ID(MX27_PA, 24),
MX27_PAD_CLS = PAD_ID(MX27_PA, 25),
MX27_PAD_PS = PAD_ID(MX27_PA, 26),
MX27_PAD_SPL_SPR = PAD_ID(MX27_PA, 27),
MX27_PAD_HSYNC = PAD_ID(MX27_PA, 28),
MX27_PAD_VSYNC = PAD_ID(MX27_PA, 29),
MX27_PAD_CONTRAST = PAD_ID(MX27_PA, 30),
MX27_PAD_OE_ACD = PAD_ID(MX27_PA, 31),
MX27_PAD_SD2_D0 = PAD_ID(PB, 4),
MX27_PAD_SD2_D1 = PAD_ID(PB, 5),
MX27_PAD_SD2_D2 = PAD_ID(PB, 6),
MX27_PAD_SD2_D3 = PAD_ID(PB, 7),
MX27_PAD_SD2_CMD = PAD_ID(PB, 8),
MX27_PAD_SD2_CLK = PAD_ID(PB, 9),
MX27_PAD_CSI_D0 = PAD_ID(PB, 10),
MX27_PAD_CSI_D1 = PAD_ID(PB, 11),
MX27_PAD_CSI_D2 = PAD_ID(PB, 12),
MX27_PAD_CSI_D3 = PAD_ID(PB, 13),
MX27_PAD_CSI_D4 = PAD_ID(PB, 14),
MX27_PAD_CSI_MCLK = PAD_ID(PB, 15),
MX27_PAD_CSI_PIXCLK = PAD_ID(PB, 16),
MX27_PAD_CSI_D5 = PAD_ID(PB, 17),
MX27_PAD_CSI_D6 = PAD_ID(PB, 18),
MX27_PAD_CSI_D7 = PAD_ID(PB, 19),
MX27_PAD_CSI_VSYNC = PAD_ID(PB, 20),
MX27_PAD_CSI_HSYNC = PAD_ID(PB, 21),
MX27_PAD_USBH1_SUSP = PAD_ID(PB, 22),
MX27_PAD_USB_PWR = PAD_ID(PB, 23),
MX27_PAD_USB_OC_B = PAD_ID(PB, 24),
MX27_PAD_USBH1_RCV = PAD_ID(PB, 25),
MX27_PAD_USBH1_FS = PAD_ID(PB, 26),
MX27_PAD_USBH1_OE_B = PAD_ID(PB, 27),
MX27_PAD_USBH1_TXDM = PAD_ID(PB, 28),
MX27_PAD_USBH1_TXDP = PAD_ID(PB, 29),
MX27_PAD_USBH1_RXDM = PAD_ID(PB, 30),
MX27_PAD_USBH1_RXDP = PAD_ID(PB, 31),
MX27_PAD_SD2_D0 = PAD_ID(MX27_PB, 4),
MX27_PAD_SD2_D1 = PAD_ID(MX27_PB, 5),
MX27_PAD_SD2_D2 = PAD_ID(MX27_PB, 6),
MX27_PAD_SD2_D3 = PAD_ID(MX27_PB, 7),
MX27_PAD_SD2_CMD = PAD_ID(MX27_PB, 8),
MX27_PAD_SD2_CLK = PAD_ID(MX27_PB, 9),
MX27_PAD_CSI_D0 = PAD_ID(MX27_PB, 10),
MX27_PAD_CSI_D1 = PAD_ID(MX27_PB, 11),
MX27_PAD_CSI_D2 = PAD_ID(MX27_PB, 12),
MX27_PAD_CSI_D3 = PAD_ID(MX27_PB, 13),
MX27_PAD_CSI_D4 = PAD_ID(MX27_PB, 14),
MX27_PAD_CSI_MCLK = PAD_ID(MX27_PB, 15),
MX27_PAD_CSI_PIXCLK = PAD_ID(MX27_PB, 16),
MX27_PAD_CSI_D5 = PAD_ID(MX27_PB, 17),
MX27_PAD_CSI_D6 = PAD_ID(MX27_PB, 18),
MX27_PAD_CSI_D7 = PAD_ID(MX27_PB, 19),
MX27_PAD_CSI_VSYNC = PAD_ID(MX27_PB, 20),
MX27_PAD_CSI_HSYNC = PAD_ID(MX27_PB, 21),
MX27_PAD_USBH1_SUSP = PAD_ID(MX27_PB, 22),
MX27_PAD_USB_PWR = PAD_ID(MX27_PB, 23),
MX27_PAD_USB_OC_B = PAD_ID(MX27_PB, 24),
MX27_PAD_USBH1_RCV = PAD_ID(MX27_PB, 25),
MX27_PAD_USBH1_FS = PAD_ID(MX27_PB, 26),
MX27_PAD_USBH1_OE_B = PAD_ID(MX27_PB, 27),
MX27_PAD_USBH1_TXDM = PAD_ID(MX27_PB, 28),
MX27_PAD_USBH1_TXDP = PAD_ID(MX27_PB, 29),
MX27_PAD_USBH1_RXDM = PAD_ID(MX27_PB, 30),
MX27_PAD_USBH1_RXDP = PAD_ID(MX27_PB, 31),
MX27_PAD_I2C2_SDA = PAD_ID(PC, 5),
MX27_PAD_I2C2_SCL = PAD_ID(PC, 6),
MX27_PAD_USBOTG_DATA5 = PAD_ID(PC, 7),
MX27_PAD_USBOTG_DATA6 = PAD_ID(PC, 8),
MX27_PAD_USBOTG_DATA0 = PAD_ID(PC, 9),
MX27_PAD_USBOTG_DATA2 = PAD_ID(PC, 10),
MX27_PAD_USBOTG_DATA1 = PAD_ID(PC, 11),
MX27_PAD_USBOTG_DATA4 = PAD_ID(PC, 12),
MX27_PAD_USBOTG_DATA3 = PAD_ID(PC, 13),
MX27_PAD_TOUT = PAD_ID(PC, 14),
MX27_PAD_TIN = PAD_ID(PC, 15),
MX27_PAD_SSI4_FS = PAD_ID(PC, 16),
MX27_PAD_SSI4_RXDAT = PAD_ID(PC, 17),
MX27_PAD_SSI4_TXDAT = PAD_ID(PC, 18),
MX27_PAD_SSI4_CLK = PAD_ID(PC, 19),
MX27_PAD_SSI1_FS = PAD_ID(PC, 20),
MX27_PAD_SSI1_RXDAT = PAD_ID(PC, 21),
MX27_PAD_SSI1_TXDAT = PAD_ID(PC, 22),
MX27_PAD_SSI1_CLK = PAD_ID(PC, 23),
MX27_PAD_SSI2_FS = PAD_ID(PC, 24),
MX27_PAD_SSI2_RXDAT = PAD_ID(PC, 25),
MX27_PAD_SSI2_TXDAT = PAD_ID(PC, 26),
MX27_PAD_SSI2_CLK = PAD_ID(PC, 27),
MX27_PAD_SSI3_FS = PAD_ID(PC, 28),
MX27_PAD_SSI3_RXDAT = PAD_ID(PC, 29),
MX27_PAD_SSI3_TXDAT = PAD_ID(PC, 30),
MX27_PAD_SSI3_CLK = PAD_ID(PC, 31),
MX27_PAD_I2C2_SDA = PAD_ID(MX27_PC, 5),
MX27_PAD_I2C2_SCL = PAD_ID(MX27_PC, 6),
MX27_PAD_USBOTG_DATA5 = PAD_ID(MX27_PC, 7),
MX27_PAD_USBOTG_DATA6 = PAD_ID(MX27_PC, 8),
MX27_PAD_USBOTG_DATA0 = PAD_ID(MX27_PC, 9),
MX27_PAD_USBOTG_DATA2 = PAD_ID(MX27_PC, 10),
MX27_PAD_USBOTG_DATA1 = PAD_ID(MX27_PC, 11),
MX27_PAD_USBOTG_DATA4 = PAD_ID(MX27_PC, 12),
MX27_PAD_USBOTG_DATA3 = PAD_ID(MX27_PC, 13),
MX27_PAD_TOUT = PAD_ID(MX27_PC, 14),
MX27_PAD_TIN = PAD_ID(MX27_PC, 15),
MX27_PAD_SSI4_FS = PAD_ID(MX27_PC, 16),
MX27_PAD_SSI4_RXDAT = PAD_ID(MX27_PC, 17),
MX27_PAD_SSI4_TXDAT = PAD_ID(MX27_PC, 18),
MX27_PAD_SSI4_CLK = PAD_ID(MX27_PC, 19),
MX27_PAD_SSI1_FS = PAD_ID(MX27_PC, 20),
MX27_PAD_SSI1_RXDAT = PAD_ID(MX27_PC, 21),
MX27_PAD_SSI1_TXDAT = PAD_ID(MX27_PC, 22),
MX27_PAD_SSI1_CLK = PAD_ID(MX27_PC, 23),
MX27_PAD_SSI2_FS = PAD_ID(MX27_PC, 24),
MX27_PAD_SSI2_RXDAT = PAD_ID(MX27_PC, 25),
MX27_PAD_SSI2_TXDAT = PAD_ID(MX27_PC, 26),
MX27_PAD_SSI2_CLK = PAD_ID(MX27_PC, 27),
MX27_PAD_SSI3_FS = PAD_ID(MX27_PC, 28),
MX27_PAD_SSI3_RXDAT = PAD_ID(MX27_PC, 29),
MX27_PAD_SSI3_TXDAT = PAD_ID(MX27_PC, 30),
MX27_PAD_SSI3_CLK = PAD_ID(MX27_PC, 31),
MX27_PAD_SD3_CMD = PAD_ID(PD, 0),
MX27_PAD_SD3_CLK = PAD_ID(PD, 1),
MX27_PAD_ATA_DATA0 = PAD_ID(PD, 2),
MX27_PAD_ATA_DATA1 = PAD_ID(PD, 3),
MX27_PAD_ATA_DATA2 = PAD_ID(PD, 4),
MX27_PAD_ATA_DATA3 = PAD_ID(PD, 5),
MX27_PAD_ATA_DATA4 = PAD_ID(PD, 6),
MX27_PAD_ATA_DATA5 = PAD_ID(PD, 7),
MX27_PAD_ATA_DATA6 = PAD_ID(PD, 8),
MX27_PAD_ATA_DATA7 = PAD_ID(PD, 9),
MX27_PAD_ATA_DATA8 = PAD_ID(PD, 10),
MX27_PAD_ATA_DATA9 = PAD_ID(PD, 11),
MX27_PAD_ATA_DATA10 = PAD_ID(PD, 12),
MX27_PAD_ATA_DATA11 = PAD_ID(PD, 13),
MX27_PAD_ATA_DATA12 = PAD_ID(PD, 14),
MX27_PAD_ATA_DATA13 = PAD_ID(PD, 15),
MX27_PAD_ATA_DATA14 = PAD_ID(PD, 16),
MX27_PAD_I2C_DATA = PAD_ID(PD, 17),
MX27_PAD_I2C_CLK = PAD_ID(PD, 18),
MX27_PAD_CSPI2_SS2 = PAD_ID(PD, 19),
MX27_PAD_CSPI2_SS1 = PAD_ID(PD, 20),
MX27_PAD_CSPI2_SS0 = PAD_ID(PD, 21),
MX27_PAD_CSPI2_SCLK = PAD_ID(PD, 22),
MX27_PAD_CSPI2_MISO = PAD_ID(PD, 23),
MX27_PAD_CSPI2_MOSI = PAD_ID(PD, 24),
MX27_PAD_CSPI1_RDY = PAD_ID(PD, 25),
MX27_PAD_CSPI1_SS2 = PAD_ID(PD, 26),
MX27_PAD_CSPI1_SS1 = PAD_ID(PD, 27),
MX27_PAD_CSPI1_SS0 = PAD_ID(PD, 28),
MX27_PAD_CSPI1_SCLK = PAD_ID(PD, 29),
MX27_PAD_CSPI1_MISO = PAD_ID(PD, 30),
MX27_PAD_CSPI1_MOSI = PAD_ID(PD, 31),
MX27_PAD_SD3_CMD = PAD_ID(MX27_PD, 0),
MX27_PAD_SD3_CLK = PAD_ID(MX27_PD, 1),
MX27_PAD_ATA_DATA0 = PAD_ID(MX27_PD, 2),
MX27_PAD_ATA_DATA1 = PAD_ID(MX27_PD, 3),
MX27_PAD_ATA_DATA2 = PAD_ID(MX27_PD, 4),
MX27_PAD_ATA_DATA3 = PAD_ID(MX27_PD, 5),
MX27_PAD_ATA_DATA4 = PAD_ID(MX27_PD, 6),
MX27_PAD_ATA_DATA5 = PAD_ID(MX27_PD, 7),
MX27_PAD_ATA_DATA6 = PAD_ID(MX27_PD, 8),
MX27_PAD_ATA_DATA7 = PAD_ID(MX27_PD, 9),
MX27_PAD_ATA_DATA8 = PAD_ID(MX27_PD, 10),
MX27_PAD_ATA_DATA9 = PAD_ID(MX27_PD, 11),
MX27_PAD_ATA_DATA10 = PAD_ID(MX27_PD, 12),
MX27_PAD_ATA_DATA11 = PAD_ID(MX27_PD, 13),
MX27_PAD_ATA_DATA12 = PAD_ID(MX27_PD, 14),
MX27_PAD_ATA_DATA13 = PAD_ID(MX27_PD, 15),
MX27_PAD_ATA_DATA14 = PAD_ID(MX27_PD, 16),
MX27_PAD_I2C_DATA = PAD_ID(MX27_PD, 17),
MX27_PAD_I2C_CLK = PAD_ID(MX27_PD, 18),
MX27_PAD_CSPI2_SS2 = PAD_ID(MX27_PD, 19),
MX27_PAD_CSPI2_SS1 = PAD_ID(MX27_PD, 20),
MX27_PAD_CSPI2_SS0 = PAD_ID(MX27_PD, 21),
MX27_PAD_CSPI2_SCLK = PAD_ID(MX27_PD, 22),
MX27_PAD_CSPI2_MISO = PAD_ID(MX27_PD, 23),
MX27_PAD_CSPI2_MOSI = PAD_ID(MX27_PD, 24),
MX27_PAD_CSPI1_RDY = PAD_ID(MX27_PD, 25),
MX27_PAD_CSPI1_SS2 = PAD_ID(MX27_PD, 26),
MX27_PAD_CSPI1_SS1 = PAD_ID(MX27_PD, 27),
MX27_PAD_CSPI1_SS0 = PAD_ID(MX27_PD, 28),
MX27_PAD_CSPI1_SCLK = PAD_ID(MX27_PD, 29),
MX27_PAD_CSPI1_MISO = PAD_ID(MX27_PD, 30),
MX27_PAD_CSPI1_MOSI = PAD_ID(MX27_PD, 31),
MX27_PAD_USBOTG_NXT = PAD_ID(PE, 0),
MX27_PAD_USBOTG_STP = PAD_ID(PE, 1),
MX27_PAD_USBOTG_DIR = PAD_ID(PE, 2),
MX27_PAD_UART2_CTS = PAD_ID(PE, 3),
MX27_PAD_UART2_RTS = PAD_ID(PE, 4),
MX27_PAD_PWMO = PAD_ID(PE, 5),
MX27_PAD_UART2_TXD = PAD_ID(PE, 6),
MX27_PAD_UART2_RXD = PAD_ID(PE, 7),
MX27_PAD_UART3_TXD = PAD_ID(PE, 8),
MX27_PAD_UART3_RXD = PAD_ID(PE, 9),
MX27_PAD_UART3_CTS = PAD_ID(PE, 10),
MX27_PAD_UART3_RTS = PAD_ID(PE, 11),
MX27_PAD_UART1_TXD = PAD_ID(PE, 12),
MX27_PAD_UART1_RXD = PAD_ID(PE, 13),
MX27_PAD_UART1_CTS = PAD_ID(PE, 14),
MX27_PAD_UART1_RTS = PAD_ID(PE, 15),
MX27_PAD_RTCK = PAD_ID(PE, 16),
MX27_PAD_RESET_OUT_B = PAD_ID(PE, 17),
MX27_PAD_SD1_D0 = PAD_ID(PE, 18),
MX27_PAD_SD1_D1 = PAD_ID(PE, 19),
MX27_PAD_SD1_D2 = PAD_ID(PE, 20),
MX27_PAD_SD1_D3 = PAD_ID(PE, 21),
MX27_PAD_SD1_CMD = PAD_ID(PE, 22),
MX27_PAD_SD1_CLK = PAD_ID(PE, 23),
MX27_PAD_USBOTG_CLK = PAD_ID(PE, 24),
MX27_PAD_USBOTG_DATA7 = PAD_ID(PE, 25),
MX27_PAD_USBOTG_NXT = PAD_ID(MX27_PE, 0),
MX27_PAD_USBOTG_STP = PAD_ID(MX27_PE, 1),
MX27_PAD_USBOTG_DIR = PAD_ID(MX27_PE, 2),
MX27_PAD_UART2_CTS = PAD_ID(MX27_PE, 3),
MX27_PAD_UART2_RTS = PAD_ID(MX27_PE, 4),
MX27_PAD_PWMO = PAD_ID(MX27_PE, 5),
MX27_PAD_UART2_TXD = PAD_ID(MX27_PE, 6),
MX27_PAD_UART2_RXD = PAD_ID(MX27_PE, 7),
MX27_PAD_UART3_TXD = PAD_ID(MX27_PE, 8),
MX27_PAD_UART3_RXD = PAD_ID(MX27_PE, 9),
MX27_PAD_UART3_CTS = PAD_ID(MX27_PE, 10),
MX27_PAD_UART3_RTS = PAD_ID(MX27_PE, 11),
MX27_PAD_UART1_TXD = PAD_ID(MX27_PE, 12),
MX27_PAD_UART1_RXD = PAD_ID(MX27_PE, 13),
MX27_PAD_UART1_CTS = PAD_ID(MX27_PE, 14),
MX27_PAD_UART1_RTS = PAD_ID(MX27_PE, 15),
MX27_PAD_RTCK = PAD_ID(MX27_PE, 16),
MX27_PAD_RESET_OUT_B = PAD_ID(MX27_PE, 17),
MX27_PAD_SD1_D0 = PAD_ID(MX27_PE, 18),
MX27_PAD_SD1_D1 = PAD_ID(MX27_PE, 19),
MX27_PAD_SD1_D2 = PAD_ID(MX27_PE, 20),
MX27_PAD_SD1_D3 = PAD_ID(MX27_PE, 21),
MX27_PAD_SD1_CMD = PAD_ID(MX27_PE, 22),
MX27_PAD_SD1_CLK = PAD_ID(MX27_PE, 23),
MX27_PAD_USBOTG_CLK = PAD_ID(MX27_PE, 24),
MX27_PAD_USBOTG_DATA7 = PAD_ID(MX27_PE, 25),
MX27_PAD_NFRB = PAD_ID(PF, 0),
MX27_PAD_NFCLE = PAD_ID(PF, 1),
MX27_PAD_NFWP_B = PAD_ID(PF, 2),
MX27_PAD_NFCE_B = PAD_ID(PF, 3),
MX27_PAD_NFALE = PAD_ID(PF, 4),
MX27_PAD_NFRE_B = PAD_ID(PF, 5),
MX27_PAD_NFWE_B = PAD_ID(PF, 6),
MX27_PAD_PC_POE = PAD_ID(PF, 7),
MX27_PAD_PC_RW_B = PAD_ID(PF, 8),
MX27_PAD_IOIS16 = PAD_ID(PF, 9),
MX27_PAD_PC_RST = PAD_ID(PF, 10),
MX27_PAD_PC_BVD2 = PAD_ID(PF, 11),
MX27_PAD_PC_BVD1 = PAD_ID(PF, 12),
MX27_PAD_PC_VS2 = PAD_ID(PF, 13),
MX27_PAD_PC_VS1 = PAD_ID(PF, 14),
MX27_PAD_CLKO = PAD_ID(PF, 15),
MX27_PAD_PC_PWRON = PAD_ID(PF, 16),
MX27_PAD_PC_READY = PAD_ID(PF, 17),
MX27_PAD_PC_WAIT_B = PAD_ID(PF, 18),
MX27_PAD_PC_CD2_B = PAD_ID(PF, 19),
MX27_PAD_PC_CD1_B = PAD_ID(PF, 20),
MX27_PAD_CS4_B = PAD_ID(PF, 21),
MX27_PAD_CS5_B = PAD_ID(PF, 22),
MX27_PAD_ATA_DATA15 = PAD_ID(PF, 23),
MX27_PAD_NFRB = PAD_ID(MX27_PF, 0),
MX27_PAD_NFCLE = PAD_ID(MX27_PF, 1),
MX27_PAD_NFWP_B = PAD_ID(MX27_PF, 2),
MX27_PAD_NFCE_B = PAD_ID(MX27_PF, 3),
MX27_PAD_NFALE = PAD_ID(MX27_PF, 4),
MX27_PAD_NFRE_B = PAD_ID(MX27_PF, 5),
MX27_PAD_NFWE_B = PAD_ID(MX27_PF, 6),
MX27_PAD_PC_POE = PAD_ID(MX27_PF, 7),
MX27_PAD_PC_RW_B = PAD_ID(MX27_PF, 8),
MX27_PAD_IOIS16 = PAD_ID(MX27_PF, 9),
MX27_PAD_PC_RST = PAD_ID(MX27_PF, 10),
MX27_PAD_PC_BVD2 = PAD_ID(MX27_PF, 11),
MX27_PAD_PC_BVD1 = PAD_ID(MX27_PF, 12),
MX27_PAD_PC_VS2 = PAD_ID(MX27_PF, 13),
MX27_PAD_PC_VS1 = PAD_ID(MX27_PF, 14),
MX27_PAD_CLKO = PAD_ID(MX27_PF, 15),
MX27_PAD_PC_PWRON = PAD_ID(MX27_PF, 16),
MX27_PAD_PC_READY = PAD_ID(MX27_PF, 17),
MX27_PAD_PC_WAIT_B = PAD_ID(MX27_PF, 18),
MX27_PAD_PC_CD2_B = PAD_ID(MX27_PF, 19),
MX27_PAD_PC_CD1_B = PAD_ID(MX27_PF, 20),
MX27_PAD_CS4_B = PAD_ID(MX27_PF, 21),
MX27_PAD_CS5_B = PAD_ID(MX27_PF, 22),
MX27_PAD_ATA_DATA15 = PAD_ID(MX27_PF, 23),
};
/* Pad names for the pinmux subsystem */

View File

@ -1792,7 +1792,7 @@ MODULE_DEVICE_TABLE(acpi, chv_pinctrl_acpi_match);
static struct platform_driver chv_pinctrl_driver = {
.probe = chv_pinctrl_probe,
.remove_new = chv_pinctrl_remove,
.remove = chv_pinctrl_remove,
.driver = {
.name = "cherryview-pinctrl",
.pm = pm_sleep_ptr(&chv_pinctrl_pm_ops),

View File

@ -264,6 +264,43 @@ static const struct intel_pinctrl_soc_data ehl_community1_soc_data = {
.ncommunities = ARRAY_SIZE(ehl_community1),
};
static const struct pinctrl_pin_desc ehl_community2_pins[] = {
/* DSW */
PINCTRL_PIN(0, "BATLOWB"),
PINCTRL_PIN(1, "ACPRESENT"),
PINCTRL_PIN(2, "LAN_WAKEB"),
PINCTRL_PIN(3, "PWRBTNB"),
PINCTRL_PIN(4, "SLP_S3B"),
PINCTRL_PIN(5, "SLP_S4B"),
PINCTRL_PIN(6, "SLP_AB"),
PINCTRL_PIN(7, "GPD_7"),
PINCTRL_PIN(8, "SUSCLK"),
PINCTRL_PIN(9, "SLP_WLANB"),
PINCTRL_PIN(10, "SLP_S5B"),
PINCTRL_PIN(11, "LANPHYPC"),
PINCTRL_PIN(12, "INPUT3VSEL"),
PINCTRL_PIN(13, "SLP_LANB"),
PINCTRL_PIN(14, "SLP_SUSB"),
PINCTRL_PIN(15, "WAKEB"),
PINCTRL_PIN(16, "DRAM_RESETB"),
};
static const struct intel_padgroup ehl_community2_gpps[] = {
EHL_GPP(0, 0, 16), /* DSW */
};
static const struct intel_community ehl_community2[] = {
EHL_COMMUNITY(0, 0, 16, ehl_community2_gpps),
};
static const struct intel_pinctrl_soc_data ehl_community2_soc_data = {
.uid = "2",
.pins = ehl_community2_pins,
.npins = ARRAY_SIZE(ehl_community2_pins),
.communities = ehl_community2,
.ncommunities = ARRAY_SIZE(ehl_community2),
};
static const struct pinctrl_pin_desc ehl_community3_pins[] = {
/* CPU */
PINCTRL_PIN(0, "HDACPU_SDI"),
@ -474,6 +511,7 @@ static const struct intel_pinctrl_soc_data ehl_community5_soc_data = {
static const struct intel_pinctrl_soc_data *ehl_soc_data_array[] = {
&ehl_community0_soc_data,
&ehl_community1_soc_data,
&ehl_community2_soc_data,
&ehl_community3_soc_data,
&ehl_community4_soc_data,
&ehl_community5_soc_data,

View File

@ -85,6 +85,18 @@
#define PADCFG1_TERM_UP BIT(13)
#define PADCFG1_TERM_SHIFT 10
#define PADCFG1_TERM_MASK GENMASK(12, 10)
/*
* Bit 0 Bit 1 Bit 2 Value, Ohms
*
* 0 0 0 -
* 0 0 1 20000
* 0 1 0 5000
* 0 1 1 ~4000
* 1 0 0 1000 (if supported)
* 1 0 1 ~952 (if supported)
* 1 1 0 ~833 (if supported)
* 1 1 1 ~800 (if supported)
*/
#define PADCFG1_TERM_20K BIT(2)
#define PADCFG1_TERM_5K BIT(1)
#define PADCFG1_TERM_4K (BIT(2) | BIT(1))

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
menu "MediaTek pinctrl drivers"
depends on ARCH_MEDIATEK || RALINK || COMPILE_TEST
depends on ARCH_MEDIATEK || ARCH_AIROHA || RALINK || COMPILE_TEST
config EINT_MTK
tristate "MediaTek External Interrupt Support"
@ -126,6 +126,21 @@ config PINCTRL_MT8127
select PINCTRL_MTK
# For ARMv8 SoCs
config PINCTRL_AIROHA
tristate "Airoha EN7581 pin control"
depends on OF
depends on ARM64 || COMPILE_TEST
select PINMUX
select GENERIC_PINCONF
select GENERIC_PINCTRL_GROUPS
select GENERIC_PINMUX_FUNCTIONS
select GPIOLIB
select GPIOLIB_IRQCHIP
select REGMAP_MMIO
help
Say yes here to support pin controller and gpio driver
on Airoha EN7581 SoC.
config PINCTRL_MT2712
bool "MediaTek MT2712 pin control"
depends on OF

View File

@ -8,6 +8,7 @@ obj-$(CONFIG_PINCTRL_MTK_MOORE) += pinctrl-moore.o
obj-$(CONFIG_PINCTRL_MTK_PARIS) += pinctrl-paris.o
# SoC Drivers
obj-$(CONFIG_PINCTRL_AIROHA) += pinctrl-airoha.o
obj-$(CONFIG_PINCTRL_MT7620) += pinctrl-mt7620.o
obj-$(CONFIG_PINCTRL_MT7621) += pinctrl-mt7621.o
obj-$(CONFIG_PINCTRL_MT76X8) += pinctrl-mt76x8.o

File diff suppressed because it is too large Load Diff

View File

@ -1089,7 +1089,7 @@ static struct platform_driver abx500_gpio_driver = {
.of_match_table = abx500_gpio_match,
},
.probe = abx500_gpio_probe,
.remove_new = abx500_gpio_remove,
.remove = abx500_gpio_remove,
};
static int __init abx500_gpio_init(void)

View File

@ -216,6 +216,12 @@ enum s32_pins {
S32G_IMCR_CAN1_RXD = 631,
S32G_IMCR_CAN2_RXD = 632,
S32G_IMCR_CAN3_RXD = 633,
/* JTAG IMCRs */
S32G_IMCR_JTAG_TMS = 562,
S32G_IMCR_JTAG_TCK = 572,
S32G_IMCR_JTAG_TDI = 573,
/* GMAC0 */
S32G_IMCR_Ethernet_MDIO = 527,
S32G_IMCR_Ethernet_CRS = 526,
@ -229,7 +235,21 @@ enum s32_pins {
S32G_IMCR_Ethernet_RX_DV = 530,
S32G_IMCR_Ethernet_TX_CLK = 538,
S32G_IMCR_Ethernet_REF_CLK = 535,
/* PFE EMAC 0 MII */
S32G_IMCR_PFE_EMAC_0_MDIO = 837,
S32G_IMCR_PFE_EMAC_0_CRS = 836,
S32G_IMCR_PFE_EMAC_0_COL = 835,
S32G_IMCR_PFE_EMAC_0_RX_D0 = 841,
S32G_IMCR_PFE_EMAC_0_RX_D1 = 842,
S32G_IMCR_PFE_EMAC_0_RX_D2 = 843,
S32G_IMCR_PFE_EMAC_0_RX_D3 = 844,
S32G_IMCR_PFE_EMAC_0_RX_ER = 840,
S32G_IMCR_PFE_EMAC_0_RX_CLK = 839,
S32G_IMCR_PFE_EMAC_0_RX_DV = 845,
S32G_IMCR_PFE_EMAC_0_TX_CLK = 846,
S32G_IMCR_PFE_EMAC_0_REF_CLK = 838,
/* PFE EMAC 1 MII */
S32G_IMCR_PFE_EMAC_1_MDIO = 857,
S32G_IMCR_PFE_EMAC_1_CRS = 856,
@ -317,6 +337,13 @@ enum s32_pins {
S32G_IMCR_LLCE_CAN13_RXD = 758,
S32G_IMCR_LLCE_CAN14_RXD = 759,
S32G_IMCR_LLCE_CAN15_RXD = 760,
S32G_IMCR_LLCE_UART0_RXD = 790,
S32G_IMCR_LLCE_UART1_RXD = 791,
S32G_IMCR_LLCE_UART2_RXD = 792,
S32G_IMCR_LLCE_UART3_RXD = 793,
S32G_IMCR_LLCE_LPSPI2_PCS0 = 811,
S32G_IMCR_LLCE_LPSPI2_SCK = 816,
S32G_IMCR_LLCE_LPSPI2_SIN = 817,
S32G_IMCR_USB_CLK = 895,
S32G_IMCR_USB_DATA0 = 896,
S32G_IMCR_USB_DATA1 = 897,
@ -503,6 +530,12 @@ static const struct pinctrl_pin_desc s32_pinctrl_pads_siul2[] = {
S32_PINCTRL_PIN(S32G_IMCR_USDHC_DAT7),
S32_PINCTRL_PIN(S32G_IMCR_USDHC_DQS),
S32_PINCTRL_PIN(S32G_IMCR_CAN0_RXD),
/* JTAG IMCRs */
S32_PINCTRL_PIN(S32G_IMCR_JTAG_TMS),
S32_PINCTRL_PIN(S32G_IMCR_JTAG_TCK),
S32_PINCTRL_PIN(S32G_IMCR_JTAG_TDI),
/* GMAC0 */
S32_PINCTRL_PIN(S32G_IMCR_Ethernet_MDIO),
S32_PINCTRL_PIN(S32G_IMCR_Ethernet_CRS),
@ -638,6 +671,13 @@ static const struct pinctrl_pin_desc s32_pinctrl_pads_siul2[] = {
S32_PINCTRL_PIN(S32G_IMCR_LLCE_CAN13_RXD),
S32_PINCTRL_PIN(S32G_IMCR_LLCE_CAN14_RXD),
S32_PINCTRL_PIN(S32G_IMCR_LLCE_CAN15_RXD),
S32_PINCTRL_PIN(S32G_IMCR_LLCE_UART0_RXD),
S32_PINCTRL_PIN(S32G_IMCR_LLCE_UART1_RXD),
S32_PINCTRL_PIN(S32G_IMCR_LLCE_UART2_RXD),
S32_PINCTRL_PIN(S32G_IMCR_LLCE_UART3_RXD),
S32_PINCTRL_PIN(S32G_IMCR_LLCE_LPSPI2_PCS0),
S32_PINCTRL_PIN(S32G_IMCR_LLCE_LPSPI2_SCK),
S32_PINCTRL_PIN(S32G_IMCR_LLCE_LPSPI2_SIN),
S32_PINCTRL_PIN(S32G_IMCR_CAN1_RXD),
S32_PINCTRL_PIN(S32G_IMCR_CAN2_RXD),
S32_PINCTRL_PIN(S32G_IMCR_CAN3_RXD),
@ -652,6 +692,18 @@ static const struct pinctrl_pin_desc s32_pinctrl_pads_siul2[] = {
S32_PINCTRL_PIN(S32G_IMCR_USB_DATA7),
S32_PINCTRL_PIN(S32G_IMCR_USB_DIR),
S32_PINCTRL_PIN(S32G_IMCR_USB_NXT),
S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_MDIO),
S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_CRS),
S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_COL),
S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_RX_D0),
S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_RX_D1),
S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_RX_D2),
S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_RX_D3),
S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_RX_ER),
S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_RX_CLK),
S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_RX_DV),
S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_TX_CLK),
S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_0_REF_CLK),
S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_1_MDIO),
S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_1_CRS),
S32_PINCTRL_PIN(S32G_IMCR_PFE_EMAC_1_COL),

View File

@ -506,7 +506,7 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
case IRQ_TYPE_EDGE_BOTH:
pin_reg &= ~BIT(LEVEL_TRIG_OFF);
pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
pin_reg |= BOTH_EADGE << ACTIVE_LEVEL_OFF;
pin_reg |= BOTH_EDGES << ACTIVE_LEVEL_OFF;
irq_set_handler_locked(d, handle_edge_irq);
break;
@ -1204,7 +1204,7 @@ static struct platform_driver amd_gpio_driver = {
#endif
},
.probe = amd_gpio_probe,
.remove_new = amd_gpio_remove,
.remove = amd_gpio_remove,
};
module_platform_driver(amd_gpio_driver);

View File

@ -60,12 +60,12 @@
#define DB_TYPE_PRESERVE_HIGH_GLITCH 0x2UL
#define DB_TYPE_REMOVE_GLITCH 0x3UL
#define EDGE_TRAGGER 0x0UL
#define EDGE_TRIGGER 0x0UL
#define LEVEL_TRIGGER 0x1UL
#define ACTIVE_HIGH 0x0UL
#define ACTIVE_LOW 0x1UL
#define BOTH_EADGE 0x2UL
#define BOTH_EDGES 0x2UL
#define ENABLE_INTERRUPT 0x1UL
#define DISABLE_INTERRUPT 0x0UL

View File

@ -988,7 +988,7 @@ static struct platform_driver artpec6_pmx_driver = {
.of_match_table = artpec6_pinctrl_match,
},
.probe = artpec6_pmx_probe,
.remove_new = artpec6_pmx_remove,
.remove = artpec6_pmx_remove,
};
static int __init artpec6_pmx_init(void)

View File

@ -80,7 +80,7 @@ struct aw9523 {
struct regmap *regmap;
struct mutex i2c_lock;
struct gpio_desc *reset_gpio;
struct regulator *vio_vreg;
int vio_vreg;
struct pinctrl_dev *pctl;
struct gpio_chip gpio;
struct aw9523_irq *irq;
@ -550,10 +550,10 @@ static int aw9523_gpio_get(struct gpio_chip *chip, unsigned int offset)
/**
* _aw9523_gpio_get_multiple - Get I/O state for an entire port
* @regmap: Regmap structure
* @pin: gpiolib pin number
* @awi: Controller data
* @regbit: hw pin index, used to retrieve port number
* @state: returned port I/O state
* @mask: lines to read values for
*
* Return: Zero for success or negative number for error
*/
@ -972,29 +972,23 @@ static int aw9523_probe(struct i2c_client *client)
if (IS_ERR(awi->regmap))
return PTR_ERR(awi->regmap);
awi->vio_vreg = devm_regulator_get_optional(dev, "vio");
if (IS_ERR(awi->vio_vreg)) {
if (PTR_ERR(awi->vio_vreg) == -EPROBE_DEFER)
return -EPROBE_DEFER;
awi->vio_vreg = NULL;
} else {
ret = regulator_enable(awi->vio_vreg);
if (ret)
return ret;
}
awi->vio_vreg = devm_regulator_get_enable_optional(dev, "vio");
if (awi->vio_vreg && awi->vio_vreg != -ENODEV)
return awi->vio_vreg;
ret = devm_mutex_init(dev, &awi->i2c_lock);
if (ret)
return ret;
mutex_init(&awi->i2c_lock);
lockdep_set_subclass(&awi->i2c_lock, i2c_adapter_depth(client->adapter));
pdesc = devm_kzalloc(dev, sizeof(*pdesc), GFP_KERNEL);
if (!pdesc) {
ret = -ENOMEM;
goto err_disable_vregs;
}
if (!pdesc)
return -ENOMEM;
ret = aw9523_hw_init(awi);
if (ret)
goto err_disable_vregs;
return ret;
pdesc->name = dev_name(dev);
pdesc->owner = THIS_MODULE;
@ -1006,31 +1000,20 @@ static int aw9523_probe(struct i2c_client *client)
ret = aw9523_init_gpiochip(awi, pdesc->npins);
if (ret)
goto err_disable_vregs;
return ret;
if (client->irq) {
ret = aw9523_init_irq(awi, client->irq);
if (ret)
goto err_disable_vregs;
return ret;
}
awi->pctl = devm_pinctrl_register(dev, pdesc, awi);
if (IS_ERR(awi->pctl)) {
ret = dev_err_probe(dev, PTR_ERR(awi->pctl), "Cannot register pinctrl");
goto err_disable_vregs;
}
if (IS_ERR(awi->pctl))
return dev_err_probe(dev, PTR_ERR(awi->pctl),
"Cannot register pinctrl");
ret = devm_gpiochip_add_data(dev, &awi->gpio, awi);
if (ret)
goto err_disable_vregs;
return ret;
err_disable_vregs:
if (awi->vio_vreg)
regulator_disable(awi->vio_vreg);
mutex_destroy(&awi->i2c_lock);
return ret;
return devm_gpiochip_add_data(dev, &awi->gpio, awi);
}
static void aw9523_remove(struct i2c_client *client)
@ -1043,19 +1026,15 @@ static void aw9523_remove(struct i2c_client *client)
* set the pins to hardware defaults before removing the driver
* to leave it in a clean, safe and predictable state.
*/
if (awi->vio_vreg) {
regulator_disable(awi->vio_vreg);
} else {
if (awi->vio_vreg == -ENODEV) {
mutex_lock(&awi->i2c_lock);
aw9523_hw_init(awi);
mutex_unlock(&awi->i2c_lock);
}
mutex_destroy(&awi->i2c_lock);
}
static const struct i2c_device_id aw9523_i2c_id_table[] = {
{ "aw9523_i2c", 0 },
{ "aw9523_i2c" },
{ }
};
MODULE_DEVICE_TABLE(i2c, aw9523_i2c_id_table);

View File

@ -141,7 +141,6 @@ static const struct dmi_system_id cy8c95x0_dmi_acpi_irq_info[] = {
* @nport: Number of Gports in this chip
* @gpio_chip: gpiolib chip
* @driver_data: private driver data
* @regulator: Pointer to the regulator for the IC
* @dev: struct device
* @pctldev: pin controller device
* @pinctrl_desc: pin controller description
@ -160,10 +159,9 @@ struct cy8c95x0_pinctrl {
DECLARE_BITMAP(irq_trig_high, MAX_LINE);
DECLARE_BITMAP(push_pull, MAX_LINE);
DECLARE_BITMAP(shiftmask, MAX_LINE);
int nport;
unsigned int nport;
struct gpio_chip gpio_chip;
unsigned long driver_data;
struct regulator *regulator;
struct device *dev;
struct pinctrl_dev *pctldev;
struct pinctrl_desc pinctrl_desc;
@ -612,9 +610,8 @@ static int cy8c95x0_write_regs_mask(struct cy8c95x0_pinctrl *chip, int reg,
DECLARE_BITMAP(tmask, MAX_LINE);
DECLARE_BITMAP(tval, MAX_LINE);
int write_val;
int ret = 0;
int i;
u8 bits;
int ret;
/* Add the 4 bit gap of Gport2 */
bitmap_andnot(tmask, mask, chip->shiftmask, MAX_LINE);
@ -625,7 +622,7 @@ static int cy8c95x0_write_regs_mask(struct cy8c95x0_pinctrl *chip, int reg,
bitmap_shift_left(tval, tval, 4, MAX_LINE);
bitmap_replace(tval, tval, val, chip->shiftmask, BANK_SZ * 3);
for (i = 0; i < chip->nport; i++) {
for (unsigned int i = 0; i < chip->nport; i++) {
/* Skip over unused banks */
bits = bitmap_get_value8(tmask, i * BANK_SZ);
if (!bits)
@ -634,15 +631,13 @@ static int cy8c95x0_write_regs_mask(struct cy8c95x0_pinctrl *chip, int reg,
write_val = bitmap_get_value8(tval, i * BANK_SZ);
ret = cy8c95x0_regmap_update_bits(chip, reg, i, bits, write_val);
if (ret < 0)
goto out;
if (ret < 0) {
dev_err(chip->dev, "failed writing register %d, port %u: err %d\n", reg, i, ret);
return ret;
}
}
out:
if (ret < 0)
dev_err(chip->dev, "failed writing register %d, port %d: err %d\n", reg, i, ret);
return ret;
return 0;
}
static int cy8c95x0_read_regs_mask(struct cy8c95x0_pinctrl *chip, int reg,
@ -652,9 +647,8 @@ static int cy8c95x0_read_regs_mask(struct cy8c95x0_pinctrl *chip, int reg,
DECLARE_BITMAP(tval, MAX_LINE);
DECLARE_BITMAP(tmp, MAX_LINE);
int read_val;
int ret = 0;
int i;
u8 bits;
int ret;
/* Add the 4 bit gap of Gport2 */
bitmap_andnot(tmask, mask, chip->shiftmask, MAX_LINE);
@ -665,15 +659,17 @@ static int cy8c95x0_read_regs_mask(struct cy8c95x0_pinctrl *chip, int reg,
bitmap_shift_left(tval, tval, 4, MAX_LINE);
bitmap_replace(tval, tval, val, chip->shiftmask, BANK_SZ * 3);
for (i = 0; i < chip->nport; i++) {
for (unsigned int i = 0; i < chip->nport; i++) {
/* Skip over unused banks */
bits = bitmap_get_value8(tmask, i * BANK_SZ);
if (!bits)
continue;
ret = cy8c95x0_regmap_read(chip, reg, i, &read_val);
if (ret < 0)
goto out;
if (ret < 0) {
dev_err(chip->dev, "failed reading register %d, port %u: err %d\n", reg, i, ret);
return ret;
}
read_val &= bits;
read_val |= bitmap_get_value8(tval, i * BANK_SZ) & ~bits;
@ -684,11 +680,7 @@ static int cy8c95x0_read_regs_mask(struct cy8c95x0_pinctrl *chip, int reg,
bitmap_shift_right(tmp, tval, 4, MAX_LINE);
bitmap_replace(val, tmp, tval, chip->shiftmask, MAX_LINE);
out:
if (ret < 0)
dev_err(chip->dev, "failed reading register %d, port %d: err %d\n", reg, i, ret);
return ret;
return 0;
}
static int cy8c95x0_gpio_direction_input(struct gpio_chip *gc, unsigned int off)
@ -754,14 +746,12 @@ static int cy8c95x0_gpio_get_direction(struct gpio_chip *gc, unsigned int off)
ret = cy8c95x0_regmap_read(chip, CY8C95X0_DIRECTION, port, &reg_val);
if (ret < 0)
goto out;
return ret;
if (reg_val & bit)
return GPIO_LINE_DIRECTION_IN;
return GPIO_LINE_DIRECTION_OUT;
out:
return ret;
}
static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip,
@ -823,8 +813,7 @@ static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip,
case PIN_CONFIG_SLEEP_HARDWARE_STATE:
case PIN_CONFIG_SLEW_RATE:
default:
ret = -ENOTSUPP;
goto out;
return -ENOTSUPP;
}
/*
* Writing 1 to one of the drive mode registers will automatically
@ -832,7 +821,7 @@ static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip,
*/
ret = cy8c95x0_regmap_read(chip, reg, port, &reg_val);
if (ret < 0)
goto out;
return ret;
if (reg_val & bit)
arg = 1;
@ -840,8 +829,7 @@ static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip,
arg = !arg;
*config = pinconf_to_config_packed(param, (u16)arg);
out:
return ret;
return 0;
}
static int cy8c95x0_gpio_set_pincfg(struct cy8c95x0_pinctrl *chip,
@ -853,7 +841,6 @@ static int cy8c95x0_gpio_set_pincfg(struct cy8c95x0_pinctrl *chip,
unsigned long param = pinconf_to_config_param(config);
unsigned long arg = pinconf_to_config_argument(config);
unsigned int reg;
int ret;
switch (param) {
case PIN_CONFIG_BIAS_PULL_UP:
@ -884,22 +871,17 @@ static int cy8c95x0_gpio_set_pincfg(struct cy8c95x0_pinctrl *chip,
reg = CY8C95X0_PWMSEL;
break;
case PIN_CONFIG_OUTPUT_ENABLE:
ret = cy8c95x0_pinmux_direction(chip, off, !arg);
goto out;
return cy8c95x0_pinmux_direction(chip, off, !arg);
case PIN_CONFIG_INPUT_ENABLE:
ret = cy8c95x0_pinmux_direction(chip, off, arg);
goto out;
return cy8c95x0_pinmux_direction(chip, off, arg);
default:
ret = -ENOTSUPP;
goto out;
return -ENOTSUPP;
}
/*
* Writing 1 to one of the drive mode registers will automatically
* clear conflicting set bits in the other drive mode registers.
*/
ret = cy8c95x0_regmap_write_bits(chip, reg, port, bit, bit);
out:
return ret;
return cy8c95x0_regmap_write_bits(chip, reg, port, bit, bit);
}
static int cy8c95x0_gpio_get_multiple(struct gpio_chip *gc,
@ -1424,32 +1406,30 @@ static int cy8c95x0_detect(struct i2c_client *client,
}
dev_info(&client->dev, "Found a %s chip at 0x%02x.\n", name, client->addr);
strscpy(info->type, name, I2C_NAME_SIZE);
strscpy(info->type, name);
return 0;
}
static int cy8c95x0_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
struct cy8c95x0_pinctrl *chip;
struct regmap_config regmap_conf;
struct regmap_range_cfg regmap_range_conf;
struct regulator *reg;
int ret;
chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;
chip->dev = &client->dev;
chip->dev = dev;
/* Set the device type */
chip->driver_data = (uintptr_t)i2c_get_match_data(client);
if (!chip->driver_data)
return -ENODEV;
i2c_set_clientdata(client, chip);
chip->tpin = chip->driver_data & CY8C95X0_GPIO_MASK;
chip->nport = DIV_ROUND_UP(CY8C95X0_PIN_TO_OFFSET(chip->tpin), BANK_SZ);
@ -1457,46 +1437,34 @@ static int cy8c95x0_probe(struct i2c_client *client)
switch (chip->tpin) {
case 20:
strscpy(chip->name, cy8c95x0_id[0].name, I2C_NAME_SIZE);
strscpy(chip->name, cy8c95x0_id[0].name);
regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 3 * MUXED_STRIDE;
break;
case 40:
strscpy(chip->name, cy8c95x0_id[1].name, I2C_NAME_SIZE);
strscpy(chip->name, cy8c95x0_id[1].name);
regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 6 * MUXED_STRIDE;
break;
case 60:
strscpy(chip->name, cy8c95x0_id[2].name, I2C_NAME_SIZE);
strscpy(chip->name, cy8c95x0_id[2].name);
regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 8 * MUXED_STRIDE;
break;
default:
return -ENODEV;
}
reg = devm_regulator_get(&client->dev, "vdd");
if (IS_ERR(reg)) {
if (PTR_ERR(reg) == -EPROBE_DEFER)
return -EPROBE_DEFER;
} else {
ret = regulator_enable(reg);
if (ret) {
dev_err(&client->dev, "failed to enable regulator vdd: %d\n", ret);
return ret;
}
chip->regulator = reg;
}
ret = devm_regulator_get_enable(dev, "vdd");
if (ret)
return dev_err_probe(dev, ret, "failed to enable regulator vdd\n");
/* bring the chip out of reset if reset pin is provided */
chip->gpio_reset = devm_gpiod_get_optional(&client->dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(chip->gpio_reset)) {
ret = dev_err_probe(chip->dev, PTR_ERR(chip->gpio_reset),
"Failed to get GPIO 'reset'\n");
goto err_exit;
} else if (chip->gpio_reset) {
usleep_range(1000, 2000);
chip->gpio_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(chip->gpio_reset))
return dev_err_probe(dev, PTR_ERR(chip->gpio_reset), "Failed to get GPIO 'reset'\n");
gpiod_set_consumer_name(chip->gpio_reset, "CY8C95X0 RESET");
if (chip->gpio_reset) {
fsleep(1000);
gpiod_set_value_cansleep(chip->gpio_reset, 0);
usleep_range(250000, 300000);
gpiod_set_consumer_name(chip->gpio_reset, "CY8C95X0 RESET");
fsleep(250000);
}
/* Regmap for direct and paged registers */
@ -1506,10 +1474,8 @@ static int cy8c95x0_probe(struct i2c_client *client)
regmap_conf.num_reg_defaults_raw = regmap_range_conf.range_max;
chip->regmap = devm_regmap_init_i2c(client, &regmap_conf);
if (IS_ERR(chip->regmap)) {
ret = PTR_ERR(chip->regmap);
goto err_exit;
}
if (IS_ERR(chip->regmap))
return PTR_ERR(chip->regmap);
bitmap_zero(chip->push_pull, MAX_LINE);
bitmap_zero(chip->shiftmask, MAX_LINE);
@ -1525,31 +1491,14 @@ static int cy8c95x0_probe(struct i2c_client *client)
if (client->irq) {
ret = cy8c95x0_irq_setup(chip, client->irq);
if (ret)
goto err_exit;
return ret;
}
ret = cy8c95x0_setup_pinctrl(chip);
if (ret)
goto err_exit;
return ret;
ret = cy8c95x0_setup_gpiochip(chip);
if (ret)
goto err_exit;
return 0;
err_exit:
if (!IS_ERR_OR_NULL(chip->regulator))
regulator_disable(chip->regulator);
return ret;
}
static void cy8c95x0_remove(struct i2c_client *client)
{
struct cy8c95x0_pinctrl *chip = i2c_get_clientdata(client);
if (!IS_ERR_OR_NULL(chip->regulator))
regulator_disable(chip->regulator);
return cy8c95x0_setup_gpiochip(chip);
}
static const struct acpi_device_id cy8c95x0_acpi_ids[] = {
@ -1565,7 +1514,6 @@ static struct i2c_driver cy8c95x0_driver = {
.acpi_match_table = cy8c95x0_acpi_ids,
},
.probe = cy8c95x0_probe,
.remove = cy8c95x0_remove,
.id_table = cy8c95x0_id,
.detect = cy8c95x0_detect,
};

View File

@ -96,8 +96,6 @@ struct k210_fpioa_data {
struct k210_fpioa __iomem *fpioa;
struct regmap *sysctl_map;
u32 power_offset;
struct clk *clk;
struct clk *pclk;
};
#define K210_PIN_NAME(i) ("IO_" #i)
@ -183,7 +181,7 @@ static const u32 k210_pinconf_mode_id_to_mode[] = {
[K210_PC_DEFAULT_INT13] = K210_PC_MODE_IN | K210_PC_PU,
};
#undef DEFAULT
#undef K210_PC_DEFAULT
/*
* Pin functions configuration information.
@ -925,6 +923,7 @@ static int k210_fpioa_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
struct k210_fpioa_data *pdata;
struct clk *clk, *pclk;
dev_info(dev, "K210 FPIOA pin controller\n");
@ -939,13 +938,13 @@ static int k210_fpioa_probe(struct platform_device *pdev)
if (IS_ERR(pdata->fpioa))
return PTR_ERR(pdata->fpioa);
pdata->clk = devm_clk_get_enabled(dev, "ref");
if (IS_ERR(pdata->clk))
return PTR_ERR(pdata->clk);
clk = devm_clk_get_enabled(dev, "ref");
if (IS_ERR(clk))
return PTR_ERR(clk);
pdata->pclk = devm_clk_get_optional_enabled(dev, "pclk");
if (IS_ERR(pdata->pclk))
return PTR_ERR(pdata->pclk);
pclk = devm_clk_get_optional_enabled(dev, "pclk");
if (IS_ERR(pclk))
return PTR_ERR(pclk);
pdata->sysctl_map =
syscon_regmap_lookup_by_phandle_args(np,

View File

@ -0,0 +1,641 @@
// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
/*
* Copyright (C) 2024 Canaan Bright Sight Co. Ltd
* Copyright (C) 2024 Ze Huang <18771902331@163.com>
*/
#include <linux/module.h>
#include <linux/device.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/regmap.h>
#include <linux/seq_file.h>
#include "core.h"
#include "pinconf.h"
#define K230_NPINS 64
#define K230_SHIFT_ST (0)
#define K230_SHIFT_DS (1)
#define K230_SHIFT_BIAS (5)
#define K230_SHIFT_PD (5)
#define K230_SHIFT_PU (6)
#define K230_SHIFT_OE (7)
#define K230_SHIFT_IE (8)
#define K230_SHIFT_MSC (9)
#define K230_SHIFT_SL (10)
#define K230_SHIFT_SEL (11)
#define K230_PC_ST BIT(0)
#define K230_PC_DS GENMASK(4, 1)
#define K230_PC_PD BIT(5)
#define K230_PC_PU BIT(6)
#define K230_PC_BIAS GENMASK(6, 5)
#define K230_PC_OE BIT(7)
#define K230_PC_IE BIT(8)
#define K230_PC_MSC BIT(9)
#define K230_PC_SL BIT(10)
#define K230_PC_SEL GENMASK(13, 11)
struct k230_pin_conf {
unsigned int func;
unsigned long *configs;
unsigned int nconfigs;
};
struct k230_pin_group {
const char *name;
unsigned int *pins;
unsigned int num_pins;
struct k230_pin_conf *data;
};
struct k230_pmx_func {
const char *name;
const char **groups;
unsigned int *group_idx;
unsigned int ngroups;
};
struct k230_pinctrl {
struct pinctrl_desc pctl;
struct pinctrl_dev *pctl_dev;
struct regmap *regmap_base;
void __iomem *base;
struct k230_pin_group *groups;
unsigned int ngroups;
struct k230_pmx_func *functions;
unsigned int nfunctions;
};
static const struct regmap_config k230_regmap_config = {
.name = "canaan,pinctrl",
.reg_bits = 32,
.val_bits = 32,
.max_register = 0x100,
.reg_stride = 4,
};
static int k230_get_groups_count(struct pinctrl_dev *pctldev)
{
struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
return info->ngroups;
}
static const char *k230_get_group_name(struct pinctrl_dev *pctldev,
unsigned int selector)
{
struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
return info->groups[selector].name;
}
static int k230_get_group_pins(struct pinctrl_dev *pctldev,
unsigned int selector,
const unsigned int **pins,
unsigned int *num_pins)
{
struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
if (selector >= info->ngroups)
return -EINVAL;
*pins = info->groups[selector].pins;
*num_pins = info->groups[selector].num_pins;
return 0;
}
static inline const struct k230_pmx_func *k230_name_to_funtion(
const struct k230_pinctrl *info, const char *name)
{
unsigned int i;
for (i = 0; i < info->nfunctions; i++) {
if (!strcmp(info->functions[i].name, name))
return &info->functions[i];
}
return NULL;
}
static struct pinctrl_pin_desc k230_pins[] = {
PINCTRL_PIN(0, "IO0"), PINCTRL_PIN(1, "IO1"), PINCTRL_PIN(2, "IO2"),
PINCTRL_PIN(3, "IO3"), PINCTRL_PIN(4, "IO4"), PINCTRL_PIN(5, "IO5"),
PINCTRL_PIN(6, "IO6"), PINCTRL_PIN(7, "IO7"), PINCTRL_PIN(8, "IO8"),
PINCTRL_PIN(9, "IO9"), PINCTRL_PIN(10, "IO10"), PINCTRL_PIN(11, "IO11"),
PINCTRL_PIN(12, "IO12"), PINCTRL_PIN(13, "IO13"), PINCTRL_PIN(14, "IO14"),
PINCTRL_PIN(15, "IO15"), PINCTRL_PIN(16, "IO16"), PINCTRL_PIN(17, "IO17"),
PINCTRL_PIN(18, "IO18"), PINCTRL_PIN(19, "IO19"), PINCTRL_PIN(20, "IO20"),
PINCTRL_PIN(21, "IO21"), PINCTRL_PIN(22, "IO22"), PINCTRL_PIN(23, "IO23"),
PINCTRL_PIN(24, "IO24"), PINCTRL_PIN(25, "IO25"), PINCTRL_PIN(26, "IO26"),
PINCTRL_PIN(27, "IO27"), PINCTRL_PIN(28, "IO28"), PINCTRL_PIN(29, "IO29"),
PINCTRL_PIN(30, "IO30"), PINCTRL_PIN(31, "IO31"), PINCTRL_PIN(32, "IO32"),
PINCTRL_PIN(33, "IO33"), PINCTRL_PIN(34, "IO34"), PINCTRL_PIN(35, "IO35"),
PINCTRL_PIN(36, "IO36"), PINCTRL_PIN(37, "IO37"), PINCTRL_PIN(38, "IO38"),
PINCTRL_PIN(39, "IO39"), PINCTRL_PIN(40, "IO40"), PINCTRL_PIN(41, "IO41"),
PINCTRL_PIN(42, "IO42"), PINCTRL_PIN(43, "IO43"), PINCTRL_PIN(44, "IO44"),
PINCTRL_PIN(45, "IO45"), PINCTRL_PIN(46, "IO46"), PINCTRL_PIN(47, "IO47"),
PINCTRL_PIN(48, "IO48"), PINCTRL_PIN(49, "IO49"), PINCTRL_PIN(50, "IO50"),
PINCTRL_PIN(51, "IO51"), PINCTRL_PIN(52, "IO52"), PINCTRL_PIN(53, "IO53"),
PINCTRL_PIN(54, "IO54"), PINCTRL_PIN(55, "IO55"), PINCTRL_PIN(56, "IO56"),
PINCTRL_PIN(57, "IO57"), PINCTRL_PIN(58, "IO58"), PINCTRL_PIN(59, "IO59"),
PINCTRL_PIN(60, "IO60"), PINCTRL_PIN(61, "IO61"), PINCTRL_PIN(62, "IO62"),
PINCTRL_PIN(63, "IO63")
};
static void k230_pinctrl_pin_dbg_show(struct pinctrl_dev *pctldev,
struct seq_file *s, unsigned int offset)
{
struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
u32 val, bias, drive, input, slew, schmitt, power;
struct k230_pin_group *grp = k230_pins[offset].drv_data;
static const char * const biasing[] = {
"pull none", "pull down", "pull up", "" };
static const char * const enable[] = {
"disable", "enable" };
static const char * const power_source[] = {
"3V3", "1V8" };
regmap_read(info->regmap_base, offset * 4, &val);
drive = (val & K230_PC_DS) >> K230_SHIFT_DS;
bias = (val & K230_PC_BIAS) >> K230_SHIFT_BIAS;
input = (val & K230_PC_IE) >> K230_SHIFT_IE;
slew = (val & K230_PC_SL) >> K230_SHIFT_SL;
schmitt = (val & K230_PC_ST) >> K230_SHIFT_ST;
power = (val & K230_PC_MSC) >> K230_SHIFT_MSC;
seq_printf(s, "%s - strength %d - %s - %s - slewrate %s - schmitt %s - %s",
grp ? grp->name : "unknown",
drive,
biasing[bias],
input ? "input" : "output",
enable[slew],
enable[schmitt],
power_source[power]);
}
static int k230_dt_node_to_map(struct pinctrl_dev *pctldev,
struct device_node *np_config,
struct pinctrl_map **map,
unsigned int *num_maps)
{
struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
struct device *dev = info->pctl_dev->dev;
const struct k230_pmx_func *func;
const struct k230_pin_group *grp;
struct pinctrl_map *new_map;
int map_num, i, j, idx;
unsigned int grp_id;
func = k230_name_to_funtion(info, np_config->name);
if (!func) {
dev_err(dev, "function %s not found\n", np_config->name);
return -EINVAL;
}
map_num = 0;
for (i = 0; i < func->ngroups; ++i) {
grp_id = func->group_idx[i];
/* npins of config map plus a mux map */
map_num += info->groups[grp_id].num_pins + 1;
}
new_map = kcalloc(map_num, sizeof(*new_map), GFP_KERNEL);
if (!new_map)
return -ENOMEM;
*map = new_map;
*num_maps = map_num;
idx = 0;
for (i = 0; i < func->ngroups; ++i) {
grp_id = func->group_idx[i];
grp = &info->groups[grp_id];
new_map[idx].type = PIN_MAP_TYPE_MUX_GROUP;
new_map[idx].data.mux.group = grp->name;
new_map[idx].data.mux.function = np_config->name;
idx++;
for (j = 0; j < grp->num_pins; ++j) {
new_map[idx].type = PIN_MAP_TYPE_CONFIGS_PIN;
new_map[idx].data.configs.group_or_pin =
pin_get_name(pctldev, grp->pins[j]);
new_map[idx].data.configs.configs =
grp->data[j].configs;
new_map[idx].data.configs.num_configs =
grp->data[j].nconfigs;
idx++;
}
}
return 0;
}
static void k230_dt_free_map(struct pinctrl_dev *pctldev,
struct pinctrl_map *map, unsigned int num_maps)
{
kfree(map);
}
static const struct pinctrl_ops k230_pctrl_ops = {
.get_groups_count = k230_get_groups_count,
.get_group_name = k230_get_group_name,
.get_group_pins = k230_get_group_pins,
.pin_dbg_show = k230_pinctrl_pin_dbg_show,
.dt_node_to_map = k230_dt_node_to_map,
.dt_free_map = k230_dt_free_map,
};
static int k230_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long *config)
{
struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
enum pin_config_param param = pinconf_to_config_param(*config);
unsigned int val, arg;
regmap_read(info->regmap_base, pin * 4, &val);
switch (param) {
case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
arg = (val & K230_PC_ST) ? 1 : 0;
break;
case PIN_CONFIG_DRIVE_STRENGTH:
arg = (val & K230_PC_DS) >> K230_SHIFT_DS;
break;
case PIN_CONFIG_BIAS_DISABLE:
arg = (val & K230_PC_BIAS) ? 0 : 1;
break;
case PIN_CONFIG_BIAS_PULL_DOWN:
arg = (val & K230_PC_PD) ? 1 : 0;
break;
case PIN_CONFIG_BIAS_PULL_UP:
arg = (val & K230_PC_PU) ? 1 : 0;
break;
case PIN_CONFIG_OUTPUT_ENABLE:
arg = (val & K230_PC_OE) ? 1 : 0;
break;
case PIN_CONFIG_INPUT_ENABLE:
arg = (val & K230_PC_IE) ? 1 : 0;
break;
case PIN_CONFIG_POWER_SOURCE:
arg = (val & K230_PC_MSC) ? 1 : 0;
break;
case PIN_CONFIG_SLEW_RATE:
arg = (val & K230_PC_SL) ? 1 : 0;
break;
default:
return -EINVAL;
}
*config = pinconf_to_config_packed(param, arg);
return 0;
}
static int k230_pinconf_set_param(struct pinctrl_dev *pctldev, unsigned int pin,
enum pin_config_param param, unsigned int arg)
{
struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
unsigned int val;
regmap_read(info->regmap_base, pin * 4, &val);
switch (param) {
case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
if (arg)
val |= K230_PC_ST;
else
val &= ~K230_PC_ST;
break;
case PIN_CONFIG_DRIVE_STRENGTH:
val &= ~K230_PC_DS;
val |= (arg << K230_SHIFT_DS) & K230_PC_DS;
break;
case PIN_CONFIG_BIAS_DISABLE:
val &= ~K230_PC_BIAS;
break;
case PIN_CONFIG_BIAS_PULL_DOWN:
if (!arg)
return -EINVAL;
val |= K230_PC_PD;
break;
case PIN_CONFIG_BIAS_PULL_UP:
if (!arg)
return -EINVAL;
val |= K230_PC_PU;
break;
case PIN_CONFIG_OUTPUT_ENABLE:
if (!arg)
return -EINVAL;
val |= K230_PC_OE;
break;
case PIN_CONFIG_INPUT_ENABLE:
if (!arg)
return -EINVAL;
val |= K230_PC_IE;
break;
case PIN_CONFIG_POWER_SOURCE:
if (arg)
val |= K230_PC_MSC;
else
val &= ~K230_PC_MSC;
break;
case PIN_CONFIG_SLEW_RATE:
if (arg)
val |= K230_PC_SL;
else
val &= ~K230_PC_SL;
break;
default:
return -EINVAL;
}
regmap_write(info->regmap_base, pin * 4, val);
return 0;
}
static int k230_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long *configs, unsigned int num_configs)
{
struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
struct device *dev = info->pctl_dev->dev;
enum pin_config_param param;
unsigned int arg, i;
int ret;
if (pin >= K230_NPINS) {
dev_err(dev, "pin number out of range\n");
return -EINVAL;
}
for (i = 0; i < num_configs; i++) {
param = pinconf_to_config_param(configs[i]);
arg = pinconf_to_config_argument(configs[i]);
ret = k230_pinconf_set_param(pctldev, pin, param, arg);
if (ret)
return ret;
}
return 0;
}
static void k230_pconf_dbg_show(struct pinctrl_dev *pctldev,
struct seq_file *s, unsigned int pin)
{
struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
unsigned int val;
regmap_read(info->regmap_base, pin * 4, &val);
seq_printf(s, " 0x%08x", val);
}
static const struct pinconf_ops k230_pinconf_ops = {
.is_generic = true,
.pin_config_get = k230_pinconf_get,
.pin_config_set = k230_pinconf_set,
.pin_config_dbg_show = k230_pconf_dbg_show,
};
static int k230_get_functions_count(struct pinctrl_dev *pctldev)
{
struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
return info->nfunctions;
}
static const char *k230_get_fname(struct pinctrl_dev *pctldev,
unsigned int selector)
{
struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
return info->functions[selector].name;
}
static int k230_get_groups(struct pinctrl_dev *pctldev, unsigned int selector,
const char * const **groups, unsigned int *num_groups)
{
struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
*groups = info->functions[selector].groups;
*num_groups = info->functions[selector].ngroups;
return 0;
}
static int k230_set_mux(struct pinctrl_dev *pctldev, unsigned int selector,
unsigned int group)
{
struct k230_pinctrl *info = pinctrl_dev_get_drvdata(pctldev);
const struct k230_pin_conf *data = info->groups[group].data;
struct k230_pin_group *grp = &info->groups[group];
const unsigned int *pins = grp->pins;
struct regmap *regmap;
unsigned int value, mask;
int cnt, reg;
regmap = info->regmap_base;
for (cnt = 0; cnt < grp->num_pins; cnt++) {
reg = pins[cnt] * 4;
value = data[cnt].func << K230_SHIFT_SEL;
mask = K230_PC_SEL;
regmap_update_bits(regmap, reg, mask, value);
k230_pins[pins[cnt]].drv_data = grp;
}
return 0;
}
static const struct pinmux_ops k230_pmxops = {
.get_functions_count = k230_get_functions_count,
.get_function_name = k230_get_fname,
.get_function_groups = k230_get_groups,
.set_mux = k230_set_mux,
.strict = true,
};
static int k230_pinctrl_parse_groups(struct device_node *np,
struct k230_pin_group *grp,
struct k230_pinctrl *info,
unsigned int index)
{
struct device *dev = info->pctl_dev->dev;
const __be32 *list;
int size, i, ret;
grp->name = np->name;
list = of_get_property(np, "pinmux", &size);
size /= sizeof(*list);
grp->num_pins = size;
grp->pins = devm_kcalloc(dev, grp->num_pins, sizeof(*grp->pins),
GFP_KERNEL);
grp->data = devm_kcalloc(dev, grp->num_pins, sizeof(*grp->data),
GFP_KERNEL);
if (!grp->pins || !grp->data)
return -ENOMEM;
for (i = 0; i < size; i++) {
unsigned int mux_data = be32_to_cpu(*list++);
grp->pins[i] = (mux_data >> 8);
grp->data[i].func = (mux_data & 0xff);
ret = pinconf_generic_parse_dt_config(np, NULL,
&grp->data[i].configs,
&grp->data[i].nconfigs);
if (ret)
return ret;
}
return 0;
}
static int k230_pinctrl_parse_functions(struct device_node *np,
struct k230_pinctrl *info,
unsigned int index)
{
struct device *dev = info->pctl_dev->dev;
struct k230_pmx_func *func;
struct k230_pin_group *grp;
static unsigned int idx, i;
int ret;
func = &info->functions[index];
func->name = np->name;
func->ngroups = of_get_child_count(np);
if (func->ngroups <= 0)
return 0;
func->groups = devm_kcalloc(dev, func->ngroups,
sizeof(*func->groups), GFP_KERNEL);
func->group_idx = devm_kcalloc(dev, func->ngroups,
sizeof(*func->group_idx), GFP_KERNEL);
if (!func->groups || !func->group_idx)
return -ENOMEM;
i = 0;
for_each_child_of_node_scoped(np, child) {
func->groups[i] = child->name;
func->group_idx[i] = idx;
grp = &info->groups[idx];
idx++;
ret = k230_pinctrl_parse_groups(child, grp, info, i++);
if (ret)
return ret;
}
return 0;
}
static void k230_pinctrl_child_count(struct k230_pinctrl *info,
struct device_node *np)
{
for_each_child_of_node_scoped(np, child) {
info->nfunctions++;
info->ngroups += of_get_child_count(child);
}
}
static int k230_pinctrl_parse_dt(struct platform_device *pdev,
struct k230_pinctrl *info)
{
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
unsigned int i;
int ret;
k230_pinctrl_child_count(info, np);
info->functions = devm_kcalloc(dev, info->nfunctions,
sizeof(*info->functions), GFP_KERNEL);
info->groups = devm_kcalloc(dev, info->ngroups,
sizeof(*info->groups), GFP_KERNEL);
if (!info->functions || !info->groups)
return -ENOMEM;
i = 0;
for_each_child_of_node_scoped(np, child) {
ret = k230_pinctrl_parse_functions(child, info, i++);
if (ret) {
dev_err(dev, "failed to parse function\n");
return ret;
}
}
return 0;
}
static int k230_pinctrl_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct k230_pinctrl *info;
struct pinctrl_desc *pctl;
info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
pctl = &info->pctl;
pctl->name = "k230-pinctrl";
pctl->owner = THIS_MODULE;
pctl->pins = k230_pins;
pctl->npins = ARRAY_SIZE(k230_pins);
pctl->pctlops = &k230_pctrl_ops;
pctl->pmxops = &k230_pmxops;
pctl->confops = &k230_pinconf_ops;
info->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(info->base))
return PTR_ERR(info->base);
info->regmap_base = devm_regmap_init_mmio(dev, info->base,
&k230_regmap_config);
if (IS_ERR(info->regmap_base))
return dev_err_probe(dev, PTR_ERR(info->regmap_base),
"failed to init regmap\n");
info->pctl_dev = devm_pinctrl_register(dev, pctl, info);
if (IS_ERR(info->pctl_dev))
return dev_err_probe(dev, PTR_ERR(info->pctl_dev),
"devm_pinctrl_register failed\n");
k230_pinctrl_parse_dt(pdev, info);
return 0;
}
static const struct of_device_id k230_dt_ids[] = {
{ .compatible = "canaan,k230-pinctrl", },
{ /* sintenel */ }
};
MODULE_DEVICE_TABLE(of, k230_dt_ids);
static struct platform_driver k230_pinctrl_driver = {
.probe = k230_pinctrl_probe,
.driver = {
.name = "k230-pinctrl",
.of_match_table = k230_dt_ids,
},
};
module_platform_driver(k230_pinctrl_driver);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Ze Huang <18771902331@163.com>");
MODULE_DESCRIPTION("Canaan K230 pinctrl driver");

View File

@ -57,6 +57,8 @@ enum {
FUNC_CAN1,
FUNC_CLKMON,
FUNC_NONE,
FUNC_FAN,
FUNC_FC,
FUNC_FC0_a,
FUNC_FC0_b,
FUNC_FC0_c,
@ -71,6 +73,7 @@ enum {
FUNC_FC4_a,
FUNC_FC4_b,
FUNC_FC4_c,
FUNC_FC_SHRD,
FUNC_FC_SHRD0,
FUNC_FC_SHRD1,
FUNC_FC_SHRD2,
@ -92,6 +95,7 @@ enum {
FUNC_FC_SHRD18,
FUNC_FC_SHRD19,
FUNC_FC_SHRD20,
FUNC_FUSA,
FUNC_GPIO,
FUNC_IB_TRG_a,
FUNC_IB_TRG_b,
@ -108,6 +112,8 @@ enum {
FUNC_IRQ1,
FUNC_IRQ1_IN,
FUNC_IRQ1_OUT,
FUNC_IRQ3,
FUNC_IRQ4,
FUNC_EXT_IRQ,
FUNC_MIIM,
FUNC_MIIM_a,
@ -115,12 +121,14 @@ enum {
FUNC_MIIM_c,
FUNC_MIIM_Sa,
FUNC_MIIM_Sb,
FUNC_MIIM_IRQ,
FUNC_OB_TRG,
FUNC_OB_TRG_a,
FUNC_OB_TRG_b,
FUNC_PHY_LED,
FUNC_PCI_WAKE,
FUNC_MD,
FUNC_PCIE_PERST,
FUNC_PTP0,
FUNC_PTP1,
FUNC_PTP2,
@ -152,6 +160,7 @@ enum {
FUNC_SGPIO_b,
FUNC_SI,
FUNC_SI2,
FUNC_SYNCE,
FUNC_TACHO,
FUNC_TACHO_a,
FUNC_TACHO_b,
@ -170,6 +179,10 @@ enum {
FUNC_USB_S_a,
FUNC_USB_S_b,
FUNC_USB_S_c,
FUNC_USB_POWER,
FUNC_USB2PHY_RST,
FUNC_USB_OVER_DETECT,
FUNC_USB_ULPI,
FUNC_PLL_STAT,
FUNC_EMMC,
FUNC_EMMC_SD,
@ -184,6 +197,8 @@ static const char *const ocelot_function_names[] = {
[FUNC_CAN1] = "can1",
[FUNC_CLKMON] = "clkmon",
[FUNC_NONE] = "none",
[FUNC_FAN] = "fan",
[FUNC_FC] = "fc",
[FUNC_FC0_a] = "fc0_a",
[FUNC_FC0_b] = "fc0_b",
[FUNC_FC0_c] = "fc0_c",
@ -198,6 +213,7 @@ static const char *const ocelot_function_names[] = {
[FUNC_FC4_a] = "fc4_a",
[FUNC_FC4_b] = "fc4_b",
[FUNC_FC4_c] = "fc4_c",
[FUNC_FC_SHRD] = "fc_shrd",
[FUNC_FC_SHRD0] = "fc_shrd0",
[FUNC_FC_SHRD1] = "fc_shrd1",
[FUNC_FC_SHRD2] = "fc_shrd2",
@ -219,6 +235,7 @@ static const char *const ocelot_function_names[] = {
[FUNC_FC_SHRD18] = "fc_shrd18",
[FUNC_FC_SHRD19] = "fc_shrd19",
[FUNC_FC_SHRD20] = "fc_shrd20",
[FUNC_FUSA] = "fusa",
[FUNC_GPIO] = "gpio",
[FUNC_IB_TRG_a] = "ib_trig_a",
[FUNC_IB_TRG_b] = "ib_trig_b",
@ -235,6 +252,8 @@ static const char *const ocelot_function_names[] = {
[FUNC_IRQ1] = "irq1",
[FUNC_IRQ1_IN] = "irq1_in",
[FUNC_IRQ1_OUT] = "irq1_out",
[FUNC_IRQ3] = "irq3",
[FUNC_IRQ4] = "irq4",
[FUNC_EXT_IRQ] = "ext_irq",
[FUNC_MIIM] = "miim",
[FUNC_MIIM_a] = "miim_a",
@ -242,8 +261,10 @@ static const char *const ocelot_function_names[] = {
[FUNC_MIIM_c] = "miim_c",
[FUNC_MIIM_Sa] = "miim_slave_a",
[FUNC_MIIM_Sb] = "miim_slave_b",
[FUNC_MIIM_IRQ] = "miim_irq",
[FUNC_PHY_LED] = "phy_led",
[FUNC_PCI_WAKE] = "pci_wake",
[FUNC_PCIE_PERST] = "pcie_perst",
[FUNC_MD] = "md",
[FUNC_OB_TRG] = "ob_trig",
[FUNC_OB_TRG_a] = "ob_trig_a",
@ -279,6 +300,7 @@ static const char *const ocelot_function_names[] = {
[FUNC_SGPIO_b] = "sgpio_b",
[FUNC_SI] = "si",
[FUNC_SI2] = "si2",
[FUNC_SYNCE] = "synce",
[FUNC_TACHO] = "tacho",
[FUNC_TACHO_a] = "tacho_a",
[FUNC_TACHO_b] = "tacho_b",
@ -294,6 +316,10 @@ static const char *const ocelot_function_names[] = {
[FUNC_USB_S_a] = "usb_slave_a",
[FUNC_USB_S_b] = "usb_slave_b",
[FUNC_USB_S_c] = "usb_slave_c",
[FUNC_USB_POWER] = "usb_power",
[FUNC_USB2PHY_RST] = "usb2phy_rst",
[FUNC_USB_OVER_DETECT] = "usb_over_detect",
[FUNC_USB_ULPI] = "usb_ulpi",
[FUNC_UART] = "uart",
[FUNC_UART2] = "uart2",
[FUNC_UART3] = "uart3",
@ -1136,6 +1162,165 @@ static const struct pinctrl_pin_desc lan966x_pins[] = {
LAN966X_PIN(77),
};
#define LAN969X_P(p, f0, f1, f2, f3, f4, f5, f6, f7) \
static struct ocelot_pin_caps lan969x_pin_##p = { \
.pin = p, \
.functions = { \
FUNC_##f0, FUNC_##f1, FUNC_##f2, \
FUNC_##f3 \
}, \
.a_functions = { \
FUNC_##f4, FUNC_##f5, FUNC_##f6, \
FUNC_##f7 \
}, \
}
/* Pinmuxing table taken from data sheet */
/* Pin FUNC0 FUNC1 FUNC2 FUNC3 FUNC4 FUNC5 FUNC6 FUNC7 */
LAN969X_P(0, GPIO, IRQ0, FC_SHRD, PCIE_PERST, NONE, NONE, NONE, R);
LAN969X_P(1, GPIO, IRQ1, FC_SHRD, USB_POWER, NONE, NONE, NONE, R);
LAN969X_P(2, GPIO, FC, NONE, NONE, NONE, NONE, NONE, R);
LAN969X_P(3, GPIO, FC, NONE, NONE, NONE, NONE, NONE, R);
LAN969X_P(4, GPIO, FC, NONE, NONE, NONE, NONE, NONE, R);
LAN969X_P(5, GPIO, SGPIO_a, NONE, CLKMON, NONE, NONE, NONE, R);
LAN969X_P(6, GPIO, SGPIO_a, NONE, CLKMON, NONE, NONE, NONE, R);
LAN969X_P(7, GPIO, SGPIO_a, NONE, CLKMON, NONE, NONE, NONE, R);
LAN969X_P(8, GPIO, SGPIO_a, NONE, CLKMON, NONE, NONE, NONE, R);
LAN969X_P(9, GPIO, MIIM, MIIM_Sa, CLKMON, NONE, NONE, NONE, R);
LAN969X_P(10, GPIO, MIIM, MIIM_Sa, CLKMON, NONE, NONE, NONE, R);
LAN969X_P(11, GPIO, MIIM_IRQ, MIIM_Sa, CLKMON, NONE, NONE, NONE, R);
LAN969X_P(12, GPIO, IRQ3, FC_SHRD, USB2PHY_RST, NONE, NONE, NONE, R);
LAN969X_P(13, GPIO, IRQ4, FC_SHRD, USB_OVER_DETECT, NONE, NONE, NONE, R);
LAN969X_P(14, GPIO, EMMC_SD, QSPI1, FC, NONE, NONE, NONE, R);
LAN969X_P(15, GPIO, EMMC_SD, QSPI1, FC, NONE, NONE, NONE, R);
LAN969X_P(16, GPIO, EMMC_SD, QSPI1, FC, NONE, NONE, NONE, R);
LAN969X_P(17, GPIO, EMMC_SD, QSPI1, PTPSYNC_0, USB_POWER, NONE, NONE, R);
LAN969X_P(18, GPIO, EMMC_SD, QSPI1, PTPSYNC_1, USB2PHY_RST, NONE, NONE, R);
LAN969X_P(19, GPIO, EMMC_SD, QSPI1, PTPSYNC_2, USB_OVER_DETECT, NONE, NONE, R);
LAN969X_P(20, GPIO, EMMC_SD, NONE, FC_SHRD, NONE, NONE, NONE, R);
LAN969X_P(21, GPIO, EMMC_SD, NONE, FC_SHRD, NONE, NONE, NONE, R);
LAN969X_P(22, GPIO, EMMC_SD, NONE, FC_SHRD, NONE, NONE, NONE, R);
LAN969X_P(23, GPIO, EMMC_SD, NONE, FC_SHRD, NONE, NONE, NONE, R);
LAN969X_P(24, GPIO, EMMC_SD, NONE, NONE, NONE, NONE, NONE, R);
LAN969X_P(25, GPIO, FAN, FUSA, CAN0_a, QSPI1, NONE, NONE, R);
LAN969X_P(26, GPIO, FAN, FUSA, CAN0_a, QSPI1, NONE, NONE, R);
LAN969X_P(27, GPIO, SYNCE, FC, MIIM, QSPI1, NONE, NONE, R);
LAN969X_P(28, GPIO, SYNCE, FC, MIIM, QSPI1, NONE, NONE, R);
LAN969X_P(29, GPIO, SYNCE, FC, MIIM_IRQ, QSPI1, NONE, NONE, R);
LAN969X_P(30, GPIO, PTPSYNC_0, USB_ULPI, FC_SHRD, QSPI1, NONE, NONE, R);
LAN969X_P(31, GPIO, PTPSYNC_1, USB_ULPI, FC_SHRD, NONE, NONE, NONE, R);
LAN969X_P(32, GPIO, PTPSYNC_2, USB_ULPI, FC_SHRD, NONE, NONE, NONE, R);
LAN969X_P(33, GPIO, SD, USB_ULPI, FC_SHRD, NONE, NONE, NONE, R);
LAN969X_P(34, GPIO, SD, USB_ULPI, CAN1, FC_SHRD, NONE, NONE, R);
LAN969X_P(35, GPIO, SD, USB_ULPI, CAN1, FC_SHRD, NONE, NONE, R);
LAN969X_P(36, GPIO, SD, USB_ULPI, PCIE_PERST, FC_SHRD, NONE, NONE, R);
LAN969X_P(37, GPIO, SD, USB_ULPI, CAN0_b, NONE, NONE, NONE, R);
LAN969X_P(38, GPIO, SD, USB_ULPI, CAN0_b, NONE, NONE, NONE, R);
LAN969X_P(39, GPIO, SD, USB_ULPI, MIIM, NONE, NONE, NONE, R);
LAN969X_P(40, GPIO, SD, USB_ULPI, MIIM, NONE, NONE, NONE, R);
LAN969X_P(41, GPIO, SD, USB_ULPI, MIIM_IRQ, NONE, NONE, NONE, R);
LAN969X_P(42, GPIO, PTPSYNC_3, CAN1, NONE, NONE, NONE, NONE, R);
LAN969X_P(43, GPIO, PTPSYNC_4, CAN1, NONE, NONE, NONE, NONE, R);
LAN969X_P(44, GPIO, PTPSYNC_5, SFP_SD, NONE, NONE, NONE, NONE, R);
LAN969X_P(45, GPIO, PTPSYNC_6, SFP_SD, NONE, NONE, NONE, NONE, R);
LAN969X_P(46, GPIO, PTPSYNC_7, SFP_SD, NONE, NONE, NONE, NONE, R);
LAN969X_P(47, GPIO, NONE, SFP_SD, NONE, NONE, NONE, NONE, R);
LAN969X_P(48, GPIO, NONE, SFP_SD, NONE, NONE, NONE, NONE, R);
LAN969X_P(49, GPIO, NONE, SFP_SD, NONE, NONE, NONE, NONE, R);
LAN969X_P(50, GPIO, NONE, SFP_SD, NONE, NONE, NONE, NONE, R);
LAN969X_P(51, GPIO, NONE, SFP_SD, NONE, NONE, NONE, NONE, R);
LAN969X_P(52, GPIO, FAN, SFP_SD, NONE, NONE, NONE, NONE, R);
LAN969X_P(53, GPIO, FAN, SFP_SD, NONE, NONE, NONE, NONE, R);
LAN969X_P(54, GPIO, SYNCE, FC, NONE, NONE, NONE, NONE, R);
LAN969X_P(55, GPIO, SYNCE, FC, NONE, NONE, NONE, NONE, R);
LAN969X_P(56, GPIO, SYNCE, FC, NONE, NONE, NONE, NONE, R);
LAN969X_P(57, GPIO, SFP_SD, FC_SHRD, TWI, PTPSYNC_3, NONE, NONE, R);
LAN969X_P(58, GPIO, SFP_SD, FC_SHRD, TWI, PTPSYNC_4, NONE, NONE, R);
LAN969X_P(59, GPIO, SFP_SD, FC_SHRD, TWI, PTPSYNC_5, NONE, NONE, R);
LAN969X_P(60, GPIO, SFP_SD, FC_SHRD, TWI, PTPSYNC_6, NONE, NONE, R);
LAN969X_P(61, GPIO, MIIM, FC_SHRD, TWI, NONE, NONE, NONE, R);
LAN969X_P(62, GPIO, MIIM, FC_SHRD, TWI, NONE, NONE, NONE, R);
LAN969X_P(63, GPIO, MIIM_IRQ, FC_SHRD, TWI, NONE, NONE, NONE, R);
LAN969X_P(64, GPIO, FC, FC_SHRD, TWI, NONE, NONE, NONE, R);
LAN969X_P(65, GPIO, FC, FC_SHRD, TWI, NONE, NONE, NONE, R);
LAN969X_P(66, GPIO, FC, FC_SHRD, TWI, NONE, NONE, NONE, R);
#define LAN969X_PIN(n) { \
.number = n, \
.name = "GPIO_"#n, \
.drv_data = &lan969x_pin_##n \
}
static const struct pinctrl_pin_desc lan969x_pins[] = {
LAN969X_PIN(0),
LAN969X_PIN(1),
LAN969X_PIN(2),
LAN969X_PIN(3),
LAN969X_PIN(4),
LAN969X_PIN(5),
LAN969X_PIN(6),
LAN969X_PIN(7),
LAN969X_PIN(8),
LAN969X_PIN(9),
LAN969X_PIN(10),
LAN969X_PIN(11),
LAN969X_PIN(12),
LAN969X_PIN(13),
LAN969X_PIN(14),
LAN969X_PIN(15),
LAN969X_PIN(16),
LAN969X_PIN(17),
LAN969X_PIN(18),
LAN969X_PIN(19),
LAN969X_PIN(20),
LAN969X_PIN(21),
LAN969X_PIN(22),
LAN969X_PIN(23),
LAN969X_PIN(24),
LAN969X_PIN(25),
LAN969X_PIN(26),
LAN969X_PIN(27),
LAN969X_PIN(28),
LAN969X_PIN(29),
LAN969X_PIN(30),
LAN969X_PIN(31),
LAN969X_PIN(32),
LAN969X_PIN(33),
LAN969X_PIN(34),
LAN969X_PIN(35),
LAN969X_PIN(36),
LAN969X_PIN(37),
LAN969X_PIN(38),
LAN969X_PIN(39),
LAN969X_PIN(40),
LAN969X_PIN(41),
LAN969X_PIN(42),
LAN969X_PIN(43),
LAN969X_PIN(44),
LAN969X_PIN(45),
LAN969X_PIN(46),
LAN969X_PIN(47),
LAN969X_PIN(48),
LAN969X_PIN(49),
LAN969X_PIN(50),
LAN969X_PIN(51),
LAN969X_PIN(52),
LAN969X_PIN(53),
LAN969X_PIN(54),
LAN969X_PIN(55),
LAN969X_PIN(56),
LAN969X_PIN(57),
LAN969X_PIN(58),
LAN969X_PIN(59),
LAN969X_PIN(60),
LAN969X_PIN(61),
LAN969X_PIN(62),
LAN969X_PIN(63),
LAN969X_PIN(64),
LAN969X_PIN(65),
LAN969X_PIN(66),
};
static int ocelot_get_functions_count(struct pinctrl_dev *pctldev)
{
return ARRAY_SIZE(ocelot_function_names);
@ -1682,6 +1867,23 @@ static struct ocelot_match_data lan966x_desc = {
},
};
static struct ocelot_match_data lan969x_desc = {
.desc = {
.name = "lan969x-pinctrl",
.pins = lan969x_pins,
.npins = ARRAY_SIZE(lan969x_pins),
.pctlops = &ocelot_pctl_ops,
.pmxops = &lan966x_pmx_ops,
.confops = &ocelot_confops,
.owner = THIS_MODULE,
},
.pincfg_data = {
.pd_bit = BIT(3),
.pu_bit = BIT(2),
.drive_bits = GENMASK(1, 0),
},
};
static int ocelot_create_group_func_map(struct device *dev,
struct ocelot_pinctrl *info)
{
@ -2014,6 +2216,7 @@ static const struct of_device_id ocelot_pinctrl_of_match[] = {
{ .compatible = "mscc,servalt-pinctrl", .data = &servalt_desc },
{ .compatible = "microchip,sparx5-pinctrl", .data = &sparx5_desc },
{ .compatible = "microchip,lan966x-pinctrl", .data = &lan966x_desc },
{ .compatible = "microchip,lan9691-pinctrl", .data = &lan969x_desc },
{},
};
MODULE_DEVICE_TABLE(of, ocelot_pinctrl_of_match);

View File

@ -3227,7 +3227,9 @@ static int rockchip_pinctrl_parse_groups(struct device_node *np,
/* we do not check return since it's safe node passed down */
size /= sizeof(*list);
if (!size || size % 4)
return dev_err_probe(dev, -EINVAL, "wrong pins number or pins and configs should be by 4\n");
return dev_err_probe(dev, -EINVAL,
"%pOF: rockchip,pins: expected one or more of <bank pin mux CONFIG>, got %d args instead\n",
np, size);
grp->npins = size / 4;
@ -4219,7 +4221,7 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = {
static struct platform_driver rockchip_pinctrl_driver = {
.probe = rockchip_pinctrl_probe,
.remove_new = rockchip_pinctrl_remove,
.remove = rockchip_pinctrl_remove,
.driver = {
.name = "rockchip-pinctrl",
.pm = &rockchip_pinctrl_dev_pm_ops,

View File

@ -1966,6 +1966,7 @@ static const struct pcs_soc_data pinconf_single = {
};
static const struct of_device_id pcs_of_match[] = {
{ .compatible = "marvell,pxa1908-padconf", .data = &pinconf_single },
{ .compatible = "ti,am437-padconf", .data = &pinctrl_single_am437x },
{ .compatible = "ti,am654-padconf", .data = &pinctrl_single_am654 },
{ .compatible = "ti,dra7-padconf", .data = &pinctrl_single_dra7 },
@ -1981,7 +1982,7 @@ MODULE_DEVICE_TABLE(of, pcs_of_match);
static struct platform_driver pcs_driver = {
.probe = pcs_probe,
.remove_new = pcs_remove,
.remove = pcs_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = pcs_of_match,

View File

@ -855,7 +855,7 @@ static struct platform_driver stmfx_pinctrl_driver = {
.pm = &stmfx_pinctrl_dev_pm_ops,
},
.probe = stmfx_pinctrl_probe,
.remove_new = stmfx_pinctrl_remove,
.remove = stmfx_pinctrl_remove,
};
module_platform_driver(stmfx_pinctrl_driver);

View File

@ -1105,7 +1105,7 @@ static const struct regmap_config sx150x_regmap_config = {
.reg_bits = 8,
.val_bits = 32,
.cache_type = REGCACHE_RBTREE,
.cache_type = REGCACHE_MAPLE,
.reg_read = sx150x_regmap_reg_read,
.reg_write = sx150x_regmap_reg_write,

View File

@ -820,7 +820,7 @@ MODULE_DEVICE_TABLE(of, tb10x_pinctrl_dt_ids);
static struct platform_driver tb10x_pinctrl_pdrv = {
.probe = tb10x_pinctrl_probe,
.remove_new = tb10x_pinctrl_remove,
.remove = tb10x_pinctrl_remove,
.driver = {
.name = "tb10x_pinctrl",
.of_match_table = of_match_ptr(tb10x_pinctrl_dt_ids),

View File

@ -0,0 +1,918 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Pinctrl driver for the T-Head TH1520 SoC
*
* Copyright (C) 2023 Emil Renner Berthing <emil.renner.berthing@canonical.com>
*/
#include <linux/array_size.h>
#include <linux/bits.h>
#include <linux/cleanup.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/seq_file.h>
#include <linux/spinlock.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>
#include "core.h"
#include "pinmux.h"
#include "pinconf.h"
#define TH1520_PADCFG_IE BIT(9)
#define TH1520_PADCFG_SL BIT(8)
#define TH1520_PADCFG_ST BIT(7)
#define TH1520_PADCFG_SPU BIT(6)
#define TH1520_PADCFG_PS BIT(5)
#define TH1520_PADCFG_PE BIT(4)
#define TH1520_PADCFG_BIAS (TH1520_PADCFG_SPU | TH1520_PADCFG_PS | TH1520_PADCFG_PE)
#define TH1520_PADCFG_DS GENMASK(3, 0)
#define TH1520_PULL_DOWN_OHM 44000 /* typ. 44kOhm */
#define TH1520_PULL_UP_OHM 48000 /* typ. 48kOhm */
#define TH1520_PULL_STRONG_OHM 2100 /* typ. 2.1kOhm */
#define TH1520_PAD_NO_PADCFG BIT(30)
#define TH1520_PAD_MUXDATA GENMASK(29, 0)
struct th1520_pad_group {
const char *name;
const struct pinctrl_pin_desc *pins;
unsigned int npins;
};
struct th1520_pinctrl {
struct pinctrl_desc desc;
struct mutex mutex; /* serialize adding functions */
raw_spinlock_t lock; /* serialize register access */
void __iomem *base;
struct pinctrl_dev *pctl;
};
static void __iomem *th1520_padcfg(struct th1520_pinctrl *thp,
unsigned int pin)
{
return thp->base + 4 * (pin / 2);
}
static unsigned int th1520_padcfg_shift(unsigned int pin)
{
return 16 * (pin & BIT(0));
}
static void __iomem *th1520_muxcfg(struct th1520_pinctrl *thp,
unsigned int pin)
{
return thp->base + 0x400 + 4 * (pin / 8);
}
static unsigned int th1520_muxcfg_shift(unsigned int pin)
{
return 4 * (pin & GENMASK(2, 0));
}
enum th1520_muxtype {
TH1520_MUX_____,
TH1520_MUX_GPIO,
TH1520_MUX_PWM,
TH1520_MUX_UART,
TH1520_MUX_IR,
TH1520_MUX_I2C,
TH1520_MUX_SPI,
TH1520_MUX_QSPI,
TH1520_MUX_SDIO,
TH1520_MUX_AUD,
TH1520_MUX_I2S,
TH1520_MUX_MAC0,
TH1520_MUX_MAC1,
TH1520_MUX_DPU0,
TH1520_MUX_DPU1,
TH1520_MUX_ISP,
TH1520_MUX_HDMI,
TH1520_MUX_BSEL,
TH1520_MUX_DBG,
TH1520_MUX_CLK,
TH1520_MUX_JTAG,
TH1520_MUX_ISO,
TH1520_MUX_FUSE,
TH1520_MUX_RST,
};
static const char *const th1520_muxtype_string[] = {
[TH1520_MUX_GPIO] = "gpio",
[TH1520_MUX_PWM] = "pwm",
[TH1520_MUX_UART] = "uart",
[TH1520_MUX_IR] = "ir",
[TH1520_MUX_I2C] = "i2c",
[TH1520_MUX_SPI] = "spi",
[TH1520_MUX_QSPI] = "qspi",
[TH1520_MUX_SDIO] = "sdio",
[TH1520_MUX_AUD] = "audio",
[TH1520_MUX_I2S] = "i2s",
[TH1520_MUX_MAC0] = "gmac0",
[TH1520_MUX_MAC1] = "gmac1",
[TH1520_MUX_DPU0] = "dpu0",
[TH1520_MUX_DPU1] = "dpu1",
[TH1520_MUX_ISP] = "isp",
[TH1520_MUX_HDMI] = "hdmi",
[TH1520_MUX_BSEL] = "bootsel",
[TH1520_MUX_DBG] = "debug",
[TH1520_MUX_CLK] = "clock",
[TH1520_MUX_JTAG] = "jtag",
[TH1520_MUX_ISO] = "iso7816",
[TH1520_MUX_FUSE] = "efuse",
[TH1520_MUX_RST] = "reset",
};
static enum th1520_muxtype th1520_muxtype_get(const char *str)
{
enum th1520_muxtype mt;
for (mt = TH1520_MUX_GPIO; mt < ARRAY_SIZE(th1520_muxtype_string); mt++) {
if (!strcmp(str, th1520_muxtype_string[mt]))
return mt;
}
return TH1520_MUX_____;
}
#define TH1520_PAD(_nr, _name, m0, m1, m2, m3, m4, m5, _flags) \
{ .number = _nr, .name = #_name, .drv_data = (void *)((_flags) | \
(TH1520_MUX_##m0 << 0) | (TH1520_MUX_##m1 << 5) | (TH1520_MUX_##m2 << 10) | \
(TH1520_MUX_##m3 << 15) | (TH1520_MUX_##m4 << 20) | (TH1520_MUX_##m5 << 25)) }
static unsigned long th1520_pad_muxdata(void *drv_data)
{
return (uintptr_t)drv_data & TH1520_PAD_MUXDATA;
}
static bool th1520_pad_no_padcfg(void *drv_data)
{
return (uintptr_t)drv_data & TH1520_PAD_NO_PADCFG;
}
static const struct pinctrl_pin_desc th1520_group1_pins[] = {
TH1520_PAD(0, OSC_CLK_IN, ____, ____, ____, ____, ____, ____, TH1520_PAD_NO_PADCFG),
TH1520_PAD(1, OSC_CLK_OUT, ____, ____, ____, ____, ____, ____, TH1520_PAD_NO_PADCFG),
TH1520_PAD(2, SYS_RST_N, ____, ____, ____, ____, ____, ____, TH1520_PAD_NO_PADCFG),
TH1520_PAD(3, RTC_CLK_IN, ____, ____, ____, ____, ____, ____, TH1520_PAD_NO_PADCFG),
TH1520_PAD(4, RTC_CLK_OUT, ____, ____, ____, ____, ____, ____, TH1520_PAD_NO_PADCFG),
/* skip number 5 so we can calculate register offsets and shifts from the pin number */
TH1520_PAD(6, TEST_MODE, ____, ____, ____, ____, ____, ____, TH1520_PAD_NO_PADCFG),
TH1520_PAD(7, DEBUG_MODE, DBG, ____, ____, GPIO, ____, ____, TH1520_PAD_NO_PADCFG),
TH1520_PAD(8, POR_SEL, ____, ____, ____, ____, ____, ____, TH1520_PAD_NO_PADCFG),
TH1520_PAD(9, I2C_AON_SCL, I2C, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(10, I2C_AON_SDA, I2C, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(11, CPU_JTG_TCLK, JTAG, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(12, CPU_JTG_TMS, JTAG, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(13, CPU_JTG_TDI, JTAG, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(14, CPU_JTG_TDO, JTAG, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(15, CPU_JTG_TRST, JTAG, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(16, AOGPIO_7, CLK, AUD, ____, GPIO, ____, ____, 0),
TH1520_PAD(17, AOGPIO_8, UART, AUD, IR, GPIO, ____, ____, 0),
TH1520_PAD(18, AOGPIO_9, UART, AUD, IR, GPIO, ____, ____, 0),
TH1520_PAD(19, AOGPIO_10, CLK, AUD, ____, GPIO, ____, ____, 0),
TH1520_PAD(20, AOGPIO_11, GPIO, AUD, ____, ____, ____, ____, 0),
TH1520_PAD(21, AOGPIO_12, GPIO, AUD, ____, ____, ____, ____, 0),
TH1520_PAD(22, AOGPIO_13, GPIO, AUD, ____, ____, ____, ____, 0),
TH1520_PAD(23, AOGPIO_14, GPIO, AUD, ____, ____, ____, ____, 0),
TH1520_PAD(24, AOGPIO_15, GPIO, AUD, ____, ____, ____, ____, 0),
TH1520_PAD(25, AUDIO_PA0, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(26, AUDIO_PA1, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(27, AUDIO_PA2, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(28, AUDIO_PA3, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(29, AUDIO_PA4, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(30, AUDIO_PA5, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(31, AUDIO_PA6, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(32, AUDIO_PA7, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(33, AUDIO_PA8, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(34, AUDIO_PA9, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(35, AUDIO_PA10, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(36, AUDIO_PA11, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(37, AUDIO_PA12, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(38, AUDIO_PA13, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(39, AUDIO_PA14, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(40, AUDIO_PA15, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(41, AUDIO_PA16, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(42, AUDIO_PA17, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(43, AUDIO_PA27, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(44, AUDIO_PA28, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(45, AUDIO_PA29, AUD, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(46, AUDIO_PA30, AUD, RST, ____, GPIO, ____, ____, 0),
};
static const struct pinctrl_pin_desc th1520_group2_pins[] = {
TH1520_PAD(0, QSPI1_SCLK, QSPI, ISO, ____, GPIO, FUSE, ____, 0),
TH1520_PAD(1, QSPI1_CSN0, QSPI, ____, I2C, GPIO, FUSE, ____, 0),
TH1520_PAD(2, QSPI1_D0_MOSI, QSPI, ISO, I2C, GPIO, FUSE, ____, 0),
TH1520_PAD(3, QSPI1_D1_MISO, QSPI, ISO, ____, GPIO, FUSE, ____, 0),
TH1520_PAD(4, QSPI1_D2_WP, QSPI, ISO, UART, GPIO, FUSE, ____, 0),
TH1520_PAD(5, QSPI1_D3_HOLD, QSPI, ISO, UART, GPIO, ____, ____, 0),
TH1520_PAD(6, I2C0_SCL, I2C, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(7, I2C0_SDA, I2C, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(8, I2C1_SCL, I2C, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(9, I2C1_SDA, I2C, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(10, UART1_TXD, UART, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(11, UART1_RXD, UART, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(12, UART4_TXD, UART, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(13, UART4_RXD, UART, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(14, UART4_CTSN, UART, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(15, UART4_RTSN, UART, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(16, UART3_TXD, DBG, UART, ____, GPIO, ____, ____, 0),
TH1520_PAD(17, UART3_RXD, DBG, UART, ____, GPIO, ____, ____, 0),
TH1520_PAD(18, GPIO0_18, GPIO, I2C, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(19, GPIO0_19, GPIO, I2C, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(20, GPIO0_20, GPIO, UART, IR, ____, DPU0, DPU1, 0),
TH1520_PAD(21, GPIO0_21, GPIO, UART, IR, ____, DPU0, DPU1, 0),
TH1520_PAD(22, GPIO0_22, GPIO, JTAG, I2C, ____, DPU0, DPU1, 0),
TH1520_PAD(23, GPIO0_23, GPIO, JTAG, I2C, ____, DPU0, DPU1, 0),
TH1520_PAD(24, GPIO0_24, GPIO, JTAG, QSPI, ____, DPU0, DPU1, 0),
TH1520_PAD(25, GPIO0_25, GPIO, JTAG, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(26, GPIO0_26, GPIO, JTAG, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(27, GPIO0_27, GPIO, ____, I2C, ____, DPU0, DPU1, 0),
TH1520_PAD(28, GPIO0_28, GPIO, ____, I2C, ____, DPU0, DPU1, 0),
TH1520_PAD(29, GPIO0_29, GPIO, ____, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(30, GPIO0_30, GPIO, ____, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(31, GPIO0_31, GPIO, ____, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(32, GPIO1_0, GPIO, JTAG, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(33, GPIO1_1, GPIO, JTAG, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(34, GPIO1_2, GPIO, JTAG, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(35, GPIO1_3, GPIO, JTAG, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(36, GPIO1_4, GPIO, JTAG, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(37, GPIO1_5, GPIO, ____, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(38, GPIO1_6, GPIO, QSPI, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(39, GPIO1_7, GPIO, QSPI, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(40, GPIO1_8, GPIO, QSPI, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(41, GPIO1_9, GPIO, QSPI, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(42, GPIO1_10, GPIO, QSPI, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(43, GPIO1_11, GPIO, QSPI, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(44, GPIO1_12, GPIO, QSPI, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(45, GPIO1_13, GPIO, UART, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(46, GPIO1_14, GPIO, UART, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(47, GPIO1_15, GPIO, UART, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(48, GPIO1_16, GPIO, UART, ____, ____, DPU0, DPU1, 0),
TH1520_PAD(49, CLK_OUT_0, BSEL, CLK, ____, GPIO, ____, ____, 0),
TH1520_PAD(50, CLK_OUT_1, BSEL, CLK, ____, GPIO, ____, ____, 0),
TH1520_PAD(51, CLK_OUT_2, BSEL, CLK, ____, GPIO, ____, ____, 0),
TH1520_PAD(52, CLK_OUT_3, BSEL, CLK, ____, GPIO, ____, ____, 0),
TH1520_PAD(53, GPIO1_21, JTAG, ____, ISP, GPIO, ____, ____, 0),
TH1520_PAD(54, GPIO1_22, JTAG, ____, ISP, GPIO, ____, ____, 0),
TH1520_PAD(55, GPIO1_23, JTAG, ____, ISP, GPIO, ____, ____, 0),
TH1520_PAD(56, GPIO1_24, JTAG, ____, ISP, GPIO, ____, ____, 0),
TH1520_PAD(57, GPIO1_25, JTAG, ____, ISP, GPIO, ____, ____, 0),
TH1520_PAD(58, GPIO1_26, GPIO, ____, ISP, ____, ____, ____, 0),
TH1520_PAD(59, GPIO1_27, GPIO, ____, ISP, ____, ____, ____, 0),
TH1520_PAD(60, GPIO1_28, GPIO, ____, ISP, ____, ____, ____, 0),
TH1520_PAD(61, GPIO1_29, GPIO, ____, ISP, ____, ____, ____, 0),
TH1520_PAD(62, GPIO1_30, GPIO, ____, ISP, ____, ____, ____, 0),
};
static const struct pinctrl_pin_desc th1520_group3_pins[] = {
TH1520_PAD(0, UART0_TXD, UART, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(1, UART0_RXD, UART, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(2, QSPI0_SCLK, QSPI, PWM, I2S, GPIO, ____, ____, 0),
TH1520_PAD(3, QSPI0_CSN0, QSPI, PWM, I2S, GPIO, ____, ____, 0),
TH1520_PAD(4, QSPI0_CSN1, QSPI, PWM, I2S, GPIO, ____, ____, 0),
TH1520_PAD(5, QSPI0_D0_MOSI, QSPI, PWM, I2S, GPIO, ____, ____, 0),
TH1520_PAD(6, QSPI0_D1_MISO, QSPI, PWM, I2S, GPIO, ____, ____, 0),
TH1520_PAD(7, QSPI0_D2_WP, QSPI, PWM, I2S, GPIO, ____, ____, 0),
TH1520_PAD(8, QSPI1_D3_HOLD, QSPI, ____, I2S, GPIO, ____, ____, 0),
TH1520_PAD(9, I2C2_SCL, I2C, UART, ____, GPIO, ____, ____, 0),
TH1520_PAD(10, I2C2_SDA, I2C, UART, ____, GPIO, ____, ____, 0),
TH1520_PAD(11, I2C3_SCL, I2C, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(12, I2C3_SDA, I2C, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(13, GPIO2_13, GPIO, SPI, ____, ____, ____, ____, 0),
TH1520_PAD(14, SPI_SCLK, SPI, UART, IR, GPIO, ____, ____, 0),
TH1520_PAD(15, SPI_CSN, SPI, UART, IR, GPIO, ____, ____, 0),
TH1520_PAD(16, SPI_MOSI, SPI, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(17, SPI_MISO, SPI, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(18, GPIO2_18, GPIO, MAC1, ____, ____, ____, ____, 0),
TH1520_PAD(19, GPIO2_19, GPIO, MAC1, ____, ____, ____, ____, 0),
TH1520_PAD(20, GPIO2_20, GPIO, MAC1, ____, ____, ____, ____, 0),
TH1520_PAD(21, GPIO2_21, GPIO, MAC1, ____, ____, ____, ____, 0),
TH1520_PAD(22, GPIO2_22, GPIO, MAC1, ____, ____, ____, ____, 0),
TH1520_PAD(23, GPIO2_23, GPIO, MAC1, ____, ____, ____, ____, 0),
TH1520_PAD(24, GPIO2_24, GPIO, MAC1, ____, ____, ____, ____, 0),
TH1520_PAD(25, GPIO2_25, GPIO, MAC1, ____, ____, ____, ____, 0),
TH1520_PAD(26, SDIO0_WPRTN, SDIO, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(27, SDIO0_DETN, SDIO, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(28, SDIO1_WPRTN, SDIO, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(29, SDIO1_DETN, SDIO, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(30, GPIO2_30, GPIO, MAC1, ____, ____, ____, ____, 0),
TH1520_PAD(31, GPIO2_31, GPIO, MAC1, ____, ____, ____, ____, 0),
TH1520_PAD(32, GPIO3_0, GPIO, MAC1, ____, ____, ____, ____, 0),
TH1520_PAD(33, GPIO3_1, GPIO, MAC1, ____, ____, ____, ____, 0),
TH1520_PAD(34, GPIO3_2, GPIO, PWM, ____, ____, ____, ____, 0),
TH1520_PAD(35, GPIO3_3, GPIO, PWM, ____, ____, ____, ____, 0),
TH1520_PAD(36, HDMI_SCL, HDMI, PWM, ____, GPIO, ____, ____, 0),
TH1520_PAD(37, HDMI_SDA, HDMI, PWM, ____, GPIO, ____, ____, 0),
TH1520_PAD(38, HDMI_CEC, HDMI, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(39, GMAC0_TX_CLK, MAC0, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(40, GMAC0_RX_CLK, MAC0, ____, ____, GPIO, ____, ____, 0),
TH1520_PAD(41, GMAC0_TXEN, MAC0, UART, ____, GPIO, ____, ____, 0),
TH1520_PAD(42, GMAC0_TXD0, MAC0, UART, ____, GPIO, ____, ____, 0),
TH1520_PAD(43, GMAC0_TXD1, MAC0, UART, ____, GPIO, ____, ____, 0),
TH1520_PAD(44, GMAC0_TXD2, MAC0, UART, ____, GPIO, ____, ____, 0),
TH1520_PAD(45, GMAC0_TXD3, MAC0, I2C, ____, GPIO, ____, ____, 0),
TH1520_PAD(46, GMAC0_RXDV, MAC0, I2C, ____, GPIO, ____, ____, 0),
TH1520_PAD(47, GMAC0_RXD0, MAC0, I2C, ____, GPIO, ____, ____, 0),
TH1520_PAD(48, GMAC0_RXD1, MAC0, I2C, ____, GPIO, ____, ____, 0),
TH1520_PAD(49, GMAC0_RXD2, MAC0, SPI, ____, GPIO, ____, ____, 0),
TH1520_PAD(50, GMAC0_RXD3, MAC0, SPI, ____, GPIO, ____, ____, 0),
TH1520_PAD(51, GMAC0_MDC, MAC0, SPI, MAC1, GPIO, ____, ____, 0),
TH1520_PAD(52, GMAC0_MDIO, MAC0, SPI, MAC1, GPIO, ____, ____, 0),
TH1520_PAD(53, GMAC0_COL, MAC0, PWM, ____, GPIO, ____, ____, 0),
TH1520_PAD(54, GMAC0_CRS, MAC0, PWM, ____, GPIO, ____, ____, 0),
};
static const struct th1520_pad_group th1520_group1 = {
.name = "th1520-group1",
.pins = th1520_group1_pins,
.npins = ARRAY_SIZE(th1520_group1_pins),
};
static const struct th1520_pad_group th1520_group2 = {
.name = "th1520-group2",
.pins = th1520_group2_pins,
.npins = ARRAY_SIZE(th1520_group2_pins),
};
static const struct th1520_pad_group th1520_group3 = {
.name = "th1520-group3",
.pins = th1520_group3_pins,
.npins = ARRAY_SIZE(th1520_group3_pins),
};
static int th1520_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
{
struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev);
return thp->desc.npins;
}
static const char *th1520_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
unsigned int gsel)
{
struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev);
return thp->desc.pins[gsel].name;
}
static int th1520_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
unsigned int gsel,
const unsigned int **pins,
unsigned int *npins)
{
struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev);
*pins = &thp->desc.pins[gsel].number;
*npins = 1;
return 0;
}
#ifdef CONFIG_DEBUG_FS
static void th1520_pin_dbg_show(struct pinctrl_dev *pctldev,
struct seq_file *s, unsigned int pin)
{
struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev);
void __iomem *padcfg = th1520_padcfg(thp, pin);
void __iomem *muxcfg = th1520_muxcfg(thp, pin);
u32 pad;
u32 mux;
scoped_guard(raw_spinlock_irqsave, &thp->lock) {
pad = readl_relaxed(padcfg);
mux = readl_relaxed(muxcfg);
}
seq_printf(s, "[PADCFG_%03u:0x%x=0x%07x MUXCFG_%03u:0x%x=0x%08x]",
1 + pin / 2, 0x000 + 4 * (pin / 2), pad,
1 + pin / 8, 0x400 + 4 * (pin / 8), mux);
}
#else
#define th1520_pin_dbg_show NULL
#endif
static void th1520_pinctrl_dt_free_map(struct pinctrl_dev *pctldev,
struct pinctrl_map *map, unsigned int nmaps)
{
unsigned long *seen = NULL;
unsigned int i;
for (i = 0; i < nmaps; i++) {
if (map[i].type == PIN_MAP_TYPE_CONFIGS_PIN &&
map[i].data.configs.configs != seen) {
seen = map[i].data.configs.configs;
kfree(seen);
}
}
kfree(map);
}
static int th1520_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
struct device_node *np,
struct pinctrl_map **maps,
unsigned int *num_maps)
{
struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev);
struct pinctrl_map *map;
unsigned long *configs;
unsigned int nconfigs;
unsigned int nmaps;
int ret;
nmaps = 0;
for_each_available_child_of_node_scoped(np, child) {
int npins = of_property_count_strings(child, "pins");
if (npins <= 0) {
dev_err(thp->pctl->dev, "no pins selected for %pOFn.%pOFn\n",
np, child);
return -EINVAL;
}
nmaps += npins;
if (of_property_present(child, "function"))
nmaps += npins;
}
map = kcalloc(nmaps, sizeof(*map), GFP_KERNEL);
if (!map)
return -ENOMEM;
nmaps = 0;
guard(mutex)(&thp->mutex);
for_each_available_child_of_node_scoped(np, child) {
unsigned int rollback = nmaps;
enum th1520_muxtype muxtype;
struct property *prop;
const char *funcname;
const char **pgnames;
const char *pinname;
int npins;
ret = pinconf_generic_parse_dt_config(child, pctldev, &configs, &nconfigs);
if (ret) {
dev_err(thp->pctl->dev, "%pOFn.%pOFn: error parsing pin config\n",
np, child);
goto free_map;
}
if (!of_property_read_string(child, "function", &funcname)) {
muxtype = th1520_muxtype_get(funcname);
if (!muxtype) {
dev_err(thp->pctl->dev, "%pOFn.%pOFn: unknown function '%s'\n",
np, child, funcname);
ret = -EINVAL;
goto free_configs;
}
funcname = devm_kasprintf(thp->pctl->dev, GFP_KERNEL, "%pOFn.%pOFn",
np, child);
if (!funcname) {
ret = -ENOMEM;
goto free_configs;
}
npins = of_property_count_strings(child, "pins");
pgnames = devm_kcalloc(thp->pctl->dev, npins, sizeof(*pgnames), GFP_KERNEL);
if (!pgnames) {
ret = -ENOMEM;
goto free_configs;
}
} else {
funcname = NULL;
}
npins = 0;
of_property_for_each_string(child, "pins", prop, pinname) {
unsigned int i;
for (i = 0; i < thp->desc.npins; i++) {
if (!strcmp(pinname, thp->desc.pins[i].name))
break;
}
if (i == thp->desc.npins) {
nmaps = rollback;
dev_err(thp->pctl->dev, "%pOFn.%pOFn: unknown pin '%s'\n",
np, child, pinname);
ret = -EINVAL;
goto free_configs;
}
if (nconfigs) {
map[nmaps].type = PIN_MAP_TYPE_CONFIGS_PIN;
map[nmaps].data.configs.group_or_pin = thp->desc.pins[i].name;
map[nmaps].data.configs.configs = configs;
map[nmaps].data.configs.num_configs = nconfigs;
nmaps += 1;
}
if (funcname) {
pgnames[npins++] = thp->desc.pins[i].name;
map[nmaps].type = PIN_MAP_TYPE_MUX_GROUP;
map[nmaps].data.mux.function = funcname;
map[nmaps].data.mux.group = thp->desc.pins[i].name;
nmaps += 1;
}
}
if (funcname) {
ret = pinmux_generic_add_function(pctldev, funcname, pgnames,
npins, (void *)muxtype);
if (ret < 0) {
dev_err(thp->pctl->dev, "error adding function %s\n", funcname);
goto free_map;
}
}
}
*maps = map;
*num_maps = nmaps;
return 0;
free_configs:
kfree(configs);
free_map:
th1520_pinctrl_dt_free_map(pctldev, map, nmaps);
return ret;
}
static const struct pinctrl_ops th1520_pinctrl_ops = {
.get_groups_count = th1520_pinctrl_get_groups_count,
.get_group_name = th1520_pinctrl_get_group_name,
.get_group_pins = th1520_pinctrl_get_group_pins,
.pin_dbg_show = th1520_pin_dbg_show,
.dt_node_to_map = th1520_pinctrl_dt_node_to_map,
.dt_free_map = th1520_pinctrl_dt_free_map,
};
static const u8 th1520_drive_strength_in_ma[16] = {
1, 2, 3, 5, 7, 8, 10, 12, 13, 15, 16, 18, 20, 21, 23, 25,
};
static u16 th1520_drive_strength_from_ma(u32 arg)
{
u16 ds;
for (ds = 0; ds < TH1520_PADCFG_DS; ds++) {
if (arg <= th1520_drive_strength_in_ma[ds])
return ds;
}
return TH1520_PADCFG_DS;
}
static int th1520_padcfg_rmw(struct th1520_pinctrl *thp, unsigned int pin,
u32 mask, u32 value)
{
void __iomem *padcfg = th1520_padcfg(thp, pin);
unsigned int shift = th1520_padcfg_shift(pin);
u32 tmp;
mask <<= shift;
value <<= shift;
scoped_guard(raw_spinlock_irqsave, &thp->lock) {
tmp = readl_relaxed(padcfg);
tmp = (tmp & ~mask) | value;
writel_relaxed(tmp, padcfg);
}
return 0;
}
static int th1520_pinconf_get(struct pinctrl_dev *pctldev,
unsigned int pin, unsigned long *config)
{
struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev);
const struct pin_desc *desc = pin_desc_get(pctldev, pin);
bool enabled;
int param;
u32 value;
u32 arg;
if (th1520_pad_no_padcfg(desc->drv_data))
return -ENOTSUPP;
value = readl_relaxed(th1520_padcfg(thp, pin));
value = (value >> th1520_padcfg_shift(pin)) & GENMASK(9, 0);
param = pinconf_to_config_param(*config);
switch (param) {
case PIN_CONFIG_BIAS_DISABLE:
enabled = !(value & (TH1520_PADCFG_SPU | TH1520_PADCFG_PE));
arg = 0;
break;
case PIN_CONFIG_BIAS_PULL_DOWN:
enabled = (value & TH1520_PADCFG_BIAS) == TH1520_PADCFG_PE;
arg = enabled ? TH1520_PULL_DOWN_OHM : 0;
break;
case PIN_CONFIG_BIAS_PULL_UP:
if (value & TH1520_PADCFG_SPU) {
enabled = true;
arg = TH1520_PULL_STRONG_OHM;
} else if ((value & (TH1520_PADCFG_PE | TH1520_PADCFG_PS)) ==
(TH1520_PADCFG_PE | TH1520_PADCFG_PS)) {
enabled = true;
arg = TH1520_PULL_UP_OHM;
} else {
enabled = false;
arg = 0;
}
break;
case PIN_CONFIG_DRIVE_STRENGTH:
enabled = true;
arg = th1520_drive_strength_in_ma[value & TH1520_PADCFG_DS];
break;
case PIN_CONFIG_INPUT_ENABLE:
enabled = value & TH1520_PADCFG_IE;
arg = enabled ? 1 : 0;
break;
case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
enabled = value & TH1520_PADCFG_ST;
arg = enabled ? 1 : 0;
break;
case PIN_CONFIG_SLEW_RATE:
enabled = value & TH1520_PADCFG_SL;
arg = enabled ? 1 : 0;
break;
default:
return -ENOTSUPP;
}
*config = pinconf_to_config_packed(param, arg);
return enabled ? 0 : -EINVAL;
}
static int th1520_pinconf_group_get(struct pinctrl_dev *pctldev,
unsigned int gsel, unsigned long *config)
{
struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev);
unsigned int pin = thp->desc.pins[gsel].number;
return th1520_pinconf_get(pctldev, pin, config);
}
static int th1520_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned long *configs, unsigned int num_configs)
{
struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev);
const struct pin_desc *desc = pin_desc_get(pctldev, pin);
unsigned int i;
u16 mask, value;
if (th1520_pad_no_padcfg(desc->drv_data))
return -ENOTSUPP;
mask = 0;
value = 0;
for (i = 0; i < num_configs; i++) {
int param = pinconf_to_config_param(configs[i]);
u32 arg = pinconf_to_config_argument(configs[i]);
switch (param) {
case PIN_CONFIG_BIAS_DISABLE:
mask |= TH1520_PADCFG_BIAS;
value &= ~TH1520_PADCFG_BIAS;
break;
case PIN_CONFIG_BIAS_PULL_DOWN:
if (arg == 0)
return -ENOTSUPP;
mask |= TH1520_PADCFG_BIAS;
value &= ~TH1520_PADCFG_BIAS;
value |= TH1520_PADCFG_PE;
break;
case PIN_CONFIG_BIAS_PULL_UP:
if (arg == 0)
return -ENOTSUPP;
mask |= TH1520_PADCFG_BIAS;
value &= ~TH1520_PADCFG_BIAS;
if (arg == TH1520_PULL_STRONG_OHM)
value |= TH1520_PADCFG_SPU;
else
value |= TH1520_PADCFG_PE | TH1520_PADCFG_PS;
break;
case PIN_CONFIG_DRIVE_STRENGTH:
mask |= TH1520_PADCFG_DS;
value &= ~TH1520_PADCFG_DS;
value |= th1520_drive_strength_from_ma(arg);
break;
case PIN_CONFIG_INPUT_ENABLE:
mask |= TH1520_PADCFG_IE;
if (arg)
value |= TH1520_PADCFG_IE;
else
value &= ~TH1520_PADCFG_IE;
break;
case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
mask |= TH1520_PADCFG_ST;
if (arg)
value |= TH1520_PADCFG_ST;
else
value &= ~TH1520_PADCFG_ST;
break;
case PIN_CONFIG_SLEW_RATE:
mask |= TH1520_PADCFG_SL;
if (arg)
value |= TH1520_PADCFG_SL;
else
value &= ~TH1520_PADCFG_SL;
break;
default:
return -ENOTSUPP;
}
}
return th1520_padcfg_rmw(thp, pin, mask, value);
}
static int th1520_pinconf_group_set(struct pinctrl_dev *pctldev,
unsigned int gsel,
unsigned long *configs,
unsigned int num_configs)
{
struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev);
unsigned int pin = thp->desc.pins[gsel].number;
return th1520_pinconf_set(pctldev, pin, configs, num_configs);
}
#ifdef CONFIG_DEBUG_FS
static void th1520_pinconf_dbg_show(struct pinctrl_dev *pctldev,
struct seq_file *s, unsigned int pin)
{
struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev);
u32 value = readl_relaxed(th1520_padcfg(thp, pin));
value = (value >> th1520_padcfg_shift(pin)) & GENMASK(9, 0);
seq_printf(s, " [0x%03x]", value);
}
#else
#define th1520_pinconf_dbg_show NULL
#endif
static const struct pinconf_ops th1520_pinconf_ops = {
.pin_config_get = th1520_pinconf_get,
.pin_config_group_get = th1520_pinconf_group_get,
.pin_config_set = th1520_pinconf_set,
.pin_config_group_set = th1520_pinconf_group_set,
.pin_config_dbg_show = th1520_pinconf_dbg_show,
.is_generic = true,
};
static int th1520_pinmux_set(struct th1520_pinctrl *thp, unsigned int pin,
unsigned long muxdata, enum th1520_muxtype muxtype)
{
void __iomem *muxcfg = th1520_muxcfg(thp, pin);
unsigned int shift = th1520_muxcfg_shift(pin);
u32 mask, value, tmp;
for (value = 0; muxdata; muxdata >>= 5, value++) {
if ((muxdata & GENMASK(4, 0)) == muxtype)
break;
}
if (!muxdata) {
dev_err(thp->pctl->dev, "invalid mux %s for pin %s\n",
th1520_muxtype_string[muxtype], pin_get_name(thp->pctl, pin));
return -EINVAL;
}
mask = GENMASK(3, 0) << shift;
value = value << shift;
scoped_guard(raw_spinlock_irqsave, &thp->lock) {
tmp = readl_relaxed(muxcfg);
tmp = (tmp & ~mask) | value;
writel_relaxed(tmp, muxcfg);
}
return 0;
}
static int th1520_pinmux_set_mux(struct pinctrl_dev *pctldev,
unsigned int fsel, unsigned int gsel)
{
struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev);
const struct function_desc *func = pinmux_generic_get_function(pctldev, fsel);
enum th1520_muxtype muxtype;
if (!func)
return -EINVAL;
muxtype = (uintptr_t)func->data;
return th1520_pinmux_set(thp, thp->desc.pins[gsel].number,
th1520_pad_muxdata(thp->desc.pins[gsel].drv_data),
muxtype);
}
static int th1520_gpio_request_enable(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range,
unsigned int offset)
{
struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev);
const struct pin_desc *desc = pin_desc_get(pctldev, offset);
return th1520_pinmux_set(thp, offset,
th1520_pad_muxdata(desc->drv_data),
TH1520_MUX_GPIO);
}
static int th1520_gpio_set_direction(struct pinctrl_dev *pctldev,
struct pinctrl_gpio_range *range,
unsigned int offset, bool input)
{
struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev);
return th1520_padcfg_rmw(thp, offset, TH1520_PADCFG_IE,
input ? TH1520_PADCFG_IE : 0);
}
static const struct pinmux_ops th1520_pinmux_ops = {
.get_functions_count = pinmux_generic_get_function_count,
.get_function_name = pinmux_generic_get_function_name,
.get_function_groups = pinmux_generic_get_function_groups,
.set_mux = th1520_pinmux_set_mux,
.gpio_request_enable = th1520_gpio_request_enable,
.gpio_set_direction = th1520_gpio_set_direction,
.strict = true,
};
static int th1520_pinctrl_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
const struct th1520_pad_group *group;
struct device_node *np = dev->of_node;
struct th1520_pinctrl *thp;
struct clk *clk;
u32 pin_group;
int ret;
thp = devm_kzalloc(dev, sizeof(*thp), GFP_KERNEL);
if (!thp)
return -ENOMEM;
thp->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(thp->base))
return PTR_ERR(thp->base);
clk = devm_clk_get_enabled(dev, NULL);
if (IS_ERR(clk))
return dev_err_probe(dev, PTR_ERR(clk), "error getting clock\n");
ret = of_property_read_u32(np, "thead,pad-group", &pin_group);
if (ret)
return dev_err_probe(dev, ret, "failed to read the thead,pad-group property\n");
if (pin_group == 1)
group = &th1520_group1;
else if (pin_group == 2)
group = &th1520_group2;
else if (pin_group == 3)
group = &th1520_group3;
else
return dev_err_probe(dev, -EINVAL, "unit address did not match any pad group\n");
thp->desc.name = group->name;
thp->desc.pins = group->pins;
thp->desc.npins = group->npins;
thp->desc.pctlops = &th1520_pinctrl_ops;
thp->desc.pmxops = &th1520_pinmux_ops;
thp->desc.confops = &th1520_pinconf_ops;
thp->desc.owner = THIS_MODULE;
mutex_init(&thp->mutex);
raw_spin_lock_init(&thp->lock);
ret = devm_pinctrl_register_and_init(dev, &thp->desc, thp, &thp->pctl);
if (ret)
return dev_err_probe(dev, ret, "could not register pinctrl driver\n");
return pinctrl_enable(thp->pctl);
}
static const struct of_device_id th1520_pinctrl_of_match[] = {
{ .compatible = "thead,th1520-pinctrl"},
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, th1520_pinctrl_of_match);
static struct platform_driver th1520_pinctrl_driver = {
.probe = th1520_pinctrl_probe,
.driver = {
.name = "pinctrl-th1520",
.of_match_table = th1520_pinctrl_of_match,
},
};
module_platform_driver(th1520_pinctrl_driver);
MODULE_DESCRIPTION("Pinctrl driver for the T-Head TH1520 SoC");
MODULE_AUTHOR("Emil Renner Berthing <emil.renner.berthing@canonical.com>");
MODULE_LICENSE("GPL");

View File

@ -1524,7 +1524,7 @@ static int pinmux_xway_probe(struct platform_device *pdev)
* files which don't set the "gpio-ranges" property or systems that
* utilize ACPI the driver has to call gpiochip_add_pin_range().
*/
if (!of_property_read_bool(pdev->dev.of_node, "gpio-ranges")) {
if (!of_property_present(pdev->dev.of_node, "gpio-ranges")) {
/* finish with registering the gpio range in pinctrl */
xway_gpio_range.npins = xway_chip.ngpio;
xway_gpio_range.base = xway_chip.base;

View File

@ -10,6 +10,7 @@
#include <dt-bindings/pinctrl/pinctrl-zynqmp.h>
#include <linux/bitfield.h>
#include <linux/bitmap.h>
#include <linux/init.h>
#include <linux/module.h>
@ -44,12 +45,17 @@
#define DRIVE_STRENGTH_8MA 8
#define DRIVE_STRENGTH_12MA 12
#define VERSAL_LPD_PIN_PREFIX "LPD_MIO"
#define VERSAL_PMC_PIN_PREFIX "PMC_MIO"
#define VERSAL_PINCTRL_ATTR_NODETYPE_MASK GENMASK(19, 14)
#define VERSAL_PINCTRL_NODETYPE_LPD_MIO BIT(0)
/**
* struct zynqmp_pmux_function - a pinmux function
* @name: Name of the pin mux function
* @groups: List of pin groups for this function
* @ngroups: Number of entries in @groups
* @node: Firmware node matching with the function
*
* This structure holds information about pin control function
* and function group names supporting that function.
@ -93,6 +99,8 @@ struct zynqmp_pctrl_group {
};
static struct pinctrl_desc zynqmp_desc;
static u32 family_code;
static u32 sub_family_code;
static int zynqmp_pctrl_get_groups_count(struct pinctrl_dev *pctldev)
{
@ -596,8 +604,12 @@ static int zynqmp_pinctrl_prepare_func_groups(struct device *dev, u32 fid,
if (!groups[resp[i]].name)
return -ENOMEM;
for (pin = 0; pin < groups[resp[i]].npins; pin++)
__set_bit(groups[resp[i]].pins[pin], used_pins);
for (pin = 0; pin < groups[resp[i]].npins; pin++) {
if (family_code == ZYNQMP_FAMILY_CODE)
__set_bit(groups[resp[i]].pins[pin], used_pins);
else
__set_bit((u8)groups[resp[i]].pins[pin] - 1, used_pins);
}
}
}
done:
@ -873,6 +885,70 @@ static int zynqmp_pinctrl_prepare_pin_desc(struct device *dev,
return 0;
}
static int versal_pinctrl_get_attributes(u32 pin_idx, u32 *response)
{
struct zynqmp_pm_query_data qdata = {0};
u32 payload[PAYLOAD_ARG_CNT];
int ret;
qdata.qid = PM_QID_PINCTRL_GET_ATTRIBUTES;
qdata.arg1 = pin_idx;
ret = zynqmp_pm_query_data(qdata, payload);
if (ret)
return ret;
memcpy(response, &payload[1], sizeof(*response));
return 0;
}
static int versal_pinctrl_prepare_pin_desc(struct device *dev,
const struct pinctrl_pin_desc **zynqmp_pins,
unsigned int *npins)
{
u32 lpd_mio_pins = 0, attr, nodetype;
struct pinctrl_pin_desc *pins, *pin;
int ret, i;
ret = zynqmp_pm_is_function_supported(PM_QUERY_DATA, PM_QID_PINCTRL_GET_ATTRIBUTES);
if (ret)
return ret;
ret = zynqmp_pinctrl_get_num_pins(npins);
if (ret)
return ret;
pins = devm_kzalloc(dev, sizeof(*pins) * *npins, GFP_KERNEL);
if (!pins)
return -ENOMEM;
for (i = 0; i < *npins; i++) {
ret = versal_pinctrl_get_attributes(i, &attr);
if (ret)
return ret;
pin = &pins[i];
pin->number = attr;
nodetype = FIELD_GET(VERSAL_PINCTRL_ATTR_NODETYPE_MASK, attr);
if (nodetype == VERSAL_PINCTRL_NODETYPE_LPD_MIO) {
pin->name = devm_kasprintf(dev, GFP_KERNEL, "%s%d",
VERSAL_LPD_PIN_PREFIX, i);
lpd_mio_pins++;
} else {
pin->name = devm_kasprintf(dev, GFP_KERNEL, "%s%d",
VERSAL_PMC_PIN_PREFIX, i - lpd_mio_pins);
}
if (!pin->name)
return -ENOMEM;
}
*zynqmp_pins = pins;
return 0;
}
static int zynqmp_pinctrl_probe(struct platform_device *pdev)
{
struct zynqmp_pinctrl *pctrl;
@ -882,9 +958,18 @@ static int zynqmp_pinctrl_probe(struct platform_device *pdev)
if (!pctrl)
return -ENOMEM;
ret = zynqmp_pinctrl_prepare_pin_desc(&pdev->dev,
&zynqmp_desc.pins,
&zynqmp_desc.npins);
ret = zynqmp_pm_get_family_info(&family_code, &sub_family_code);
if (ret < 0)
return ret;
if (family_code == ZYNQMP_FAMILY_CODE) {
ret = zynqmp_pinctrl_prepare_pin_desc(&pdev->dev, &zynqmp_desc.pins,
&zynqmp_desc.npins);
} else {
ret = versal_pinctrl_prepare_pin_desc(&pdev->dev, &zynqmp_desc.pins,
&zynqmp_desc.npins);
}
if (ret) {
dev_err(&pdev->dev, "pin desc prepare fail with %d\n", ret);
return ret;
@ -907,6 +992,7 @@ static int zynqmp_pinctrl_probe(struct platform_device *pdev)
static const struct of_device_id zynqmp_pinctrl_of_match[] = {
{ .compatible = "xlnx,zynqmp-pinctrl" },
{ .compatible = "xlnx,versal-pinctrl" },
{ }
};
MODULE_DEVICE_TABLE(of, zynqmp_pinctrl_of_match);

View File

@ -14,6 +14,7 @@
#include <linux/array_size.h>
#include <linux/ctype.h>
#include <linux/cleanup.h>
#include <linux/debugfs.h>
#include <linux/device.h>
#include <linux/err.h>
@ -93,6 +94,7 @@ bool pinmux_can_be_used_for_gpio(struct pinctrl_dev *pctldev, unsigned int pin)
if (!desc || !ops)
return true;
guard(mutex)(&desc->mux_lock);
if (ops->strict && desc->mux_usecount)
return false;
@ -127,29 +129,31 @@ static int pin_request(struct pinctrl_dev *pctldev,
dev_dbg(pctldev->dev, "request pin %d (%s) for %s\n",
pin, desc->name, owner);
if ((!gpio_range || ops->strict) &&
desc->mux_usecount && strcmp(desc->mux_owner, owner)) {
dev_err(pctldev->dev,
"pin %s already requested by %s; cannot claim for %s\n",
desc->name, desc->mux_owner, owner);
goto out;
}
scoped_guard(mutex, &desc->mux_lock) {
if ((!gpio_range || ops->strict) &&
desc->mux_usecount && strcmp(desc->mux_owner, owner)) {
dev_err(pctldev->dev,
"pin %s already requested by %s; cannot claim for %s\n",
desc->name, desc->mux_owner, owner);
goto out;
}
if ((gpio_range || ops->strict) && desc->gpio_owner) {
dev_err(pctldev->dev,
"pin %s already requested by %s; cannot claim for %s\n",
desc->name, desc->gpio_owner, owner);
goto out;
}
if ((gpio_range || ops->strict) && desc->gpio_owner) {
dev_err(pctldev->dev,
"pin %s already requested by %s; cannot claim for %s\n",
desc->name, desc->gpio_owner, owner);
goto out;
}
if (gpio_range) {
desc->gpio_owner = owner;
} else {
desc->mux_usecount++;
if (desc->mux_usecount > 1)
return 0;
if (gpio_range) {
desc->gpio_owner = owner;
} else {
desc->mux_usecount++;
if (desc->mux_usecount > 1)
return 0;
desc->mux_owner = owner;
desc->mux_owner = owner;
}
}
/* Let each pin increase references to this module */
@ -178,12 +182,14 @@ static int pin_request(struct pinctrl_dev *pctldev,
out_free_pin:
if (status) {
if (gpio_range) {
desc->gpio_owner = NULL;
} else {
desc->mux_usecount--;
if (!desc->mux_usecount)
desc->mux_owner = NULL;
scoped_guard(mutex, &desc->mux_lock) {
if (gpio_range) {
desc->gpio_owner = NULL;
} else {
desc->mux_usecount--;
if (!desc->mux_usecount)
desc->mux_owner = NULL;
}
}
}
out:
@ -219,15 +225,17 @@ static const char *pin_free(struct pinctrl_dev *pctldev, int pin,
return NULL;
}
if (!gpio_range) {
/*
* A pin should not be freed more times than allocated.
*/
if (WARN_ON(!desc->mux_usecount))
return NULL;
desc->mux_usecount--;
if (desc->mux_usecount)
return NULL;
scoped_guard(mutex, &desc->mux_lock) {
if (!gpio_range) {
/*
* A pin should not be freed more times than allocated.
*/
if (WARN_ON(!desc->mux_usecount))
return NULL;
desc->mux_usecount--;
if (desc->mux_usecount)
return NULL;
}
}
/*
@ -239,13 +247,15 @@ static const char *pin_free(struct pinctrl_dev *pctldev, int pin,
else if (ops->free)
ops->free(pctldev, pin);
if (gpio_range) {
owner = desc->gpio_owner;
desc->gpio_owner = NULL;
} else {
owner = desc->mux_owner;
desc->mux_owner = NULL;
desc->mux_setting = NULL;
scoped_guard(mutex, &desc->mux_lock) {
if (gpio_range) {
owner = desc->gpio_owner;
desc->gpio_owner = NULL;
} else {
owner = desc->mux_owner;
desc->mux_owner = NULL;
desc->mux_setting = NULL;
}
}
module_put(pctldev->owner);
@ -458,7 +468,8 @@ int pinmux_enable_setting(const struct pinctrl_setting *setting)
pins[i]);
continue;
}
desc->mux_setting = &(setting->data.mux);
scoped_guard(mutex, &desc->mux_lock)
desc->mux_setting = &(setting->data.mux);
}
ret = ops->set_mux(pctldev, setting->data.mux.func,
@ -472,8 +483,10 @@ int pinmux_enable_setting(const struct pinctrl_setting *setting)
err_set_mux:
for (i = 0; i < num_pins; i++) {
desc = pin_desc_get(pctldev, pins[i]);
if (desc)
desc->mux_setting = NULL;
if (desc) {
scoped_guard(mutex, &desc->mux_lock)
desc->mux_setting = NULL;
}
}
err_pin_request:
/* On error release all taken pins */
@ -492,6 +505,7 @@ void pinmux_disable_setting(const struct pinctrl_setting *setting)
unsigned int num_pins = 0;
int i;
struct pin_desc *desc;
bool is_equal;
if (pctlops->get_group_pins)
ret = pctlops->get_group_pins(pctldev, setting->data.mux.group,
@ -517,7 +531,10 @@ void pinmux_disable_setting(const struct pinctrl_setting *setting)
pins[i]);
continue;
}
if (desc->mux_setting == &(setting->data.mux)) {
scoped_guard(mutex, &desc->mux_lock)
is_equal = (desc->mux_setting == &(setting->data.mux));
if (is_equal) {
pin_free(pctldev, pins[i], NULL);
} else {
const char *gname;
@ -608,40 +625,42 @@ static int pinmux_pins_show(struct seq_file *s, void *what)
if (desc == NULL)
continue;
if (desc->mux_owner &&
!strcmp(desc->mux_owner, pinctrl_dev_get_name(pctldev)))
is_hog = true;
scoped_guard(mutex, &desc->mux_lock) {
if (desc->mux_owner &&
!strcmp(desc->mux_owner, pinctrl_dev_get_name(pctldev)))
is_hog = true;
if (pmxops->strict) {
if (desc->mux_owner)
seq_printf(s, "pin %d (%s): device %s%s",
pin, desc->name, desc->mux_owner,
if (pmxops->strict) {
if (desc->mux_owner)
seq_printf(s, "pin %d (%s): device %s%s",
pin, desc->name, desc->mux_owner,
is_hog ? " (HOG)" : "");
else if (desc->gpio_owner)
seq_printf(s, "pin %d (%s): GPIO %s",
pin, desc->name, desc->gpio_owner);
else
seq_printf(s, "pin %d (%s): UNCLAIMED",
pin, desc->name);
} else {
/* For non-strict controllers */
seq_printf(s, "pin %d (%s): %s %s%s", pin, desc->name,
desc->mux_owner ? desc->mux_owner
: "(MUX UNCLAIMED)",
desc->gpio_owner ? desc->gpio_owner
: "(GPIO UNCLAIMED)",
is_hog ? " (HOG)" : "");
else if (desc->gpio_owner)
seq_printf(s, "pin %d (%s): GPIO %s",
pin, desc->name, desc->gpio_owner);
else
seq_printf(s, "pin %d (%s): UNCLAIMED",
pin, desc->name);
} else {
/* For non-strict controllers */
seq_printf(s, "pin %d (%s): %s %s%s", pin, desc->name,
desc->mux_owner ? desc->mux_owner
: "(MUX UNCLAIMED)",
desc->gpio_owner ? desc->gpio_owner
: "(GPIO UNCLAIMED)",
is_hog ? " (HOG)" : "");
}
}
/* If mux: print function+group claiming the pin */
if (desc->mux_setting)
seq_printf(s, " function %s group %s\n",
pmxops->get_function_name(pctldev,
desc->mux_setting->func),
pctlops->get_group_name(pctldev,
desc->mux_setting->group));
else
seq_putc(s, '\n');
/* If mux: print function+group claiming the pin */
if (desc->mux_setting)
seq_printf(s, " function %s group %s\n",
pmxops->get_function_name(pctldev,
desc->mux_setting->func),
pctlops->get_group_name(pctldev,
desc->mux_setting->group));
else
seq_putc(s, '\n');
}
}
mutex_unlock(&pctldev->mutex);

View File

@ -46,6 +46,15 @@ config PINCTRL_IPQ5332
Qualcomm Technologies Inc TLMM block found on the Qualcomm
Technologies Inc IPQ5332 platform.
config PINCTRL_IPQ5424
tristate "Qualcomm Technologies, Inc. IPQ5424 pin controller driver"
depends on ARM64 || COMPILE_TEST
help
This is the pinctrl, pinmux, pinconf and gpiolib driver for
the Qualcomm Technologies Inc. TLMM block found on the
Qualcomm Technologies Inc. IPQ5424 platform. Select this for
IPQ5424.
config PINCTRL_IPQ8074
tristate "Qualcomm Technologies, Inc. IPQ8074 pin controller driver"
depends on ARM64 || COMPILE_TEST
@ -182,6 +191,20 @@ config PINCTRL_QCS404
This is the pinctrl, pinmux, pinconf and gpiolib driver for the
TLMM block found in the Qualcomm QCS404 platform.
config PINCTRL_QCS615
tristate "Qualcomm Technologies QCS615 pin controller driver"
depends on ARM64 || COMPILE_TEST
help
This is the pinctrl, pinmux, pinconf and gpiolib driver for the
TLMM block found on the Qualcomm QCS615 platform.
config PINCTRL_QCS8300
tristate "Qualcomm Technologies QCS8300 pin controller driver"
depends on ARM64 || COMPILE_TEST
help
This is the pinctrl, pinmux and pinconf driver for the Qualcomm
TLMM block found on the Qualcomm QCS8300 platform.
config PINCTRL_QDF2XXX
tristate "Qualcomm Technologies QDF2xxx pin controller driver"
depends on ACPI
@ -204,6 +227,14 @@ config PINCTRL_SA8775P
This is the pinctrl, pinmux and pinconf driver for the Qualcomm
TLMM block found on the Qualcomm SA8775P platforms.
config PINCTRL_SAR2130P
tristate "Qualcomm Technologies Inc SAR2130P pin controller driver"
depends on ARM64 || COMPILE_TEST
help
This is the pinctrl, pinmux, pinconf and gpiolib driver for the
Qualcomm Technologies Inc TLMM block found on the Qualcomm
Technologies Inc SAR2130P platform.
config PINCTRL_SC7180
tristate "Qualcomm Technologies Inc SC7180 pin controller driver"
depends on ARM64 || COMPILE_TEST
@ -382,6 +413,14 @@ config PINCTRL_SM8650
Qualcomm Technologies Inc TLMM block found on the Qualcomm
Technologies Inc SM8650 platform.
config PINCTRL_SM8750
tristate "Qualcomm Technologies Inc SM8750 pin controller driver"
depends on ARM64 || COMPILE_TEST
help
This is the pinctrl, pinmux, pinconf and gpiolib driver for the
Qualcomm Technologies Inc TLMM block found on the Qualcomm
Technologies Inc SM8750 platform.
config PINCTRL_X1E80100
tristate "Qualcomm Technologies Inc X1E80100 pin controller driver"
depends on ARM64 || COMPILE_TEST

View File

@ -7,6 +7,7 @@ obj-$(CONFIG_PINCTRL_IPQ4019) += pinctrl-ipq4019.o
obj-$(CONFIG_PINCTRL_IPQ5018) += pinctrl-ipq5018.o
obj-$(CONFIG_PINCTRL_IPQ8064) += pinctrl-ipq8064.o
obj-$(CONFIG_PINCTRL_IPQ5332) += pinctrl-ipq5332.o
obj-$(CONFIG_PINCTRL_IPQ5424) += pinctrl-ipq5424.o
obj-$(CONFIG_PINCTRL_IPQ8074) += pinctrl-ipq8074.o
obj-$(CONFIG_PINCTRL_IPQ6018) += pinctrl-ipq6018.o
obj-$(CONFIG_PINCTRL_IPQ9574) += pinctrl-ipq9574.o
@ -23,6 +24,8 @@ obj-$(CONFIG_PINCTRL_MSM8996) += pinctrl-msm8996.o
obj-$(CONFIG_PINCTRL_MSM8998) += pinctrl-msm8998.o
obj-$(CONFIG_PINCTRL_QCM2290) += pinctrl-qcm2290.o
obj-$(CONFIG_PINCTRL_QCS404) += pinctrl-qcs404.o
obj-$(CONFIG_PINCTRL_QCS615) += pinctrl-qcs615.o
obj-$(CONFIG_PINCTRL_QCS8300) += pinctrl-qcs8300.o
obj-$(CONFIG_PINCTRL_QDF2XXX) += pinctrl-qdf2xxx.o
obj-$(CONFIG_PINCTRL_MDM9607) += pinctrl-mdm9607.o
obj-$(CONFIG_PINCTRL_MDM9615) += pinctrl-mdm9615.o
@ -32,6 +35,7 @@ obj-$(CONFIG_PINCTRL_QCOM_SSBI_PMIC) += pinctrl-ssbi-gpio.o
obj-$(CONFIG_PINCTRL_QCOM_SSBI_PMIC) += pinctrl-ssbi-mpp.o
obj-$(CONFIG_PINCTRL_QDU1000) += pinctrl-qdu1000.o
obj-$(CONFIG_PINCTRL_SA8775P) += pinctrl-sa8775p.o
obj-$(CONFIG_PINCTRL_SAR2130P) += pinctrl-sar2130p.o
obj-$(CONFIG_PINCTRL_SC7180) += pinctrl-sc7180.o
obj-$(CONFIG_PINCTRL_SC7280) += pinctrl-sc7280.o
obj-$(CONFIG_PINCTRL_SC7280_LPASS_LPI) += pinctrl-sc7280-lpass-lpi.o
@ -62,6 +66,7 @@ obj-$(CONFIG_PINCTRL_SM8550) += pinctrl-sm8550.o
obj-$(CONFIG_PINCTRL_SM8550_LPASS_LPI) += pinctrl-sm8550-lpass-lpi.o
obj-$(CONFIG_PINCTRL_SM8650) += pinctrl-sm8650.o
obj-$(CONFIG_PINCTRL_SM8650_LPASS_LPI) += pinctrl-sm8650-lpass-lpi.o
obj-$(CONFIG_PINCTRL_SM8750) += pinctrl-sm8750.o
obj-$(CONFIG_PINCTRL_SC8280XP_LPASS_LPI) += pinctrl-sc8280xp-lpass-lpi.o
obj-$(CONFIG_PINCTRL_LPASS_LPI) += pinctrl-lpass-lpi.o
obj-$(CONFIG_PINCTRL_X1E80100) += pinctrl-x1e80100.o

View File

@ -629,7 +629,7 @@ static struct platform_driver apq8064_pinctrl_driver = {
.of_match_table = apq8064_pinctrl_of_match,
},
.probe = apq8064_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init apq8064_pinctrl_init(void)

View File

@ -1207,7 +1207,7 @@ static struct platform_driver apq8084_pinctrl_driver = {
.of_match_table = apq8084_pinctrl_of_match,
},
.probe = apq8084_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init apq8084_pinctrl_init(void)

View File

@ -710,7 +710,7 @@ static struct platform_driver ipq4019_pinctrl_driver = {
.of_match_table = ipq4019_pinctrl_of_match,
},
.probe = ipq4019_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init ipq4019_pinctrl_init(void)

View File

@ -754,7 +754,7 @@ static struct platform_driver ipq5018_pinctrl_driver = {
.of_match_table = ipq5018_pinctrl_of_match,
},
.probe = ipq5018_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init ipq5018_pinctrl_init(void)

View File

@ -834,7 +834,7 @@ static struct platform_driver ipq5332_pinctrl_driver = {
.of_match_table = ipq5332_pinctrl_of_match,
},
.probe = ipq5332_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init ipq5332_pinctrl_init(void)

View File

@ -0,0 +1,792 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2016-2018,2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include "pinctrl-msm.h"
#define REG_SIZE 0x1000
#define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9) \
{ \
.grp = PINCTRL_PINGROUP("gpio" #id, \
gpio##id##_pins, \
ARRAY_SIZE(gpio##id##_pins)), \
.funcs = (int[]){ \
msm_mux_gpio, /* gpio mode */ \
msm_mux_##f1, \
msm_mux_##f2, \
msm_mux_##f3, \
msm_mux_##f4, \
msm_mux_##f5, \
msm_mux_##f6, \
msm_mux_##f7, \
msm_mux_##f8, \
msm_mux_##f9 \
}, \
.nfuncs = 10, \
.ctl_reg = REG_SIZE * id, \
.io_reg = 0x4 + REG_SIZE * id, \
.intr_cfg_reg = 0x8 + REG_SIZE * id, \
.intr_status_reg = 0xc + REG_SIZE * id, \
.intr_target_reg = 0x8 + REG_SIZE * id, \
.mux_bit = 2, \
.pull_bit = 0, \
.drv_bit = 6, \
.oe_bit = 9, \
.in_bit = 0, \
.out_bit = 1, \
.intr_enable_bit = 0, \
.intr_status_bit = 0, \
.intr_target_bit = 5, \
.intr_target_kpss_val = 3, \
.intr_raw_status_bit = 4, \
.intr_polarity_bit = 1, \
.intr_detection_bit = 2, \
.intr_detection_width = 2, \
}
static const struct pinctrl_pin_desc ipq5424_pins[] = {
PINCTRL_PIN(0, "GPIO_0"),
PINCTRL_PIN(1, "GPIO_1"),
PINCTRL_PIN(2, "GPIO_2"),
PINCTRL_PIN(3, "GPIO_3"),
PINCTRL_PIN(4, "GPIO_4"),
PINCTRL_PIN(5, "GPIO_5"),
PINCTRL_PIN(6, "GPIO_6"),
PINCTRL_PIN(7, "GPIO_7"),
PINCTRL_PIN(8, "GPIO_8"),
PINCTRL_PIN(9, "GPIO_9"),
PINCTRL_PIN(10, "GPIO_10"),
PINCTRL_PIN(11, "GPIO_11"),
PINCTRL_PIN(12, "GPIO_12"),
PINCTRL_PIN(13, "GPIO_13"),
PINCTRL_PIN(14, "GPIO_14"),
PINCTRL_PIN(15, "GPIO_15"),
PINCTRL_PIN(16, "GPIO_16"),
PINCTRL_PIN(17, "GPIO_17"),
PINCTRL_PIN(18, "GPIO_18"),
PINCTRL_PIN(19, "GPIO_19"),
PINCTRL_PIN(20, "GPIO_20"),
PINCTRL_PIN(21, "GPIO_21"),
PINCTRL_PIN(22, "GPIO_22"),
PINCTRL_PIN(23, "GPIO_23"),
PINCTRL_PIN(24, "GPIO_24"),
PINCTRL_PIN(25, "GPIO_25"),
PINCTRL_PIN(26, "GPIO_26"),
PINCTRL_PIN(27, "GPIO_27"),
PINCTRL_PIN(28, "GPIO_28"),
PINCTRL_PIN(29, "GPIO_29"),
PINCTRL_PIN(30, "GPIO_30"),
PINCTRL_PIN(31, "GPIO_31"),
PINCTRL_PIN(32, "GPIO_32"),
PINCTRL_PIN(33, "GPIO_33"),
PINCTRL_PIN(34, "GPIO_34"),
PINCTRL_PIN(35, "GPIO_35"),
PINCTRL_PIN(36, "GPIO_36"),
PINCTRL_PIN(37, "GPIO_37"),
PINCTRL_PIN(38, "GPIO_38"),
PINCTRL_PIN(39, "GPIO_39"),
PINCTRL_PIN(40, "GPIO_40"),
PINCTRL_PIN(41, "GPIO_41"),
PINCTRL_PIN(42, "GPIO_42"),
PINCTRL_PIN(43, "GPIO_43"),
PINCTRL_PIN(44, "GPIO_44"),
PINCTRL_PIN(45, "GPIO_45"),
PINCTRL_PIN(46, "GPIO_46"),
PINCTRL_PIN(47, "GPIO_47"),
PINCTRL_PIN(48, "GPIO_48"),
PINCTRL_PIN(49, "GPIO_49"),
};
#define DECLARE_MSM_GPIO_PINS(pin) \
static const unsigned int gpio##pin##_pins[] = { pin }
DECLARE_MSM_GPIO_PINS(0);
DECLARE_MSM_GPIO_PINS(1);
DECLARE_MSM_GPIO_PINS(2);
DECLARE_MSM_GPIO_PINS(3);
DECLARE_MSM_GPIO_PINS(4);
DECLARE_MSM_GPIO_PINS(5);
DECLARE_MSM_GPIO_PINS(6);
DECLARE_MSM_GPIO_PINS(7);
DECLARE_MSM_GPIO_PINS(8);
DECLARE_MSM_GPIO_PINS(9);
DECLARE_MSM_GPIO_PINS(10);
DECLARE_MSM_GPIO_PINS(11);
DECLARE_MSM_GPIO_PINS(12);
DECLARE_MSM_GPIO_PINS(13);
DECLARE_MSM_GPIO_PINS(14);
DECLARE_MSM_GPIO_PINS(15);
DECLARE_MSM_GPIO_PINS(16);
DECLARE_MSM_GPIO_PINS(17);
DECLARE_MSM_GPIO_PINS(18);
DECLARE_MSM_GPIO_PINS(19);
DECLARE_MSM_GPIO_PINS(20);
DECLARE_MSM_GPIO_PINS(21);
DECLARE_MSM_GPIO_PINS(22);
DECLARE_MSM_GPIO_PINS(23);
DECLARE_MSM_GPIO_PINS(24);
DECLARE_MSM_GPIO_PINS(25);
DECLARE_MSM_GPIO_PINS(26);
DECLARE_MSM_GPIO_PINS(27);
DECLARE_MSM_GPIO_PINS(28);
DECLARE_MSM_GPIO_PINS(29);
DECLARE_MSM_GPIO_PINS(30);
DECLARE_MSM_GPIO_PINS(31);
DECLARE_MSM_GPIO_PINS(32);
DECLARE_MSM_GPIO_PINS(33);
DECLARE_MSM_GPIO_PINS(34);
DECLARE_MSM_GPIO_PINS(35);
DECLARE_MSM_GPIO_PINS(36);
DECLARE_MSM_GPIO_PINS(37);
DECLARE_MSM_GPIO_PINS(38);
DECLARE_MSM_GPIO_PINS(39);
DECLARE_MSM_GPIO_PINS(40);
DECLARE_MSM_GPIO_PINS(41);
DECLARE_MSM_GPIO_PINS(42);
DECLARE_MSM_GPIO_PINS(43);
DECLARE_MSM_GPIO_PINS(44);
DECLARE_MSM_GPIO_PINS(45);
DECLARE_MSM_GPIO_PINS(46);
DECLARE_MSM_GPIO_PINS(47);
DECLARE_MSM_GPIO_PINS(48);
DECLARE_MSM_GPIO_PINS(49);
enum ipq5424_functions {
msm_mux_atest_char,
msm_mux_atest_char0,
msm_mux_atest_char1,
msm_mux_atest_char2,
msm_mux_atest_char3,
msm_mux_atest_tic,
msm_mux_audio_pri,
msm_mux_audio_pri0,
msm_mux_audio_pri1,
msm_mux_audio_sec,
msm_mux_audio_sec0,
msm_mux_audio_sec1,
msm_mux_core_voltage,
msm_mux_cri_trng0,
msm_mux_cri_trng1,
msm_mux_cri_trng2,
msm_mux_cri_trng3,
msm_mux_cxc_clk,
msm_mux_cxc_data,
msm_mux_dbg_out,
msm_mux_gcc_plltest,
msm_mux_gcc_tlmm,
msm_mux_gpio,
msm_mux_i2c0_scl,
msm_mux_i2c0_sda,
msm_mux_i2c1_scl,
msm_mux_i2c1_sda,
msm_mux_i2c11,
msm_mux_mac0,
msm_mux_mac1,
msm_mux_mdc_mst,
msm_mux_mdc_slv,
msm_mux_mdio_mst,
msm_mux_mdio_slv,
msm_mux_pcie0_clk,
msm_mux_pcie0_wake,
msm_mux_pcie1_clk,
msm_mux_pcie1_wake,
msm_mux_pcie2_clk,
msm_mux_pcie2_wake,
msm_mux_pcie3_clk,
msm_mux_pcie3_wake,
msm_mux_pll_test,
msm_mux_prng_rosc0,
msm_mux_prng_rosc1,
msm_mux_prng_rosc2,
msm_mux_prng_rosc3,
msm_mux_PTA0_0,
msm_mux_PTA0_1,
msm_mux_PTA0_2,
msm_mux_PTA10,
msm_mux_PTA11,
msm_mux_pwm0,
msm_mux_pwm1,
msm_mux_pwm2,
msm_mux_qdss_cti_trig_in_a0,
msm_mux_qdss_cti_trig_out_a0,
msm_mux_qdss_cti_trig_in_a1,
msm_mux_qdss_cti_trig_out_a1,
msm_mux_qdss_cti_trig_in_b0,
msm_mux_qdss_cti_trig_out_b0,
msm_mux_qdss_cti_trig_in_b1,
msm_mux_qdss_cti_trig_out_b1,
msm_mux_qdss_traceclk_a,
msm_mux_qdss_tracectl_a,
msm_mux_qdss_tracedata_a,
msm_mux_qspi_clk,
msm_mux_qspi_cs,
msm_mux_qspi_data,
msm_mux_resout,
msm_mux_rx0,
msm_mux_rx1,
msm_mux_rx2,
msm_mux_sdc_clk,
msm_mux_sdc_cmd,
msm_mux_sdc_data,
msm_mux_spi0,
msm_mux_spi1,
msm_mux_spi10,
msm_mux_spi11,
msm_mux_tsens_max,
msm_mux_uart0,
msm_mux_uart1,
msm_mux_wci_txd,
msm_mux_wci_rxd,
msm_mux_wsi_clk,
msm_mux_wsi_data,
msm_mux__,
};
static const char * const gpio_groups[] = {
"gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
"gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
"gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
"gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
"gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
"gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
"gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
};
static const char * const sdc_data_groups[] = {
"gpio0", "gpio1", "gpio2", "gpio3",
};
static const char * const qspi_data_groups[] = {
"gpio0", "gpio1", "gpio2", "gpio3",
};
static const char * const pwm2_groups[] = {
"gpio0", "gpio1", "gpio2", "gpio3",
};
static const char * const wci_txd_groups[] = {
"gpio0", "gpio1", "gpio8", "gpio10", "gpio11", "gpio40", "gpio41",
};
static const char * const wci_rxd_groups[] = {
"gpio0", "gpio1", "gpio8", "gpio10", "gpio11", "gpio40", "gpio41",
};
static const char * const sdc_cmd_groups[] = {
"gpio4",
};
static const char * const qspi_cs_groups[] = {
"gpio4",
};
static const char * const qdss_cti_trig_out_a1_groups[] = {
"gpio27",
};
static const char * const sdc_clk_groups[] = {
"gpio5",
};
static const char * const qspi_clk_groups[] = {
"gpio5",
};
static const char * const spi0_groups[] = {
"gpio6", "gpio7", "gpio8", "gpio9",
};
static const char * const pwm1_groups[] = {
"gpio6", "gpio7", "gpio8", "gpio9",
};
static const char * const cri_trng0_groups[] = {
"gpio6",
};
static const char * const qdss_tracedata_a_groups[] = {
"gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio12",
"gpio13", "gpio14", "gpio15", "gpio20", "gpio21", "gpio36", "gpio37",
"gpio38", "gpio39",
};
static const char * const cri_trng1_groups[] = {
"gpio7",
};
static const char * const cri_trng2_groups[] = {
"gpio8",
};
static const char * const cri_trng3_groups[] = {
"gpio9",
};
static const char * const uart0_groups[] = {
"gpio10", "gpio11", "gpio12", "gpio13",
};
static const char * const pwm0_groups[] = {
"gpio10", "gpio11", "gpio12", "gpio13",
};
static const char * const prng_rosc0_groups[] = {
"gpio12",
};
static const char * const prng_rosc1_groups[] = {
"gpio13",
};
static const char * const i2c0_scl_groups[] = {
"gpio14",
};
static const char * const tsens_max_groups[] = {
"gpio14",
};
static const char * const prng_rosc2_groups[] = {
"gpio14",
};
static const char * const i2c0_sda_groups[] = {
"gpio15",
};
static const char * const prng_rosc3_groups[] = {
"gpio15",
};
static const char * const core_voltage_groups[] = {
"gpio16", "gpio17",
};
static const char * const i2c1_scl_groups[] = {
"gpio16",
};
static const char * const i2c1_sda_groups[] = {
"gpio17",
};
static const char * const mdc_slv_groups[] = {
"gpio20",
};
static const char * const atest_char0_groups[] = {
"gpio20",
};
static const char * const mdio_slv_groups[] = {
"gpio21",
};
static const char * const atest_char1_groups[] = {
"gpio21",
};
static const char * const mdc_mst_groups[] = {
"gpio22",
};
static const char * const atest_char2_groups[] = {
"gpio22",
};
static const char * const mdio_mst_groups[] = {
"gpio23",
};
static const char * const atest_char3_groups[] = {
"gpio23",
};
static const char * const pcie0_clk_groups[] = {
"gpio24",
};
static const char * const PTA10_groups[] = {
"gpio24", "gpio26", "gpio27",
};
static const char * const mac0_groups[] = {
"gpio24", "gpio26",
};
static const char * const atest_char_groups[] = {
"gpio24",
};
static const char * const pcie0_wake_groups[] = {
"gpio26",
};
static const char * const pcie1_clk_groups[] = {
"gpio27",
};
static const char * const i2c11_groups[] = {
"gpio27", "gpio29",
};
static const char * const pcie1_wake_groups[] = {
"gpio29",
};
static const char * const pcie2_clk_groups[] = {
"gpio30",
};
static const char * const mac1_groups[] = {
"gpio30", "gpio32",
};
static const char * const pcie2_wake_groups[] = {
"gpio32",
};
static const char * const PTA11_groups[] = {
"gpio30", "gpio32", "gpio33",
};
static const char * const audio_pri0_groups[] = {
"gpio32", "gpio32",
};
static const char * const pcie3_clk_groups[] = {
"gpio33",
};
static const char * const audio_pri1_groups[] = {
"gpio33", "gpio33",
};
static const char * const pcie3_wake_groups[] = {
"gpio35",
};
static const char * const audio_sec1_groups[] = {
"gpio35", "gpio35",
};
static const char * const audio_pri_groups[] = {
"gpio36", "gpio37", "gpio38", "gpio39",
};
static const char * const spi1_groups[] = {
"gpio11", "gpio36", "gpio37", "gpio38", "gpio46",
};
static const char * const audio_sec0_groups[] = {
"gpio36", "gpio36",
};
static const char * const rx1_groups[] = {
"gpio38", "gpio46",
};
static const char * const pll_test_groups[] = {
"gpio38",
};
static const char * const dbg_out_groups[] = {
"gpio46",
};
static const char * const PTA0_0_groups[] = {
"gpio40",
};
static const char * const atest_tic_groups[] = {
"gpio40",
};
static const char * const PTA0_1_groups[] = {
"gpio41",
};
static const char * const cxc_data_groups[] = {
"gpio41",
};
static const char * const PTA0_2_groups[] = {
"gpio42",
};
static const char * const cxc_clk_groups[] = {
"gpio42",
};
static const char * const uart1_groups[] = {
"gpio43", "gpio44",
};
static const char * const audio_sec_groups[] = {
"gpio45", "gpio46", "gpio47", "gpio48",
};
static const char * const gcc_plltest_groups[] = {
"gpio43", "gpio45",
};
static const char * const gcc_tlmm_groups[] = {
"gpio44",
};
static const char * const qdss_cti_trig_out_b1_groups[] = {
"gpio33",
};
static const char * const rx0_groups[] = {
"gpio39", "gpio47",
};
static const char * const qdss_traceclk_a_groups[] = {
"gpio45",
};
static const char * const qdss_tracectl_a_groups[] = {
"gpio46",
};
static const char * const qdss_cti_trig_out_a0_groups[] = {
"gpio24",
};
static const char * const qdss_cti_trig_in_a0_groups[] = {
"gpio26",
};
static const char * const resout_groups[] = {
"gpio49",
};
static const char * const qdss_cti_trig_in_a1_groups[] = {
"gpio29",
};
static const char * const qdss_cti_trig_out_b0_groups[] = {
"gpio30",
};
static const char * const qdss_cti_trig_in_b0_groups[] = {
"gpio32",
};
static const char * const qdss_cti_trig_in_b1_groups[] = {
"gpio35",
};
static const char * const spi10_groups[] = {
"gpio45", "gpio47", "gpio48",
};
static const char * const spi11_groups[] = {
"gpio10", "gpio12", "gpio13",
};
static const char * const wsi_clk_groups[] = {
"gpio24", "gpio27",
};
static const char * const wsi_data_groups[] = {
"gpio26", "gpio29",
};
static const char * const rx2_groups[] = {
"gpio37", "gpio45",
};
static const struct pinfunction ipq5424_functions[] = {
MSM_PIN_FUNCTION(atest_char),
MSM_PIN_FUNCTION(atest_char0),
MSM_PIN_FUNCTION(atest_char1),
MSM_PIN_FUNCTION(atest_char2),
MSM_PIN_FUNCTION(atest_char3),
MSM_PIN_FUNCTION(atest_tic),
MSM_PIN_FUNCTION(audio_pri),
MSM_PIN_FUNCTION(audio_pri0),
MSM_PIN_FUNCTION(audio_pri1),
MSM_PIN_FUNCTION(audio_sec),
MSM_PIN_FUNCTION(audio_sec0),
MSM_PIN_FUNCTION(audio_sec1),
MSM_PIN_FUNCTION(core_voltage),
MSM_PIN_FUNCTION(cri_trng0),
MSM_PIN_FUNCTION(cri_trng1),
MSM_PIN_FUNCTION(cri_trng2),
MSM_PIN_FUNCTION(cri_trng3),
MSM_PIN_FUNCTION(cxc_clk),
MSM_PIN_FUNCTION(cxc_data),
MSM_PIN_FUNCTION(dbg_out),
MSM_PIN_FUNCTION(gcc_plltest),
MSM_PIN_FUNCTION(gcc_tlmm),
MSM_PIN_FUNCTION(gpio),
MSM_PIN_FUNCTION(i2c0_scl),
MSM_PIN_FUNCTION(i2c0_sda),
MSM_PIN_FUNCTION(i2c1_scl),
MSM_PIN_FUNCTION(i2c1_sda),
MSM_PIN_FUNCTION(i2c11),
MSM_PIN_FUNCTION(mac0),
MSM_PIN_FUNCTION(mac1),
MSM_PIN_FUNCTION(mdc_mst),
MSM_PIN_FUNCTION(mdc_slv),
MSM_PIN_FUNCTION(mdio_mst),
MSM_PIN_FUNCTION(mdio_slv),
MSM_PIN_FUNCTION(pcie0_clk),
MSM_PIN_FUNCTION(pcie0_wake),
MSM_PIN_FUNCTION(pcie1_clk),
MSM_PIN_FUNCTION(pcie1_wake),
MSM_PIN_FUNCTION(pcie2_clk),
MSM_PIN_FUNCTION(pcie2_wake),
MSM_PIN_FUNCTION(pcie3_clk),
MSM_PIN_FUNCTION(pcie3_wake),
MSM_PIN_FUNCTION(pll_test),
MSM_PIN_FUNCTION(prng_rosc0),
MSM_PIN_FUNCTION(prng_rosc1),
MSM_PIN_FUNCTION(prng_rosc2),
MSM_PIN_FUNCTION(prng_rosc3),
MSM_PIN_FUNCTION(PTA0_0),
MSM_PIN_FUNCTION(PTA0_1),
MSM_PIN_FUNCTION(PTA0_2),
MSM_PIN_FUNCTION(PTA10),
MSM_PIN_FUNCTION(PTA11),
MSM_PIN_FUNCTION(pwm0),
MSM_PIN_FUNCTION(pwm1),
MSM_PIN_FUNCTION(pwm2),
MSM_PIN_FUNCTION(qdss_cti_trig_in_a0),
MSM_PIN_FUNCTION(qdss_cti_trig_out_a0),
MSM_PIN_FUNCTION(qdss_cti_trig_in_a1),
MSM_PIN_FUNCTION(qdss_cti_trig_out_a1),
MSM_PIN_FUNCTION(qdss_cti_trig_in_b0),
MSM_PIN_FUNCTION(qdss_cti_trig_out_b0),
MSM_PIN_FUNCTION(qdss_cti_trig_in_b1),
MSM_PIN_FUNCTION(qdss_cti_trig_out_b1),
MSM_PIN_FUNCTION(qdss_traceclk_a),
MSM_PIN_FUNCTION(qdss_tracectl_a),
MSM_PIN_FUNCTION(qdss_tracedata_a),
MSM_PIN_FUNCTION(qspi_clk),
MSM_PIN_FUNCTION(qspi_cs),
MSM_PIN_FUNCTION(qspi_data),
MSM_PIN_FUNCTION(resout),
MSM_PIN_FUNCTION(rx0),
MSM_PIN_FUNCTION(rx1),
MSM_PIN_FUNCTION(rx2),
MSM_PIN_FUNCTION(sdc_clk),
MSM_PIN_FUNCTION(sdc_cmd),
MSM_PIN_FUNCTION(sdc_data),
MSM_PIN_FUNCTION(spi0),
MSM_PIN_FUNCTION(spi1),
MSM_PIN_FUNCTION(spi10),
MSM_PIN_FUNCTION(spi11),
MSM_PIN_FUNCTION(tsens_max),
MSM_PIN_FUNCTION(uart0),
MSM_PIN_FUNCTION(uart1),
MSM_PIN_FUNCTION(wci_txd),
MSM_PIN_FUNCTION(wci_rxd),
MSM_PIN_FUNCTION(wsi_clk),
MSM_PIN_FUNCTION(wsi_data),
};
static const struct msm_pingroup ipq5424_groups[] = {
PINGROUP(0, sdc_data, qspi_data, pwm2, wci_txd, wci_rxd, _, _, _, _),
PINGROUP(1, sdc_data, qspi_data, pwm2, wci_txd, wci_rxd, _, _, _, _),
PINGROUP(2, sdc_data, qspi_data, pwm2, _, _, _, _, _, _),
PINGROUP(3, sdc_data, qspi_data, pwm2, _, _, _, _, _, _),
PINGROUP(4, sdc_cmd, qspi_cs, _, _, _, _, _, _, _),
PINGROUP(5, sdc_clk, qspi_clk, _, _, _, _, _, _, _),
PINGROUP(6, spi0, pwm1, _, cri_trng0, qdss_tracedata_a, _, _, _, _),
PINGROUP(7, spi0, pwm1, _, cri_trng1, qdss_tracedata_a, _, _, _, _),
PINGROUP(8, spi0, pwm1, wci_txd, wci_rxd, _, cri_trng2, qdss_tracedata_a, _, _),
PINGROUP(9, spi0, pwm1, _, cri_trng3, qdss_tracedata_a, _, _, _, _),
PINGROUP(10, uart0, pwm0, spi11, _, wci_txd, wci_rxd, _, qdss_tracedata_a, _),
PINGROUP(11, uart0, pwm0, spi1, _, wci_txd, wci_rxd, _, qdss_tracedata_a, _),
PINGROUP(12, uart0, pwm0, spi11, _, prng_rosc0, qdss_tracedata_a, _, _, _),
PINGROUP(13, uart0, pwm0, spi11, _, prng_rosc1, qdss_tracedata_a, _, _, _),
PINGROUP(14, i2c0_scl, tsens_max, _, prng_rosc2, qdss_tracedata_a, _, _, _, _),
PINGROUP(15, i2c0_sda, _, prng_rosc3, qdss_tracedata_a, _, _, _, _, _),
PINGROUP(16, core_voltage, i2c1_scl, _, _, _, _, _, _, _),
PINGROUP(17, core_voltage, i2c1_sda, _, _, _, _, _, _, _),
PINGROUP(18, _, _, _, _, _, _, _, _, _),
PINGROUP(19, _, _, _, _, _, _, _, _, _),
PINGROUP(20, mdc_slv, atest_char0, _, qdss_tracedata_a, _, _, _, _, _),
PINGROUP(21, mdio_slv, atest_char1, _, qdss_tracedata_a, _, _, _, _, _),
PINGROUP(22, mdc_mst, atest_char2, _, _, _, _, _, _, _),
PINGROUP(23, mdio_mst, atest_char3, _, _, _, _, _, _, _),
PINGROUP(24, pcie0_clk, PTA10, mac0, _, wsi_clk, _, atest_char, qdss_cti_trig_out_a0, _),
PINGROUP(25, _, _, _, _, _, _, _, _, _),
PINGROUP(26, pcie0_wake, PTA10, mac0, _, wsi_data, _, qdss_cti_trig_in_a0, _, _),
PINGROUP(27, pcie1_clk, i2c11, PTA10, wsi_clk, qdss_cti_trig_out_a1, _, _, _, _),
PINGROUP(28, _, _, _, _, _, _, _, _, _),
PINGROUP(29, pcie1_wake, i2c11, wsi_data, qdss_cti_trig_in_a1, _, _, _, _, _),
PINGROUP(30, pcie2_clk, PTA11, mac1, qdss_cti_trig_out_b0, _, _, _, _, _),
PINGROUP(31, _, _, _, _, _, _, _, _, _),
PINGROUP(32, pcie2_wake, PTA11, mac1, audio_pri0, audio_pri0, qdss_cti_trig_in_b0, _, _, _),
PINGROUP(33, pcie3_clk, PTA11, audio_pri1, audio_pri1, qdss_cti_trig_out_b1, _, _, _, _),
PINGROUP(34, _, _, _, _, _, _, _, _, _),
PINGROUP(35, pcie3_wake, audio_sec1, audio_sec1, qdss_cti_trig_in_b1, _, _, _, _, _),
PINGROUP(36, audio_pri, spi1, audio_sec0, audio_sec0, qdss_tracedata_a, _, _, _, _),
PINGROUP(37, audio_pri, spi1, rx2, qdss_tracedata_a, _, _, _, _, _),
PINGROUP(38, audio_pri, spi1, pll_test, rx1, qdss_tracedata_a, _, _, _, _),
PINGROUP(39, audio_pri, rx0, _, qdss_tracedata_a, _, _, _, _, _),
PINGROUP(40, PTA0_0, wci_txd, wci_rxd, _, atest_tic, _, _, _, _),
PINGROUP(41, PTA0_1, wci_txd, wci_rxd, cxc_data, _, _, _, _, _),
PINGROUP(42, PTA0_2, cxc_clk, _, _, _, _, _, _, _),
PINGROUP(43, uart1, gcc_plltest, _, _, _, _, _, _, _),
PINGROUP(44, uart1, gcc_tlmm, _, _, _, _, _, _, _),
PINGROUP(45, spi10, rx2, audio_sec, gcc_plltest, _, qdss_traceclk_a, _, _, _),
PINGROUP(46, spi1, rx1, audio_sec, dbg_out, qdss_tracectl_a, _, _, _, _),
PINGROUP(47, spi10, rx0, audio_sec, _, _, _, _, _, _),
PINGROUP(48, spi10, audio_sec, _, _, _, _, _, _, _),
PINGROUP(49, resout, _, _, _, _, _, _, _, _),
};
static const struct msm_pinctrl_soc_data ipq5424_pinctrl = {
.pins = ipq5424_pins,
.npins = ARRAY_SIZE(ipq5424_pins),
.functions = ipq5424_functions,
.nfunctions = ARRAY_SIZE(ipq5424_functions),
.groups = ipq5424_groups,
.ngroups = ARRAY_SIZE(ipq5424_groups),
.ngpios = 50,
};
static int ipq5424_pinctrl_probe(struct platform_device *pdev)
{
return msm_pinctrl_probe(pdev, &ipq5424_pinctrl);
}
static const struct of_device_id ipq5424_pinctrl_of_match[] = {
{ .compatible = "qcom,ipq5424-tlmm", },
{ },
};
MODULE_DEVICE_TABLE(of, ipq5424_pinctrl_of_match);
static struct platform_driver ipq5424_pinctrl_driver = {
.driver = {
.name = "ipq5424-tlmm",
.of_match_table = ipq5424_pinctrl_of_match,
},
.probe = ipq5424_pinctrl_probe,
.remove = msm_pinctrl_remove,
};
static int __init ipq5424_pinctrl_init(void)
{
return platform_driver_register(&ipq5424_pinctrl_driver);
}
arch_initcall(ipq5424_pinctrl_init);
static void __exit ipq5424_pinctrl_exit(void)
{
platform_driver_unregister(&ipq5424_pinctrl_driver);
}
module_exit(ipq5424_pinctrl_exit);
MODULE_DESCRIPTION("QTI IPQ5424 TLMM driver");
MODULE_LICENSE("GPL");

View File

@ -1080,7 +1080,7 @@ static struct platform_driver ipq6018_pinctrl_driver = {
.of_match_table = ipq6018_pinctrl_of_match,
},
.probe = ipq6018_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init ipq6018_pinctrl_init(void)

View File

@ -631,7 +631,7 @@ static struct platform_driver ipq8064_pinctrl_driver = {
.of_match_table = ipq8064_pinctrl_of_match,
},
.probe = ipq8064_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init ipq8064_pinctrl_init(void)

View File

@ -1041,7 +1041,7 @@ static struct platform_driver ipq8074_pinctrl_driver = {
.of_match_table = ipq8074_pinctrl_of_match,
},
.probe = ipq8074_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init ipq8074_pinctrl_init(void)

View File

@ -799,7 +799,7 @@ static struct platform_driver ipq9574_pinctrl_driver = {
.of_match_table = ipq9574_pinctrl_of_match,
},
.probe = ipq9574_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init ipq9574_pinctrl_init(void)

View File

@ -1059,7 +1059,7 @@ static struct platform_driver mdm9607_pinctrl_driver = {
.of_match_table = mdm9607_pinctrl_of_match,
},
.probe = mdm9607_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init mdm9607_pinctrl_init(void)

View File

@ -446,7 +446,7 @@ static struct platform_driver mdm9615_pinctrl_driver = {
.of_match_table = mdm9615_pinctrl_of_match,
},
.probe = mdm9615_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init mdm9615_pinctrl_init(void)

View File

@ -1457,7 +1457,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
* files which don't set the "gpio-ranges" property or systems that
* utilize ACPI the driver has to call gpiochip_add_pin_range().
*/
if (!of_property_read_bool(pctrl->dev->of_node, "gpio-ranges")) {
if (!of_property_present(pctrl->dev->of_node, "gpio-ranges")) {
ret = gpiochip_add_pin_range(&pctrl->chip,
dev_name(pctrl->dev), 0, 0, chip->ngpio);
if (ret) {

View File

@ -654,7 +654,7 @@ static struct platform_driver msm8226_pinctrl_driver = {
.of_match_table = msm8226_pinctrl_of_match,
},
.probe = msm8226_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init msm8226_pinctrl_init(void)

View File

@ -981,7 +981,7 @@ static struct platform_driver msm8660_pinctrl_driver = {
.of_match_table = msm8660_pinctrl_of_match,
},
.probe = msm8660_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init msm8660_pinctrl_init(void)

View File

@ -929,7 +929,7 @@ static struct platform_driver msm8909_pinctrl_driver = {
.of_match_table = msm8909_pinctrl_of_match,
},
.probe = msm8909_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init msm8909_pinctrl_init(void)

View File

@ -969,7 +969,7 @@ static struct platform_driver msm8916_pinctrl_driver = {
.of_match_table = msm8916_pinctrl_of_match,
},
.probe = msm8916_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init msm8916_pinctrl_init(void)

View File

@ -1816,7 +1816,7 @@ static struct platform_driver msm8953_pinctrl_driver = {
.of_match_table = msm8953_pinctrl_of_match,
},
.probe = msm8953_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init msm8953_pinctrl_init(void)

View File

@ -1246,7 +1246,7 @@ static struct platform_driver msm8960_pinctrl_driver = {
.of_match_table = msm8960_pinctrl_of_match,
},
.probe = msm8960_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init msm8960_pinctrl_init(void)

View File

@ -1096,7 +1096,7 @@ static struct platform_driver msm8976_pinctrl_driver = {
.of_match_table = msm8976_pinctrl_of_match,
},
.probe = msm8976_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init msm8976_pinctrl_init(void)

View File

@ -1343,7 +1343,7 @@ static struct platform_driver msm8994_pinctrl_driver = {
.of_match_table = msm8994_pinctrl_of_match,
},
.probe = msm8994_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init msm8994_pinctrl_init(void)

View File

@ -1920,7 +1920,7 @@ static struct platform_driver msm8996_pinctrl_driver = {
.of_match_table = msm8996_pinctrl_of_match,
},
.probe = msm8996_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init msm8996_pinctrl_init(void)

View File

@ -1535,7 +1535,7 @@ static struct platform_driver msm8998_pinctrl_driver = {
.of_match_table = msm8998_pinctrl_of_match,
},
.probe = msm8998_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init msm8998_pinctrl_init(void)

View File

@ -1083,7 +1083,7 @@ static struct platform_driver msm8x74_pinctrl_driver = {
.of_match_table = msm8x74_pinctrl_of_match,
},
.probe = msm8x74_pinctrl_probe,
.remove_new = msm_pinctrl_remove,
.remove = msm_pinctrl_remove,
};
static int __init msm8x74_pinctrl_init(void)

Some files were not shown because too many files have changed in this diff Show More