Commit 907bb57a authored by Linus Torvalds's avatar Linus Torvalds

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

Pull pin control updates from Linus Walleij:
 "Pretty big this time. Mostly due to (nice) Renesas refactorings.

  Core changes:

   - New helpers from Andy such as for_each_gpiochip_node() affecting
     both GPIO and pin control, improving a bunch of drivers in the
     process.

   - Pulled in Marc Zyngiers work to make IRQ chips immutable, and
     started to apply fixups on top.

  New drivers:

   - New driver for Marvell MVEBU 98DX2530.

   - New driver for Mediatek MT8195.

   - Support Qualcomm PMX65 and PM6125.

   - New driver for Qualcomm SC7280 LPASS pin control.

   - New driver for Rockchip RK3588.

   - New driver for NXP Freescale i.MXRT1170.

   - New driver for Mediatek MT6795 Helio X10.

  Improvements:

   - Several Aspeed G6 cleanups and non-critical fixes.

   - Thorought refactoring of some of the ever improving Renesas
     drivers.

   - Clean up Mediatek MT8192 bindings a bit.

   - PWM output and clock monitoring in the Ocelot LAN966x driver.

   - Thorough refactoring and cleanup of the Ralink drivers such as
     RT2880, RT3883, RT305X, MT7620, MT7621, MT7628 splitting these into
     proper sub-drivers"

* tag 'pinctrl-v5.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (161 commits)
  pinctrl: apple: Use a raw spinlock for the regmap
  pinctrl: berlin: bg4ct: Use devm_platform_*ioremap_resource() APIs
  pinctrl: intel: Fix kernel doc format, i.e. add return sections
  dt-bindings: pinctrl: qcom: Drop 'maxItems' on 'wakeup-parent'
  pinctrl: starfive: Make the irqchip immutable
  pinctrl: mediatek: Add pinctrl driver for MT6795 Helio X10
  dt-bindings: pinctrl: Add MediaTek MT6795 pinctrl bindings
  pinctrl: freescale: Add i.MXRT1170 pinctrl driver support
  dt-bindings: pinctrl: add i.MXRT1170 pinctrl Documentation
  dt-bindings: pinctrl: rockchip: increase max amount of device functions
  dt-bindings: pinctrl: qcom,pmic-gpio: add 'gpio-reserved-ranges'
  dt-bindings: pinctrl: qcom,pmic-gpio: add 'input-disable'
  dt-bindings: pinctrl: qcom,pmic-gpio: describe gpio-line-names
  dt-bindings: pinctrl: qcom,pmic-gpio: fix matching pin config
  dt-bindings: pinctrl: qcom,pmic-gpio: document PM8150L and PMM8155AU
  pinctrl: qcom: spmi-gpio: Add pm6125 compatible
  dt-bindings: pinctrl: qcom-pmic-gpio: Add pm6125 compatible
  pinctrl: intel: Drop unused irqchip member in struct intel_pinctrl
  pinctrl: intel: make irq_chip immutable
  pinctrl: cherryview: Use GPIO chip pointer in chv_gpio_irq_mask_unmask()
  ...
parents ca7984df 83969805
...@@ -22,6 +22,7 @@ Properties: ...@@ -22,6 +22,7 @@ Properties:
- "qcom,sc7280-pdc": For SC7280 - "qcom,sc7280-pdc": For SC7280
- "qcom,sdm845-pdc": For SDM845 - "qcom,sdm845-pdc": For SDM845
- "qcom,sm6350-pdc": For SM6350 - "qcom,sm6350-pdc": For SM6350
- "qcom,sm8150-pdc": For SM8150
- "qcom,sm8250-pdc": For SM8250 - "qcom,sm8250-pdc": For SM8250
- "qcom,sm8350-pdc": For SM8350 - "qcom,sm8350-pdc": For SM8350
......
...@@ -76,73 +76,24 @@ additionalProperties: false ...@@ -76,73 +76,24 @@ additionalProperties: false
examples: examples:
- | - |
#include <dt-bindings/clock/aspeed-clock.h> #include <dt-bindings/clock/aspeed-clock.h>
apb { scu@1e6e2000 {
compatible = "simple-bus"; compatible = "aspeed,ast2500-scu", "syscon", "simple-mfd";
#address-cells = <1>; reg = <0x1e6e2000 0x1a8>;
#size-cells = <1>; #clock-cells = <1>;
ranges; #reset-cells = <1>;
syscon: scu@1e6e2000 { pinctrl: pinctrl {
compatible = "aspeed,ast2500-scu", "syscon", "simple-mfd"; compatible = "aspeed,ast2500-pinctrl";
reg = <0x1e6e2000 0x1a8>; aspeed,external-nodes = <&gfx>, <&lhc>;
#clock-cells = <1>;
#reset-cells = <1>; pinctrl_i2c3_default: i2c3_default {
function = "I2C3";
pinctrl: pinctrl { groups = "I2C3";
compatible = "aspeed,ast2500-pinctrl";
aspeed,external-nodes = <&gfx>, <&lhc>;
pinctrl_i2c3_default: i2c3_default {
function = "I2C3";
groups = "I2C3";
};
pinctrl_gpioh0_unbiased_default: gpioh0 {
pins = "A18";
bias-disable;
};
}; };
};
gfx: display@1e6e6000 {
compatible = "aspeed,ast2500-gfx", "syscon";
reg = <0x1e6e6000 0x1000>;
reg-io-width = <4>;
clocks = <&syscon ASPEED_CLK_GATE_D1CLK>;
resets = <&syscon ASPEED_RESET_CRT1>;
interrupts = <0x19>;
syscon = <&syscon>;
memory-region = <&gfx_memory>;
};
};
lpc: lpc@1e789000 {
compatible = "aspeed,ast2500-lpc", "simple-mfd";
reg = <0x1e789000 0x1000>;
#address-cells = <1>;
#size-cells = <1>;
ranges = <0x0 0x1e789000 0x1000>;
lpc_host: lpc-host@80 {
compatible = "aspeed,ast2500-lpc-host", "simple-mfd", "syscon";
reg = <0x80 0x1e0>;
reg-io-width = <4>;
#address-cells = <1>; pinctrl_gpioh0_unbiased_default: gpioh0 {
#size-cells = <1>; pins = "A18";
ranges = <0x0 0x80 0x1e0>; bias-disable;
lhc: lhc@20 {
compatible = "aspeed,ast2500-lhc";
reg = <0x20 0x24>, <0x48 0x8>;
}; };
}; };
}; };
gfx_memory: framebuffer {
size = <0x01000000>;
alignment = <0x01000000>;
compatible = "shared-dma-pool";
reusable;
};
* Freescale i.MX7 Dual IOMUX Controller
iMX7D supports two iomuxc controllers, fsl,imx7d-iomuxc controller is similar
as previous iMX SoC generation and fsl,imx7d-iomuxc-lpsr which provides low
power state retention capabilities on gpios that are part of iomuxc-lpsr
(GPIO1_IO7..GPIO1_IO0). While iomuxc-lpsr provides its own set of registers for
mux and pad control settings, it shares the input select register from main
iomuxc controller for daisy chain settings, the fsl,input-sel property extends
fsl,imx-pinctrl driver to support iomuxc-lpsr controller.
iomuxc_lpsr: iomuxc-lpsr@302c0000 {
compatible = "fsl,imx7d-iomuxc-lpsr";
reg = <0x302c0000 0x10000>;
fsl,input-sel = <&iomuxc>;
};
iomuxc: iomuxc@30330000 {
compatible = "fsl,imx7d-iomuxc";
reg = <0x30330000 0x10000>;
};
Peripherals using pads from iomuxc-lpsr support low state retention power
state, under LPSR mode GPIO's state of pads are retain.
Please refer to fsl,imx-pinctrl.txt in this directory for common binding part
and usage.
Required properties:
- compatible: "fsl,imx7d-iomuxc" for main IOMUXC controller, or
"fsl,imx7d-iomuxc-lpsr" for Low Power State Retention IOMUXC controller.
- 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
imx7d-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.MX7 Dual
Reference Manual for detailed CONFIG settings.
- fsl,input-sel: required property for iomuxc-lpsr controller, this property is
a phandle for main iomuxc controller which shares the input select register for
daisy chain settings.
CONFIG bits definition:
PAD_CTL_PUS_100K_DOWN (0 << 5)
PAD_CTL_PUS_5K_UP (1 << 5)
PAD_CTL_PUS_47K_UP (2 << 5)
PAD_CTL_PUS_100K_UP (3 << 5)
PAD_CTL_PUE (1 << 4)
PAD_CTL_HYS (1 << 3)
PAD_CTL_SRE_SLOW (1 << 2)
PAD_CTL_SRE_FAST (0 << 2)
PAD_CTL_DSE_X1 (0 << 0)
PAD_CTL_DSE_X4 (1 << 0)
PAD_CTL_DSE_X2 (2 << 0)
PAD_CTL_DSE_X6 (3 << 0)
Examples:
While iomuxc-lpsr is intended to be used by dedicated peripherals to take
advantages of LPSR power mode, is also possible that an IP to use pads from
any of the iomux controllers. For example the I2C1 IP can use SCL pad from
iomuxc-lpsr controller and SDA pad from iomuxc controller as:
i2c1: i2c@30a20000 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c1_1>, <&pinctrl_i2c1_2>;
};
iomuxc-lpsr@302c0000 {
compatible = "fsl,imx7d-iomuxc-lpsr";
reg = <0x302c0000 0x10000>;
fsl,input-sel = <&iomuxc>;
pinctrl_i2c1_1: i2c1grp-1 {
fsl,pins = <
MX7D_PAD_GPIO1_IO04__I2C1_SCL 0x4000007f
>;
};
};
iomuxc@30330000 {
compatible = "fsl,imx7d-iomuxc";
reg = <0x30330000 0x10000>;
pinctrl_i2c1_2: i2c1grp-2 {
fsl,pins = <
MX7D_PAD_I2C1_SDA__I2C1_SDA 0x4000007f
>;
};
};
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/fsl,imx7d-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Freescale IMX7D IOMUX Controller
maintainers:
- Dong Aisheng <aisheng.dong@nxp.com>
description:
Please refer to fsl,imx-pinctrl.txt and pinctrl-bindings.txt in this directory
for common binding part and usage.
properties:
compatible:
oneOf:
- enum:
- fsl,imx7d-iomuxc
- fsl,imx7d-iomuxc-lpsr
reg:
maxItems: 1
fsl,input-sel:
description:
phandle for main iomuxc controller which shares the input select
register for daisy chain settings.
$ref: /schemas/types.yaml#/definitions/phandle
# Client device subnode's properties
patternProperties:
'grp$':
type: object
description:
Pinctrl node's client devices use subnodes for desired pin configuration.
Client device subnodes use below standard properties.
properties:
fsl,pins:
description:
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/imx7d-pinfunc.h>. The last integer
CONFIG is the pad setting value like pull-up on this pin. Please
refer to i.MX7D Reference Manual for detailed CONFIG settings.
$ref: /schemas/types.yaml#/definitions/uint32-matrix
items:
items:
- description: |
"mux_reg" indicates the offset of mux register.
- description: |
"conf_reg" indicates the offset of pad configuration register.
- description: |
"input_reg" indicates the offset of select input register.
- description: |
"mux_val" indicates the mux value to be applied.
- description: |
"input_val" indicates the select input value to be applied.
- description: |
"pad_setting" indicates the pad configuration value to be applied.
required:
- fsl,pins
additionalProperties: false
allOf:
- $ref: "pinctrl.yaml#"
required:
- compatible
- reg
if:
properties:
compatible:
contains:
enum:
- fsl,imx7d-iomuxc-lpsr
then:
required:
- fsl,input-sel
additionalProperties: false
examples:
- |
iomuxc: pinctrl@30330000 {
compatible = "fsl,imx7d-iomuxc";
reg = <0x30330000 0x10000>;
pinctrl_uart5: uart5grp {
fsl,pins =
<0x0160 0x03D0 0x0714 0x1 0x0 0x7e>,
<0x0164 0x03D4 0x0000 0x1 0x0 0x76>;
};
};
- |
iomuxc_lpsr: pinctrl@302c0000 {
compatible = "fsl,imx7d-iomuxc-lpsr";
reg = <0x302c0000 0x10000>;
fsl,input-sel = <&iomuxc>;
pinctrl_gpio_lpsr: gpio1-grp {
fsl,pins =
<0x0008 0x0038 0x0000 0x0 0x0 0x59>,
<0x000C 0x003C 0x0000 0x0 0x0 0x59>;
};
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/fsl,imxrt1170.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Freescale i.MXRT1170 IOMUX Controller
maintainers:
- Giulio Benetti <giulio.benetti@benettiengineering.com>
- Jesse Taube <Mr.Bossman075@gmail.com>
description:
Please refer to fsl,imx-pinctrl.txt and pinctrl-bindings.txt in this directory
for common binding part and usage.
properties:
compatible:
const: fsl,imxrt1170-iomuxc
reg:
maxItems: 1
# Client device subnode's properties
patternProperties:
'grp$':
type: object
description:
Pinctrl node's client devices use subnodes for desired pin configuration.
Client device subnodes use below standard properties.
properties:
fsl,pins:
description:
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/imxrt1170-pinfunc.h>. The last
integer CONFIG is the pad setting value like pull-up on this pin. Please
refer to i.MXRT1170 Reference Manual for detailed CONFIG settings.
$ref: /schemas/types.yaml#/definitions/uint32-matrix
items:
items:
- description: |
"mux_reg" indicates the offset of mux register.
- description: |
"conf_reg" indicates the offset of pad configuration register.
- description: |
"input_reg" indicates the offset of select input register.
- description: |
"mux_val" indicates the mux value to be applied.
- description: |
"input_val" indicates the select input value to be applied.
- description: |
"pad_setting" indicates the pad configuration value to be applied.
required:
- fsl,pins
additionalProperties: false
required:
- compatible
- reg
additionalProperties: false
examples:
- |
iomuxc: iomuxc@400e8000 {
compatible = "fsl,imxrt1170-iomuxc";
reg = <0x400e8000 0x4000>;
pinctrl_lpuart1: lpuart1grp {
fsl,pins =
<0x16C 0x3B0 0x620 0x0 0x0 0xf1>,
<0x170 0x3B4 0x61C 0x0 0x0 0xf1>;
};
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/marvell,ac5-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Marvell AC5 pin controller
maintainers:
- Chris Packham <chris.packham@alliedtelesis.co.nz>
description:
Bindings for Marvell's AC5 memory-mapped pin controller.
properties:
compatible:
items:
- const: marvell,ac5-pinctrl
reg:
maxItems: 1
patternProperties:
'-pins$':
type: object
$ref: pinmux-node.yaml#
properties:
marvell,function:
$ref: "/schemas/types.yaml#/definitions/string"
description:
Indicates the function to select.
enum: [ dev_init_done, ge, gpio, i2c0, i2c1, int_out, led, nand, pcie, ptp, sdio,
spi0, spi1, synce, tsen_int, uart0, uart1, uart2, uart3, uartsd, wd_int, xg ]
marvell,pins:
$ref: /schemas/types.yaml#/definitions/string-array
description:
Array of MPP pins to be used for the given function.
minItems: 1
items:
enum: [ mpp0, mpp1, mpp2, mpp3, mpp4, mpp5, mpp6, mpp7, mpp8, mpp9,
mpp10, mpp11, mpp12, mpp13, mpp14, mpp15, mpp16, mpp17, mpp18, mpp19,
mpp20, mpp21, mpp22, mpp23, mpp24, mpp25, mpp26, mpp27, mpp28, mpp29,
mpp30, mpp31, mpp32, mpp33, mpp34, mpp35, mpp36, mpp37, mpp38, mpp39,
mpp40, mpp41, mpp42, mpp43, mpp44, mpp45 ]
allOf:
- $ref: "pinctrl.yaml#"
required:
- compatible
- reg
additionalProperties: false
examples:
- |
pinctrl@80020100 {
compatible = "marvell,ac5-pinctrl";
reg = <0x80020100 0x20>;
i2c0_pins: i2c0-pins {
marvell,pins = "mpp26", "mpp27";
marvell,function = "i2c0";
};
i2c0_gpio: i2c0-gpio-pins {
marvell,pins = "mpp26", "mpp27";
marvell,function = "gpio";
};
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/mediatek,pinctrl-mt6795.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Mediatek MT6795 Pin Controller
maintainers:
- AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
- Sean Wang <sean.wang@kernel.org>
description: |
The Mediatek's Pin controller is used to control SoC pins.
properties:
compatible:
const: mediatek,mt6795-pinctrl
gpio-controller: true
'#gpio-cells':
description: |
Number of cells in GPIO specifier. Since the generic GPIO binding is used,
the amount of cells must be specified as 2. See the below
mentioned gpio binding representation for description of particular cells.
const: 2
gpio-ranges:
description: GPIO valid number range.
maxItems: 1
reg:
description:
Physical address base for gpio base and eint registers.
minItems: 2
reg-names:
items:
- const: base
- const: eint
interrupt-controller: true
'#interrupt-cells':
const: 2
interrupts:
description: The interrupt outputs to sysirq.
maxItems: 1
# PIN CONFIGURATION NODES
patternProperties:
'-pins$':
type: object
additionalProperties: false
patternProperties:
'^pins':
type: object
additionalProperties: false
description: |
A pinctrl node should contain at least one subnodes representing the
pinctrl groups available on the machine. Each subnode will list the
pins it needs, and how they should be configured, with regard to muxer
configuration, pullups, drive strength, input enable/disable and
input schmitt.
An example of using macro:
pincontroller {
/* GPIO0 set as multifunction GPIO0 */
gpio-pins {
pins {
pinmux = <PINMUX_GPIO0__FUNC_GPIO0>;
}
};
/* GPIO45 set as multifunction SDA0 */
i2c0-pins {
pins {
pinmux = <PINMUX_GPIO45__FUNC_SDA0>;
}
};
};
$ref: "pinmux-node.yaml"
properties:
pinmux:
description: |
Integer array, represents gpio pin number and mux setting.
Supported pin number and mux varies for different SoCs, and are
defined as macros in dt-bindings/pinctrl/<soc>-pinfunc.h
directly.
drive-strength:
enum: [2, 4, 6, 8, 10, 12, 14, 16]
bias-pull-down:
oneOf:
- type: boolean
- enum: [100, 101, 102, 103]
description: mt6795 pull down PUPD/R0/R1 type define value.
description: |
For normal pull down type, it is not necessary to specify R1R0
values; When pull down type is PUPD/R0/R1, adding R1R0 defines
will set different resistance values.
bias-pull-up:
oneOf:
- type: boolean
- enum: [100, 101, 102, 103]
description: mt6795 pull up PUPD/R0/R1 type define value.
description: |
For normal pull up type, it is not necessary to specify R1R0
values; When pull up type is PUPD/R0/R1, adding R1R0 defines
will set different resistance values.
bias-disable: true
output-high: true
output-low: true
input-enable: true
input-disable: true
input-schmitt-enable: true
input-schmitt-disable: true
mediatek,pull-up-adv:
description: |
Pull up setings for 2 pull resistors, R0 and R1. User can
configure those special pins. Valid arguments are described as below:
0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled.
1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled.
2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled.
3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled.
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2, 3]
mediatek,pull-down-adv:
description: |
Pull down settings for 2 pull resistors, R0 and R1. User can
configure those special pins. Valid arguments are described as below:
0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled.
1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled.
2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled.
3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled.
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2, 3]
required:
- pinmux
allOf:
- $ref: "pinctrl.yaml#"
required:
- compatible
- reg
- reg-names
- interrupts
- interrupt-controller
- '#interrupt-cells'
- gpio-controller
- '#gpio-cells'
- gpio-ranges
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/pinctrl/mt6795-pinfunc.h>
soc {
#address-cells = <2>;
#size-cells = <2>;
pio: pinctrl@10005000 {
compatible = "mediatek,mt6795-pinctrl";
reg = <0 0x10005000 0 0x1000>, <0 0x1000b000 0 0x1000>;
reg-names = "base", "eint";
gpio-controller;
#gpio-cells = <2>;
gpio-ranges = <&pio 0 0 196>;
interrupt-controller;
interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>;
#interrupt-cells = <2>;
i2c0-pins {
pins-sda-scl {
pinmux = <PINMUX_GPIO45__FUNC_SDA0>,
<PINMUX_GPIO46__FUNC_SCL0>;
};
};
mmc0-pins {
pins-cmd-dat {
pinmux = <PINMUX_GPIO154__FUNC_MSDC0_DAT0>,
<PINMUX_GPIO155__FUNC_MSDC0_DAT1>,
<PINMUX_GPIO156__FUNC_MSDC0_DAT2>,
<PINMUX_GPIO157__FUNC_MSDC0_DAT3>,
<PINMUX_GPIO158__FUNC_MSDC0_DAT4>,
<PINMUX_GPIO159__FUNC_MSDC0_DAT5>,
<PINMUX_GPIO160__FUNC_MSDC0_DAT6>,
<PINMUX_GPIO161__FUNC_MSDC0_DAT7>,
<PINMUX_GPIO162__FUNC_MSDC0_CMD>;
input-enable;
bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
};
pins-clk {
pinmux = <PINMUX_GPIO163__FUNC_MSDC0_CLK>;
bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
};
pins-rst {
pinmux = <PINMUX_GPIO165__FUNC_MSDC0_RSTB>;
bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
};
};
};
};
Microsemi Ocelot pin controller Device Tree Bindings
----------------------------------------------------
Required properties:
- compatible : Should be "mscc,ocelot-pinctrl",
"mscc,jaguar2-pinctrl", "microchip,sparx5-pinctrl",
"mscc,luton-pinctrl", "mscc,serval-pinctrl",
"microchip,lan966x-pinctrl" or "mscc,servalt-pinctrl"
- reg : Address and length of the register set for the device
- gpio-controller : Indicates this device is a GPIO controller
- #gpio-cells : Must be 2.
The first cell is the pin number and the
second cell specifies GPIO flags, as defined in
<dt-bindings/gpio/gpio.h>.
- gpio-ranges : Range of pins managed by the GPIO controller.
The ocelot-pinctrl driver uses the generic pin multiplexing and generic pin
configuration documented in pinctrl-bindings.txt.
The following generic properties are supported:
- function
- pins
Example:
gpio: pinctrl@71070034 {
compatible = "mscc,ocelot-pinctrl";
reg = <0x71070034 0x28>;
gpio-controller;
#gpio-cells = <2>;
gpio-ranges = <&gpio 0 0 22>;
uart_pins: uart-pins {
pins = "GPIO_6", "GPIO_7";
function = "uart";
};
uart2_pins: uart2-pins {
pins = "GPIO_12", "GPIO_13";
function = "uart2";
};
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/mscc,ocelot-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Microsemi Ocelot pin controller
maintainers:
- Alexandre Belloni <alexandre.belloni@bootlin.com>
- Lars Povlsen <lars.povlsen@microchip.com>
properties:
compatible:
enum:
- microchip,lan966x-pinctrl
- microchip,sparx5-pinctrl
- mscc,jaguar2-pinctrl
- mscc,luton-pinctrl
- mscc,ocelot-pinctrl
- mscc,serval-pinctrl
- mscc,servalt-pinctrl
reg:
items:
- description: Base address
- description: Extended pin configuration registers
minItems: 1
gpio-controller: true
'#gpio-cells':
const: 2
gpio-ranges: true
interrupts:
maxItems: 1
interrupt-controller: true
"#interrupt-cells":
const: 2
resets:
maxItems: 1
reset-names:
description: Optional shared switch reset.
items:
- const: switch
patternProperties:
'-pins$':
type: object
allOf:
- $ref: "pinmux-node.yaml"
- $ref: "pincfg-node.yaml"
properties:
function: true
pins: true
output-high: true
output-low: true
drive-strength: true
required:
- function
- pins
additionalProperties: false
required:
- compatible
- reg
- gpio-controller
- '#gpio-cells'
- gpio-ranges
allOf:
- $ref: "pinctrl.yaml#"
- if:
properties:
compatible:
contains:
enum:
- microchip,lan966x-pinctrl
- microchip,sparx5-pinctrl
then:
properties:
reg:
minItems: 2
additionalProperties: false
examples:
- |
gpio: pinctrl@71070034 {
compatible = "mscc,ocelot-pinctrl";
reg = <0x71070034 0x28>;
gpio-controller;
#gpio-cells = <2>;
gpio-ranges = <&gpio 0 0 22>;
uart_pins: uart-pins {
pins = "GPIO_6", "GPIO_7";
function = "uart";
};
uart2_pins: uart2-pins {
pins = "GPIO_12", "GPIO_13";
function = "uart2";
};
};
...
...@@ -29,6 +29,8 @@ properties: ...@@ -29,6 +29,8 @@ properties:
description: gpio valid number range. description: gpio valid number range.
maxItems: 1 maxItems: 1
gpio-line-names: true
reg: reg:
description: | description: |
Physical address base for gpio base registers. There are 11 GPIO Physical address base for gpio base registers. There are 11 GPIO
...@@ -51,62 +53,92 @@ properties: ...@@ -51,62 +53,92 @@ properties:
#PIN CONFIGURATION NODES #PIN CONFIGURATION NODES
patternProperties: patternProperties:
'^pins': '-pins$':
type: object type: object
description: |
A pinctrl node should contain at least one subnodes representing the
pinctrl groups available on the machine. Each subnode will list the
pins it needs, and how they should be configured, with regard to muxer
configuration, pullups, drive strength, input enable/disable and
input schmitt.
An example of using macro:
pincontroller {
/* GPIO0 set as multifunction GPIO0 */
state_0_node_a {
pinmux = <PINMUX_GPIO0__FUNC_GPIO0>;
};
/* GPIO1 set as multifunction PWM */
state_0_node_b {
pinmux = <PINMUX_GPIO1__FUNC_PWM_1>;
};
};
$ref: "pinmux-node.yaml"
properties:
pinmux:
description: |
Integer array, represents gpio pin number and mux setting.
Supported pin number and mux varies for different SoCs, and are defined
as macros in dt-bindings/pinctrl/<soc>-pinfunc.h directly.
drive-strength:
description: |
It can support some arguments, such as MTK_DRIVE_4mA, MTK_DRIVE_6mA, etc. See
dt-bindings/pinctrl/mt65xx.h. It can only support 2/4/6/8/10/12/14/16mA in mt8192.
enum: [2, 4, 6, 8, 10, 12, 14, 16]
bias-pull-down: true
bias-pull-up: true
bias-disable: true
output-high: true
output-low: true
input-enable: true
input-disable: true
input-schmitt-enable: true
input-schmitt-disable: true
required:
- pinmux
additionalProperties: false additionalProperties: false
patternProperties:
'^pins':
type: object
description: |
A pinctrl node should contain at least one subnodes representing the
pinctrl groups available on the machine. Each subnode will list the
pins it needs, and how they should be configured, with regard to muxer
configuration, pullups, drive strength, input enable/disable and
input schmitt.
$ref: "pinmux-node.yaml"
properties:
pinmux:
description: |
Integer array, represents gpio pin number and mux setting.
Supported pin number and mux varies for different SoCs, and are defined
as macros in dt-bindings/pinctrl/<soc>-pinfunc.h directly.
drive-strength:
description: |
It can support some arguments, such as MTK_DRIVE_4mA, MTK_DRIVE_6mA, etc. See
dt-bindings/pinctrl/mt65xx.h. It can only support 2/4/6/8/10/12/14/16mA in mt8192.
enum: [2, 4, 6, 8, 10, 12, 14, 16]
mediatek,drive-strength-adv:
description: |
Describe the specific driving setup property.
For I2C pins, the existing generic driving setup can only support
2/4/6/8/10/12/14/16mA driving. But in specific driving setup, they
can support 0.125/0.25/0.5/1mA adjustment. If we enable specific
driving setup, the existing generic setup will be disabled.
The specific driving setup is controlled by E1E0EN.
When E1=0/E0=0, the strength is 0.125mA.
When E1=0/E0=1, the strength is 0.25mA.
When E1=1/E0=0, the strength is 0.5mA.
When E1=1/E0=1, the strength is 1mA.
EN is used to enable or disable the specific driving setup.
Valid arguments are described as below:
0: (E1, E0, EN) = (0, 0, 0)
1: (E1, E0, EN) = (0, 0, 1)
2: (E1, E0, EN) = (0, 1, 0)
3: (E1, E0, EN) = (0, 1, 1)
4: (E1, E0, EN) = (1, 0, 0)
5: (E1, E0, EN) = (1, 0, 1)
6: (E1, E0, EN) = (1, 1, 0)
7: (E1, E0, EN) = (1, 1, 1)
So the valid arguments are from 0 to 7.
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2, 3, 4, 5, 6, 7]
mediatek,pull-up-adv:
description: |
Pull up settings for 2 pull resistors, R0 and R1. User can
configure those special pins. Valid arguments are described as below:
0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled.
1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled.
2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled.
3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled.
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2, 3]
bias-pull-down: true
bias-pull-up: true
bias-disable: true
output-high: true
output-low: true
input-enable: true
input-disable: true
input-schmitt-enable: true
input-schmitt-disable: true
required:
- pinmux
additionalProperties: false
allOf: allOf:
- $ref: "pinctrl.yaml#" - $ref: "pinctrl.yaml#"
...@@ -151,8 +183,17 @@ examples: ...@@ -151,8 +183,17 @@ examples:
interrupts = <GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH 0>; interrupts = <GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH 0>;
#interrupt-cells = <2>; #interrupt-cells = <2>;
pins { spi1-default-pins {
pinmux = <PINMUX_GPIO0__FUNC_GPIO0>; pins-cs-mosi-clk {
output-low; pinmux = <PINMUX_GPIO157__FUNC_SPI1_A_CSB>,
<PINMUX_GPIO159__FUNC_SPI1_A_MO>,
<PINMUX_GPIO156__FUNC_SPI1_A_CLK>;
bias-disable;
};
pins-miso {
pinmux = <PINMUX_GPIO158__FUNC_SPI1_A_MI>;
bias-pull-down;
};
}; };
}; };
...@@ -20,6 +20,7 @@ properties: ...@@ -20,6 +20,7 @@ properties:
- qcom,pm2250-gpio - qcom,pm2250-gpio
- qcom,pm660-gpio - qcom,pm660-gpio
- qcom,pm660l-gpio - qcom,pm660l-gpio
- qcom,pm6125-gpio
- qcom,pm6150-gpio - qcom,pm6150-gpio
- qcom,pm6150l-gpio - qcom,pm6150l-gpio
- qcom,pm6350-gpio - qcom,pm6350-gpio
...@@ -32,6 +33,7 @@ properties: ...@@ -32,6 +33,7 @@ properties:
- qcom,pm8058-gpio - qcom,pm8058-gpio
- qcom,pm8150-gpio - qcom,pm8150-gpio
- qcom,pm8150b-gpio - qcom,pm8150b-gpio
- qcom,pm8150l-gpio
- qcom,pm8226-gpio - qcom,pm8226-gpio
- qcom,pm8350-gpio - qcom,pm8350-gpio
- qcom,pm8350b-gpio - qcom,pm8350b-gpio
...@@ -49,10 +51,12 @@ properties: ...@@ -49,10 +51,12 @@ properties:
- qcom,pmi8994-gpio - qcom,pmi8994-gpio
- qcom,pmi8998-gpio - qcom,pmi8998-gpio
- qcom,pmk8350-gpio - qcom,pmk8350-gpio
- qcom,pmm8155au-gpio
- qcom,pmr735a-gpio - qcom,pmr735a-gpio
- qcom,pmr735b-gpio - qcom,pmr735b-gpio
- qcom,pms405-gpio - qcom,pms405-gpio
- qcom,pmx55-gpio - qcom,pmx55-gpio
- qcom,pmx65-gpio
- enum: - enum:
- qcom,spmi-gpio - qcom,spmi-gpio
...@@ -71,6 +75,16 @@ properties: ...@@ -71,6 +75,16 @@ properties:
gpio-ranges: gpio-ranges:
maxItems: 1 maxItems: 1
gpio-line-names:
minItems: 2
maxItems: 44
gpio-reserved-ranges:
minItems: 1
# maxItems as half of total number of GPIOs, as there has to be at
# least one usable GPIO between each reserved range.
maxItems: 22
'#gpio-cells': '#gpio-cells':
const: 2 const: 2
description: description:
...@@ -87,13 +101,278 @@ required: ...@@ -87,13 +101,278 @@ required:
- gpio-ranges - gpio-ranges
- interrupt-controller - interrupt-controller
allOf:
- if:
properties:
compatible:
contains:
enum:
- qcom,pm8008-gpio
- qcom,pmi8950-gpio
then:
properties:
gpio-line-names:
minItems: 2
maxItems: 2
gpio-reserved-ranges:
maxItems: 1
- if:
properties:
compatible:
contains:
enum:
- qcom,pm8005-gpio
- qcom,pm8450-gpio
- qcom,pm8916-gpio
- qcom,pmk8350-gpio
- qcom,pmr735a-gpio
- qcom,pmr735b-gpio
then:
properties:
gpio-line-names:
minItems: 4
maxItems: 4
gpio-reserved-ranges:
minItems: 1
maxItems: 2
- if:
properties:
compatible:
contains:
enum:
- qcom,pm8018-gpio
- qcom,pm8019-gpio
then:
properties:
gpio-line-names:
minItems: 6
maxItems: 6
gpio-reserved-ranges:
minItems: 1
maxItems: 3
- if:
properties:
compatible:
contains:
enum:
- qcom,pm8350b-gpio
- qcom,pm8950-gpio
then:
properties:
gpio-line-names:
minItems: 8
maxItems: 8
gpio-reserved-ranges:
minItems: 1
maxItems: 4
- if:
properties:
compatible:
contains:
enum:
- qcom,pm6350-gpio
- qcom,pm8350c-gpio
then:
properties:
gpio-line-names:
minItems: 9
maxItems: 9
gpio-reserved-ranges:
minItems: 1
maxItems: 5
- if:
properties:
compatible:
contains:
enum:
- qcom,pm2250-gpio
- qcom,pm6150-gpio
- qcom,pm7325-gpio
- qcom,pm8150-gpio
- qcom,pm8350-gpio
- qcom,pmc8180-gpio
- qcom,pmi8994-gpio
- qcom,pmm8155au-gpio
then:
properties:
gpio-line-names:
minItems: 10
maxItems: 10
gpio-reserved-ranges:
minItems: 1
maxItems: 5
- if:
properties:
compatible:
contains:
enum:
- qcom,pmx55-gpio
then:
properties:
gpio-line-names:
minItems: 11
maxItems: 11
gpio-reserved-ranges:
minItems: 1
maxItems: 6
- if:
properties:
compatible:
contains:
enum:
- qcom,pm660l-gpio
- qcom,pm6150l-gpio
- qcom,pm8038-gpio
- qcom,pm8150b-gpio
- qcom,pm8150l-gpio
- qcom,pmc8180c-gpio
- qcom,pms405-gpio
then:
properties:
gpio-line-names:
minItems: 12
maxItems: 12
gpio-reserved-ranges:
minItems: 1
maxItems: 6
- if:
properties:
compatible:
contains:
enum:
- qcom,pm660-gpio
then:
properties:
gpio-line-names:
minItems: 13
maxItems: 13
gpio-reserved-ranges:
minItems: 1
maxItems: 7
- if:
properties:
compatible:
contains:
enum:
- qcom,pmi8998-gpio
then:
properties:
gpio-line-names:
minItems: 14
maxItems: 14
gpio-reserved-ranges:
minItems: 1
maxItems: 7
- if:
properties:
compatible:
contains:
enum:
- qcom,pmx65-gpio
then:
properties:
gpio-line-names:
minItems: 16
maxItems: 16
gpio-reserved-ranges:
minItems: 1
maxItems: 8
- if:
properties:
compatible:
contains:
enum:
- qcom,pm8994-gpio
- qcom,pma8084-gpio
then:
properties:
gpio-line-names:
minItems: 22
maxItems: 22
gpio-reserved-ranges:
minItems: 1
maxItems: 11
- if:
properties:
compatible:
contains:
enum:
- qcom,pm8998-gpio
then:
properties:
gpio-line-names:
minItems: 26
maxItems: 26
gpio-reserved-ranges:
minItems: 1
maxItems: 13
- if:
properties:
compatible:
contains:
enum:
- qcom,pm8941-gpio
then:
properties:
gpio-line-names:
minItems: 36
maxItems: 36
gpio-reserved-ranges:
minItems: 1
maxItems: 18
- if:
properties:
compatible:
contains:
enum:
- qcom,pm8917-gpio
then:
properties:
gpio-line-names:
minItems: 38
maxItems: 38
gpio-reserved-ranges:
minItems: 1
maxItems: 19
- if:
properties:
compatible:
contains:
enum:
- qcom,pm8058-gpio
- qcom,pm8921-gpio
then:
properties:
gpio-line-names:
minItems: 44
maxItems: 44
gpio-reserved-ranges:
minItems: 1
maxItems: 22
patternProperties: patternProperties:
'-state$': '-state$':
oneOf: oneOf:
- $ref: "#/$defs/qcom-pmic-gpio-state" - $ref: "#/$defs/qcom-pmic-gpio-state"
- patternProperties: - patternProperties:
".*": "(pinconf|-pins)$":
$ref: "#/$defs/qcom-pmic-gpio-state" $ref: "#/$defs/qcom-pmic-gpio-state"
additionalProperties: false
$defs: $defs:
qcom-pmic-gpio-state: qcom-pmic-gpio-state:
...@@ -106,6 +385,7 @@ $defs: ...@@ -106,6 +385,7 @@ $defs:
description: description:
List of gpio pins affected by the properties specified in List of gpio pins affected by the properties specified in
this subnode. Valid pins are this subnode. Valid pins are
- gpio1-gpio9 for pm6125
- gpio1-gpio10 for pm6150 - gpio1-gpio10 for pm6150
- gpio1-gpio12 for pm6150l - gpio1-gpio12 for pm6150l
- gpio1-gpio9 for pm6350 - gpio1-gpio9 for pm6350
...@@ -134,12 +414,14 @@ $defs: ...@@ -134,12 +414,14 @@ $defs:
- gpio1-gpio2 for pmi8950 - gpio1-gpio2 for pmi8950
- gpio1-gpio10 for pmi8994 - gpio1-gpio10 for pmi8994
- gpio1-gpio4 for pmk8350 - gpio1-gpio4 for pmk8350
- gpio1-gpio10 for pmm8155au
- gpio1-gpio4 for pmr735a - gpio1-gpio4 for pmr735a
- gpio1-gpio4 for pmr735b - gpio1-gpio4 for pmr735b
- gpio1-gpio12 for pms405 (holes on gpio1, gpio9 - gpio1-gpio12 for pms405 (holes on gpio1, gpio9
and gpio10) and gpio10)
- gpio1-gpio11 for pmx55 (holes on gpio3, gpio7, gpio10 - gpio1-gpio11 for pmx55 (holes on gpio3, gpio7, gpio10
and gpio11) and gpio11)
- gpio1-gpio16 for pmx65
items: items:
pattern: "^gpio([0-9]+)$" pattern: "^gpio([0-9]+)$"
...@@ -174,6 +456,7 @@ $defs: ...@@ -174,6 +456,7 @@ $defs:
bias-high-impedance: true bias-high-impedance: true
input-enable: true input-enable: true
input-disable: true
output-high: true output-high: true
output-low: true output-low: true
output-enable: true output-enable: true
...@@ -232,7 +515,7 @@ examples: ...@@ -232,7 +515,7 @@ examples:
#gpio-cells = <2>; #gpio-cells = <2>;
pm8921_gpio_keys: gpio-keys-state { pm8921_gpio_keys: gpio-keys-state {
volume-keys { volume-keys-pins {
pins = "gpio20", "gpio21"; pins = "gpio20", "gpio21";
function = "normal"; function = "normal";
......
...@@ -42,8 +42,7 @@ properties: ...@@ -42,8 +42,7 @@ properties:
gpio-ranges: gpio-ranges:
maxItems: 1 maxItems: 1
wakeup-parent: wakeup-parent: true
maxItems: 1
#PIN CONFIGURATION NODES #PIN CONFIGURATION NODES
patternProperties: patternProperties:
......
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/qcom,sc7280-lpass-lpi-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Technologies, Inc. Low Power Audio SubSystem (LPASS)
Low Power Island (LPI) TLMM block
maintainers:
- Srinivasa Rao Mandadapu <srivasam@codeaurora.org>
- Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
description: |
This binding describes the Top Level Mode Multiplexer block found in the
LPASS LPI IP on most Qualcomm SoCs
properties:
compatible:
const: qcom,sc7280-lpass-lpi-pinctrl
reg:
minItems: 2
maxItems: 2
gpio-controller: true
'#gpio-cells':
description: Specifying the pin number and flags, as defined in
include/dt-bindings/gpio/gpio.h
const: 2
gpio-ranges:
maxItems: 1
#PIN CONFIGURATION NODES
patternProperties:
'-pins$':
type: object
description:
Pinctrl node's client devices use subnodes for desired pin configuration.
Client device subnodes use below standard properties.
$ref: "/schemas/pinctrl/pincfg-node.yaml"
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])$"
minItems: 1
maxItems: 15
function:
enum: [ gpio, swr_tx_clk, qua_mi2s_sclk, swr_tx_data, qua_mi2s_ws,
qua_mi2s_data, swr_rx_clk, swr_rx_data, dmic1_clk, i2s1_clk,
dmic1_data, i2s1_ws, dmic2_clk, dmic2_data, i2s1_data,
i2s2_clk, wsa_swr_clk, i2s2_ws, wsa_swr_data, dmic3_clk,
dmic3_data, i2s2_data ]
description:
Specify the alternative function to be configured for the specified
pins.
drive-strength:
enum: [2, 4, 6, 8, 10, 12, 14, 16]
default: 2
description:
Selects the drive strength for the specified pins, in mA.
slew-rate:
enum: [0, 1, 2, 3]
default: 0
description: |
0: No adjustments
1: Higher Slew rate (faster edges)
2: Lower Slew rate (slower edges)
3: Reserved (No adjustments)
bias-pull-down: true
bias-pull-up: true
bias-disable: true
output-high: true
output-low: true
required:
- pins
- function
additionalProperties: false
required:
- compatible
- reg
- gpio-controller
- '#gpio-cells'
- gpio-ranges
additionalProperties: false
examples:
- |
lpass_tlmm: pinctrl@33c0000 {
compatible = "qcom,sc7280-lpass-lpi-pinctrl";
reg = <0x33c0000 0x20000>,
<0x3550000 0x10000>;
gpio-controller;
#gpio-cells = <2>;
gpio-ranges = <&lpass_tlmm 0 0 15>;
};
...@@ -42,8 +42,7 @@ properties: ...@@ -42,8 +42,7 @@ properties:
gpio-ranges: gpio-ranges:
maxItems: 1 maxItems: 1
wakeup-parent: wakeup-parent: true
maxItems: 1
#PIN CONFIGURATION NODES #PIN CONFIGURATION NODES
patternProperties: patternProperties:
......
...@@ -49,8 +49,7 @@ properties: ...@@ -49,8 +49,7 @@ properties:
gpio-ranges: gpio-ranges:
maxItems: 1 maxItems: 1
wakeup-parent: wakeup-parent: true
maxItems: 1
#PIN CONFIGURATION NODES #PIN CONFIGURATION NODES
patternProperties: patternProperties:
......
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2 %YAML 1.2
--- ---
$id: http://devicetree.org/schemas/pinctrl/qcom,lpass-lpi-pinctrl.yaml# $id: http://devicetree.org/schemas/pinctrl/qcom,sm8250-lpass-lpi-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm Technologies, Inc. Low Power Audio SubSystem (LPASS) title: Qualcomm Technologies, Inc. Low Power Audio SubSystem (LPASS)
......
...@@ -49,8 +49,7 @@ properties: ...@@ -49,8 +49,7 @@ properties:
gpio-ranges: gpio-ranges:
maxItems: 1 maxItems: 1
wakeup-parent: wakeup-parent: true
maxItems: 1
#PIN CONFIGURATION NODES #PIN CONFIGURATION NODES
patternProperties: patternProperties:
......
...@@ -42,7 +42,6 @@ properties: ...@@ -42,7 +42,6 @@ properties:
description: description:
Specifying the interrupt-controller used to wake up the system when the Specifying the interrupt-controller used to wake up the system when the
TLMM block has been powered down. TLMM block has been powered down.
maxItems: 1
gpio-reserved-ranges: gpio-reserved-ranges:
description: description:
......
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/ralink,mt7620-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Ralink MT7620 Pin Controller
maintainers:
- Arınç ÜNAL <arinc.unal@arinc9.com>
- Sergio Paracuellos <sergio.paracuellos@gmail.com>
description:
Ralink MT7620 pin controller for MT7620, MT7628 and MT7688 SoCs.
The pin controller can only set the muxing of pin groups. Muxing individual
pins is not supported. There is no pinconf support.
properties:
compatible:
const: ralink,mt7620-pinctrl
patternProperties:
'-pins$':
type: object
patternProperties:
'^(.*-)?pinmux$':
type: object
description: node for pinctrl.
$ref: pinmux-node.yaml#
properties:
groups:
description: The pin group to select.
enum: [
# For MT7620 SoC
ephy, i2c, mdio, nd_sd, pa, pcie, rgmii1, rgmii2, spi, spi refclk,
uartf, uartlite, wdt, wled,
# For MT7628 and MT7688 SoCs
gpio, i2c, i2s, p0led_an, p0led_kn, p1led_an, p1led_kn, p2led_an,
p2led_kn, p3led_an, p3led_kn, p4led_an, p4led_kn, perst, pwm0,
pwm1, refclk, sdmode, spi, spi cs1, spis, uart0, uart1, uart2,
wdt, wled_an, wled_kn,
]
function:
description: The mux function to select.
enum: [
# For MT7620 SoC
ephy, gpio, gpio i2s, gpio uartf, i2c, i2s uartf, mdio, nand, pa,
pcie refclk, pcie rst, pcm gpio, pcm i2s, pcm uartf, refclk,
rgmii1, rgmii2, sd, spi, spi refclk, uartf, uartlite, wdt refclk,
wdt rst, wled,
# For MT7628 and MT7688 SoCs
antenna, debug, gpio, i2c, i2s, jtag, p0led_an, p0led_kn,
p1led_an, p1led_kn, p2led_an, p2led_kn, p3led_an, p3led_kn,
p4led_an, p4led_kn, pcie, pcm, perst, pwm, pwm0, pwm1, pwm_uart2,
refclk, rsvd, sdxc, sdxc d5 d4, sdxc d6, sdxc d7, spi, spi cs1,
spis, sw_r, uart0, uart1, uart2, utif, wdt, wled_an, wled_kn, -,
]
required:
- groups
- function
additionalProperties: false
additionalProperties: false
allOf:
- $ref: "pinctrl.yaml#"
required:
- compatible
additionalProperties: false
examples:
# Pinmux controller node
- |
pinctrl {
compatible = "ralink,mt7620-pinctrl";
i2c_pins: i2c0-pins {
pinmux {
groups = "i2c";
function = "i2c";
};
};
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2 %YAML 1.2
--- ---
$id: http://devicetree.org/schemas/pinctrl/ralink,rt2880-pinmux.yaml# $id: http://devicetree.org/schemas/pinctrl/ralink,mt7621-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Ralink rt2880 pinmux controller title: Ralink MT7621 Pin Controller
maintainers: maintainers:
- Arınç ÜNAL <arinc.unal@arinc9.com>
- Sergio Paracuellos <sergio.paracuellos@gmail.com> - Sergio Paracuellos <sergio.paracuellos@gmail.com>
description: description:
The rt2880 pinmux can only set the muxing of pin groups. Muxing indiviual pins Ralink MT7621 pin controller for MT7621 SoC.
is not supported. There is no pinconf support. The pin controller can only set the muxing of pin groups. Muxing individual
pins is not supported. There is no pinconf support.
properties: properties:
compatible: compatible:
const: ralink,rt2880-pinmux const: ralink,mt7621-pinctrl
patternProperties: patternProperties:
'-pins$': '-pins$':
...@@ -28,14 +30,15 @@ patternProperties: ...@@ -28,14 +30,15 @@ patternProperties:
properties: properties:
groups: groups:
description: Name of the pin group to use for the functions. description: The pin group to select.
enum: [i2c, jtag, mdio, pcie, rgmii1, rgmii2, sdhci, spi, enum: [i2c, jtag, mdio, pcie, rgmii1, rgmii2, sdhci, spi, uart1,
uart1, uart2, uart3, wdt] uart2, uart3, wdt]
function: function:
description: The mux function to select description: The mux function to select.
enum: [gpio, i2c, i2s, jtag, mdio, nand1, nand2, pcie refclk, enum: [gpio, i2c, i2s, jtag, mdio, nand1, nand2, pcie refclk,
pcie rst, pcm, rgmii1, rgmii2, sdhci, spdif2, spdif3, pcie rst, pcm, rgmii1, rgmii2, sdhci, spdif2, spdif3, spi,
spi, uart1, uart2, uart3, wdt refclk, wdt rst] uart1, uart2, uart3, wdt refclk, wdt rst]
required: required:
- groups - groups
...@@ -57,7 +60,7 @@ examples: ...@@ -57,7 +60,7 @@ examples:
# Pinmux controller node # Pinmux controller node
- | - |
pinctrl { pinctrl {
compatible = "ralink,rt2880-pinmux"; compatible = "ralink,mt7621-pinctrl";
i2c_pins: i2c0-pins { i2c_pins: i2c0-pins {
pinmux { pinmux {
......
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/ralink,rt2880-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Ralink RT2880 Pin Controller
maintainers:
- Arınç ÜNAL <arinc.unal@arinc9.com>
- Sergio Paracuellos <sergio.paracuellos@gmail.com>
description:
Ralink RT2880 pin controller for RT2880 SoC.
The pin controller can only set the muxing of pin groups. Muxing individual
pins is not supported. There is no pinconf support.
properties:
compatible:
const: ralink,rt2880-pinctrl
patternProperties:
'-pins$':
type: object
patternProperties:
'^(.*-)?pinmux$':
type: object
description: node for pinctrl.
$ref: pinmux-node.yaml#
properties:
groups:
description: The pin group to select.
enum: [i2c, spi, uartlite, jtag, mdio, sdram, pci]
function:
description: The mux function to select.
enum: [gpio, i2c, spi, uartlite, jtag, mdio, sdram, pci]
required:
- groups
- function
additionalProperties: false
additionalProperties: false
allOf:
- $ref: "pinctrl.yaml#"
required:
- compatible
additionalProperties: false
examples:
# Pinmux controller node
- |
pinctrl {
compatible = "ralink,rt2880-pinctrl";
i2c_pins: i2c0-pins {
pinmux {
groups = "i2c";
function = "i2c";
};
};
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/ralink,rt305x-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Ralink RT305X Pin Controller
maintainers:
- Arınç ÜNAL <arinc.unal@arinc9.com>
- Sergio Paracuellos <sergio.paracuellos@gmail.com>
description:
Ralink RT305X pin controller for RT3050, RT3052, RT3350, RT3352 and RT5350
SoCs.
The pin controller can only set the muxing of pin groups. Muxing individual
pins is not supported. There is no pinconf support.
properties:
compatible:
const: ralink,rt305x-pinctrl
patternProperties:
'-pins$':
type: object
patternProperties:
'^(.*-)?pinmux$':
type: object
description: node for pinctrl.
$ref: pinmux-node.yaml#
properties:
groups:
description: The pin group to select.
enum: [
# For RT3050, RT3052 and RT3350 SoCs
i2c, jtag, mdio, rgmii, sdram, spi, uartf, uartlite,
# For RT3352 SoC
i2c, jtag, led, lna, mdio, pa, rgmii, spi, spi_cs1, uartf,
uartlite,
# For RT5350 SoC
i2c, jtag, led, spi, spi_cs1, uartf, uartlite,
]
function:
description: The mux function to select.
enum: [
# For RT3050, RT3052 and RT3350 SoCs
gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag, mdio, pcm gpio,
pcm i2s, pcm uartf, rgmii, sdram, spi, uartf, uartlite,
# For RT3352 SoC
gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag, led, lna, mdio,
pa, pcm gpio, pcm i2s, pcm uartf, rgmii, spi, spi_cs1, uartf,
uartlite, wdg_cs1,
# For RT5350 SoC
gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag, led, pcm gpio,
pcm i2s, pcm uartf, spi, spi_cs1, uartf, uartlite, wdg_cs1,
]
required:
- groups
- function
additionalProperties: false
additionalProperties: false
allOf:
- $ref: "pinctrl.yaml#"
required:
- compatible
additionalProperties: false
examples:
# Pinmux controller node
- |
pinctrl {
compatible = "ralink,rt305x-pinctrl";
i2c_pins: i2c0-pins {
pinmux {
groups = "i2c";
function = "i2c";
};
};
};
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/pinctrl/ralink,rt3883-pinctrl.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Ralink RT3883 Pin Controller
maintainers:
- Arınç ÜNAL <arinc.unal@arinc9.com>
- Sergio Paracuellos <sergio.paracuellos@gmail.com>
description:
Ralink RT3883 pin controller for RT3883 SoC.
The pin controller can only set the muxing of pin groups. Muxing individual
pins is not supported. There is no pinconf support.
properties:
compatible:
const: ralink,rt3883-pinctrl
patternProperties:
'-pins$':
type: object
patternProperties:
'^(.*-)?pinmux$':
type: object
description: node for pinctrl.
$ref: pinmux-node.yaml#
properties:
groups:
description: The pin group to select.
enum: [ge1, ge2, i2c, jtag, lna a, lna g, mdio, pci, spi, uartf,
uartlite]
function:
description: The mux function to select.
enum: [ge1, ge2, gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag,
lna a, lna g, mdio, pci-dev, pci-fnc, pci-host1, pci-host2,
pcm gpio, pcm i2s, pcm uartf, spi, uartf, uartlite]
required:
- groups
- function
additionalProperties: false
additionalProperties: false
allOf:
- $ref: "pinctrl.yaml#"
required:
- compatible
additionalProperties: false
examples:
# Pinmux controller node
- |
pinctrl {
compatible = "ralink,rt3883-pinctrl";
i2c_pins: i2c0-pins {
pinmux {
groups = "i2c";
function = "i2c";
};
};
};
...@@ -11,8 +11,8 @@ maintainers: ...@@ -11,8 +11,8 @@ maintainers:
- Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> - Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
description: description:
The Renesas SoCs of the RZ/{G2L,V2L} series feature a combined Pin and GPIO The Renesas SoCs of the RZ/{G2L,V2L} alike series feature a combined Pin and
controller. GPIO controller.
Pin multiplexing and GPIO configuration is performed on a per-pin basis. Pin multiplexing and GPIO configuration is performed on a per-pin basis.
Each port features up to 8 pins, each of them configurable for GPIO function Each port features up to 8 pins, each of them configurable for GPIO function
(port mode) or in alternate function mode. (port mode) or in alternate function mode.
...@@ -23,6 +23,7 @@ properties: ...@@ -23,6 +23,7 @@ properties:
oneOf: oneOf:
- items: - items:
- enum: - enum:
- renesas,r9a07g043-pinctrl # RZ/G2UL{Type-1,Type-2}
- renesas,r9a07g044-pinctrl # RZ/G2{L,LC} - renesas,r9a07g044-pinctrl # RZ/G2{L,LC}
- items: - items:
......
...@@ -33,6 +33,7 @@ properties: ...@@ -33,6 +33,7 @@ properties:
enum: enum:
- rockchip,px30-pinctrl - rockchip,px30-pinctrl
- rockchip,rk2928-pinctrl - rockchip,rk2928-pinctrl
- rockchip,rk3036-pinctrl
- rockchip,rk3066a-pinctrl - rockchip,rk3066a-pinctrl
- rockchip,rk3066b-pinctrl - rockchip,rk3066b-pinctrl
- rockchip,rk3128-pinctrl - rockchip,rk3128-pinctrl
...@@ -44,6 +45,7 @@ properties: ...@@ -44,6 +45,7 @@ properties:
- rockchip,rk3368-pinctrl - rockchip,rk3368-pinctrl
- rockchip,rk3399-pinctrl - rockchip,rk3399-pinctrl
- rockchip,rk3568-pinctrl - rockchip,rk3568-pinctrl
- rockchip,rk3588-pinctrl
- rockchip,rv1108-pinctrl - rockchip,rv1108-pinctrl
rockchip,grf: rockchip,grf:
...@@ -129,7 +131,7 @@ additionalProperties: ...@@ -129,7 +131,7 @@ additionalProperties:
description: description:
Pin bank index. Pin bank index.
- minimum: 0 - minimum: 0
maximum: 6 maximum: 10
description: description:
Mux 0 means GPIO and mux 1 to N means Mux 0 means GPIO and mux 1 to N means
the specific device function. the specific device function.
......
...@@ -429,7 +429,8 @@ call into the core gpiolib code: ...@@ -429,7 +429,8 @@ call into the core gpiolib code:
static void my_gpio_mask_irq(struct irq_data *d) static void my_gpio_mask_irq(struct irq_data *d)
{ {
struct gpio_chip *gc = irq_desc_get_handler_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
irq_hw_number_t hwirq = irqd_to_hwirq(d);
/* /*
* Perform any necessary action to mask the interrupt, * Perform any necessary action to mask the interrupt,
...@@ -437,14 +438,15 @@ call into the core gpiolib code: ...@@ -437,14 +438,15 @@ call into the core gpiolib code:
* state. * state.
*/ */
gpiochip_disable_irq(gc, d->hwirq); gpiochip_disable_irq(gc, hwirq);
} }
static void my_gpio_unmask_irq(struct irq_data *d) static void my_gpio_unmask_irq(struct irq_data *d)
{ {
struct gpio_chip *gc = irq_desc_get_handler_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
irq_hw_number_t hwirq = irqd_to_hwirq(d);
gpiochip_enable_irq(gc, d->hwirq); gpiochip_enable_irq(gc, hwirq);
/* /*
* Perform any necessary action to unmask the interrupt, * Perform any necessary action to unmask the interrupt,
...@@ -501,7 +503,8 @@ the interrupt separately and go with it: ...@@ -501,7 +503,8 @@ the interrupt separately and go with it:
static void my_gpio_mask_irq(struct irq_data *d) static void my_gpio_mask_irq(struct irq_data *d)
{ {
struct gpio_chip *gc = irq_desc_get_handler_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
irq_hw_number_t hwirq = irqd_to_hwirq(d);
/* /*
* Perform any necessary action to mask the interrupt, * Perform any necessary action to mask the interrupt,
...@@ -509,14 +512,15 @@ the interrupt separately and go with it: ...@@ -509,14 +512,15 @@ the interrupt separately and go with it:
* state. * state.
*/ */
gpiochip_disable_irq(gc, d->hwirq); gpiochip_disable_irq(gc, hwirq);
} }
static void my_gpio_unmask_irq(struct irq_data *d) static void my_gpio_unmask_irq(struct irq_data *d)
{ {
struct gpio_chip *gc = irq_desc_get_handler_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
irq_hw_number_t hwirq = irqd_to_hwirq(d);
gpiochip_enable_irq(gc, d->hwirq); gpiochip_enable_irq(gc, hwirq);
/* /*
* Perform any necessary action to unmask the interrupt, * Perform any necessary action to unmask the interrupt,
...@@ -576,7 +580,8 @@ In this case the typical set-up will look like this: ...@@ -576,7 +580,8 @@ In this case the typical set-up will look like this:
static void my_gpio_mask_irq(struct irq_data *d) static void my_gpio_mask_irq(struct irq_data *d)
{ {
struct gpio_chip *gc = irq_desc_get_handler_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
irq_hw_number_t hwirq = irqd_to_hwirq(d);
/* /*
* Perform any necessary action to mask the interrupt, * Perform any necessary action to mask the interrupt,
...@@ -584,15 +589,16 @@ In this case the typical set-up will look like this: ...@@ -584,15 +589,16 @@ In this case the typical set-up will look like this:
* state. * state.
*/ */
gpiochip_disable_irq(gc, d->hwirq); gpiochip_disable_irq(gc, hwirq);
irq_mask_mask_parent(d); irq_mask_mask_parent(d);
} }
static void my_gpio_unmask_irq(struct irq_data *d) static void my_gpio_unmask_irq(struct irq_data *d)
{ {
struct gpio_chip *gc = irq_desc_get_handler_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
irq_hw_number_t hwirq = irqd_to_hwirq(d);
gpiochip_enable_irq(gc, d->hwirq); gpiochip_enable_irq(gc, hwirq);
/* /*
* Perform any necessary action to unmask the interrupt, * Perform any necessary action to unmask the interrupt,
......
...@@ -16647,6 +16647,13 @@ L: linux-mips@vger.kernel.org ...@@ -16647,6 +16647,13 @@ L: linux-mips@vger.kernel.org
S: Maintained S: Maintained
F: arch/mips/boot/dts/ralink/mt7621* F: arch/mips/boot/dts/ralink/mt7621*
RALINK PINCTRL DRIVER
M: Arınç ÜNAL <arinc.unal@arinc9.com>
M: Sergio Paracuellos <sergio.paracuellos@gmail.com>
L: linux-mips@vger.kernel.org
S: Maintained
F: drivers/pinctrl/ralink/
RALINK RT2X00 WIRELESS LAN DRIVER RALINK RT2X00 WIRELESS LAN DRIVER
M: Stanislaw Gruszka <stf_xl@wp.pl> M: Stanislaw Gruszka <stf_xl@wp.pl>
M: Helmut Schaa <helmut.schaa@googlemail.com> M: Helmut Schaa <helmut.schaa@googlemail.com>
......
...@@ -151,7 +151,7 @@ spi0: spi@b00 { ...@@ -151,7 +151,7 @@ spi0: spi@b00 {
}; };
pinctrl: pinctrl { pinctrl: pinctrl {
compatible = "ralink,rt2880-pinmux"; compatible = "ralink,mt7621-pinctrl";
i2c_pins: i2c0-pins { i2c_pins: i2c0-pins {
pinmux { pinmux {
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_irq.h> #include <linux/of_irq.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include "../pinctrl/core.h" #include "../pinctrl/core.h"
...@@ -706,7 +707,7 @@ static int rockchip_gpio_probe(struct platform_device *pdev) ...@@ -706,7 +707,7 @@ static int rockchip_gpio_probe(struct platform_device *pdev)
struct device_node *pctlnp = of_get_parent(np); struct device_node *pctlnp = of_get_parent(np);
struct pinctrl_dev *pctldev = NULL; struct pinctrl_dev *pctldev = NULL;
struct rockchip_pin_bank *bank = NULL; struct rockchip_pin_bank *bank = NULL;
struct rockchip_pin_output_deferred *cfg; struct rockchip_pin_deferred *cfg;
static int gpio; static int gpio;
int id, ret; int id, ret;
...@@ -747,15 +748,27 @@ static int rockchip_gpio_probe(struct platform_device *pdev) ...@@ -747,15 +748,27 @@ static int rockchip_gpio_probe(struct platform_device *pdev)
return ret; return ret;
} }
while (!list_empty(&bank->deferred_output)) { while (!list_empty(&bank->deferred_pins)) {
cfg = list_first_entry(&bank->deferred_output, cfg = list_first_entry(&bank->deferred_pins,
struct rockchip_pin_output_deferred, head); struct rockchip_pin_deferred, head);
list_del(&cfg->head); list_del(&cfg->head);
ret = rockchip_gpio_direction_output(&bank->gpio_chip, cfg->pin, cfg->arg); switch (cfg->param) {
if (ret) case PIN_CONFIG_OUTPUT:
dev_warn(dev, "setting output pin %u to %u failed\n", cfg->pin, cfg->arg); ret = rockchip_gpio_direction_output(&bank->gpio_chip, cfg->pin, cfg->arg);
if (ret)
dev_warn(dev, "setting output pin %u to %u failed\n", cfg->pin,
cfg->arg);
break;
case PIN_CONFIG_INPUT_ENABLE:
ret = rockchip_gpio_direction_input(&bank->gpio_chip, cfg->pin);
if (ret)
dev_warn(dev, "setting input pin %u failed\n", cfg->pin);
break;
default:
dev_warn(dev, "unknown deferred config param %d\n", cfg->param);
break;
}
kfree(cfg); kfree(cfg);
} }
......
...@@ -930,6 +930,11 @@ static int of_gpiochip_add_pin_range(struct gpio_chip *chip) ...@@ -930,6 +930,11 @@ static int of_gpiochip_add_pin_range(struct gpio_chip *chip)
if (!np) if (!np)
return 0; return 0;
if (!of_property_read_bool(np, "gpio-ranges") &&
chip->of_gpio_ranges_fallback) {
return chip->of_gpio_ranges_fallback(chip, np);
}
group_names = of_find_property(np, group_names_propname, NULL); group_names = of_find_property(np, group_names_propname, NULL);
for (;; index++) { for (;; index++) {
......
...@@ -358,6 +358,22 @@ static int bcm2835_gpio_direction_output(struct gpio_chip *chip, ...@@ -358,6 +358,22 @@ static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
return 0; return 0;
} }
static int bcm2835_of_gpio_ranges_fallback(struct gpio_chip *gc,
struct device_node *np)
{
struct pinctrl_dev *pctldev = of_pinctrl_get(np);
of_node_put(np);
if (!pctldev)
return 0;
gpiochip_add_pin_range(gc, pinctrl_dev_get_devname(pctldev), 0, 0,
gc->ngpio);
return 0;
}
static const struct gpio_chip bcm2835_gpio_chip = { static const struct gpio_chip bcm2835_gpio_chip = {
.label = MODULE_NAME, .label = MODULE_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -372,6 +388,7 @@ static const struct gpio_chip bcm2835_gpio_chip = { ...@@ -372,6 +388,7 @@ static const struct gpio_chip bcm2835_gpio_chip = {
.base = -1, .base = -1,
.ngpio = BCM2835_NUM_GPIOS, .ngpio = BCM2835_NUM_GPIOS,
.can_sleep = false, .can_sleep = false,
.of_gpio_ranges_fallback = bcm2835_of_gpio_ranges_fallback,
}; };
static const struct gpio_chip bcm2711_gpio_chip = { static const struct gpio_chip bcm2711_gpio_chip = {
...@@ -388,6 +405,7 @@ static const struct gpio_chip bcm2711_gpio_chip = { ...@@ -388,6 +405,7 @@ static const struct gpio_chip bcm2711_gpio_chip = {
.base = -1, .base = -1,
.ngpio = BCM2711_NUM_GPIOS, .ngpio = BCM2711_NUM_GPIOS,
.can_sleep = false, .can_sleep = false,
.of_gpio_ranges_fallback = bcm2835_of_gpio_ranges_fallback,
}; };
static void bcm2835_gpio_irq_handle_bank(struct bcm2835_pinctrl *pc, static void bcm2835_gpio_irq_handle_bank(struct bcm2835_pinctrl *pc,
......
...@@ -460,8 +460,7 @@ static int berlin4ct_pinctrl_probe(struct platform_device *pdev) ...@@ -460,8 +460,7 @@ static int berlin4ct_pinctrl_probe(struct platform_device *pdev)
if (!rmconfig) if (!rmconfig)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
......
...@@ -206,3 +206,10 @@ config PINCTRL_IMX23 ...@@ -206,3 +206,10 @@ config PINCTRL_IMX23
config PINCTRL_IMX28 config PINCTRL_IMX28
bool bool
select PINCTRL_MXS select PINCTRL_MXS
config PINCTRL_IMXRT1170
bool "IMXRT1170 pinctrl driver"
depends on ARCH_MXC
select PINCTRL_IMX
help
Say Y here to enable the imxrt1170 pinctrl driver
...@@ -32,3 +32,4 @@ obj-$(CONFIG_PINCTRL_IMX23) += pinctrl-imx23.o ...@@ -32,3 +32,4 @@ obj-$(CONFIG_PINCTRL_IMX23) += pinctrl-imx23.o
obj-$(CONFIG_PINCTRL_IMX25) += pinctrl-imx25.o obj-$(CONFIG_PINCTRL_IMX25) += pinctrl-imx25.o
obj-$(CONFIG_PINCTRL_IMX28) += pinctrl-imx28.o obj-$(CONFIG_PINCTRL_IMX28) += pinctrl-imx28.o
obj-$(CONFIG_PINCTRL_IMXRT1050) += pinctrl-imxrt1050.o obj-$(CONFIG_PINCTRL_IMXRT1050) += pinctrl-imxrt1050.o
obj-$(CONFIG_PINCTRL_IMXRT1170) += pinctrl-imxrt1170.o
This diff is collapsed.
...@@ -1350,15 +1350,15 @@ static void byt_irq_ack(struct irq_data *d) ...@@ -1350,15 +1350,15 @@ static void byt_irq_ack(struct irq_data *d)
{ {
struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct intel_pinctrl *vg = gpiochip_get_data(gc); struct intel_pinctrl *vg = gpiochip_get_data(gc);
unsigned int offset = irqd_to_hwirq(d); irq_hw_number_t hwirq = irqd_to_hwirq(d);
void __iomem *reg; void __iomem *reg;
reg = byt_gpio_reg(vg, offset, BYT_INT_STAT_REG); reg = byt_gpio_reg(vg, hwirq, BYT_INT_STAT_REG);
if (!reg) if (!reg)
return; return;
raw_spin_lock(&byt_lock); raw_spin_lock(&byt_lock);
writel(BIT(offset % 32), reg); writel(BIT(hwirq % 32), reg);
raw_spin_unlock(&byt_lock); raw_spin_unlock(&byt_lock);
} }
...@@ -1366,20 +1366,24 @@ static void byt_irq_mask(struct irq_data *d) ...@@ -1366,20 +1366,24 @@ static void byt_irq_mask(struct irq_data *d)
{ {
struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct intel_pinctrl *vg = gpiochip_get_data(gc); struct intel_pinctrl *vg = gpiochip_get_data(gc);
irq_hw_number_t hwirq = irqd_to_hwirq(d);
byt_gpio_clear_triggering(vg, irqd_to_hwirq(d)); byt_gpio_clear_triggering(vg, hwirq);
gpiochip_disable_irq(gc, hwirq);
} }
static void byt_irq_unmask(struct irq_data *d) static void byt_irq_unmask(struct irq_data *d)
{ {
struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct intel_pinctrl *vg = gpiochip_get_data(gc); struct intel_pinctrl *vg = gpiochip_get_data(gc);
unsigned int offset = irqd_to_hwirq(d); irq_hw_number_t hwirq = irqd_to_hwirq(d);
unsigned long flags; unsigned long flags;
void __iomem *reg; void __iomem *reg;
u32 value; u32 value;
reg = byt_gpio_reg(vg, offset, BYT_CONF0_REG); gpiochip_enable_irq(gc, hwirq);
reg = byt_gpio_reg(vg, hwirq, BYT_CONF0_REG);
if (!reg) if (!reg)
return; return;
...@@ -1412,12 +1416,13 @@ static void byt_irq_unmask(struct irq_data *d) ...@@ -1412,12 +1416,13 @@ static void byt_irq_unmask(struct irq_data *d)
static int byt_irq_type(struct irq_data *d, unsigned int type) static int byt_irq_type(struct irq_data *d, unsigned int type)
{ {
struct intel_pinctrl *vg = gpiochip_get_data(irq_data_get_irq_chip_data(d)); struct intel_pinctrl *vg = gpiochip_get_data(irq_data_get_irq_chip_data(d));
u32 offset = irqd_to_hwirq(d); irq_hw_number_t hwirq = irqd_to_hwirq(d);
u32 value; u32 value;
unsigned long flags; unsigned long flags;
void __iomem *reg = byt_gpio_reg(vg, offset, BYT_CONF0_REG); void __iomem *reg;
if (!reg || offset >= vg->chip.ngpio) reg = byt_gpio_reg(vg, hwirq, BYT_CONF0_REG);
if (!reg)
return -EINVAL; return -EINVAL;
raw_spin_lock_irqsave(&byt_lock, flags); raw_spin_lock_irqsave(&byt_lock, flags);
...@@ -1447,6 +1452,16 @@ static int byt_irq_type(struct irq_data *d, unsigned int type) ...@@ -1447,6 +1452,16 @@ static int byt_irq_type(struct irq_data *d, unsigned int type)
return 0; return 0;
} }
static const struct irq_chip byt_gpio_irq_chip = {
.name = "BYT-GPIO",
.irq_ack = byt_irq_ack,
.irq_mask = byt_irq_mask,
.irq_unmask = byt_irq_unmask,
.irq_set_type = byt_irq_type,
.flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_SET_TYPE_MASKED | IRQCHIP_IMMUTABLE,
GPIOCHIP_IRQ_RESOURCE_HELPERS,
};
static void byt_gpio_irq_handler(struct irq_desc *desc) static void byt_gpio_irq_handler(struct irq_desc *desc)
{ {
struct irq_data *data = irq_desc_get_irq_data(desc); struct irq_data *data = irq_desc_get_irq_data(desc);
...@@ -1633,15 +1648,8 @@ static int byt_gpio_probe(struct intel_pinctrl *vg) ...@@ -1633,15 +1648,8 @@ static int byt_gpio_probe(struct intel_pinctrl *vg)
if (irq > 0) { if (irq > 0) {
struct gpio_irq_chip *girq; struct gpio_irq_chip *girq;
vg->irqchip.name = "BYT-GPIO",
vg->irqchip.irq_ack = byt_irq_ack,
vg->irqchip.irq_mask = byt_irq_mask,
vg->irqchip.irq_unmask = byt_irq_unmask,
vg->irqchip.irq_set_type = byt_irq_type,
vg->irqchip.flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_SET_TYPE_MASKED,
girq = &gc->irq; girq = &gc->irq;
girq->chip = &vg->irqchip; gpio_irq_chip_set_chip(girq, &byt_gpio_irq_chip);
girq->init_hw = byt_gpio_irq_init_hw; girq->init_hw = byt_gpio_irq_init_hw;
girq->init_valid_mask = byt_init_irq_valid_mask; girq->init_valid_mask = byt_init_irq_valid_mask;
girq->parent_handler = byt_gpio_irq_handler; girq->parent_handler = byt_gpio_irq_handler;
......
...@@ -1035,4 +1035,5 @@ module_exit(bxt_pinctrl_exit); ...@@ -1035,4 +1035,5 @@ module_exit(bxt_pinctrl_exit);
MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>"); MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
MODULE_DESCRIPTION("Intel Broxton SoC pinctrl/GPIO driver"); MODULE_DESCRIPTION("Intel Broxton SoC pinctrl/GPIO driver");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:apollolake-pinctrl");
MODULE_ALIAS("platform:broxton-pinctrl"); MODULE_ALIAS("platform:broxton-pinctrl");
...@@ -1242,12 +1242,12 @@ static void chv_gpio_irq_ack(struct irq_data *d) ...@@ -1242,12 +1242,12 @@ static void chv_gpio_irq_ack(struct irq_data *d)
{ {
struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct intel_pinctrl *pctrl = gpiochip_get_data(gc); struct intel_pinctrl *pctrl = gpiochip_get_data(gc);
int pin = irqd_to_hwirq(d); irq_hw_number_t hwirq = irqd_to_hwirq(d);
u32 intr_line; u32 intr_line;
raw_spin_lock(&chv_lock); raw_spin_lock(&chv_lock);
intr_line = chv_readl(pctrl, pin, CHV_PADCTRL0); intr_line = chv_readl(pctrl, hwirq, CHV_PADCTRL0);
intr_line &= CHV_PADCTRL0_INTSEL_MASK; intr_line &= CHV_PADCTRL0_INTSEL_MASK;
intr_line >>= CHV_PADCTRL0_INTSEL_SHIFT; intr_line >>= CHV_PADCTRL0_INTSEL_SHIFT;
chv_pctrl_writel(pctrl, CHV_INTSTAT, BIT(intr_line)); chv_pctrl_writel(pctrl, CHV_INTSTAT, BIT(intr_line));
...@@ -1255,17 +1255,15 @@ static void chv_gpio_irq_ack(struct irq_data *d) ...@@ -1255,17 +1255,15 @@ static void chv_gpio_irq_ack(struct irq_data *d)
raw_spin_unlock(&chv_lock); raw_spin_unlock(&chv_lock);
} }
static void chv_gpio_irq_mask_unmask(struct irq_data *d, bool mask) static void chv_gpio_irq_mask_unmask(struct gpio_chip *gc, irq_hw_number_t hwirq, bool mask)
{ {
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct intel_pinctrl *pctrl = gpiochip_get_data(gc); struct intel_pinctrl *pctrl = gpiochip_get_data(gc);
int pin = irqd_to_hwirq(d);
u32 value, intr_line; u32 value, intr_line;
unsigned long flags; unsigned long flags;
raw_spin_lock_irqsave(&chv_lock, flags); raw_spin_lock_irqsave(&chv_lock, flags);
intr_line = chv_readl(pctrl, pin, CHV_PADCTRL0); intr_line = chv_readl(pctrl, hwirq, CHV_PADCTRL0);
intr_line &= CHV_PADCTRL0_INTSEL_MASK; intr_line &= CHV_PADCTRL0_INTSEL_MASK;
intr_line >>= CHV_PADCTRL0_INTSEL_SHIFT; intr_line >>= CHV_PADCTRL0_INTSEL_SHIFT;
...@@ -1281,12 +1279,20 @@ static void chv_gpio_irq_mask_unmask(struct irq_data *d, bool mask) ...@@ -1281,12 +1279,20 @@ static void chv_gpio_irq_mask_unmask(struct irq_data *d, bool mask)
static void chv_gpio_irq_mask(struct irq_data *d) static void chv_gpio_irq_mask(struct irq_data *d)
{ {
chv_gpio_irq_mask_unmask(d, true); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
irq_hw_number_t hwirq = irqd_to_hwirq(d);
chv_gpio_irq_mask_unmask(gc, hwirq, true);
gpiochip_disable_irq(gc, hwirq);
} }
static void chv_gpio_irq_unmask(struct irq_data *d) static void chv_gpio_irq_unmask(struct irq_data *d)
{ {
chv_gpio_irq_mask_unmask(d, false); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
irq_hw_number_t hwirq = irqd_to_hwirq(d);
gpiochip_enable_irq(gc, hwirq);
chv_gpio_irq_mask_unmask(gc, hwirq, false);
} }
static unsigned chv_gpio_irq_startup(struct irq_data *d) static unsigned chv_gpio_irq_startup(struct irq_data *d)
...@@ -1306,17 +1312,17 @@ static unsigned chv_gpio_irq_startup(struct irq_data *d) ...@@ -1306,17 +1312,17 @@ static unsigned chv_gpio_irq_startup(struct irq_data *d)
struct intel_pinctrl *pctrl = gpiochip_get_data(gc); struct intel_pinctrl *pctrl = gpiochip_get_data(gc);
struct device *dev = pctrl->dev; struct device *dev = pctrl->dev;
struct intel_community_context *cctx = &pctrl->context.communities[0]; struct intel_community_context *cctx = &pctrl->context.communities[0];
unsigned int pin = irqd_to_hwirq(d); irq_hw_number_t hwirq = irqd_to_hwirq(d);
irq_flow_handler_t handler; irq_flow_handler_t handler;
unsigned long flags; unsigned long flags;
u32 intsel, value; u32 intsel, value;
raw_spin_lock_irqsave(&chv_lock, flags); raw_spin_lock_irqsave(&chv_lock, flags);
intsel = chv_readl(pctrl, pin, CHV_PADCTRL0); intsel = chv_readl(pctrl, hwirq, CHV_PADCTRL0);
intsel &= CHV_PADCTRL0_INTSEL_MASK; intsel &= CHV_PADCTRL0_INTSEL_MASK;
intsel >>= CHV_PADCTRL0_INTSEL_SHIFT; intsel >>= CHV_PADCTRL0_INTSEL_SHIFT;
value = chv_readl(pctrl, pin, CHV_PADCTRL1); value = chv_readl(pctrl, hwirq, CHV_PADCTRL1);
if (value & CHV_PADCTRL1_INTWAKECFG_LEVEL) if (value & CHV_PADCTRL1_INTWAKECFG_LEVEL)
handler = handle_level_irq; handler = handle_level_irq;
else else
...@@ -1324,9 +1330,9 @@ static unsigned chv_gpio_irq_startup(struct irq_data *d) ...@@ -1324,9 +1330,9 @@ static unsigned chv_gpio_irq_startup(struct irq_data *d)
if (cctx->intr_lines[intsel] == CHV_INVALID_HWIRQ) { if (cctx->intr_lines[intsel] == CHV_INVALID_HWIRQ) {
irq_set_handler_locked(d, handler); irq_set_handler_locked(d, handler);
dev_dbg(dev, "using interrupt line %u for IRQ_TYPE_NONE on pin %u\n", dev_dbg(dev, "using interrupt line %u for IRQ_TYPE_NONE on pin %lu\n",
intsel, pin); intsel, hwirq);
cctx->intr_lines[intsel] = pin; cctx->intr_lines[intsel] = hwirq;
} }
raw_spin_unlock_irqrestore(&chv_lock, flags); raw_spin_unlock_irqrestore(&chv_lock, flags);
} }
...@@ -1392,14 +1398,14 @@ static int chv_gpio_irq_type(struct irq_data *d, unsigned int type) ...@@ -1392,14 +1398,14 @@ static int chv_gpio_irq_type(struct irq_data *d, unsigned int type)
{ {
struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct intel_pinctrl *pctrl = gpiochip_get_data(gc); struct intel_pinctrl *pctrl = gpiochip_get_data(gc);
unsigned int pin = irqd_to_hwirq(d); irq_hw_number_t hwirq = irqd_to_hwirq(d);
unsigned long flags; unsigned long flags;
u32 value; u32 value;
int ret; int ret;
raw_spin_lock_irqsave(&chv_lock, flags); raw_spin_lock_irqsave(&chv_lock, flags);
ret = chv_gpio_set_intr_line(pctrl, pin); ret = chv_gpio_set_intr_line(pctrl, hwirq);
if (ret) if (ret)
goto out_unlock; goto out_unlock;
...@@ -1416,8 +1422,8 @@ static int chv_gpio_irq_type(struct irq_data *d, unsigned int type) ...@@ -1416,8 +1422,8 @@ static int chv_gpio_irq_type(struct irq_data *d, unsigned int type)
* 2. If the pin cfg is not locked in BIOS: * 2. If the pin cfg is not locked in BIOS:
* Driver programs the IntWakeCfg bits and save the mapping. * Driver programs the IntWakeCfg bits and save the mapping.
*/ */
if (!chv_pad_locked(pctrl, pin)) { if (!chv_pad_locked(pctrl, hwirq)) {
value = chv_readl(pctrl, pin, CHV_PADCTRL1); value = chv_readl(pctrl, hwirq, CHV_PADCTRL1);
value &= ~CHV_PADCTRL1_INTWAKECFG_MASK; value &= ~CHV_PADCTRL1_INTWAKECFG_MASK;
value &= ~CHV_PADCTRL1_INVRXTX_MASK; value &= ~CHV_PADCTRL1_INVRXTX_MASK;
...@@ -1434,7 +1440,7 @@ static int chv_gpio_irq_type(struct irq_data *d, unsigned int type) ...@@ -1434,7 +1440,7 @@ static int chv_gpio_irq_type(struct irq_data *d, unsigned int type)
value |= CHV_PADCTRL1_INVRXTX_RXDATA; value |= CHV_PADCTRL1_INVRXTX_RXDATA;
} }
chv_writel(pctrl, pin, CHV_PADCTRL1, value); chv_writel(pctrl, hwirq, CHV_PADCTRL1, value);
} }
if (type & IRQ_TYPE_EDGE_BOTH) if (type & IRQ_TYPE_EDGE_BOTH)
...@@ -1448,6 +1454,17 @@ static int chv_gpio_irq_type(struct irq_data *d, unsigned int type) ...@@ -1448,6 +1454,17 @@ static int chv_gpio_irq_type(struct irq_data *d, unsigned int type)
return ret; return ret;
} }
static const struct irq_chip chv_gpio_irq_chip = {
.name = "chv-gpio",
.irq_startup = chv_gpio_irq_startup,
.irq_ack = chv_gpio_irq_ack,
.irq_mask = chv_gpio_irq_mask,
.irq_unmask = chv_gpio_irq_unmask,
.irq_set_type = chv_gpio_irq_type,
.flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_IMMUTABLE,
GPIOCHIP_IRQ_RESOURCE_HELPERS,
};
static void chv_gpio_irq_handler(struct irq_desc *desc) static void chv_gpio_irq_handler(struct irq_desc *desc)
{ {
struct gpio_chip *gc = irq_desc_get_handler_data(desc); struct gpio_chip *gc = irq_desc_get_handler_data(desc);
...@@ -1611,15 +1628,8 @@ static int chv_gpio_probe(struct intel_pinctrl *pctrl, int irq) ...@@ -1611,15 +1628,8 @@ static int chv_gpio_probe(struct intel_pinctrl *pctrl, int irq)
chip->base = -1; chip->base = -1;
pctrl->irq = irq; pctrl->irq = irq;
pctrl->irqchip.name = "chv-gpio";
pctrl->irqchip.irq_startup = chv_gpio_irq_startup; gpio_irq_chip_set_chip(&chip->irq, &chv_gpio_irq_chip);
pctrl->irqchip.irq_ack = chv_gpio_irq_ack;
pctrl->irqchip.irq_mask = chv_gpio_irq_mask;
pctrl->irqchip.irq_unmask = chv_gpio_irq_unmask;
pctrl->irqchip.irq_set_type = chv_gpio_irq_type;
pctrl->irqchip.flags = IRQCHIP_SKIP_SET_WAKE;
chip->irq.chip = &pctrl->irqchip;
chip->irq.init_hw = chv_gpio_irq_init_hw; chip->irq.init_hw = chv_gpio_irq_init_hw;
chip->irq.parent_handler = chv_gpio_irq_handler; chip->irq.parent_handler = chv_gpio_irq_handler;
chip->irq.num_parents = 1; chip->irq.num_parents = 1;
......
...@@ -858,6 +858,9 @@ static const struct pinctrl_desc intel_pinctrl_desc = { ...@@ -858,6 +858,9 @@ static const struct pinctrl_desc intel_pinctrl_desc = {
* When coming through gpiolib irqchip, the GPIO offset is not * When coming through gpiolib irqchip, the GPIO offset is not
* automatically translated to pinctrl pin number. This function can be * automatically translated to pinctrl pin number. This function can be
* used to find out the corresponding pinctrl pin. * used to find out the corresponding pinctrl pin.
*
* Return: a pin number and pointers to the community and pad group, which
* the pin belongs to, or negative error code if translation can't be done.
*/ */
static int intel_gpio_to_pin(struct intel_pinctrl *pctrl, unsigned int offset, static int intel_gpio_to_pin(struct intel_pinctrl *pctrl, unsigned int offset,
const struct intel_community **community, const struct intel_community **community,
...@@ -899,6 +902,8 @@ static int intel_gpio_to_pin(struct intel_pinctrl *pctrl, unsigned int offset, ...@@ -899,6 +902,8 @@ static int intel_gpio_to_pin(struct intel_pinctrl *pctrl, unsigned int offset,
* @pin: pin number * @pin: pin number
* *
* Translate the pin number of pinctrl to GPIO offset * Translate the pin number of pinctrl to GPIO offset
*
* Return: a GPIO offset, or negative error code if translation can't be done.
*/ */
static __maybe_unused int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin) static __maybe_unused int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin)
{ {
...@@ -1039,15 +1044,14 @@ static void intel_gpio_irq_ack(struct irq_data *d) ...@@ -1039,15 +1044,14 @@ static void intel_gpio_irq_ack(struct irq_data *d)
} }
} }
static void intel_gpio_irq_mask_unmask(struct irq_data *d, bool mask) static void intel_gpio_irq_mask_unmask(struct gpio_chip *gc, irq_hw_number_t hwirq, bool mask)
{ {
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct intel_pinctrl *pctrl = gpiochip_get_data(gc); struct intel_pinctrl *pctrl = gpiochip_get_data(gc);
const struct intel_community *community; const struct intel_community *community;
const struct intel_padgroup *padgrp; const struct intel_padgroup *padgrp;
int pin; int pin;
pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), &community, &padgrp); pin = intel_gpio_to_pin(pctrl, hwirq, &community, &padgrp);
if (pin >= 0) { if (pin >= 0) {
unsigned int gpp, gpp_offset; unsigned int gpp, gpp_offset;
unsigned long flags; unsigned long flags;
...@@ -1077,12 +1081,20 @@ static void intel_gpio_irq_mask_unmask(struct irq_data *d, bool mask) ...@@ -1077,12 +1081,20 @@ static void intel_gpio_irq_mask_unmask(struct irq_data *d, bool mask)
static void intel_gpio_irq_mask(struct irq_data *d) static void intel_gpio_irq_mask(struct irq_data *d)
{ {
intel_gpio_irq_mask_unmask(d, true); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
irq_hw_number_t hwirq = irqd_to_hwirq(d);
intel_gpio_irq_mask_unmask(gc, hwirq, true);
gpiochip_disable_irq(gc, hwirq);
} }
static void intel_gpio_irq_unmask(struct irq_data *d) static void intel_gpio_irq_unmask(struct irq_data *d)
{ {
intel_gpio_irq_mask_unmask(d, false); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
irq_hw_number_t hwirq = irqd_to_hwirq(d);
gpiochip_enable_irq(gc, hwirq);
intel_gpio_irq_mask_unmask(gc, hwirq, false);
} }
static int intel_gpio_irq_type(struct irq_data *d, unsigned int type) static int intel_gpio_irq_type(struct irq_data *d, unsigned int type)
...@@ -1157,6 +1169,17 @@ static int intel_gpio_irq_wake(struct irq_data *d, unsigned int on) ...@@ -1157,6 +1169,17 @@ static int intel_gpio_irq_wake(struct irq_data *d, unsigned int on)
return 0; return 0;
} }
static const struct irq_chip intel_gpio_irq_chip = {
.name = "intel-gpio",
.irq_ack = intel_gpio_irq_ack,
.irq_mask = intel_gpio_irq_mask,
.irq_unmask = intel_gpio_irq_unmask,
.irq_set_type = intel_gpio_irq_type,
.irq_set_wake = intel_gpio_irq_wake,
.flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_IMMUTABLE,
GPIOCHIP_IRQ_RESOURCE_HELPERS,
};
static int intel_gpio_community_irq_handler(struct intel_pinctrl *pctrl, static int intel_gpio_community_irq_handler(struct intel_pinctrl *pctrl,
const struct intel_community *community) const struct intel_community *community)
{ {
...@@ -1319,15 +1342,6 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq) ...@@ -1319,15 +1342,6 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
pctrl->chip.add_pin_ranges = intel_gpio_add_pin_ranges; pctrl->chip.add_pin_ranges = intel_gpio_add_pin_ranges;
pctrl->irq = irq; pctrl->irq = irq;
/* Setup IRQ chip */
pctrl->irqchip.name = dev_name(pctrl->dev);
pctrl->irqchip.irq_ack = intel_gpio_irq_ack;
pctrl->irqchip.irq_mask = intel_gpio_irq_mask;
pctrl->irqchip.irq_unmask = intel_gpio_irq_unmask;
pctrl->irqchip.irq_set_type = intel_gpio_irq_type;
pctrl->irqchip.irq_set_wake = intel_gpio_irq_wake;
pctrl->irqchip.flags = IRQCHIP_MASK_ON_SUSPEND;
/* /*
* On some platforms several GPIO controllers share the same interrupt * On some platforms several GPIO controllers share the same interrupt
* line. * line.
...@@ -1340,8 +1354,9 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq) ...@@ -1340,8 +1354,9 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
return ret; return ret;
} }
/* Setup IRQ chip */
girq = &pctrl->chip.irq; girq = &pctrl->chip.irq;
girq->chip = &pctrl->irqchip; gpio_irq_chip_set_chip(girq, &intel_gpio_irq_chip);
/* This will let us handle the IRQ in the driver */ /* This will let us handle the IRQ in the driver */
girq->parent_handler = NULL; girq->parent_handler = NULL;
girq->num_parents = 0; girq->num_parents = 0;
......
...@@ -223,7 +223,6 @@ struct intel_pinctrl_context { ...@@ -223,7 +223,6 @@ struct intel_pinctrl_context {
* @pctldesc: Pin controller description * @pctldesc: Pin controller description
* @pctldev: Pointer to the pin controller device * @pctldev: Pointer to the pin controller device
* @chip: GPIO chip in this pin controller * @chip: GPIO chip in this pin controller
* @irqchip: IRQ chip in this pin controller
* @soc: SoC/PCH specific pin configuration data * @soc: SoC/PCH specific pin configuration data
* @communities: All communities in this pin controller * @communities: All communities in this pin controller
* @ncommunities: Number of communities in this pin controller * @ncommunities: Number of communities in this pin controller
...@@ -236,7 +235,6 @@ struct intel_pinctrl { ...@@ -236,7 +235,6 @@ struct intel_pinctrl {
struct pinctrl_desc pctldesc; struct pinctrl_desc pctldesc;
struct pinctrl_dev *pctldev; struct pinctrl_dev *pctldev;
struct gpio_chip chip; struct gpio_chip chip;
struct irq_chip irqchip;
const struct intel_pinctrl_soc_data *soc; const struct intel_pinctrl_soc_data *soc;
struct intel_community *communities; struct intel_community *communities;
size_t ncommunities; size_t ncommunities;
......
...@@ -663,7 +663,7 @@ static void lp_irq_ack(struct irq_data *d) ...@@ -663,7 +663,7 @@ static void lp_irq_ack(struct irq_data *d)
{ {
struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct intel_pinctrl *lg = gpiochip_get_data(gc); struct intel_pinctrl *lg = gpiochip_get_data(gc);
u32 hwirq = irqd_to_hwirq(d); irq_hw_number_t hwirq = irqd_to_hwirq(d);
void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_STAT); void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_STAT);
unsigned long flags; unsigned long flags;
...@@ -684,10 +684,12 @@ static void lp_irq_enable(struct irq_data *d) ...@@ -684,10 +684,12 @@ static void lp_irq_enable(struct irq_data *d)
{ {
struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct intel_pinctrl *lg = gpiochip_get_data(gc); struct intel_pinctrl *lg = gpiochip_get_data(gc);
u32 hwirq = irqd_to_hwirq(d); irq_hw_number_t hwirq = irqd_to_hwirq(d);
void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_ENABLE); void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_ENABLE);
unsigned long flags; unsigned long flags;
gpiochip_enable_irq(gc, hwirq);
raw_spin_lock_irqsave(&lg->lock, flags); raw_spin_lock_irqsave(&lg->lock, flags);
iowrite32(ioread32(reg) | BIT(hwirq % 32), reg); iowrite32(ioread32(reg) | BIT(hwirq % 32), reg);
raw_spin_unlock_irqrestore(&lg->lock, flags); raw_spin_unlock_irqrestore(&lg->lock, flags);
...@@ -697,30 +699,33 @@ static void lp_irq_disable(struct irq_data *d) ...@@ -697,30 +699,33 @@ static void lp_irq_disable(struct irq_data *d)
{ {
struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct intel_pinctrl *lg = gpiochip_get_data(gc); struct intel_pinctrl *lg = gpiochip_get_data(gc);
u32 hwirq = irqd_to_hwirq(d); irq_hw_number_t hwirq = irqd_to_hwirq(d);
void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_ENABLE); void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_INT_ENABLE);
unsigned long flags; unsigned long flags;
raw_spin_lock_irqsave(&lg->lock, flags); raw_spin_lock_irqsave(&lg->lock, flags);
iowrite32(ioread32(reg) & ~BIT(hwirq % 32), reg); iowrite32(ioread32(reg) & ~BIT(hwirq % 32), reg);
raw_spin_unlock_irqrestore(&lg->lock, flags); raw_spin_unlock_irqrestore(&lg->lock, flags);
gpiochip_disable_irq(gc, hwirq);
} }
static int lp_irq_set_type(struct irq_data *d, unsigned int type) static int lp_irq_set_type(struct irq_data *d, unsigned int type)
{ {
struct gpio_chip *gc = irq_data_get_irq_chip_data(d); struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct intel_pinctrl *lg = gpiochip_get_data(gc); struct intel_pinctrl *lg = gpiochip_get_data(gc);
u32 hwirq = irqd_to_hwirq(d); irq_hw_number_t hwirq = irqd_to_hwirq(d);
void __iomem *reg = lp_gpio_reg(&lg->chip, hwirq, LP_CONFIG1);
unsigned long flags; unsigned long flags;
void __iomem *reg;
u32 value; u32 value;
if (hwirq >= lg->chip.ngpio) reg = lp_gpio_reg(&lg->chip, hwirq, LP_CONFIG1);
if (!reg)
return -EINVAL; return -EINVAL;
/* Fail if BIOS reserved pin for ACPI use */ /* Fail if BIOS reserved pin for ACPI use */
if (lp_gpio_acpi_use(lg, hwirq)) { if (lp_gpio_acpi_use(lg, hwirq)) {
dev_err(lg->dev, "pin %u can't be used as IRQ\n", hwirq); dev_err(lg->dev, "pin %lu can't be used as IRQ\n", hwirq);
return -EBUSY; return -EBUSY;
} }
...@@ -755,7 +760,7 @@ static int lp_irq_set_type(struct irq_data *d, unsigned int type) ...@@ -755,7 +760,7 @@ static int lp_irq_set_type(struct irq_data *d, unsigned int type)
return 0; return 0;
} }
static struct irq_chip lp_irqchip = { static const struct irq_chip lp_irqchip = {
.name = "LP-GPIO", .name = "LP-GPIO",
.irq_ack = lp_irq_ack, .irq_ack = lp_irq_ack,
.irq_mask = lp_irq_mask, .irq_mask = lp_irq_mask,
...@@ -763,7 +768,8 @@ static struct irq_chip lp_irqchip = { ...@@ -763,7 +768,8 @@ static struct irq_chip lp_irqchip = {
.irq_enable = lp_irq_enable, .irq_enable = lp_irq_enable,
.irq_disable = lp_irq_disable, .irq_disable = lp_irq_disable,
.irq_set_type = lp_irq_set_type, .irq_set_type = lp_irq_set_type,
.flags = IRQCHIP_SKIP_SET_WAKE, .flags = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_IMMUTABLE,
GPIOCHIP_IRQ_RESOURCE_HELPERS,
}; };
static int lp_gpio_irq_init_hw(struct gpio_chip *chip) static int lp_gpio_irq_init_hw(struct gpio_chip *chip)
...@@ -884,7 +890,7 @@ static int lp_gpio_probe(struct platform_device *pdev) ...@@ -884,7 +890,7 @@ static int lp_gpio_probe(struct platform_device *pdev)
struct gpio_irq_chip *girq; struct gpio_irq_chip *girq;
girq = &gc->irq; girq = &gc->irq;
girq->chip = &lp_irqchip; gpio_irq_chip_set_chip(girq, &lp_irqchip);
girq->init_hw = lp_gpio_irq_init_hw; girq->init_hw = lp_gpio_irq_init_hw;
girq->parent_handler = lp_gpio_irq_handler; girq->parent_handler = lp_gpio_irq_handler;
girq->num_parents = 1; girq->num_parents = 1;
......
...@@ -106,6 +106,13 @@ config PINCTRL_MT6779 ...@@ -106,6 +106,13 @@ config PINCTRL_MT6779
In MTK platform, we support virtual gpio and use it to In MTK platform, we support virtual gpio and use it to
map specific eint which doesn't have real gpio pin. map specific eint which doesn't have real gpio pin.
config PINCTRL_MT6795
bool "Mediatek MT6795 pin control"
depends on OF
depends on ARM64 || COMPILE_TEST
default ARM64 && ARCH_MEDIATEK
select PINCTRL_MTK_PARIS
config PINCTRL_MT6797 config PINCTRL_MT6797
bool "Mediatek MT6797 pin control" bool "Mediatek MT6797 pin control"
depends on OF depends on OF
...@@ -166,6 +173,7 @@ config PINCTRL_MT8195 ...@@ -166,6 +173,7 @@ config PINCTRL_MT8195
bool "Mediatek MT8195 pin control" bool "Mediatek MT8195 pin control"
depends on OF depends on OF
depends on ARM64 || COMPILE_TEST depends on ARM64 || COMPILE_TEST
default ARM64 && ARCH_MEDIATEK
select PINCTRL_MTK_PARIS select PINCTRL_MTK_PARIS
config PINCTRL_MT8365 config PINCTRL_MT8365
......
...@@ -13,6 +13,7 @@ obj-$(CONFIG_PINCTRL_MT8135) += pinctrl-mt8135.o ...@@ -13,6 +13,7 @@ obj-$(CONFIG_PINCTRL_MT8135) += pinctrl-mt8135.o
obj-$(CONFIG_PINCTRL_MT8127) += pinctrl-mt8127.o obj-$(CONFIG_PINCTRL_MT8127) += pinctrl-mt8127.o
obj-$(CONFIG_PINCTRL_MT6765) += pinctrl-mt6765.o obj-$(CONFIG_PINCTRL_MT6765) += pinctrl-mt6765.o
obj-$(CONFIG_PINCTRL_MT6779) += pinctrl-mt6779.o obj-$(CONFIG_PINCTRL_MT6779) += pinctrl-mt6779.o
obj-$(CONFIG_PINCTRL_MT6795) += pinctrl-mt6795.o
obj-$(CONFIG_PINCTRL_MT6797) += pinctrl-mt6797.o obj-$(CONFIG_PINCTRL_MT6797) += pinctrl-mt6797.o
obj-$(CONFIG_PINCTRL_MT7622) += pinctrl-mt7622.o obj-$(CONFIG_PINCTRL_MT7622) += pinctrl-mt7622.o
obj-$(CONFIG_PINCTRL_MT7623) += pinctrl-mt7623.o obj-$(CONFIG_PINCTRL_MT7623) += pinctrl-mt7623.o
......
This diff is collapsed.
This diff is collapsed.
...@@ -575,6 +575,7 @@ static struct meson_pmx_group meson_s4_periphs_groups[] = { ...@@ -575,6 +575,7 @@ static struct meson_pmx_group meson_s4_periphs_groups[] = {
GROUP(tdm_d2_c, 4), GROUP(tdm_d2_c, 4),
GROUP(tdm_d3_c, 4), GROUP(tdm_d3_c, 4),
GROUP(tdm_fs1_c, 4), GROUP(tdm_fs1_c, 4),
GROUP(tdm_sclk1_c, 4),
GROUP(mclk_1_c, 4), GROUP(mclk_1_c, 4),
GROUP(tdm_d4_c, 4), GROUP(tdm_d4_c, 4),
GROUP(tdm_d5_c, 4), GROUP(tdm_d5_c, 4),
...@@ -936,7 +937,7 @@ static const char * const iso7816_groups[] = { ...@@ -936,7 +937,7 @@ static const char * const iso7816_groups[] = {
}; };
static const char * const tdm_groups[] = { static const char * const tdm_groups[] = {
"tdm_d2_c", "tdm_d3_c", "tdm_fs1_c", "tdm_d4_c", "tdm_d5_c", "tdm_d2_c", "tdm_d3_c", "tdm_fs1_c", "tdm_d4_c", "tdm_d5_c", "tdm_sclk1_c",
"tdm_fs1_d", "tdm_d4_d", "tdm_d3_d", "tdm_d2_d", "tdm_sclk1_d", "tdm_fs1_d", "tdm_d4_d", "tdm_d3_d", "tdm_d2_d", "tdm_sclk1_d",
"tdm_sclk1_h", "tdm_fs1_h", "tdm_d2_h", "tdm_d3_h", "tdm_d4_h", "tdm_sclk1_h", "tdm_fs1_h", "tdm_d2_h", "tdm_d3_h", "tdm_d4_h",
"tdm_d1", "tdm_d0", "tdm_fs0", "tdm_sclk0", "tdm_fs2", "tdm_sclk2", "tdm_d1", "tdm_d0", "tdm_fs0", "tdm_sclk0", "tdm_fs2", "tdm_sclk2",
......
...@@ -45,6 +45,10 @@ config PINCTRL_ORION ...@@ -45,6 +45,10 @@ config PINCTRL_ORION
bool bool
select PINCTRL_MVEBU select PINCTRL_MVEBU
config PINCTRL_AC5
bool
select PINCTRL_MVEBU
config PINCTRL_ARMADA_37XX config PINCTRL_ARMADA_37XX
bool bool
select GENERIC_PINCONF select GENERIC_PINCONF
......
...@@ -11,3 +11,4 @@ obj-$(CONFIG_PINCTRL_ARMADA_CP110) += pinctrl-armada-cp110.o ...@@ -11,3 +11,4 @@ obj-$(CONFIG_PINCTRL_ARMADA_CP110) += pinctrl-armada-cp110.o
obj-$(CONFIG_PINCTRL_ARMADA_XP) += pinctrl-armada-xp.o obj-$(CONFIG_PINCTRL_ARMADA_XP) += pinctrl-armada-xp.o
obj-$(CONFIG_PINCTRL_ARMADA_37XX) += pinctrl-armada-37xx.o obj-$(CONFIG_PINCTRL_ARMADA_37XX) += pinctrl-armada-37xx.o
obj-$(CONFIG_PINCTRL_ORION) += pinctrl-orion.o obj-$(CONFIG_PINCTRL_ORION) += pinctrl-orion.o
obj-$(CONFIG_PINCTRL_AC5) += pinctrl-ac5.o
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Marvell ac5 pinctrl driver based on mvebu pinctrl core
*
* Copyright (C) 2021 Marvell
*
* Noam Liron <lnoam@marvell.com>
*/
#include <linux/err.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/pinctrl/pinctrl.h>
#include "pinctrl-mvebu.h"
static struct mvebu_mpp_mode ac5_mpp_modes[] = {
MPP_MODE(0,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "sdio", "d0"),
MPP_FUNCTION(2, "nand", "io4")),
MPP_MODE(1,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "sdio", "d1"),
MPP_FUNCTION(2, "nand", "io3")),
MPP_MODE(2,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "sdio", "d2"),
MPP_FUNCTION(2, "nand", "io2")),
MPP_MODE(3,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "sdio", "d3"),
MPP_FUNCTION(2, "nand", "io7")),
MPP_MODE(4,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "sdio", "d4"),
MPP_FUNCTION(2, "nand", "io6"),
MPP_FUNCTION(3, "uart3", "txd"),
MPP_FUNCTION(4, "uart2", "txd")),
MPP_MODE(5,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "sdio", "d5"),
MPP_FUNCTION(2, "nand", "io5"),
MPP_FUNCTION(3, "uart3", "rxd"),
MPP_FUNCTION(4, "uart2", "rxd")),
MPP_MODE(6,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "sdio", "d6"),
MPP_FUNCTION(2, "nand", "io0"),
MPP_FUNCTION(3, "i2c1", "sck")),
MPP_MODE(7,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "sdio", "d7"),
MPP_FUNCTION(2, "nand", "io1"),
MPP_FUNCTION(3, "i2c1", "sda")),
MPP_MODE(8,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "sdio", "clk"),
MPP_FUNCTION(2, "nand", "wen")),
MPP_MODE(9,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "sdio", "cmd"),
MPP_FUNCTION(2, "nand", "ale")),
MPP_MODE(10,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "sdio", "ds"),
MPP_FUNCTION(2, "nand", "cle")),
MPP_MODE(11,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "sdio", "rst"),
MPP_FUNCTION(2, "nand", "cen")),
MPP_MODE(12,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "spi0", "clk")),
MPP_MODE(13,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "spi0", "csn")),
MPP_MODE(14,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "spi0", "mosi")),
MPP_MODE(15,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "spi0", "miso")),
MPP_MODE(16,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "spi0", "wpn"),
MPP_FUNCTION(2, "nand", "ren"),
MPP_FUNCTION(3, "uart1", "txd")),
MPP_MODE(17,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "spi0", "hold"),
MPP_FUNCTION(2, "nand", "rb"),
MPP_FUNCTION(3, "uart1", "rxd")),
MPP_MODE(18,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "tsen_int", NULL),
MPP_FUNCTION(2, "uart2", "rxd"),
MPP_FUNCTION(3, "wd_int", NULL)),
MPP_MODE(19,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "dev_init_done", NULL),
MPP_FUNCTION(2, "uart2", "txd")),
MPP_MODE(20,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(2, "i2c1", "sck"),
MPP_FUNCTION(3, "spi1", "clk"),
MPP_FUNCTION(4, "uart3", "txd")),
MPP_MODE(21,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(2, "i2c1", "sda"),
MPP_FUNCTION(3, "spi1", "csn"),
MPP_FUNCTION(4, "uart3", "rxd")),
MPP_MODE(22,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(3, "spi1", "mosi")),
MPP_MODE(23,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(3, "spi1", "miso")),
MPP_MODE(24,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "wd_int", NULL),
MPP_FUNCTION(2, "uart2", "txd"),
MPP_FUNCTION(3, "uartsd", "txd")),
MPP_MODE(25,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "int_out", NULL),
MPP_FUNCTION(2, "uart2", "rxd"),
MPP_FUNCTION(3, "uartsd", "rxd")),
MPP_MODE(26,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "i2c0", "sck"),
MPP_FUNCTION(2, "ptp", "clk1"),
MPP_FUNCTION(3, "uart3", "txd")),
MPP_MODE(27,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "i2c0", "sda"),
MPP_FUNCTION(2, "ptp", "pulse"),
MPP_FUNCTION(3, "uart3", "rxd")),
MPP_MODE(28,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "xg", "mdio"),
MPP_FUNCTION(2, "ge", "mdio"),
MPP_FUNCTION(3, "uart3", "txd")),
MPP_MODE(29,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "xg", "mdio"),
MPP_FUNCTION(2, "ge", "mdio"),
MPP_FUNCTION(3, "uart3", "rxd")),
MPP_MODE(30,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "xg", "mdio"),
MPP_FUNCTION(2, "ge", "mdio"),
MPP_FUNCTION(3, "ge", "mdio")),
MPP_MODE(31,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "xg", "mdio"),
MPP_FUNCTION(2, "ge", "mdio"),
MPP_FUNCTION(3, "ge", "mdio")),
MPP_MODE(32,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "uart0", "txd")),
MPP_MODE(33,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "uart0", "rxd"),
MPP_FUNCTION(2, "ptp", "clk1"),
MPP_FUNCTION(3, "ptp", "pulse")),
MPP_MODE(34,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "ge", "mdio"),
MPP_FUNCTION(2, "uart3", "rxd")),
MPP_MODE(35,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "ge", "mdio"),
MPP_FUNCTION(2, "uart3", "txd"),
MPP_FUNCTION(3, "pcie", "rstoutn")),
MPP_MODE(36,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "ptp", "clk0_tp"),
MPP_FUNCTION(2, "ptp", "clk1_tp")),
MPP_MODE(37,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "ptp", "pulse_tp"),
MPP_FUNCTION(2, "wd_int", NULL)),
MPP_MODE(38,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "synce", "clk_out0")),
MPP_MODE(39,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "synce", "clk_out1")),
MPP_MODE(40,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "ptp", "pclk_out0"),
MPP_FUNCTION(2, "ptp", "pclk_out1")),
MPP_MODE(41,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "ptp", "ref_clk"),
MPP_FUNCTION(2, "ptp", "clk1"),
MPP_FUNCTION(3, "ptp", "pulse"),
MPP_FUNCTION(4, "uart2", "txd"),
MPP_FUNCTION(5, "i2c1", "sck")),
MPP_MODE(42,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "ptp", "clk0"),
MPP_FUNCTION(2, "ptp", "clk1"),
MPP_FUNCTION(3, "ptp", "pulse"),
MPP_FUNCTION(4, "uart2", "rxd"),
MPP_FUNCTION(5, "i2c1", "sda")),
MPP_MODE(43,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "led", "clk")),
MPP_MODE(44,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "led", "stb")),
MPP_MODE(45,
MPP_FUNCTION(0, "gpio", NULL),
MPP_FUNCTION(1, "led", "data")),
};
static struct mvebu_pinctrl_soc_info ac5_pinctrl_info;
static const struct of_device_id ac5_pinctrl_of_match[] = {
{
.compatible = "marvell,ac5-pinctrl",
},
{ },
};
static const struct mvebu_mpp_ctrl ac5_mpp_controls[] = {
MPP_FUNC_CTRL(0, 45, NULL, mvebu_mmio_mpp_ctrl), };
static struct pinctrl_gpio_range ac5_mpp_gpio_ranges[] = {
MPP_GPIO_RANGE(0, 0, 0, 46), };
static int ac5_pinctrl_probe(struct platform_device *pdev)
{
struct mvebu_pinctrl_soc_info *soc = &ac5_pinctrl_info;
soc->variant = 0; /* no variants for ac5 */
soc->controls = ac5_mpp_controls;
soc->ncontrols = ARRAY_SIZE(ac5_mpp_controls);
soc->gpioranges = ac5_mpp_gpio_ranges;
soc->ngpioranges = ARRAY_SIZE(ac5_mpp_gpio_ranges);
soc->modes = ac5_mpp_modes;
soc->nmodes = ac5_mpp_controls[0].npins;
pdev->dev.platform_data = soc;
return mvebu_pinctrl_simple_mmio_probe(pdev);
}
static struct platform_driver ac5_pinctrl_driver = {
.driver = {
.name = "ac5-pinctrl",
.of_match_table = of_match_ptr(ac5_pinctrl_of_match),
},
.probe = ac5_pinctrl_probe,
};
builtin_platform_driver(ac5_pinctrl_driver);
...@@ -764,7 +764,7 @@ static int armada_37xx_irqchip_register(struct platform_device *pdev, ...@@ -764,7 +764,7 @@ static int armada_37xx_irqchip_register(struct platform_device *pdev,
for (i = 0; i < nr_irq_parent; i++) { for (i = 0; i < nr_irq_parent; i++) {
int irq = irq_of_parse_and_map(np, i); int irq = irq_of_parse_and_map(np, i);
if (irq < 0) if (!irq)
continue; continue;
girq->parents[i] = irq; girq->parents[i] = irq;
} }
......
...@@ -440,6 +440,10 @@ static const unsigned mc2_a_1_pins[] = { DB8500_PIN_A5, DB8500_PIN_B4, ...@@ -440,6 +440,10 @@ static const unsigned mc2_a_1_pins[] = { DB8500_PIN_A5, DB8500_PIN_B4,
DB8500_PIN_C8, DB8500_PIN_A12, DB8500_PIN_C10, DB8500_PIN_B10, DB8500_PIN_C8, DB8500_PIN_A12, DB8500_PIN_C10, DB8500_PIN_B10,
DB8500_PIN_B9, DB8500_PIN_A9, DB8500_PIN_C7, DB8500_PIN_A7, DB8500_PIN_B9, DB8500_PIN_A9, DB8500_PIN_C7, DB8500_PIN_A7,
DB8500_PIN_C5 }; DB8500_PIN_C5 };
/* MC2 without the feedback clock */
static const unsigned mc2_a_2_pins[] = { DB8500_PIN_A5, DB8500_PIN_B4,
DB8500_PIN_A12, DB8500_PIN_C10, DB8500_PIN_B10, DB8500_PIN_B9,
DB8500_PIN_A9, DB8500_PIN_C7, DB8500_PIN_A7, DB8500_PIN_C5 };
static const unsigned ssp1_a_1_pins[] = { DB8500_PIN_C9, DB8500_PIN_B11, static const unsigned ssp1_a_1_pins[] = { DB8500_PIN_C9, DB8500_PIN_B11,
DB8500_PIN_C12, DB8500_PIN_C11 }; DB8500_PIN_C12, DB8500_PIN_C11 };
static const unsigned ssp0_a_1_pins[] = { DB8500_PIN_D12, DB8500_PIN_B13, static const unsigned ssp0_a_1_pins[] = { DB8500_PIN_D12, DB8500_PIN_B13,
...@@ -699,6 +703,7 @@ static const struct nmk_pingroup nmk_db8500_groups[] = { ...@@ -699,6 +703,7 @@ static const struct nmk_pingroup nmk_db8500_groups[] = {
DB8500_PIN_GROUP(kp_a_1, NMK_GPIO_ALT_A), DB8500_PIN_GROUP(kp_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(kpskaskb_a_1, NMK_GPIO_ALT_A), DB8500_PIN_GROUP(kpskaskb_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(mc2_a_1, NMK_GPIO_ALT_A), DB8500_PIN_GROUP(mc2_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(mc2_a_2, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(ssp1_a_1, NMK_GPIO_ALT_A), DB8500_PIN_GROUP(ssp1_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(ssp0_a_1, NMK_GPIO_ALT_A), DB8500_PIN_GROUP(ssp0_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(i2c0_a_1, NMK_GPIO_ALT_A), DB8500_PIN_GROUP(i2c0_a_1, NMK_GPIO_ALT_A),
...@@ -856,7 +861,7 @@ DB8500_FUNC_GROUPS(lcd, "lcdvsi0_a_1", "lcdvsi1_a_1", "lcd_d0_d7_a_1", ...@@ -856,7 +861,7 @@ DB8500_FUNC_GROUPS(lcd, "lcdvsi0_a_1", "lcdvsi1_a_1", "lcd_d0_d7_a_1",
"lcd_d8_d11_a_1", "lcd_d12_d15_a_1", "lcd_d12_d23_a_1", "lcd_b_1", "lcd_d8_d11_a_1", "lcd_d12_d15_a_1", "lcd_d12_d23_a_1", "lcd_b_1",
"lcd_d16_d23_b_1"); "lcd_d16_d23_b_1");
DB8500_FUNC_GROUPS(kp, "kp_a_1", "kp_a_2", "kp_b_1", "kp_b_2", "kp_c_1", "kp_oc1_1"); DB8500_FUNC_GROUPS(kp, "kp_a_1", "kp_a_2", "kp_b_1", "kp_b_2", "kp_c_1", "kp_oc1_1");
DB8500_FUNC_GROUPS(mc2, "mc2_a_1", "mc2rstn_c_1"); DB8500_FUNC_GROUPS(mc2, "mc2_a_1", "mc2_a_2", "mc2rstn_c_1");
DB8500_FUNC_GROUPS(ssp1, "ssp1_a_1"); DB8500_FUNC_GROUPS(ssp1, "ssp1_a_1");
DB8500_FUNC_GROUPS(ssp0, "ssp0_a_1"); DB8500_FUNC_GROUPS(ssp0, "ssp0_a_1");
DB8500_FUNC_GROUPS(i2c0, "i2c0_a_1"); DB8500_FUNC_GROUPS(i2c0, "i2c0_a_1");
......
...@@ -1113,6 +1113,7 @@ static int nmk_gpio_probe(struct platform_device *dev) ...@@ -1113,6 +1113,7 @@ static int nmk_gpio_probe(struct platform_device *dev)
spin_lock_init(&nmk_chip->lock); spin_lock_init(&nmk_chip->lock);
chip = &nmk_chip->chip; chip = &nmk_chip->chip;
chip->parent = &dev->dev;
chip->request = gpiochip_generic_request; chip->request = gpiochip_generic_request;
chip->free = gpiochip_generic_free; chip->free = gpiochip_generic_free;
chip->get_direction = nmk_gpio_get_dir; chip->get_direction = nmk_gpio_get_dir;
...@@ -1154,7 +1155,6 @@ static int nmk_gpio_probe(struct platform_device *dev) ...@@ -1154,7 +1155,6 @@ static int nmk_gpio_probe(struct platform_device *dev)
clk_enable(nmk_chip->clk); clk_enable(nmk_chip->clk);
nmk_chip->lowemi = readl_relaxed(nmk_chip->addr + NMK_GPIO_LOWEMI); nmk_chip->lowemi = readl_relaxed(nmk_chip->addr + NMK_GPIO_LOWEMI);
clk_disable(nmk_chip->clk); clk_disable(nmk_chip->clk);
chip->of_node = np;
ret = gpiochip_add_data(chip, nmk_chip); ret = gpiochip_add_data(chip, nmk_chip);
if (ret) if (ret)
......
...@@ -1898,9 +1898,9 @@ static int npcm7xx_gpio_of(struct npcm7xx_pinctrl *pctrl) ...@@ -1898,9 +1898,9 @@ static int npcm7xx_gpio_of(struct npcm7xx_pinctrl *pctrl)
} }
ret = irq_of_parse_and_map(np, 0); ret = irq_of_parse_and_map(np, 0);
if (ret < 0) { if (!ret) {
dev_err(dev, "No IRQ for GPIO bank %u\n", id); dev_err(dev, "No IRQ for GPIO bank %u\n", id);
return ret; return -EINVAL;
} }
pctrl->gpio_bank[id].irq = ret; pctrl->gpio_bank[id].irq = ret;
pctrl->gpio_bank[id].irq_chip = npcmgpio_irqchip; pctrl->gpio_bank[id].irq_chip = npcmgpio_irqchip;
......
...@@ -71,6 +71,7 @@ struct regmap_config regmap_config = { ...@@ -71,6 +71,7 @@ struct regmap_config regmap_config = {
.max_register = 512 * sizeof(u32), .max_register = 512 * sizeof(u32),
.num_reg_defaults_raw = 512, .num_reg_defaults_raw = 512,
.use_relaxed_mmio = true, .use_relaxed_mmio = true,
.use_raw_spinlock = true,
}; };
/* No locking needed to mask/unmask IRQs as the interrupt mode is per pin-register. */ /* No locking needed to mask/unmask IRQs as the interrupt mode is per pin-register. */
...@@ -509,6 +510,7 @@ static const struct of_device_id apple_gpio_pinctrl_of_match[] = { ...@@ -509,6 +510,7 @@ static const struct of_device_id apple_gpio_pinctrl_of_match[] = {
{ .compatible = "apple,pinctrl", }, { .compatible = "apple,pinctrl", },
{ } { }
}; };
MODULE_DEVICE_TABLE(of, apple_gpio_pinctrl_of_match);
static struct platform_driver apple_gpio_pinctrl_driver = { static struct platform_driver apple_gpio_pinctrl_driver = {
.driver = { .driver = {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/pinctrl/pinconf-generic.h> #include <linux/pinctrl/pinconf-generic.h>
#include <linux/pinctrl/pinmux.h> #include <linux/pinctrl/pinmux.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/property.h>
#include "core.h" #include "core.h"
#include "pinconf.h" #include "pinconf.h"
...@@ -167,11 +168,9 @@ static int gpiochip_setup(struct device *dev, struct eqbr_gpio_ctrl *gctrl) ...@@ -167,11 +168,9 @@ static int gpiochip_setup(struct device *dev, struct eqbr_gpio_ctrl *gctrl)
gc = &gctrl->chip; gc = &gctrl->chip;
gc->label = gctrl->name; gc->label = gctrl->name;
#if defined(CONFIG_OF_GPIO) gc->fwnode = gctrl->fwnode;
gc->of_node = gctrl->node;
#endif
if (!of_property_read_bool(gctrl->node, "interrupt-controller")) { if (!fwnode_property_read_bool(gctrl->fwnode, "interrupt-controller")) {
dev_dbg(dev, "gc %s: doesn't act as interrupt controller!\n", dev_dbg(dev, "gc %s: doesn't act as interrupt controller!\n",
gctrl->name); gctrl->name);
return 0; return 0;
...@@ -209,7 +208,7 @@ static int gpiolib_reg(struct eqbr_pinctrl_drv_data *drvdata) ...@@ -209,7 +208,7 @@ static int gpiolib_reg(struct eqbr_pinctrl_drv_data *drvdata)
for (i = 0; i < drvdata->nr_gpio_ctrls; i++) { for (i = 0; i < drvdata->nr_gpio_ctrls; i++) {
gctrl = drvdata->gpio_ctrls + i; gctrl = drvdata->gpio_ctrls + i;
np = gctrl->node; np = to_of_node(gctrl->fwnode);
gctrl->name = devm_kasprintf(dev, GFP_KERNEL, "gpiochip%d", i); gctrl->name = devm_kasprintf(dev, GFP_KERNEL, "gpiochip%d", i);
if (!gctrl->name) if (!gctrl->name)
...@@ -895,7 +894,7 @@ static int pinbank_probe(struct eqbr_pinctrl_drv_data *drvdata) ...@@ -895,7 +894,7 @@ static int pinbank_probe(struct eqbr_pinctrl_drv_data *drvdata)
pinbank_init(np_gpio, drvdata, banks + i, i); pinbank_init(np_gpio, drvdata, banks + i, i);
gctrls[i].node = np_gpio; gctrls[i].fwnode = of_fwnode_handle(np_gpio);
gctrls[i].bank = banks + i; gctrls[i].bank = banks + i;
i++; i++;
} }
......
...@@ -95,22 +95,24 @@ struct eqbr_pin_bank { ...@@ -95,22 +95,24 @@ struct eqbr_pin_bank {
u32 aval_pinmap; u32 aval_pinmap;
}; };
struct fwnode_handle;
/** /**
* struct eqbr_gpio_ctrl: represent a gpio controller. * struct eqbr_gpio_ctrl: represent a gpio controller.
* @node: device node of gpio controller. * @chip: gpio chip.
* @fwnode: firmware node of gpio controller.
* @bank: pointer to corresponding pin bank. * @bank: pointer to corresponding pin bank.
* @membase: base address of the gpio controller. * @membase: base address of the gpio controller.
* @chip: gpio chip.
* @ic: irq chip. * @ic: irq chip.
* @name: gpio chip name. * @name: gpio chip name.
* @virq: irq number of the gpio chip to parent's irq domain. * @virq: irq number of the gpio chip to parent's irq domain.
* @lock: spin lock to protect gpio register write. * @lock: spin lock to protect gpio register write.
*/ */
struct eqbr_gpio_ctrl { struct eqbr_gpio_ctrl {
struct device_node *node; struct gpio_chip chip;
struct fwnode_handle *fwnode;
struct eqbr_pin_bank *bank; struct eqbr_pin_bank *bank;
void __iomem *membase; void __iomem *membase;
struct gpio_chip chip;
struct irq_chip ic; struct irq_chip ic;
const char *name; const char *name;
unsigned int virq; unsigned int virq;
......
This diff is collapsed.
...@@ -668,5 +668,4 @@ module_platform_driver(max77620_pinctrl_driver); ...@@ -668,5 +668,4 @@ module_platform_driver(max77620_pinctrl_driver);
MODULE_DESCRIPTION("MAX77620/MAX20024 pin control driver"); MODULE_DESCRIPTION("MAX77620/MAX20024 pin control driver");
MODULE_AUTHOR("Chaitanya Bandi<bandik@nvidia.com>"); MODULE_AUTHOR("Chaitanya Bandi<bandik@nvidia.com>");
MODULE_AUTHOR("Laxman Dewangan<ldewangan@nvidia.com>"); MODULE_AUTHOR("Laxman Dewangan<ldewangan@nvidia.com>");
MODULE_ALIAS("platform:max77620-pinctrl");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
...@@ -688,11 +688,17 @@ static void microchip_sgpio_irq_setreg(struct irq_data *data, ...@@ -688,11 +688,17 @@ static void microchip_sgpio_irq_setreg(struct irq_data *data,
static void microchip_sgpio_irq_mask(struct irq_data *data) static void microchip_sgpio_irq_mask(struct irq_data *data)
{ {
struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
microchip_sgpio_irq_setreg(data, REG_INT_ENABLE, true); microchip_sgpio_irq_setreg(data, REG_INT_ENABLE, true);
gpiochip_disable_irq(chip, data->hwirq);
} }
static void microchip_sgpio_irq_unmask(struct irq_data *data) static void microchip_sgpio_irq_unmask(struct irq_data *data)
{ {
struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
gpiochip_enable_irq(chip, data->hwirq);
microchip_sgpio_irq_setreg(data, REG_INT_ENABLE, false); microchip_sgpio_irq_setreg(data, REG_INT_ENABLE, false);
} }
...@@ -746,6 +752,8 @@ static const struct irq_chip microchip_sgpio_irqchip = { ...@@ -746,6 +752,8 @@ static const struct irq_chip microchip_sgpio_irqchip = {
.irq_ack = microchip_sgpio_irq_ack, .irq_ack = microchip_sgpio_irq_ack,
.irq_unmask = microchip_sgpio_irq_unmask, .irq_unmask = microchip_sgpio_irq_unmask,
.irq_set_type = microchip_sgpio_irq_set_type, .irq_set_type = microchip_sgpio_irq_set_type,
.flags = IRQCHIP_IMMUTABLE,
GPIOCHIP_IRQ_RESOURCE_HELPERS,
}; };
static void sgpio_irq_handler(struct irq_desc *desc) static void sgpio_irq_handler(struct irq_desc *desc)
...@@ -840,7 +848,7 @@ static int microchip_sgpio_register_bank(struct device *dev, ...@@ -840,7 +848,7 @@ static int microchip_sgpio_register_bank(struct device *dev,
gc = &bank->gpio; gc = &bank->gpio;
gc->label = pctl_desc->name; gc->label = pctl_desc->name;
gc->parent = dev; gc->parent = dev;
gc->of_node = to_of_node(fwnode); gc->fwnode = fwnode;
gc->owner = THIS_MODULE; gc->owner = THIS_MODULE;
gc->get_direction = microchip_sgpio_get_direction; gc->get_direction = microchip_sgpio_get_direction;
gc->direction_input = microchip_sgpio_direction_input; gc->direction_input = microchip_sgpio_direction_input;
...@@ -861,11 +869,7 @@ static int microchip_sgpio_register_bank(struct device *dev, ...@@ -861,11 +869,7 @@ static int microchip_sgpio_register_bank(struct device *dev,
if (irq) { if (irq) {
struct gpio_irq_chip *girq = &gc->irq; struct gpio_irq_chip *girq = &gc->irq;
girq->chip = devm_kmemdup(dev, &microchip_sgpio_irqchip, gpio_irq_chip_set_chip(girq, &microchip_sgpio_irqchip);
sizeof(microchip_sgpio_irqchip),
GFP_KERNEL);
if (!girq->chip)
return -ENOMEM;
girq->parent_handler = sgpio_irq_handler; girq->parent_handler = sgpio_irq_handler;
girq->num_parents = 1; girq->num_parents = 1;
girq->parents = devm_kcalloc(dev, 1, girq->parents = devm_kcalloc(dev, 1,
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/pinctrl/pinconf-generic.h> #include <linux/pinctrl/pinconf-generic.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/slab.h> #include <linux/slab.h>
#include "core.h" #include "core.h"
...@@ -60,6 +61,7 @@ enum { ...@@ -60,6 +61,7 @@ enum {
FUNC_CAN0_a, FUNC_CAN0_a,
FUNC_CAN0_b, FUNC_CAN0_b,
FUNC_CAN1, FUNC_CAN1,
FUNC_CLKMON,
FUNC_NONE, FUNC_NONE,
FUNC_FC0_a, FUNC_FC0_a,
FUNC_FC0_b, FUNC_FC0_b,
...@@ -138,6 +140,8 @@ enum { ...@@ -138,6 +140,8 @@ enum {
FUNC_PTPSYNC_6, FUNC_PTPSYNC_6,
FUNC_PTPSYNC_7, FUNC_PTPSYNC_7,
FUNC_PWM, FUNC_PWM,
FUNC_PWM_a,
FUNC_PWM_b,
FUNC_QSPI1, FUNC_QSPI1,
FUNC_QSPI2, FUNC_QSPI2,
FUNC_R, FUNC_R,
...@@ -184,6 +188,7 @@ static const char *const ocelot_function_names[] = { ...@@ -184,6 +188,7 @@ static const char *const ocelot_function_names[] = {
[FUNC_CAN0_a] = "can0_a", [FUNC_CAN0_a] = "can0_a",
[FUNC_CAN0_b] = "can0_b", [FUNC_CAN0_b] = "can0_b",
[FUNC_CAN1] = "can1", [FUNC_CAN1] = "can1",
[FUNC_CLKMON] = "clkmon",
[FUNC_NONE] = "none", [FUNC_NONE] = "none",
[FUNC_FC0_a] = "fc0_a", [FUNC_FC0_a] = "fc0_a",
[FUNC_FC0_b] = "fc0_b", [FUNC_FC0_b] = "fc0_b",
...@@ -262,6 +267,8 @@ static const char *const ocelot_function_names[] = { ...@@ -262,6 +267,8 @@ static const char *const ocelot_function_names[] = {
[FUNC_PTPSYNC_6] = "ptpsync_6", [FUNC_PTPSYNC_6] = "ptpsync_6",
[FUNC_PTPSYNC_7] = "ptpsync_7", [FUNC_PTPSYNC_7] = "ptpsync_7",
[FUNC_PWM] = "pwm", [FUNC_PWM] = "pwm",
[FUNC_PWM_a] = "pwm_a",
[FUNC_PWM_b] = "pwm_b",
[FUNC_QSPI1] = "qspi1", [FUNC_QSPI1] = "qspi1",
[FUNC_QSPI2] = "qspi2", [FUNC_QSPI2] = "qspi2",
[FUNC_R] = "reserved", [FUNC_R] = "reserved",
...@@ -977,11 +984,11 @@ LAN966X_P(23, GPIO, NONE, NONE, NONE, OB_TRG_a, NONE, NON ...@@ -977,11 +984,11 @@ LAN966X_P(23, GPIO, NONE, NONE, NONE, OB_TRG_a, NONE, NON
LAN966X_P(24, GPIO, FC0_b, IB_TRG_a, USB_H_c, OB_TRG_a, IRQ_IN_c, TACHO_a, R); LAN966X_P(24, GPIO, FC0_b, IB_TRG_a, USB_H_c, OB_TRG_a, IRQ_IN_c, TACHO_a, R);
LAN966X_P(25, GPIO, FC0_b, IB_TRG_a, USB_H_c, OB_TRG_a, IRQ_OUT_c, SFP_SD, R); LAN966X_P(25, GPIO, FC0_b, IB_TRG_a, USB_H_c, OB_TRG_a, IRQ_OUT_c, SFP_SD, R);
LAN966X_P(26, GPIO, FC0_b, IB_TRG_a, USB_S_c, OB_TRG_a, CAN0_a, SFP_SD, R); LAN966X_P(26, GPIO, FC0_b, IB_TRG_a, USB_S_c, OB_TRG_a, CAN0_a, SFP_SD, R);
LAN966X_P(27, GPIO, NONE, NONE, NONE, OB_TRG_a, CAN0_a, NONE, R); LAN966X_P(27, GPIO, NONE, NONE, NONE, OB_TRG_a, CAN0_a, PWM_a, R);
LAN966X_P(28, GPIO, MIIM_a, NONE, NONE, OB_TRG_a, IRQ_OUT_c, SFP_SD, R); LAN966X_P(28, GPIO, MIIM_a, NONE, NONE, OB_TRG_a, IRQ_OUT_c, SFP_SD, R);
LAN966X_P(29, GPIO, MIIM_a, NONE, NONE, OB_TRG_a, NONE, NONE, R); LAN966X_P(29, GPIO, MIIM_a, NONE, NONE, OB_TRG_a, NONE, NONE, R);
LAN966X_P(30, GPIO, FC3_c, CAN1, NONE, OB_TRG, RECO_b, NONE, R); LAN966X_P(30, GPIO, FC3_c, CAN1, CLKMON, OB_TRG, RECO_b, NONE, R);
LAN966X_P(31, GPIO, FC3_c, CAN1, NONE, OB_TRG, RECO_b, NONE, R); LAN966X_P(31, GPIO, FC3_c, CAN1, CLKMON, OB_TRG, RECO_b, NONE, R);
LAN966X_P(32, GPIO, FC3_c, NONE, SGPIO_a, NONE, MIIM_Sa, NONE, R); LAN966X_P(32, GPIO, FC3_c, NONE, SGPIO_a, NONE, MIIM_Sa, NONE, R);
LAN966X_P(33, GPIO, FC1_b, NONE, SGPIO_a, NONE, MIIM_Sa, MIIM_b, R); LAN966X_P(33, GPIO, FC1_b, NONE, SGPIO_a, NONE, MIIM_Sa, MIIM_b, R);
LAN966X_P(34, GPIO, FC1_b, NONE, SGPIO_a, NONE, MIIM_Sa, MIIM_b, R); LAN966X_P(34, GPIO, FC1_b, NONE, SGPIO_a, NONE, MIIM_Sa, MIIM_b, R);
...@@ -1001,7 +1008,7 @@ LAN966X_P(47, GPIO, FC1_c, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, FC_SHRD5, IRQ_IN ...@@ -1001,7 +1008,7 @@ LAN966X_P(47, GPIO, FC1_c, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, FC_SHRD5, IRQ_IN
LAN966X_P(48, GPIO, FC1_c, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, FC_SHRD6, IRQ_IN_a, R); LAN966X_P(48, GPIO, FC1_c, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, FC_SHRD6, IRQ_IN_a, R);
LAN966X_P(49, GPIO, FC_SHRD7, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, TWI_SLC_GATE, IRQ_IN_a, R); LAN966X_P(49, GPIO, FC_SHRD7, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, TWI_SLC_GATE, IRQ_IN_a, R);
LAN966X_P(50, GPIO, FC_SHRD16, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, TWI_SLC_GATE, NONE, R); LAN966X_P(50, GPIO, FC_SHRD16, OB_TRG_b, IB_TRG_b, IRQ_OUT_a, TWI_SLC_GATE, NONE, R);
LAN966X_P(51, GPIO, FC3_b, OB_TRG_b, IB_TRG_c, IRQ_OUT_b, NONE, IRQ_IN_b, R); LAN966X_P(51, GPIO, FC3_b, OB_TRG_b, IB_TRG_c, IRQ_OUT_b, PWM_b, IRQ_IN_b, R);
LAN966X_P(52, GPIO, FC3_b, OB_TRG_b, IB_TRG_c, IRQ_OUT_b, TACHO_b, IRQ_IN_b, R); LAN966X_P(52, GPIO, FC3_b, OB_TRG_b, IB_TRG_c, IRQ_OUT_b, TACHO_b, IRQ_IN_b, R);
LAN966X_P(53, GPIO, FC3_b, OB_TRG_b, IB_TRG_c, IRQ_OUT_b, NONE, IRQ_IN_b, R); LAN966X_P(53, GPIO, FC3_b, OB_TRG_b, IB_TRG_c, IRQ_OUT_b, NONE, IRQ_IN_b, R);
LAN966X_P(54, GPIO, FC_SHRD8, OB_TRG_b, IB_TRG_c, IRQ_OUT_b, TWI_SLC_GATE, IRQ_IN_b, R); LAN966X_P(54, GPIO, FC_SHRD8, OB_TRG_b, IB_TRG_c, IRQ_OUT_b, TWI_SLC_GATE, IRQ_IN_b, R);
...@@ -1908,6 +1915,7 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev) ...@@ -1908,6 +1915,7 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct ocelot_pinctrl *info; struct ocelot_pinctrl *info;
struct reset_control *reset;
struct regmap *pincfg; struct regmap *pincfg;
void __iomem *base; void __iomem *base;
int ret; int ret;
...@@ -1923,6 +1931,12 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev) ...@@ -1923,6 +1931,12 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev)
info->desc = (struct pinctrl_desc *)device_get_match_data(dev); info->desc = (struct pinctrl_desc *)device_get_match_data(dev);
reset = devm_reset_control_get_optional_shared(dev, "switch");
if (IS_ERR(reset))
return dev_err_probe(dev, PTR_ERR(reset),
"Failed to get reset\n");
reset_control_reset(reset);
base = devm_ioremap_resource(dev, base = devm_ioremap_resource(dev,
platform_get_resource(pdev, IORESOURCE_MEM, 0)); platform_get_resource(pdev, IORESOURCE_MEM, 0));
if (IS_ERR(base)) if (IS_ERR(base))
......
This diff is collapsed.
...@@ -18,6 +18,171 @@ ...@@ -18,6 +18,171 @@
#ifndef _PINCTRL_ROCKCHIP_H #ifndef _PINCTRL_ROCKCHIP_H
#define _PINCTRL_ROCKCHIP_H #define _PINCTRL_ROCKCHIP_H
#define RK_GPIO0_A0 0
#define RK_GPIO0_A1 1
#define RK_GPIO0_A2 2
#define RK_GPIO0_A3 3
#define RK_GPIO0_A4 4
#define RK_GPIO0_A5 5
#define RK_GPIO0_A6 6
#define RK_GPIO0_A7 7
#define RK_GPIO0_B0 8
#define RK_GPIO0_B1 9
#define RK_GPIO0_B2 10
#define RK_GPIO0_B3 11
#define RK_GPIO0_B4 12
#define RK_GPIO0_B5 13
#define RK_GPIO0_B6 14
#define RK_GPIO0_B7 15
#define RK_GPIO0_C0 16
#define RK_GPIO0_C1 17
#define RK_GPIO0_C2 18
#define RK_GPIO0_C3 19
#define RK_GPIO0_C4 20
#define RK_GPIO0_C5 21
#define RK_GPIO0_C6 22
#define RK_GPIO0_C7 23
#define RK_GPIO0_D0 24
#define RK_GPIO0_D1 25
#define RK_GPIO0_D2 26
#define RK_GPIO0_D3 27
#define RK_GPIO0_D4 28
#define RK_GPIO0_D5 29
#define RK_GPIO0_D6 30
#define RK_GPIO0_D7 31
#define RK_GPIO1_A0 32
#define RK_GPIO1_A1 33
#define RK_GPIO1_A2 34
#define RK_GPIO1_A3 35
#define RK_GPIO1_A4 36
#define RK_GPIO1_A5 37
#define RK_GPIO1_A6 38
#define RK_GPIO1_A7 39
#define RK_GPIO1_B0 40
#define RK_GPIO1_B1 41
#define RK_GPIO1_B2 42
#define RK_GPIO1_B3 43
#define RK_GPIO1_B4 44
#define RK_GPIO1_B5 45
#define RK_GPIO1_B6 46
#define RK_GPIO1_B7 47
#define RK_GPIO1_C0 48
#define RK_GPIO1_C1 49
#define RK_GPIO1_C2 50
#define RK_GPIO1_C3 51
#define RK_GPIO1_C4 52
#define RK_GPIO1_C5 53
#define RK_GPIO1_C6 54
#define RK_GPIO1_C7 55
#define RK_GPIO1_D0 56
#define RK_GPIO1_D1 57
#define RK_GPIO1_D2 58
#define RK_GPIO1_D3 59
#define RK_GPIO1_D4 60
#define RK_GPIO1_D5 61
#define RK_GPIO1_D6 62
#define RK_GPIO1_D7 63
#define RK_GPIO2_A0 64
#define RK_GPIO2_A1 65
#define RK_GPIO2_A2 66
#define RK_GPIO2_A3 67
#define RK_GPIO2_A4 68
#define RK_GPIO2_A5 69
#define RK_GPIO2_A6 70
#define RK_GPIO2_A7 71
#define RK_GPIO2_B0 72
#define RK_GPIO2_B1 73
#define RK_GPIO2_B2 74
#define RK_GPIO2_B3 75
#define RK_GPIO2_B4 76
#define RK_GPIO2_B5 77
#define RK_GPIO2_B6 78
#define RK_GPIO2_B7 79
#define RK_GPIO2_C0 80
#define RK_GPIO2_C1 81
#define RK_GPIO2_C2 82
#define RK_GPIO2_C3 83
#define RK_GPIO2_C4 84
#define RK_GPIO2_C5 85
#define RK_GPIO2_C6 86
#define RK_GPIO2_C7 87
#define RK_GPIO2_D0 88
#define RK_GPIO2_D1 89
#define RK_GPIO2_D2 90
#define RK_GPIO2_D3 91
#define RK_GPIO2_D4 92
#define RK_GPIO2_D5 93
#define RK_GPIO2_D6 94
#define RK_GPIO2_D7 95
#define RK_GPIO3_A0 96
#define RK_GPIO3_A1 97
#define RK_GPIO3_A2 98
#define RK_GPIO3_A3 99
#define RK_GPIO3_A4 100
#define RK_GPIO3_A5 101
#define RK_GPIO3_A6 102
#define RK_GPIO3_A7 103
#define RK_GPIO3_B0 104
#define RK_GPIO3_B1 105
#define RK_GPIO3_B2 106
#define RK_GPIO3_B3 107
#define RK_GPIO3_B4 108
#define RK_GPIO3_B5 109
#define RK_GPIO3_B6 110
#define RK_GPIO3_B7 111
#define RK_GPIO3_C0 112
#define RK_GPIO3_C1 113
#define RK_GPIO3_C2 114
#define RK_GPIO3_C3 115
#define RK_GPIO3_C4 116
#define RK_GPIO3_C5 117
#define RK_GPIO3_C6 118
#define RK_GPIO3_C7 119
#define RK_GPIO3_D0 120
#define RK_GPIO3_D1 121
#define RK_GPIO3_D2 122
#define RK_GPIO3_D3 123
#define RK_GPIO3_D4 124
#define RK_GPIO3_D5 125
#define RK_GPIO3_D6 126
#define RK_GPIO3_D7 127
#define RK_GPIO4_A0 128
#define RK_GPIO4_A1 129
#define RK_GPIO4_A2 130
#define RK_GPIO4_A3 131
#define RK_GPIO4_A4 132
#define RK_GPIO4_A5 133
#define RK_GPIO4_A6 134
#define RK_GPIO4_A7 135
#define RK_GPIO4_B0 136
#define RK_GPIO4_B1 137
#define RK_GPIO4_B2 138
#define RK_GPIO4_B3 139
#define RK_GPIO4_B4 140
#define RK_GPIO4_B5 141
#define RK_GPIO4_B6 142
#define RK_GPIO4_B7 143
#define RK_GPIO4_C0 144
#define RK_GPIO4_C1 145
#define RK_GPIO4_C2 146
#define RK_GPIO4_C3 147
#define RK_GPIO4_C4 148
#define RK_GPIO4_C5 149
#define RK_GPIO4_C6 150
#define RK_GPIO4_C7 151
#define RK_GPIO4_D0 152
#define RK_GPIO4_D1 153
#define RK_GPIO4_D2 154
#define RK_GPIO4_D3 155
#define RK_GPIO4_D4 156
#define RK_GPIO4_D5 157
#define RK_GPIO4_D6 158
#define RK_GPIO4_D7 159
enum rockchip_pinctrl_type { enum rockchip_pinctrl_type {
PX30, PX30,
RV1108, RV1108,
...@@ -30,6 +195,7 @@ enum rockchip_pinctrl_type { ...@@ -30,6 +195,7 @@ enum rockchip_pinctrl_type {
RK3368, RK3368,
RK3399, RK3399,
RK3568, RK3568,
RK3588,
}; };
/** /**
...@@ -171,7 +337,7 @@ struct rockchip_pin_bank { ...@@ -171,7 +337,7 @@ struct rockchip_pin_bank {
u32 toggle_edge_mode; u32 toggle_edge_mode;
u32 recalced_mask; u32 recalced_mask;
u32 route_mask; u32 route_mask;
struct list_head deferred_output; struct list_head deferred_pins;
struct mutex deferred_lock; struct mutex deferred_lock;
}; };
...@@ -230,10 +396,10 @@ struct rockchip_pin_ctrl { ...@@ -230,10 +396,10 @@ struct rockchip_pin_ctrl {
struct rockchip_mux_route_data *iomux_routes; struct rockchip_mux_route_data *iomux_routes;
u32 niomux_routes; u32 niomux_routes;
void (*pull_calc_reg)(struct rockchip_pin_bank *bank, int (*pull_calc_reg)(struct rockchip_pin_bank *bank,
int pin_num, struct regmap **regmap, int pin_num, struct regmap **regmap,
int *reg, u8 *bit); int *reg, u8 *bit);
void (*drv_calc_reg)(struct rockchip_pin_bank *bank, int (*drv_calc_reg)(struct rockchip_pin_bank *bank,
int pin_num, struct regmap **regmap, int pin_num, struct regmap **regmap,
int *reg, u8 *bit); int *reg, u8 *bit);
int (*schmitt_calc_reg)(struct rockchip_pin_bank *bank, int (*schmitt_calc_reg)(struct rockchip_pin_bank *bank,
...@@ -247,9 +413,12 @@ struct rockchip_pin_config { ...@@ -247,9 +413,12 @@ struct rockchip_pin_config {
unsigned int nconfigs; unsigned int nconfigs;
}; };
struct rockchip_pin_output_deferred { enum pin_config_param;
struct rockchip_pin_deferred {
struct list_head head; struct list_head head;
unsigned int pin; unsigned int pin;
enum pin_config_param param;
u32 arg; u32 arg;
}; };
......
...@@ -1074,6 +1074,8 @@ static void starfive_irq_mask(struct irq_data *d) ...@@ -1074,6 +1074,8 @@ static void starfive_irq_mask(struct irq_data *d)
value = readl_relaxed(ie) & ~mask; value = readl_relaxed(ie) & ~mask;
writel_relaxed(value, ie); writel_relaxed(value, ie);
raw_spin_unlock_irqrestore(&sfp->lock, flags); raw_spin_unlock_irqrestore(&sfp->lock, flags);
gpiochip_disable_irq(&sfp->gc, d->hwirq);
} }
static void starfive_irq_mask_ack(struct irq_data *d) static void starfive_irq_mask_ack(struct irq_data *d)
...@@ -1102,6 +1104,8 @@ static void starfive_irq_unmask(struct irq_data *d) ...@@ -1102,6 +1104,8 @@ static void starfive_irq_unmask(struct irq_data *d)
unsigned long flags; unsigned long flags;
u32 value; u32 value;
gpiochip_enable_irq(&sfp->gc, d->hwirq);
raw_spin_lock_irqsave(&sfp->lock, flags); raw_spin_lock_irqsave(&sfp->lock, flags);
value = readl_relaxed(ie) | mask; value = readl_relaxed(ie) | mask;
writel_relaxed(value, ie); writel_relaxed(value, ie);
...@@ -1163,14 +1167,15 @@ static int starfive_irq_set_type(struct irq_data *d, unsigned int trigger) ...@@ -1163,14 +1167,15 @@ static int starfive_irq_set_type(struct irq_data *d, unsigned int trigger)
return 0; return 0;
} }
static struct irq_chip starfive_irq_chip = { static const struct irq_chip starfive_irq_chip = {
.name = "StarFive GPIO", .name = "StarFive GPIO",
.irq_ack = starfive_irq_ack, .irq_ack = starfive_irq_ack,
.irq_mask = starfive_irq_mask, .irq_mask = starfive_irq_mask,
.irq_mask_ack = starfive_irq_mask_ack, .irq_mask_ack = starfive_irq_mask_ack,
.irq_unmask = starfive_irq_unmask, .irq_unmask = starfive_irq_unmask,
.irq_set_type = starfive_irq_set_type, .irq_set_type = starfive_irq_set_type,
.flags = IRQCHIP_SET_TYPE_MASKED, .flags = IRQCHIP_IMMUTABLE | IRQCHIP_SET_TYPE_MASKED,
GPIOCHIP_IRQ_RESOURCE_HELPERS,
}; };
static void starfive_gpio_irq_handler(struct irq_desc *desc) static void starfive_gpio_irq_handler(struct irq_desc *desc)
...@@ -1308,7 +1313,7 @@ static int starfive_probe(struct platform_device *pdev) ...@@ -1308,7 +1313,7 @@ static int starfive_probe(struct platform_device *pdev)
sfp->gc.base = -1; sfp->gc.base = -1;
sfp->gc.ngpio = NR_GPIOS; sfp->gc.ngpio = NR_GPIOS;
sfp->gc.irq.chip = &starfive_irq_chip; gpio_irq_chip_set_chip(&sfp->gc.irq, &starfive_irq_chip);
sfp->gc.irq.parent_handler = starfive_gpio_irq_handler; sfp->gc.irq.parent_handler = starfive_gpio_irq_handler;
sfp->gc.irq.num_parents = 1; sfp->gc.irq.num_parents = 1;
sfp->gc.irq.parents = devm_kcalloc(dev, sfp->gc.irq.num_parents, sfp->gc.irq.parents = devm_kcalloc(dev, sfp->gc.irq.num_parents,
......
...@@ -1229,7 +1229,6 @@ static int thunderbay_pinctrl_probe(struct platform_device *pdev) ...@@ -1229,7 +1229,6 @@ static int thunderbay_pinctrl_probe(struct platform_device *pdev)
const struct of_device_id *of_id; const struct of_device_id *of_id;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct thunderbay_pinctrl *tpc; struct thunderbay_pinctrl *tpc;
struct resource *iomem;
int ret; int ret;
of_id = of_match_node(thunderbay_pinctrl_match, pdev->dev.of_node); of_id = of_match_node(thunderbay_pinctrl_match, pdev->dev.of_node);
...@@ -1243,11 +1242,7 @@ static int thunderbay_pinctrl_probe(struct platform_device *pdev) ...@@ -1243,11 +1242,7 @@ static int thunderbay_pinctrl_probe(struct platform_device *pdev)
tpc->dev = dev; tpc->dev = dev;
tpc->soc = of_id->data; tpc->soc = of_id->data;
iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); tpc->base0 = devm_platform_ioremap_resource(pdev, 0);
if (!iomem)
return -ENXIO;
tpc->base0 = devm_ioremap_resource(dev, iomem);
if (IS_ERR(tpc->base0)) if (IS_ERR(tpc->base0))
return PTR_ERR(tpc->base0); return PTR_ERR(tpc->base0);
......
...@@ -239,6 +239,15 @@ config PINCTRL_SC7280 ...@@ -239,6 +239,15 @@ config PINCTRL_SC7280
Qualcomm Technologies Inc TLMM block found on the Qualcomm Qualcomm Technologies Inc TLMM block found on the Qualcomm
Technologies Inc SC7280 platform. Technologies Inc SC7280 platform.
config PINCTRL_SC7280_LPASS_LPI
tristate "Qualcomm Technologies Inc SC7280 LPASS LPI pin controller driver"
depends on GPIOLIB
depends on PINCTRL_LPASS_LPI
help
This is the pinctrl, pinmux, pinconf and gpiolib driver for the
Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI
(Low Power Island) found on the Qualcomm Technologies Inc SC7280 platform.
config PINCTRL_SC8180X config PINCTRL_SC8180X
tristate "Qualcomm Technologies Inc SC8180x pin controller driver" tristate "Qualcomm Technologies Inc SC8180x pin controller driver"
depends on (OF || ACPI) depends on (OF || ACPI)
...@@ -338,6 +347,15 @@ config PINCTRL_SM8250 ...@@ -338,6 +347,15 @@ config PINCTRL_SM8250
Qualcomm Technologies Inc TLMM block found on the Qualcomm Qualcomm Technologies Inc TLMM block found on the Qualcomm
Technologies Inc SM8250 platform. Technologies Inc SM8250 platform.
config PINCTRL_SM8250_LPASS_LPI
tristate "Qualcomm Technologies Inc SM8250 LPASS LPI pin controller driver"
depends on GPIOLIB
depends on PINCTRL_LPASS_LPI
help
This is the pinctrl, pinmux, pinconf and gpiolib driver for the
Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI
(Low Power Island) found on the Qualcomm Technologies Inc SM8250 platform.
config PINCTRL_SM8350 config PINCTRL_SM8350
tristate "Qualcomm Technologies Inc SM8350 pin controller driver" tristate "Qualcomm Technologies Inc SM8350 pin controller driver"
depends on PINCTRL_MSM depends on PINCTRL_MSM
...@@ -360,6 +378,7 @@ config PINCTRL_LPASS_LPI ...@@ -360,6 +378,7 @@ config PINCTRL_LPASS_LPI
select PINMUX select PINMUX
select PINCONF select PINCONF
select GENERIC_PINCONF select GENERIC_PINCONF
select GENERIC_PINCTRL_GROUPS
depends on GPIOLIB depends on GPIOLIB
help help
This is the pinctrl, pinmux, pinconf and gpiolib driver for the This is the pinctrl, pinmux, pinconf and gpiolib driver for the
......
...@@ -28,6 +28,7 @@ obj-$(CONFIG_PINCTRL_QCOM_SSBI_PMIC) += pinctrl-ssbi-gpio.o ...@@ -28,6 +28,7 @@ obj-$(CONFIG_PINCTRL_QCOM_SSBI_PMIC) += pinctrl-ssbi-gpio.o
obj-$(CONFIG_PINCTRL_QCOM_SSBI_PMIC) += pinctrl-ssbi-mpp.o obj-$(CONFIG_PINCTRL_QCOM_SSBI_PMIC) += pinctrl-ssbi-mpp.o
obj-$(CONFIG_PINCTRL_SC7180) += pinctrl-sc7180.o obj-$(CONFIG_PINCTRL_SC7180) += pinctrl-sc7180.o
obj-$(CONFIG_PINCTRL_SC7280) += pinctrl-sc7280.o obj-$(CONFIG_PINCTRL_SC7280) += pinctrl-sc7280.o
obj-$(CONFIG_PINCTRL_SC7280_LPASS_LPI) += pinctrl-sc7280-lpass-lpi.o
obj-$(CONFIG_PINCTRL_SC8180X) += pinctrl-sc8180x.o obj-$(CONFIG_PINCTRL_SC8180X) += pinctrl-sc8180x.o
obj-$(CONFIG_PINCTRL_SC8280XP) += pinctrl-sc8280xp.o obj-$(CONFIG_PINCTRL_SC8280XP) += pinctrl-sc8280xp.o
obj-$(CONFIG_PINCTRL_SDM660) += pinctrl-sdm660.o obj-$(CONFIG_PINCTRL_SDM660) += pinctrl-sdm660.o
...@@ -39,6 +40,7 @@ obj-$(CONFIG_PINCTRL_SM6350) += pinctrl-sm6350.o ...@@ -39,6 +40,7 @@ obj-$(CONFIG_PINCTRL_SM6350) += pinctrl-sm6350.o
obj-$(CONFIG_PINCTRL_SDX65) += pinctrl-sdx65.o obj-$(CONFIG_PINCTRL_SDX65) += pinctrl-sdx65.o
obj-$(CONFIG_PINCTRL_SM8150) += pinctrl-sm8150.o obj-$(CONFIG_PINCTRL_SM8150) += pinctrl-sm8150.o
obj-$(CONFIG_PINCTRL_SM8250) += pinctrl-sm8250.o obj-$(CONFIG_PINCTRL_SM8250) += pinctrl-sm8250.o
obj-$(CONFIG_PINCTRL_SM8250_LPASS_LPI) += pinctrl-sm8250-lpass-lpi.o
obj-$(CONFIG_PINCTRL_SM8350) += pinctrl-sm8350.o obj-$(CONFIG_PINCTRL_SM8350) += pinctrl-sm8350.o
obj-$(CONFIG_PINCTRL_SM8450) += pinctrl-sm8450.o obj-$(CONFIG_PINCTRL_SM8450) += pinctrl-sm8450.o
obj-$(CONFIG_PINCTRL_LPASS_LPI) += pinctrl-lpass-lpi.o obj-$(CONFIG_PINCTRL_LPASS_LPI) += pinctrl-lpass-lpi.o
This diff is collapsed.
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2020 Linaro Ltd.
*/
#ifndef __PINCTRL_LPASS_LPI_H__
#define __PINCTRL_LPASS_LPI_H__
#include <linux/bitops.h>
#include <linux/bitfield.h>
#include "../core.h"
#define LPI_SLEW_RATE_CTL_REG 0xa000
#define LPI_TLMM_REG_OFFSET 0x1000
#define LPI_SLEW_RATE_MAX 0x03
#define LPI_SLEW_BITS_SIZE 0x02
#define LPI_SLEW_RATE_MASK GENMASK(1, 0)
#define LPI_GPIO_CFG_REG 0x00
#define LPI_GPIO_PULL_MASK GENMASK(1, 0)
#define LPI_GPIO_FUNCTION_MASK GENMASK(5, 2)
#define LPI_GPIO_OUT_STRENGTH_MASK GENMASK(8, 6)
#define LPI_GPIO_OE_MASK BIT(9)
#define LPI_GPIO_VALUE_REG 0x04
#define LPI_GPIO_VALUE_IN_MASK BIT(0)
#define LPI_GPIO_VALUE_OUT_MASK BIT(1)
#define LPI_GPIO_BIAS_DISABLE 0x0
#define LPI_GPIO_PULL_DOWN 0x1
#define LPI_GPIO_KEEPER 0x2
#define LPI_GPIO_PULL_UP 0x3
#define LPI_GPIO_DS_TO_VAL(v) (v / 2 - 1)
#define LPI_NO_SLEW -1
#define LPI_FUNCTION(fname) \
[LPI_MUX_##fname] = { \
.name = #fname, \
.groups = fname##_groups, \
.ngroups = ARRAY_SIZE(fname##_groups), \
}
#define LPI_PINGROUP(id, soff, f1, f2, f3, f4) \
{ \
.group.name = "gpio" #id, \
.group.pins = gpio##id##_pins, \
.pin = id, \
.slew_offset = soff, \
.group.num_pins = ARRAY_SIZE(gpio##id##_pins), \
.funcs = (int[]){ \
LPI_MUX_gpio, \
LPI_MUX_##f1, \
LPI_MUX_##f2, \
LPI_MUX_##f3, \
LPI_MUX_##f4, \
}, \
.nfuncs = 5, \
}
struct lpi_pingroup {
struct group_desc group;
unsigned int pin;
/* Bit offset in slew register for SoundWire pins only */
int slew_offset;
unsigned int *funcs;
unsigned int nfuncs;
};
struct lpi_function {
const char *name;
const char * const *groups;
unsigned int ngroups;
};
struct lpi_pinctrl_variant_data {
const struct pinctrl_pin_desc *pins;
int npins;
const struct lpi_pingroup *groups;
int ngroups;
const struct lpi_function *functions;
int nfunctions;
bool is_clk_optional;
};
int lpi_pinctrl_probe(struct platform_device *pdev);
int lpi_pinctrl_remove(struct platform_device *pdev);
#endif /*__PINCTRL_LPASS_LPI_H__*/
This diff is collapsed.
...@@ -1500,6 +1500,25 @@ static const struct msm_pingroup sm8150_groups[] = { ...@@ -1500,6 +1500,25 @@ static const struct msm_pingroup sm8150_groups[] = {
[178] = SDC_QDSD_PINGROUP(sdc2_data, 0xB2000, 9, 0), [178] = SDC_QDSD_PINGROUP(sdc2_data, 0xB2000, 9, 0),
}; };
static const struct msm_gpio_wakeirq_map sm8150_pdc_map[] = {
{ 3, 31 }, { 5, 32 }, { 8, 33 }, { 9, 34 }, { 10, 100 },
{ 12, 104 }, { 24, 37 }, { 26, 38 }, { 27, 41 }, { 28, 42 },
{ 30, 39 }, { 36, 43 }, { 37, 44 }, { 38, 30 }, { 39, 118 },
{ 39, 125 }, { 41, 47 }, { 42, 48 }, { 46, 50 }, { 47, 49 },
{ 48, 51 }, { 49, 53 }, { 50, 52 }, { 51, 116 }, { 51, 123 },
{ 53, 54 }, { 54, 55 }, { 55, 56 }, { 56, 57 }, { 58, 58 },
{ 60, 60 }, { 61, 61 }, { 68, 62 }, { 70, 63 }, { 76, 71 },
{ 77, 66 }, { 81, 64 }, { 83, 65 }, { 86, 67 }, { 87, 84 },
{ 88, 117 }, { 88, 124 }, { 90, 69 }, { 91, 70 }, { 93, 75 },
{ 95, 72 }, { 96, 73 }, { 97, 74 }, { 101, 40 }, { 103, 77 },
{ 104, 78 }, { 108, 79 }, { 112, 80 }, { 113, 81 }, { 114, 82 },
{ 117, 85 }, { 118, 101 }, { 119, 87 }, { 120, 88 }, { 121, 89 },
{ 122, 90 }, { 123, 91 }, { 124, 92 }, { 125, 93 }, { 129, 94 },
{ 132, 105 }, { 133, 83 }, { 134, 36 }, { 136, 97 }, { 142, 103 },
{ 144, 115 }, { 144, 122 }, { 147, 102 }, { 150, 107 },
{ 152, 108 }, { 153, 109 }
};
static const struct msm_pinctrl_soc_data sm8150_pinctrl = { static const struct msm_pinctrl_soc_data sm8150_pinctrl = {
.pins = sm8150_pins, .pins = sm8150_pins,
.npins = ARRAY_SIZE(sm8150_pins), .npins = ARRAY_SIZE(sm8150_pins),
...@@ -1510,6 +1529,9 @@ static const struct msm_pinctrl_soc_data sm8150_pinctrl = { ...@@ -1510,6 +1529,9 @@ static const struct msm_pinctrl_soc_data sm8150_pinctrl = {
.ngpios = 176, .ngpios = 176,
.tiles = sm8150_tiles, .tiles = sm8150_tiles,
.ntiles = ARRAY_SIZE(sm8150_tiles), .ntiles = ARRAY_SIZE(sm8150_tiles),
.wakeirq_map = sm8150_pdc_map,
.nwakeirq_map = ARRAY_SIZE(sm8150_pdc_map),
.wakeirq_dual_edge_errata = true,
}; };
static int sm8150_pinctrl_probe(struct platform_device *pdev) static int sm8150_pinctrl_probe(struct platform_device *pdev)
......
This diff is collapsed.
...@@ -1146,6 +1146,7 @@ static const struct of_device_id pmic_gpio_of_match[] = { ...@@ -1146,6 +1146,7 @@ static const struct of_device_id pmic_gpio_of_match[] = {
{ .compatible = "qcom,pm660-gpio", .data = (void *) 13 }, { .compatible = "qcom,pm660-gpio", .data = (void *) 13 },
/* pm660l has 12 GPIOs with holes on 1, 2, 10, 11 and 12 */ /* pm660l has 12 GPIOs with holes on 1, 2, 10, 11 and 12 */
{ .compatible = "qcom,pm660l-gpio", .data = (void *) 12 }, { .compatible = "qcom,pm660l-gpio", .data = (void *) 12 },
{ .compatible = "qcom,pm6125-gpio", .data = (void *) 9 },
{ .compatible = "qcom,pm6150-gpio", .data = (void *) 10 }, { .compatible = "qcom,pm6150-gpio", .data = (void *) 10 },
{ .compatible = "qcom,pm6150l-gpio", .data = (void *) 12 }, { .compatible = "qcom,pm6150l-gpio", .data = (void *) 12 },
{ .compatible = "qcom,pm6350-gpio", .data = (void *) 9 }, { .compatible = "qcom,pm6350-gpio", .data = (void *) 9 },
...@@ -1183,6 +1184,7 @@ static const struct of_device_id pmic_gpio_of_match[] = { ...@@ -1183,6 +1184,7 @@ static const struct of_device_id pmic_gpio_of_match[] = {
{ .compatible = "qcom,pms405-gpio", .data = (void *) 12 }, { .compatible = "qcom,pms405-gpio", .data = (void *) 12 },
/* pmx55 has 11 GPIOs with holes on 3, 7, 10, 11 */ /* pmx55 has 11 GPIOs with holes on 3, 7, 10, 11 */
{ .compatible = "qcom,pmx55-gpio", .data = (void *) 11 }, { .compatible = "qcom,pmx55-gpio", .data = (void *) 11 },
{ .compatible = "qcom,pmx65-gpio", .data = (void *) 16 },
{ }, { },
}; };
......
This diff is collapsed.
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_PINCTRL_RT2880) += pinctrl-rt2880.o obj-$(CONFIG_PINCTRL_RALINK) += pinctrl-ralink.o
obj-$(CONFIG_PINCTRL_MT7620) += pinctrl-mt7620.o obj-$(CONFIG_PINCTRL_MT7620) += pinctrl-mt7620.o
obj-$(CONFIG_PINCTRL_MT7621) += pinctrl-mt7621.o obj-$(CONFIG_PINCTRL_MT7621) += pinctrl-mt7621.o
obj-$(CONFIG_PINCTRL_RT288X) += pinctrl-rt288x.o obj-$(CONFIG_PINCTRL_RT2880) += pinctrl-rt2880.o
obj-$(CONFIG_PINCTRL_RT305X) += pinctrl-rt305x.o obj-$(CONFIG_PINCTRL_RT305X) += pinctrl-rt305x.o
obj-$(CONFIG_PINCTRL_RT3883) += pinctrl-rt3883.o obj-$(CONFIG_PINCTRL_RT3883) += pinctrl-rt3883.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -38,8 +38,7 @@ config PINCTRL_RENESAS ...@@ -38,8 +38,7 @@ config PINCTRL_RENESAS
select PINCTRL_PFC_R8A77995 if ARCH_R8A77995 select PINCTRL_PFC_R8A77995 if ARCH_R8A77995
select PINCTRL_PFC_R8A779A0 if ARCH_R8A779A0 select PINCTRL_PFC_R8A779A0 if ARCH_R8A779A0
select PINCTRL_PFC_R8A779F0 if ARCH_R8A779F0 select PINCTRL_PFC_R8A779F0 if ARCH_R8A779F0
select PINCTRL_RZG2L if ARCH_R9A07G044 select PINCTRL_RZG2L if ARCH_RZG2L
select PINCTRL_RZG2L if ARCH_R9A07G054
select PINCTRL_PFC_SH7203 if CPU_SUBTYPE_SH7203 select PINCTRL_PFC_SH7203 if CPU_SUBTYPE_SH7203
select PINCTRL_PFC_SH7264 if CPU_SUBTYPE_SH7264 select PINCTRL_PFC_SH7264 if CPU_SUBTYPE_SH7264
select PINCTRL_PFC_SH7269 if CPU_SUBTYPE_SH7269 select PINCTRL_PFC_SH7269 if CPU_SUBTYPE_SH7269
...@@ -184,14 +183,14 @@ config PINCTRL_RZA2 ...@@ -184,14 +183,14 @@ config PINCTRL_RZA2
This selects GPIO and pinctrl driver for Renesas RZ/A2 platforms. This selects GPIO and pinctrl driver for Renesas RZ/A2 platforms.
config PINCTRL_RZG2L config PINCTRL_RZG2L
bool "pin control support for RZ/{G2L,V2L}" if COMPILE_TEST bool "pin control support for RZ/{G2L,G2UL,V2L}" if COMPILE_TEST
depends on OF depends on OF
select GPIOLIB select GPIOLIB
select GENERIC_PINCTRL_GROUPS select GENERIC_PINCTRL_GROUPS
select GENERIC_PINMUX_FUNCTIONS select GENERIC_PINMUX_FUNCTIONS
select GENERIC_PINCONF select GENERIC_PINCONF
help help
This selects GPIO and pinctrl driver for Renesas RZ/{G2L,V2L} This selects GPIO and pinctrl driver for Renesas RZ/{G2L,G2UL,V2L}
platforms. platforms.
config PINCTRL_PFC_R8A77470 config PINCTRL_PFC_R8A77470
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment