mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 08:15:07 -04:00
Merge tag 'pinctrl-v7.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control updates from Linus Walleij:
"Core changes:
- Use the non-blocking mux_state_try_select() in the generic MUX pin
control back-end
- Free pin maps on pinctrl_generic_to_map() failure in the core
helpers
New hardware pin control:
- Qualcomm Maili TLMM SoC, PMG1110 PMIC, and Eliza LPASS LPI TLMM SoC
(this is for the low power audio, LPASS = Low Power Audio SubSystem
portions)
- Upboard support on top of the Intel pin controller
- Apple T6030 and T6031 support (just compatible strings)
- Samsung Exynos 8855 SoC
- Mediatek MT6858 SoC
- Rockchip RK3308B and RV1106 SoCs
- Airoha EN7523 and AN7563 SoCs
Improvements:
- Qualcomm TLMM GPIOs are unconditionally marked as wakeup capable
- Qualcomm improvements on top of the Qualcomm PDC (power domain
controller) irqchip improvements from tglx:s tree
- Qualcomm IPQ806x and IPQ9650 non-urgent pin grop fixups
- The NPCM8xx driver has been put into shape fixing many pin and
group definitions
- Some non-urgent Tegra 264 pin assignments are fixed up
- Some non-urgent fixups to Airoha AN7581 and AN7583 registers and
pin assignments, missing features etc"
* tag 'pinctrl-v7.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (130 commits)
dt-bindings: pinctrl: Convert TI DA850 pupd to DT schema
pinctrl: meson: sync some modify from A4
pinctrl: meson: a4: Add input enable pin configuration
pinctrl: realtek: rtd1625: remove unused group name spdif_sel
pinctrl: realtek: rtd1625: fix base_bit for VE4 GPIO 13
dt-bindings: pinctrl: microchip,pic32mzda-pinctrl: Convert to DT schema
Revert "Merge branch 'ib-rsk7204' into devel"
pinctrl: rockchip: Add RV1106 pinctrl support
dt-bindings: pinctrl: rockchip: Add RV1106 compatible
pinctrl: rockchip: Decode drive strength in the get function
pinctrl: fix PINCTRL_GENERIC_MUX not always being selectable
pinctrl: airoha: add support of an7563 SoC
dt-bindings: pinctrl: airoha: add support of an7563 pin controller
pinctrl: airoha: try to find chip scu node by phandle first
pinctrl: airoha: add support of en7523 SoC
dt-bindings: pinctrl: airoha: add support of en7523 pin controller
pinctrl: airoha: an7583: add support for olt pinmux
pinctrl: airoha: an7583: add support for pon_alt pinmux
pinctrl: airoha: an7583: add support for npu_uart pinmux
dt-bindings: pinctrl: airoha: an7583: add missed features
...
This commit is contained in:
@@ -0,0 +1,350 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/airoha,an7563-pinctrl.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Airoha AN7563 Pin Controller
|
||||
|
||||
maintainers:
|
||||
- Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
|
||||
description:
|
||||
The Airoha's AN7563 Pin controller is used to control SoC pins.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: airoha,an7563-pinctrl
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
gpio-controller: true
|
||||
|
||||
'#gpio-cells':
|
||||
const: 2
|
||||
|
||||
gpio-ranges:
|
||||
maxItems: 1
|
||||
|
||||
interrupt-controller: true
|
||||
|
||||
'#interrupt-cells':
|
||||
const: 2
|
||||
|
||||
allOf:
|
||||
- $ref: pinctrl.yaml#
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- interrupts
|
||||
- gpio-controller
|
||||
- "#gpio-cells"
|
||||
- interrupt-controller
|
||||
- "#interrupt-cells"
|
||||
|
||||
patternProperties:
|
||||
'-pins$':
|
||||
type: object
|
||||
|
||||
patternProperties:
|
||||
'^mux(-|$)':
|
||||
type: object
|
||||
|
||||
description:
|
||||
pinmux configuration nodes.
|
||||
|
||||
$ref: /schemas/pinctrl/pinmux-node.yaml
|
||||
|
||||
properties:
|
||||
function:
|
||||
description:
|
||||
A string containing the name of the function to mux to the group.
|
||||
enum: [pon, sipo, mdio, uart, jtag, pcm, spi, pnand, gpio,
|
||||
pcie_reset, pwm, phy1_led0, phy2_led0, phy3_led0,
|
||||
phy4_led0, phy1_led1, phy2_led1, phy3_led1, phy4_led1]
|
||||
|
||||
groups:
|
||||
description:
|
||||
An array of strings. Each string contains the name of a group.
|
||||
|
||||
required:
|
||||
- function
|
||||
- groups
|
||||
|
||||
allOf:
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: pon
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [pon]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: sipo
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [sipo, sipo_rclk]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: mdio
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [mdio]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: uart
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
items:
|
||||
enum: [hsuart, hsuart_cts_rts]
|
||||
maxItems: 2
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: jtag
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [jtag_udi, jtag_dfd]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: pcm
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [pcm1, pcm2]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: spi
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
items:
|
||||
enum: [spi_quad, spi_cs1]
|
||||
maxItems: 2
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: pnand
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [pnand]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: gpio
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio28, gpio29, gpio30, gpio31, gpio32,
|
||||
gpio33, gpio34, gpio35, gpio36, gpio37]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: pcie_reset
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [pcie_reset0, pcie_reset1]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: pwm
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6,
|
||||
gpio7, gpio8, gpio9, gpio10, gpio11, gpio12, gpio13,
|
||||
gpio14, gpio15, gpio16, gpio17, gpio18, gpio19,
|
||||
gpio20, gpio21, gpio22, gpio23, gpio24, gpio25,
|
||||
gpio26, gpio27, gpio28, gpio29, gpio30, gpio31,
|
||||
gpio36, gpio37]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy1_led0
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio8, gpio9, gpio10, gpio11]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy2_led0
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio8, gpio9, gpio10, gpio11]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy3_led0
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio8, gpio9, gpio10, gpio11]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy4_led0
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio8, gpio9, gpio10, gpio11]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy1_led1
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio4, gpio5, gpio6, gpio7]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy2_led1
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio4, gpio5, gpio6, gpio7]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy3_led1
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio4, gpio5, gpio6, gpio7]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy4_led1
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio4, gpio5, gpio6, gpio7]
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
'^conf(-|$)':
|
||||
type: object
|
||||
|
||||
description:
|
||||
pinconf configuration nodes.
|
||||
|
||||
$ref: /schemas/pinctrl/pincfg-node.yaml
|
||||
|
||||
properties:
|
||||
pins:
|
||||
description:
|
||||
An array of strings. Each string contains the name of a pin.
|
||||
items:
|
||||
enum: [gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6, gpio7,
|
||||
gpio8, gpio9, gpio10, gpio11, gpio12, gpio13, gpio14,
|
||||
gpio15, gpio16, gpio17, gpio18, gpio19, gpio20, gpio21,
|
||||
gpio22, gpio23, gpio24, gpio25, gpio26, gpio27,
|
||||
pcie_reset0, pcie_reset1, i2c_scl, i2c_sda, spi_clk,
|
||||
spi_cs, spi_mosi, spi_miso, uart_txd, uart_rxd]
|
||||
minItems: 1
|
||||
maxItems: 38
|
||||
|
||||
bias-disable: true
|
||||
|
||||
bias-pull-up: true
|
||||
|
||||
bias-pull-down: true
|
||||
|
||||
input-enable: true
|
||||
|
||||
output-enable: true
|
||||
|
||||
output-low: true
|
||||
|
||||
output-high: true
|
||||
|
||||
drive-open-drain: true
|
||||
|
||||
drive-strength:
|
||||
description:
|
||||
Selects the drive strength for MIO pins, in mA.
|
||||
enum: [2, 4, 6, 8]
|
||||
|
||||
required:
|
||||
- pins
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
|
||||
pinctrl {
|
||||
compatible = "airoha,an7563-pinctrl";
|
||||
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
|
||||
gpio-ranges = <&pinctrl 0 0 38>;
|
||||
|
||||
pcie1-rst-pins {
|
||||
conf {
|
||||
pins = "pcie_reset1";
|
||||
drive-open-drain = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
pwm-pins {
|
||||
mux {
|
||||
function = "pwm";
|
||||
groups = "gpio18";
|
||||
};
|
||||
};
|
||||
|
||||
spi-pins {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi_quad", "spi_cs1";
|
||||
};
|
||||
};
|
||||
|
||||
hsuart-pins {
|
||||
mux {
|
||||
function = "uart";
|
||||
groups = "hsuart", "hsuart_cts_rts";
|
||||
};
|
||||
};
|
||||
|
||||
mdio-pins {
|
||||
mux {
|
||||
function = "mdio";
|
||||
groups = "mdio";
|
||||
};
|
||||
|
||||
conf {
|
||||
pins = "gpio2";
|
||||
output-enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -60,8 +60,8 @@ patternProperties:
|
||||
function:
|
||||
description:
|
||||
A string containing the name of the function to mux to the group.
|
||||
enum: [pon, tod_1pps, sipo, mdio, uart, i2c, jtag, pcm, spi,
|
||||
pcm_spi, i2s, emmc, pnand, pcie_reset, pwm, phy1_led0,
|
||||
enum: [pon, olt, tod_1pps, sipo, mdio, uart, i2c, jtag, pcm, spi,
|
||||
pcm_spi, emmc, pnand, gpio, pcie_reset, pwm, phy1_led0,
|
||||
phy2_led0, phy3_led0, phy4_led0, phy1_led1, phy2_led1,
|
||||
phy3_led1, phy4_led1]
|
||||
|
||||
@@ -81,7 +81,15 @@ patternProperties:
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [pon]
|
||||
enum: [pon, pon_alt]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: olt
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [olt]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
@@ -115,7 +123,7 @@ patternProperties:
|
||||
groups:
|
||||
items:
|
||||
enum: [uart2, uart2_cts_rts, hsuart, hsuart_cts_rts,
|
||||
uart4, uart5]
|
||||
uart4, uart5, npu_uart]
|
||||
maxItems: 2
|
||||
- if:
|
||||
properties:
|
||||
@@ -124,7 +132,7 @@ patternProperties:
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [i2c1]
|
||||
enum: [i2c0, i2c1]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
@@ -159,17 +167,8 @@ patternProperties:
|
||||
properties:
|
||||
groups:
|
||||
items:
|
||||
enum: [pcm_spi, pcm_spi_int, pcm_spi_rst, pcm_spi_cs1,
|
||||
pcm_spi_cs2, pcm_spi_cs3, pcm_spi_cs4]
|
||||
maxItems: 7
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: i2c
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [i2s]
|
||||
enum: [pcm_spi, pcm_spi_rst, pcm_spi_cs1]
|
||||
maxItems: 3
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
@@ -186,6 +185,16 @@ patternProperties:
|
||||
properties:
|
||||
groups:
|
||||
enum: [pnand]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: gpio
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio39, gpio40, gpio41, gpio42, gpio43, gpio44,
|
||||
gpio45, gpio46, gpio47, gpio48, gpio49, gpio50,
|
||||
gpio51, gpio52]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
@@ -207,7 +216,8 @@ patternProperties:
|
||||
gpio20, gpio21, gpio22, gpio23, gpio24, gpio25,
|
||||
gpio26, gpio27, gpio28, gpio29, gpio30, gpio31,
|
||||
gpio36, gpio37, gpio38, gpio39, gpio40, gpio41,
|
||||
gpio42, gpio43, gpio44, gpio45, gpio46, gpio47]
|
||||
gpio42, gpio43, gpio44, gpio45, gpio46, gpio47,
|
||||
gpio48, gpio49, gpio50, gpio51]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
@@ -288,17 +298,16 @@ patternProperties:
|
||||
description:
|
||||
An array of strings. Each string contains the name of a pin.
|
||||
items:
|
||||
enum: [uart1_txd, uart1_rxd, i2c_scl, i2c_sda, spi_cs0, spi_clk,
|
||||
spi_mosi, spi_miso, gpio0, gpio1, gpio2, gpio3, gpio4,
|
||||
gpio5, gpio6, gpio7, gpio8, gpio9, gpio10, gpio11, gpio12,
|
||||
gpio13, gpio14, gpio15, gpio16, gpio17, gpio18, gpio19,
|
||||
gpio20, gpio21, gpio22, gpio23, gpio24, gpio25, gpio26,
|
||||
gpio27, gpio28, gpio29, gpio30, gpio31, gpio32, gpio33,
|
||||
gpio34, gpio35, gpio36, gpio37, gpio38, gpio39, gpio40,
|
||||
gpio41, gpio42, gpio43, gpio44, gpio45, gpio46,
|
||||
pcie_reset0, pcie_reset1, pcie_reset2]
|
||||
enum: [gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6, gpio7,
|
||||
gpio8, gpio9, gpio10, gpio11, gpio12, gpio13, gpio14,
|
||||
gpio15, gpio16, gpio17, gpio18, gpio19, gpio20, gpio21,
|
||||
gpio22, gpio23, gpio24, gpio25, gpio26, gpio27, gpio28,
|
||||
gpio29, gpio30, gpio31, gpio32, gpio33, gpio34, gpio35,
|
||||
gpio36, gpio37, gpio38, i2c0_scl, i2c0_sda, i2c1_scl,
|
||||
i2c1_sda, spi_clk, spi_cs, spi_mosi, spi_miso, uart_txd,
|
||||
uart_rxd, pcie_reset0, pcie_reset1, mdc_0, mdio_0]
|
||||
minItems: 1
|
||||
maxItems: 58
|
||||
maxItems: 53
|
||||
|
||||
bias-disable: true
|
||||
|
||||
@@ -346,6 +355,8 @@ examples:
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
|
||||
gpio-ranges = <&pinctrl 0 2 53>;
|
||||
|
||||
pcie1-rst-pins {
|
||||
conf {
|
||||
pins = "pcie_reset1";
|
||||
|
||||
@@ -0,0 +1,378 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/airoha,en7523-pinctrl.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Airoha EN7523 Pin Controller
|
||||
|
||||
maintainers:
|
||||
- Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
|
||||
description:
|
||||
The Airoha's EN7523 Pin controller is used to control SoC pins.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: airoha,en7523-pinctrl
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
gpio-controller: true
|
||||
|
||||
'#gpio-cells':
|
||||
const: 2
|
||||
|
||||
gpio-ranges:
|
||||
maxItems: 1
|
||||
|
||||
interrupt-controller: true
|
||||
|
||||
'#interrupt-cells':
|
||||
const: 2
|
||||
|
||||
allOf:
|
||||
- $ref: pinctrl.yaml#
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- interrupts
|
||||
- gpio-controller
|
||||
- gpio-ranges
|
||||
- "#gpio-cells"
|
||||
- interrupt-controller
|
||||
- "#interrupt-cells"
|
||||
|
||||
patternProperties:
|
||||
'-pins$':
|
||||
type: object
|
||||
|
||||
patternProperties:
|
||||
'^mux(-|$)':
|
||||
type: object
|
||||
|
||||
description:
|
||||
pinmux configuration nodes.
|
||||
|
||||
$ref: /schemas/pinctrl/pinmux-node.yaml
|
||||
|
||||
properties:
|
||||
function:
|
||||
description:
|
||||
A string containing the name of the function to mux to the group.
|
||||
enum: [pon, tod_1pps, sipo, mdio, uart, i2c, jtag, pcm, spi,
|
||||
pcm_spi, i2s, gpio, pcie_reset, pwm, phy1_led0,
|
||||
phy2_led0, phy3_led0, phy4_led0, phy1_led1, phy2_led1,
|
||||
phy3_led1, phy4_led1]
|
||||
|
||||
groups:
|
||||
description:
|
||||
An array of strings. Each string contains the name of a group.
|
||||
|
||||
required:
|
||||
- function
|
||||
- groups
|
||||
|
||||
allOf:
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: pon
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [pon]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: tod_1pps
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [pon_tod_1pps, gsw_tod_1pps]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: sipo
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [sipo, sipo_rclk]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: mdio
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [mdio]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: uart
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
items:
|
||||
enum: [uart2, npu_uart]
|
||||
maxItems: 2
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: i2c
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [i2c1]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: jtag
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [jtag_udi, jtag_dfd]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: pcm
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [pcm1, pcm2]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: spi
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
items:
|
||||
enum: [spi_quad, spi_cs1]
|
||||
maxItems: 2
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: pcm_spi
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
items:
|
||||
enum: [pcm_spi, pcm_spi_int, pcm_spi_rst, pcm_spi_cs1,
|
||||
pcm_spi_cs2_p156, pcm_spi_cs2_p128, pcm_spi_cs3,
|
||||
pcm_spi_cs4]
|
||||
maxItems: 7
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: i2s
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [i2s]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: gpio
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio28, gpio29]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: pcie_reset
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [pcie_reset0, pcie_reset1]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: pwm
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6,
|
||||
gpio7, gpio8, gpio9, gpio10, gpio11, gpio12, gpio13,
|
||||
gpio14, gpio15, gpio16, gpio17, gpio18, gpio19,
|
||||
gpio20, gpio21, gpio22, gpio23, gpio24, gpio25,
|
||||
gpio26, gpio27, gpio28, gpio29]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy1_led0
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio22, gpio23, gpio24, gpio25]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy2_led0
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio22, gpio23, gpio24, gpio25]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy3_led0
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio22, gpio23, gpio24, gpio25]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy4_led0
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio22, gpio23, gpio24, gpio25]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy1_led1
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio7, gpio6, gpio5, gpio4]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy2_led1
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio7, gpio6, gpio5, gpio4]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy3_led1
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio7, gpio6, gpio5, gpio4]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: phy4_led1
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio7, gpio6, gpio5, gpio4]
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
'^conf(-|$)':
|
||||
type: object
|
||||
|
||||
description:
|
||||
pinconf configuration nodes.
|
||||
|
||||
$ref: /schemas/pinctrl/pincfg-node.yaml
|
||||
|
||||
properties:
|
||||
pins:
|
||||
description:
|
||||
An array of strings. Each string contains the name of a pin.
|
||||
items:
|
||||
enum: [i2c_sda, i2c_scl, spi_cs0, spi_clk, spi_mosi, spi_miso,
|
||||
uart1_txd, uart1_rxd, gpio0, gpio1, gpio2, gpio3, gpio4,
|
||||
gpio5, gpio6, gpio7, gpio8, gpio9, gpio10, gpio11, gpio12,
|
||||
gpio13, gpio14, gpio15, gpio16, gpio17, gpio18, gpio19,
|
||||
gpio20, gpio21, gpio22, gpio23, gpio24, gpio25, gpio26,
|
||||
gpio27, pcie_reset0, pcie_reset1]
|
||||
minItems: 1
|
||||
maxItems: 38
|
||||
|
||||
bias-disable: true
|
||||
|
||||
bias-pull-up: true
|
||||
|
||||
bias-pull-down: true
|
||||
|
||||
input-enable: true
|
||||
|
||||
output-enable: true
|
||||
|
||||
output-low: true
|
||||
|
||||
output-high: true
|
||||
|
||||
drive-open-drain: true
|
||||
|
||||
drive-strength:
|
||||
description:
|
||||
Selects the drive strength for MIO pins, in mA.
|
||||
enum: [2, 4, 6, 8]
|
||||
|
||||
required:
|
||||
- pins
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
|
||||
pinctrl {
|
||||
compatible = "airoha,en7523-pinctrl";
|
||||
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
|
||||
gpio-ranges = <&pinctrl 0 12 30>;
|
||||
|
||||
pcie1-rst-pins {
|
||||
conf {
|
||||
pins = "pcie_reset1";
|
||||
drive-open-drain = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
pwm-pins {
|
||||
mux {
|
||||
function = "pwm";
|
||||
groups = "gpio18";
|
||||
};
|
||||
};
|
||||
|
||||
spi-pins {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi_quad", "spi_cs1";
|
||||
};
|
||||
};
|
||||
|
||||
uart2-pins {
|
||||
mux {
|
||||
function = "uart";
|
||||
groups = "uart2";
|
||||
};
|
||||
};
|
||||
|
||||
mdio-pins {
|
||||
mux {
|
||||
function = "mdio";
|
||||
groups = "mdio";
|
||||
};
|
||||
|
||||
conf {
|
||||
pins = "gpio2";
|
||||
output-enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -61,7 +61,7 @@ patternProperties:
|
||||
description:
|
||||
A string containing the name of the function to mux to the group.
|
||||
enum: [pon, tod_1pps, sipo, mdio, uart, i2c, jtag, pcm, spi,
|
||||
pcm_spi, i2s, emmc, pnand, pcie_reset, pwm, phy1_led0,
|
||||
pcm_spi, i2s, emmc, pnand, gpio, pcie_reset, pwm, phy1_led0,
|
||||
phy2_led0, phy3_led0, phy4_led0, phy1_led1, phy2_led1,
|
||||
phy3_led1, phy4_led1]
|
||||
|
||||
@@ -166,7 +166,7 @@ patternProperties:
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: i2c
|
||||
const: i2s
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
@@ -187,6 +187,14 @@ patternProperties:
|
||||
properties:
|
||||
groups:
|
||||
enum: [pnand]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: gpio
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [gpio47, gpio48, gpio49]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
@@ -208,7 +216,8 @@ patternProperties:
|
||||
gpio20, gpio21, gpio22, gpio23, gpio24, gpio25,
|
||||
gpio26, gpio27, gpio28, gpio29, gpio30, gpio31,
|
||||
gpio36, gpio37, gpio38, gpio39, gpio40, gpio41,
|
||||
gpio42, gpio43, gpio44, gpio45, gpio46, gpio47]
|
||||
gpio42, gpio43, gpio44, gpio45, gpio46, gpio47,
|
||||
gpio48, gpio49]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
@@ -347,6 +356,8 @@ examples:
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
|
||||
gpio-ranges = <&pinctrl 0 13 50>;
|
||||
|
||||
pcie1-rst-pins {
|
||||
conf {
|
||||
pins = "pcie_reset1";
|
||||
|
||||
@@ -20,6 +20,8 @@ properties:
|
||||
- items:
|
||||
- enum:
|
||||
- apple,t6020-pinctrl
|
||||
- apple,t6030-pinctrl
|
||||
- apple,t6031-pinctrl
|
||||
- apple,t8122-pinctrl
|
||||
- const: apple,t8103-pinctrl
|
||||
- items:
|
||||
|
||||
@@ -356,6 +356,7 @@ patternProperties:
|
||||
- I3C8
|
||||
- I3C9
|
||||
- JTAGM1
|
||||
- JTAGM1TRST
|
||||
- LPC0
|
||||
- LPC1
|
||||
- LTPI
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/mediatek,mt6858-pinctrl.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: MediaTek MT6858 Pin Controller
|
||||
|
||||
maintainers:
|
||||
- Nikolai Burov <nikolai.burov@jolla.com>
|
||||
|
||||
description:
|
||||
The MediaTek's MT6858 Pin controller is used to control SoC pins.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: mediatek,mt6858-pinctrl
|
||||
|
||||
reg:
|
||||
items:
|
||||
- description: gpio base
|
||||
- description: lm group IO
|
||||
- description: rb group IO
|
||||
- description: bm2 group IO
|
||||
- description: bm group IO
|
||||
- description: bm1 group IO
|
||||
- description: lt group IO
|
||||
- description: lt1 group IO
|
||||
- description: rt group IO
|
||||
- description: rt1 group IO
|
||||
- description: eint south group IO
|
||||
- description: eint west group IO
|
||||
- description: eint east group IO
|
||||
- description: eint center group IO
|
||||
|
||||
reg-names:
|
||||
items:
|
||||
- const: base
|
||||
- const: lm
|
||||
- const: rb
|
||||
- const: bm2
|
||||
- const: bm
|
||||
- const: bm1
|
||||
- const: lt
|
||||
- const: lt1
|
||||
- const: rt
|
||||
- const: rt1
|
||||
- const: eint0
|
||||
- const: eint1
|
||||
- const: eint2
|
||||
- const: eint3
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
interrupt-controller: true
|
||||
|
||||
'#interrupt-cells':
|
||||
const: 2
|
||||
|
||||
gpio-controller: true
|
||||
|
||||
'#gpio-cells':
|
||||
const: 2
|
||||
|
||||
gpio-ranges:
|
||||
maxItems: 1
|
||||
|
||||
gpio-line-names: true
|
||||
|
||||
# PIN CONFIGURATION NODES
|
||||
patternProperties:
|
||||
'-pins$':
|
||||
type: object
|
||||
additionalProperties: false
|
||||
|
||||
patternProperties:
|
||||
'^pins':
|
||||
type: object
|
||||
$ref: /schemas/pinctrl/pincfg-node.yaml
|
||||
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.
|
||||
|
||||
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 arch/arm64/boot/dts/mediatek/mt6858-pinfunc.h
|
||||
for this SoC.
|
||||
|
||||
drive-strength:
|
||||
enum: [2, 4, 6, 8, 10, 12, 14, 16]
|
||||
|
||||
bias-pull-down:
|
||||
oneOf:
|
||||
- type: boolean
|
||||
description: normal pull down.
|
||||
- enum: [100, 101, 102, 103]
|
||||
description: PUPD/R1/R0 pull down type. See MTK_PUPD_SET_R1R0_
|
||||
defines in dt-bindings/pinctrl/mt65xx.h.
|
||||
- enum: [200, 201, 202, 203]
|
||||
description: RSEL pull down type. See MTK_PULL_SET_RSEL_ defines
|
||||
in dt-bindings/pinctrl/mt65xx.h.
|
||||
|
||||
bias-pull-up:
|
||||
oneOf:
|
||||
- type: boolean
|
||||
description: normal pull up.
|
||||
- enum: [100, 101, 102, 103]
|
||||
description: PUPD/R1/R0 pull up type. See MTK_PUPD_SET_R1R0_
|
||||
defines in dt-bindings/pinctrl/mt65xx.h.
|
||||
- enum: [200, 201, 202, 203]
|
||||
description: RSEL pull up type. See MTK_PULL_SET_RSEL_ defines
|
||||
in dt-bindings/pinctrl/mt65xx.h.
|
||||
|
||||
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
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- interrupts
|
||||
- interrupt-controller
|
||||
- '#interrupt-cells'
|
||||
- gpio-controller
|
||||
- '#gpio-cells'
|
||||
- gpio-ranges
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/pinctrl/mt65xx.h>
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
#define PINMUX_GPIO149__FUNC_SCL5 (MTK_PIN_NO(149) | 1)
|
||||
#define PINMUX_GPIO150__FUNC_SDA5 (MTK_PIN_NO(150) | 1)
|
||||
|
||||
pio: pinctrl@10005000 {
|
||||
compatible = "mediatek,mt6858-pinctrl";
|
||||
reg = <0x10005000 0x1000>,
|
||||
<0x11b20000 0x1000>,
|
||||
<0x11c10000 0x1000>,
|
||||
<0x11d10000 0x1000>,
|
||||
<0x11d30000 0x1000>,
|
||||
<0x11d40000 0x1000>,
|
||||
<0x11e20000 0x1000>,
|
||||
<0x11e30000 0x1000>,
|
||||
<0x11ed0000 0x1000>,
|
||||
<0x11ee0000 0x1000>,
|
||||
<0x11b00000 0x1000>,
|
||||
<0x11e60000 0x1000>,
|
||||
<0x11e80000 0x1000>,
|
||||
<0x1c01e000 0x1000>;
|
||||
reg-names = "base", "lm", "rb", "bm2", "bm", "bm1", "lt", "lt1",
|
||||
"rt", "rt1", "eint0", "eint1", "eint2", "eint3";
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
gpio-ranges = <&pio 0 0 197>;
|
||||
interrupt-controller;
|
||||
interrupts = <GIC_SPI 239 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
#interrupt-cells = <2>;
|
||||
|
||||
i2c5-pins {
|
||||
pins {
|
||||
pinmux = <PINMUX_GPIO149__FUNC_SCL5>,
|
||||
<PINMUX_GPIO150__FUNC_SDA5>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -65,6 +65,11 @@ then:
|
||||
- "#interrupt-cells"
|
||||
|
||||
patternProperties:
|
||||
"-hog(-[0-9]+)?$":
|
||||
type: object
|
||||
required:
|
||||
- gpio-hog
|
||||
|
||||
'-pins(-[a-z]+)?$':
|
||||
type: object
|
||||
additionalProperties: false
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
* Microchip PIC32 Pin Controller
|
||||
|
||||
Please refer to pinctrl-bindings.txt, ../gpio/gpio.txt, and
|
||||
../interrupt-controller/interrupts.txt for generic information regarding
|
||||
pin controller, GPIO, and interrupt bindings.
|
||||
|
||||
PIC32 'pin configuration node' is a node of a group of pins which can be
|
||||
used for a specific device or function. This node represents configurations of
|
||||
pins, optional function, and optional mux related configuration.
|
||||
|
||||
Required properties for pin controller node:
|
||||
- compatible: "microchip,pic32mada-pinctrl"
|
||||
- reg: Address range of the pinctrl registers.
|
||||
- clocks: Clock specifier (see clock bindings for details)
|
||||
|
||||
Required properties for pin configuration sub-nodes:
|
||||
- pins: List of pins to which the configuration applies.
|
||||
|
||||
Optional properties for pin configuration sub-nodes:
|
||||
----------------------------------------------------
|
||||
- function: Mux function for the specified pins.
|
||||
- bias-pull-up: Enable weak pull-up.
|
||||
- bias-pull-down: Enable weak pull-down.
|
||||
- input-enable: Set the pin as an input.
|
||||
- output-low: Set the pin as an output level low.
|
||||
- output-high: Set the pin as an output level high.
|
||||
- microchip,digital: Enable digital I/O.
|
||||
- microchip,analog: Enable analog I/O.
|
||||
|
||||
Example:
|
||||
|
||||
pic32_pinctrl: pinctrl@1f801400{
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "microchip,pic32mzda-pinctrl";
|
||||
reg = <0x1f801400 0x400>;
|
||||
clocks = <&rootclk PB1CLK>;
|
||||
|
||||
pinctrl_uart2: pinctrl_uart2 {
|
||||
uart2-tx {
|
||||
pins = "G9";
|
||||
function = "U2TX";
|
||||
microchip,digital;
|
||||
output-low;
|
||||
};
|
||||
uart2-rx {
|
||||
pins = "B0";
|
||||
function = "U2RX";
|
||||
microchip,digital;
|
||||
input-enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
uart2: serial@1f822200 {
|
||||
compatible = "microchip,pic32mzda-uart";
|
||||
reg = <0x1f822200 0x50>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_uart2>;
|
||||
};
|
||||
@@ -0,0 +1,109 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/microchip,pic32mzda-pinctrl.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Microchip PIC32 Pin Controller
|
||||
|
||||
maintainers:
|
||||
- Linus Walleij <linusw@kernel.org>
|
||||
|
||||
description:
|
||||
PIC32 pin configuration node is a node of a group of pins which can be used
|
||||
for a specific device or function. This node represents configurations of
|
||||
pins, optional function, and optional mux related configuration.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: microchip,pic32mzda-pinctrl
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
clocks:
|
||||
maxItems: 1
|
||||
|
||||
$defs:
|
||||
pin-node:
|
||||
type: object
|
||||
allOf:
|
||||
- $ref: /schemas/pinctrl/pincfg-node.yaml#
|
||||
- $ref: /schemas/pinctrl/pinmux-node.yaml#
|
||||
|
||||
properties:
|
||||
pins:
|
||||
description: List of pins to which the configuration applies.
|
||||
items:
|
||||
type: string
|
||||
minItems: 1
|
||||
|
||||
function: true
|
||||
|
||||
bias-pull-up: true
|
||||
bias-pull-down: true
|
||||
input-enable: true
|
||||
output-low: true
|
||||
output-high: true
|
||||
|
||||
microchip,digital:
|
||||
description: Enable digital I/O.
|
||||
type: boolean
|
||||
|
||||
microchip,analog:
|
||||
description: Enable analog I/O.
|
||||
type: boolean
|
||||
|
||||
required:
|
||||
- pins
|
||||
|
||||
unevaluatedProperties: false
|
||||
|
||||
additionalProperties:
|
||||
oneOf:
|
||||
- additionalProperties:
|
||||
$ref: '#/$defs/pin-node'
|
||||
- $ref: '#/$defs/pin-node'
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- clocks
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/clock/microchip,pic32-clock.h>
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
|
||||
pic32_pinctrl: pinctrl@1f801400 {
|
||||
compatible = "microchip,pic32mzda-pinctrl";
|
||||
reg = <0x1f801400 0x400>;
|
||||
clocks = <&rootclk PB1CLK>;
|
||||
|
||||
pinctrl_uart2: pinctrl_uart2 {
|
||||
uart2-tx {
|
||||
pins = "G9";
|
||||
function = "U2TX";
|
||||
microchip,digital;
|
||||
output-low;
|
||||
};
|
||||
|
||||
uart2-rx {
|
||||
pins = "B0";
|
||||
function = "U2RX";
|
||||
microchip,digital;
|
||||
input-enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
uart2: serial@1f822200 {
|
||||
compatible = "microchip,pic32mzda-uart";
|
||||
reg = <0x1f822200 0x50>;
|
||||
interrupts = <145 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<146 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<147 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&rootclk PB2CLK>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_uart2>;
|
||||
};
|
||||
@@ -44,7 +44,7 @@ patternProperties:
|
||||
soc_gpio173_pu3, soc_gpio174_pu4, soc_gpio175_pu5,
|
||||
soc_gpio176_pu6, soc_gpio177_pu7, soc_gpio178_pv0,
|
||||
pwm10_pv1, uart4_tx_pv2, uart4_rx_pv3, uart4_rts_n_pv4,
|
||||
uart4_cts_n_pv5, dap2_clk_pv6, dap2_din_pv7, dap2_dout_pw0,
|
||||
uart4_cts_n_pv5, dap2_clk_pv6, dap2_din_pw0, dap2_dout_pv7,
|
||||
dap2_fs_pw1, gen1_i2c_scl_pw2, gen1_i2c_sda_pw3,
|
||||
gen0_i2c_scl_pw4, gen0_i2c_sda_pw5, pwr_i2c_scl_pw6,
|
||||
pwr_i2c_sda_pw7, soc_gpio138_pp0, soc_gpio139_pp1,
|
||||
@@ -111,8 +111,8 @@ patternProperties:
|
||||
drive_soc_gpio351_ps1, drive_gen0_i2c_scl_pw4,
|
||||
drive_gen0_i2c_sda_pw5, drive_gen1_i2c_scl_pw2,
|
||||
drive_gen1_i2c_sda_pw3, drive_dap2_fs_pw1,
|
||||
drive_dap2_clk_pv6, drive_dap2_din_pv7,
|
||||
drive_dap2_dout_pw0, drive_pwm10_pv1,
|
||||
drive_dap2_clk_pv6, drive_dap2_din_pw0,
|
||||
drive_dap2_dout_pv7, drive_pwm10_pv1,
|
||||
drive_soc_gpio170_pu0, drive_soc_gpio171_pu1,
|
||||
drive_soc_gpio172_pu2, drive_soc_gpio173_pu3,
|
||||
drive_soc_gpio174_pu4, drive_soc_gpio175_pu5,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
# Copyright 2022 NXP
|
||||
# Copyright 2022, 2026 NXP
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/nxp,s32g2-siul2-pinctrl.yaml#
|
||||
@@ -17,8 +17,10 @@ description: |
|
||||
SIUL2_0 @ 0x4009c000
|
||||
SIUL2_1 @ 0x44010000
|
||||
|
||||
Every SIUL2 region has multiple register types, and here only MSCR and
|
||||
IMCR registers need to be revealed for kernel to configure pinmux.
|
||||
Every SIUL2 region has multiple register types. MSCR and IMCR registers
|
||||
need to be revealed for kernel to configure pinmux. PGPDO and PGPDI
|
||||
registers are used for GPIO output/input operations. EIRQ registers
|
||||
are used for external interrupt configuration.
|
||||
|
||||
Please note that some register indexes are reserved in S32G2, such as
|
||||
MSCR102-MSCR111, MSCR123-MSCR143, IMCR84-IMCR118 and IMCR398-IMCR429.
|
||||
@@ -29,14 +31,22 @@ properties:
|
||||
- nxp,s32g2-siul2-pinctrl
|
||||
|
||||
reg:
|
||||
minItems: 6
|
||||
description: |
|
||||
A list of MSCR/IMCR register regions to be reserved.
|
||||
A list of MSCR/IMCR/PGPDO/PGPDI/EIRQ register regions to be reserved.
|
||||
- MSCR (Multiplexed Signal Configuration Register)
|
||||
An MSCR register can configure the associated pin as either a GPIO pin
|
||||
or a function output pin depends on the selected signal source.
|
||||
- IMCR (Input Multiplexed Signal Configuration Register)
|
||||
An IMCR register can configure the associated pin as function input
|
||||
pin depends on the selected signal source.
|
||||
- PGPDO (Parallel GPIO Pad Data Out Register)
|
||||
A PGPDO register is used to set the output value of a GPIO pin.
|
||||
- PGPDI (Parallel GPIO Pad Data In Register)
|
||||
A PGPDI register is used to read the input value of a GPIO pin.
|
||||
- EIRQ (External Interrupt Request)
|
||||
EIRQ registers are used to configure and manage external interrupts.
|
||||
|
||||
items:
|
||||
- description: MSCR registers group 0 in SIUL2_0
|
||||
- description: MSCR registers group 1 in SIUL2_1
|
||||
@@ -44,6 +54,28 @@ properties:
|
||||
- description: IMCR registers group 0 in SIUL2_0
|
||||
- description: IMCR registers group 1 in SIUL2_1
|
||||
- description: IMCR registers group 2 in SIUL2_1
|
||||
- description: PGPDO registers in SIUL2_0
|
||||
- description: PGPDI registers in SIUL2_0
|
||||
- description: PGPDO registers in SIUL2_1
|
||||
- description: PGPDI registers in SIUL2_1
|
||||
- description: EIRQ registers in SIUL2_1
|
||||
|
||||
gpio-controller: true
|
||||
|
||||
"#gpio-cells":
|
||||
const: 2
|
||||
|
||||
gpio-ranges:
|
||||
minItems: 1
|
||||
maxItems: 4
|
||||
|
||||
interrupt-controller: true
|
||||
|
||||
"#interrupt-cells":
|
||||
const: 2
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
patternProperties:
|
||||
'-pins$':
|
||||
@@ -86,11 +118,38 @@ required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
oneOf:
|
||||
- description: Legacy pinctrl-only node
|
||||
properties:
|
||||
reg:
|
||||
maxItems: 6
|
||||
|
||||
gpio-controller: false
|
||||
"#gpio-cells": false
|
||||
gpio-ranges: false
|
||||
interrupt-controller: false
|
||||
"#interrupt-cells": false
|
||||
interrupts: false
|
||||
|
||||
- description: Pinctrl node with GPIO and external interrupt support
|
||||
required:
|
||||
- gpio-controller
|
||||
- "#gpio-cells"
|
||||
- gpio-ranges
|
||||
- interrupt-controller
|
||||
- "#interrupt-cells"
|
||||
- interrupts
|
||||
properties:
|
||||
reg:
|
||||
minItems: 11
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
pinctrl@4009c240 {
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
|
||||
pinctrl: pinctrl@4009c240 {
|
||||
compatible = "nxp,s32g2-siul2-pinctrl";
|
||||
|
||||
/* MSCR0-MSCR101 registers on siul2_0 */
|
||||
@@ -104,7 +163,26 @@ examples:
|
||||
/* IMCR119-IMCR397 registers on siul2_1 */
|
||||
<0x44010c1c 0x45c>,
|
||||
/* IMCR430-IMCR495 registers on siul2_1 */
|
||||
<0x440110f8 0x108>;
|
||||
<0x440110f8 0x108>,
|
||||
/* PGPDO registers on siul2_0 */
|
||||
<0x4009d700 0x10>,
|
||||
/* PGPDI registers on siul2_0 */
|
||||
<0x4009d740 0x10>,
|
||||
/* PGPDO registers on siul2_1 */
|
||||
<0x44011700 0x18>,
|
||||
/* PGPDI registers on siul2_1 */
|
||||
<0x44011740 0x18>,
|
||||
/* EIRQ registers on siul2_1 */
|
||||
<0x44010010 0x34>;
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
gpio-ranges = <&pinctrl 0 0 102>,
|
||||
<&pinctrl 112 112 79>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
interrupts = <GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
llce-can0-pins {
|
||||
llce-can0-grp0 {
|
||||
|
||||
120
Documentation/devicetree/bindings/pinctrl/qcom,maili-tlmm.yaml
Normal file
120
Documentation/devicetree/bindings/pinctrl/qcom,maili-tlmm.yaml
Normal file
@@ -0,0 +1,120 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/qcom,maili-tlmm.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Qualcomm Technologies, Inc. Maili TLMM block
|
||||
|
||||
maintainers:
|
||||
- Jingyi Wang <jingyi.wang@oss.qualcomm.com>
|
||||
|
||||
description:
|
||||
Top Level Mode Multiplexer pin controller in Qualcomm Maili SoC.
|
||||
|
||||
allOf:
|
||||
- $ref: /schemas/pinctrl/qcom,tlmm-common.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: qcom,maili-tlmm
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
gpio-reserved-ranges:
|
||||
minItems: 1
|
||||
maxItems: 113
|
||||
|
||||
gpio-line-names:
|
||||
maxItems: 226
|
||||
|
||||
patternProperties:
|
||||
"-state$":
|
||||
oneOf:
|
||||
- $ref: "#/$defs/qcom-maili-tlmm-state"
|
||||
- patternProperties:
|
||||
"-pins$":
|
||||
$ref: "#/$defs/qcom-maili-tlmm-state"
|
||||
additionalProperties: false
|
||||
|
||||
$defs:
|
||||
qcom-maili-tlmm-state:
|
||||
type: object
|
||||
description:
|
||||
Pinctrl node's client devices use subnodes for desired pin configuration.
|
||||
Client device subnodes use below standard properties.
|
||||
$ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state
|
||||
unevaluatedProperties: false
|
||||
|
||||
properties:
|
||||
pins:
|
||||
description:
|
||||
List of gpio pins affected by the properties specified in this
|
||||
subnode.
|
||||
items:
|
||||
oneOf:
|
||||
- pattern: "^gpio([0-9]|[1-9][0-9]|1[0-9][0-9]|20[0-9]|21[0-9]|22[0-5])$"
|
||||
- enum: [ ufs_reset, sdc2_clk, sdc2_cmd, sdc2_data ]
|
||||
minItems: 1
|
||||
maxItems: 36
|
||||
|
||||
function:
|
||||
description:
|
||||
Specify the alternative function to be configured for the specified
|
||||
pins.
|
||||
enum: [ gpio, aoss_cti, atest_char, atest_usb, audio_ext_mclk,
|
||||
audio_ref_clk, cam_mclk, cci_async_in, cci_i2c0, cci_i2c1,
|
||||
cci_i2c2, cci_i2c3, cci_timer, coex_espmi, coex_uart1_rx,
|
||||
coex_uart1_tx, dbg_out_clk, ddr_bist, ddr_pxi, dp_hot, egpio,
|
||||
gcc_gp, gnss_adc, host2wlan_sol, host_rst, i2chub0_se0,
|
||||
i2chub0_se1, i2chub0_se2, i2chub0_se3, i2chub0_se4, i2s0, i2s1,
|
||||
ibi_i3c, ibi_i3c_qup5_se0, jitter_bist, mdp_esync0, mdp_esync1,
|
||||
mdp_esync2, mdp_vsync, mdp_vsync_e, mdp_vsync_p, mdp_vsync0_out,
|
||||
mdp_vsync1_out, mdp_vsync2_out, mdp_vsync3_out, mdp_vsync5_out,
|
||||
modem_pps_in, modem_pps_out, nav_gpio, nav_gpio0, nav_gpio3,
|
||||
nav_rffe, pcie0_clk_req_n, pcie1_clk_req_n, pcie1_rst_n,
|
||||
phase_flag, pll_bist_sync, pll_clk_aux, qdss_cti, qlink, qspi,
|
||||
qspi_clk, qspi_cs, qup1_se0, qup1_se1, qup1_se2, qup1_se3,
|
||||
qup1_se4, qup1_se5, qup1_se6, qup1_se7, qup2_se0, qup2_se1,
|
||||
qup2_se2, qup2_se3, qup2_se4_01, qup2_se4_23, qup3_se0,
|
||||
qup3_se1, qup3_se2, qup3_se3, qup3_se4, qup3_se5, qup4_se0,
|
||||
qup4_se1, qup4_se2, qup4_se3_01, qup4_se3_23, qup4_se3_l3,
|
||||
qup4_se4_01, qup4_se4_23, qup4_se4_l3, qup5_se0, rng_rosc,
|
||||
sd_write_protect, sdc2_clk, sdc2_cmd, sdc2_data, sdc2_rclk,
|
||||
sdc4_clk, sdc4_cmd, sdc4_data, sys_throttle, tb_trig_sdc,
|
||||
tmess_rng, tsense_clm, tsense_pwm, uim0, uim1, usb0_hs, usb_phy,
|
||||
vfr, vsense_trigger_mirnat, wcn_sw ]
|
||||
|
||||
required:
|
||||
- pins
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
|
||||
tlmm: pinctrl@f100000 {
|
||||
compatible = "qcom,maili-tlmm";
|
||||
reg = <0x0f100000 0x300000>;
|
||||
interrupts = <GIC_ESPI 272 IRQ_TYPE_LEVEL_HIGH>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
gpio-ranges = <&tlmm 0 0 227>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
|
||||
qup-uart7-state {
|
||||
pins = "gpio62", "gpio63";
|
||||
function = "qup1_se7";
|
||||
};
|
||||
};
|
||||
...
|
||||
@@ -15,9 +15,12 @@ description:
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: qcom,milos-lpass-lpi-pinctrl
|
||||
enum:
|
||||
- qcom,eliza-lpass-lpi-pinctrl
|
||||
- qcom,milos-lpass-lpi-pinctrl
|
||||
|
||||
reg:
|
||||
minItems: 1
|
||||
items:
|
||||
- description: LPASS LPI TLMM Control and Status registers
|
||||
- description: LPASS LPI MCC registers
|
||||
@@ -74,6 +77,19 @@ $defs:
|
||||
allOf:
|
||||
- $ref: qcom,lpass-lpi-common.yaml#
|
||||
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
const: qcom,eliza-lpass-lpi-pinctrl
|
||||
then:
|
||||
properties:
|
||||
reg:
|
||||
maxItems: 1
|
||||
else:
|
||||
properties:
|
||||
reg:
|
||||
minItems: 2
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
@@ -62,6 +62,7 @@ properties:
|
||||
- qcom,pmc8380-gpio
|
||||
- qcom,pmcx0102-gpio
|
||||
- qcom,pmd8028-gpio
|
||||
- qcom,pmg1110-gpio
|
||||
- qcom,pmh0101-gpio
|
||||
- qcom,pmh0104-gpio
|
||||
- qcom,pmh0110-gpio
|
||||
@@ -155,6 +156,7 @@ allOf:
|
||||
- qcom,pm8450-gpio
|
||||
- qcom,pm8916-gpio
|
||||
- qcom,pmd8028-gpio
|
||||
- qcom,pmg1110-gpio
|
||||
- qcom,pmk8350-gpio
|
||||
- qcom,pmr735a-gpio
|
||||
- qcom,pmr735b-gpio
|
||||
@@ -496,6 +498,7 @@ $defs:
|
||||
- gpio1-gpio22 for pma8084
|
||||
- gpio1-gpio14 for pmcx0102
|
||||
- gpio1-gpio4 for pmd8028
|
||||
- gpio1-gpio4 for pmg1110
|
||||
- gpio1-gpio18 for pmh0101
|
||||
- gpio1-gpio8 for pmh0104
|
||||
- gpio1-gpio14 for pmh0110
|
||||
|
||||
@@ -51,6 +51,7 @@ properties:
|
||||
- rockchip,rk3576-pinctrl
|
||||
- rockchip,rk3588-pinctrl
|
||||
- rockchip,rv1103b-pinctrl
|
||||
- rockchip,rv1106-pinctrl
|
||||
- rockchip,rv1108-pinctrl
|
||||
- rockchip,rv1126-pinctrl
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ properties:
|
||||
- samsung,exynos7870-wakeup-eint
|
||||
- samsung,exynos7885-wakeup-eint
|
||||
- samsung,exynos850-wakeup-eint
|
||||
- samsung,exynos8855-wakeup-eint
|
||||
- samsung,exynos8890-wakeup-eint
|
||||
- samsung,exynos8895-wakeup-eint
|
||||
- const: samsung,exynos7-wakeup-eint
|
||||
|
||||
@@ -53,6 +53,7 @@ properties:
|
||||
- samsung,exynos7870-pinctrl
|
||||
- samsung,exynos7885-pinctrl
|
||||
- samsung,exynos850-pinctrl
|
||||
- samsung,exynos8855-pinctrl
|
||||
- samsung,exynos8890-pinctrl
|
||||
- samsung,exynos8895-pinctrl
|
||||
- samsung,exynos9610-pinctrl
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
* Pin configuration for TI DA850/OMAP-L138/AM18x
|
||||
|
||||
These SoCs have a separate controller for setting bias (internal pullup/down).
|
||||
Bias can only be selected for groups rather than individual pins.
|
||||
|
||||
Required Properties:
|
||||
|
||||
- compatible: Must be "ti,da850-pupd"
|
||||
- reg: Base address and length of the memory resource used by the pullup/down
|
||||
controller hardware module.
|
||||
|
||||
The controller node also acts as a container for pin group configuration nodes.
|
||||
The names of these groups are ignored.
|
||||
|
||||
Pin Group Node Properties:
|
||||
|
||||
- groups: An array of strings, each string containing the name of a pin group.
|
||||
Valid names are "cp0".."cp31".
|
||||
|
||||
The pin configuration parameters use the generic pinconf bindings defined in
|
||||
pinctrl-bindings.txt in this directory. The supported parameters are
|
||||
bias-disable, bias-pull-up, bias-pull-down.
|
||||
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
In common dtsi file:
|
||||
|
||||
pinconf: pin-controller@22c00c {
|
||||
compatible = "ti,da850-pupd";
|
||||
reg = <0x22c00c 0x8>;
|
||||
};
|
||||
|
||||
In board-specific file:
|
||||
|
||||
&pinconf {
|
||||
pinctrl-0 = <&pinconf_bias_groups>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
pinconf_bias_groups: bias-groups {
|
||||
pull-up {
|
||||
groups = "cp30", "cp31";
|
||||
bias-pull-up;
|
||||
};
|
||||
pull-down {
|
||||
groups = "cp29", "cp28";
|
||||
bias-pull-down;
|
||||
};
|
||||
disable {
|
||||
groups = "cp27", "cp26";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
};
|
||||
74
Documentation/devicetree/bindings/pinctrl/ti,da850-pupd.yaml
Normal file
74
Documentation/devicetree/bindings/pinctrl/ti,da850-pupd.yaml
Normal file
@@ -0,0 +1,74 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/ti,da850-pupd.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Texas Instruments DA850/OMAP-L138/AM18x Pin Configuration
|
||||
|
||||
maintainers:
|
||||
- Eduard Bostina <egbostina@gmail.com>
|
||||
|
||||
description:
|
||||
These SoCs have a separate controller for setting bias (internal pullup/down).
|
||||
Bias can only be selected for groups rather than individual pins.
|
||||
The controller node also acts as a container for pin group configuration nodes.
|
||||
The names of these groups are ignored.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: ti,da850-pupd
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
pinctrl-0: true
|
||||
pinctrl-names: true
|
||||
|
||||
patternProperties:
|
||||
"-groups$":
|
||||
type: object
|
||||
additionalProperties: false
|
||||
patternProperties:
|
||||
"^(disable|pull-(up|down))$":
|
||||
$ref: /schemas/pinctrl/pincfg-node.yaml#
|
||||
properties:
|
||||
groups:
|
||||
$ref: /schemas/types.yaml#/definitions/string-array
|
||||
description: An array of strings containing the name of a pin group.
|
||||
items:
|
||||
pattern: "^cp([0-9]|[1-2][0-9]|3[0-1])$"
|
||||
bias-disable: true
|
||||
bias-pull-up: true
|
||||
bias-pull-down: true
|
||||
additionalProperties: false
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
pinconf: pin-controller@22c00c {
|
||||
compatible = "ti,da850-pupd";
|
||||
reg = <0x22c00c 0x8>;
|
||||
pinctrl-0 = <&pinconf_bias_groups>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
pinconf_bias_groups: bias-groups {
|
||||
pull-up {
|
||||
groups = "cp30", "cp31";
|
||||
bias-pull-up;
|
||||
};
|
||||
pull-down {
|
||||
groups = "cp29", "cp28";
|
||||
bias-pull-down;
|
||||
};
|
||||
disable {
|
||||
groups = "cp27", "cp26";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,83 @@
|
||||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/ti,dra7-iodelay.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Pin configuration for TI IODELAY controller
|
||||
|
||||
maintainers:
|
||||
- Nishanth Menon <nm@ti.com>
|
||||
- Bhargav Joshi <j.bhargav.u@gmail.com>
|
||||
|
||||
description:
|
||||
TI dra7 based SoCs such as am57xx have a controller for setting the IO delay
|
||||
for each pin. For most part the IO delay values are programmed by the
|
||||
bootloader, but some pins need to be configured dynamically by the kernel such
|
||||
as the MMC pins.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: ti,dra7-iodelay
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
'#address-cells':
|
||||
const: 1
|
||||
|
||||
'#size-cells':
|
||||
const: 0
|
||||
|
||||
'#pinctrl-cells':
|
||||
const: 2
|
||||
|
||||
patternProperties:
|
||||
^.*_conf$:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
|
||||
properties:
|
||||
pinctrl-pin-array:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32-array
|
||||
description: |
|
||||
An array of 32-bit integers defining the pin delay configuration.
|
||||
|
||||
required:
|
||||
- pinctrl-pin-array
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- '#address-cells'
|
||||
- '#size-cells'
|
||||
- '#pinctrl-cells'
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/pinctrl/dra.h>
|
||||
|
||||
padconf@4844a000 {
|
||||
compatible = "ti,dra7-iodelay";
|
||||
reg = <0x4844a000 0x0d1c>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
#pinctrl-cells = <2>;
|
||||
|
||||
mmc2_iodelay_3v3_conf {
|
||||
pinctrl-pin-array = <
|
||||
0x18c A_DELAY_PS(0) G_DELAY_PS(120) /* CFG_GPMC_A19_IN */
|
||||
0x1a4 A_DELAY_PS(265) G_DELAY_PS(360) /* CFG_GPMC_A20_IN */
|
||||
0x1b0 A_DELAY_PS(0) G_DELAY_PS(120) /* CFG_GPMC_A21_IN */
|
||||
0x1bc A_DELAY_PS(0) G_DELAY_PS(120) /* CFG_GPMC_A22_IN */
|
||||
0x1c8 A_DELAY_PS(287) G_DELAY_PS(420) /* CFG_GPMC_A23_IN */
|
||||
0x1d4 A_DELAY_PS(144) G_DELAY_PS(240) /* CFG_GPMC_A24_IN */
|
||||
0x1e0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A25_IN */
|
||||
0x1ec A_DELAY_PS(120) G_DELAY_PS(0) /* CFG_GPMC_A26_IN */
|
||||
0x1f8 A_DELAY_PS(120) G_DELAY_PS(180) /* CFG_GPMC_A27_IN */
|
||||
0x360 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_CS1_IN */
|
||||
>;
|
||||
};
|
||||
};
|
||||
@@ -1,47 +0,0 @@
|
||||
* Pin configuration for TI IODELAY controller
|
||||
|
||||
TI dra7 based SoCs such as am57xx have a controller for setting the IO delay
|
||||
for each pin. For most part the IO delay values are programmed by the bootloader,
|
||||
but some pins need to be configured dynamically by the kernel such as the
|
||||
MMC pins.
|
||||
|
||||
Required Properties:
|
||||
|
||||
- compatible: Must be "ti,dra7-iodelay"
|
||||
- reg: Base address and length of the memory resource used
|
||||
- #address-cells: Number of address cells
|
||||
- #size-cells: Size of cells
|
||||
- #pinctrl-cells: Number of pinctrl cells, must be 2. See also
|
||||
Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
In the SoC specific dtsi file:
|
||||
|
||||
dra7_iodelay_core: padconf@4844a000 {
|
||||
compatible = "ti,dra7-iodelay";
|
||||
reg = <0x4844a000 0x0d1c>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
#pinctrl-cells = <2>;
|
||||
};
|
||||
|
||||
In board-specific file:
|
||||
|
||||
&dra7_iodelay_core {
|
||||
mmc2_iodelay_3v3_conf: mmc2_iodelay_3v3_conf {
|
||||
pinctrl-pin-array = <
|
||||
0x18c A_DELAY_PS(0) G_DELAY_PS(120) /* CFG_GPMC_A19_IN */
|
||||
0x1a4 A_DELAY_PS(265) G_DELAY_PS(360) /* CFG_GPMC_A20_IN */
|
||||
0x1b0 A_DELAY_PS(0) G_DELAY_PS(120) /* CFG_GPMC_A21_IN */
|
||||
0x1bc A_DELAY_PS(0) G_DELAY_PS(120) /* CFG_GPMC_A22_IN */
|
||||
0x1c8 A_DELAY_PS(287) G_DELAY_PS(420) /* CFG_GPMC_A23_IN */
|
||||
0x1d4 A_DELAY_PS(144) G_DELAY_PS(240) /* CFG_GPMC_A24_IN */
|
||||
0x1e0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A25_IN */
|
||||
0x1ec A_DELAY_PS(120) G_DELAY_PS(0) /* CFG_GPMC_A26_IN */
|
||||
0x1f8 A_DELAY_PS(120) G_DELAY_PS(180) /* CFG_GPMC_A27_IN */
|
||||
0x360 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_CS1_IN */
|
||||
>;
|
||||
};
|
||||
};
|
||||
@@ -1175,7 +1175,7 @@ Possible standard state names are: "default", "init", "sleep" and "idle".
|
||||
selected after the driver probe.
|
||||
|
||||
- the ``sleep`` and ``idle`` states are for power management and can only
|
||||
be selected with the PM API bellow.
|
||||
be selected with the PM API below.
|
||||
|
||||
PM interfaces
|
||||
=================
|
||||
|
||||
@@ -22480,6 +22480,13 @@ L: linux-arm-msm@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/firmware/qcom/qcom_qseecom_uefisecapp.c
|
||||
|
||||
QUALCOMM PINCTRL DRIVERS
|
||||
M: Bartosz Golaszewski <brgl@kernel.org>
|
||||
L: linux-arm-msm@vger.kernel.org
|
||||
S: Supported
|
||||
F: Documentation/devicetree/bindings/pinctrl/qcom,*.yaml
|
||||
F: drivers/pinctrl/qcom/
|
||||
|
||||
QUALCOMM RMNET DRIVER
|
||||
M: Subash Abhinov Kasiviswanathan <subash.a.kasiviswanathan@oss.qualcomm.com>
|
||||
M: Sean Tranchetti <sean.tranchetti@oss.qualcomm.com>
|
||||
|
||||
1335
arch/arm64/boot/dts/mediatek/mt6858-pinfunc.h
Normal file
1335
arch/arm64/boot/dts/mediatek/mt6858-pinfunc.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -275,8 +275,8 @@ config PINCTRL_GEMINI
|
||||
|
||||
config PINCTRL_GENERIC_MUX
|
||||
tristate "Generic Pinctrl driver by using multiplexer"
|
||||
depends on MULTIPLEXER
|
||||
depends on OF
|
||||
select MULTIPLEXER
|
||||
select PINMUX
|
||||
select GENERIC_PINCTRL
|
||||
help
|
||||
@@ -488,6 +488,7 @@ config PINCTRL_PIC32
|
||||
depends on MACH_PIC32 || COMPILE_TEST
|
||||
select PINMUX
|
||||
select GENERIC_PINCONF
|
||||
select GPIOLIB
|
||||
select GPIOLIB_IRQCHIP
|
||||
help
|
||||
This is the pin controller and gpio driver for Microchip PIC32
|
||||
@@ -564,6 +565,7 @@ config PINCTRL_STMFX
|
||||
depends on I2C
|
||||
depends on HAS_IOMEM
|
||||
select GENERIC_PINCONF
|
||||
select GPIOLIB
|
||||
select GPIOLIB_IRQCHIP
|
||||
select MFD_STMFX
|
||||
help
|
||||
@@ -575,7 +577,7 @@ config PINCTRL_STMFX
|
||||
|
||||
config PINCTRL_SX150X
|
||||
tristate "Semtech SX150x I2C GPIO expander pinctrl driver"
|
||||
depends on I2C=y
|
||||
depends on I2C
|
||||
select PINMUX
|
||||
select PINCONF
|
||||
select GENERIC_PINCONF
|
||||
|
||||
@@ -824,7 +824,7 @@ static int owl_gpio_irq_set_type(struct irq_data *data, unsigned int type)
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(data);
|
||||
struct owl_pinctrl *pctrl = gpiochip_get_data(gc);
|
||||
|
||||
if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
|
||||
if (type & IRQ_TYPE_LEVEL_MASK)
|
||||
irq_set_handler_locked(data, handle_level_irq);
|
||||
else
|
||||
irq_set_handler_locked(data, handle_edge_irq);
|
||||
|
||||
@@ -3,9 +3,9 @@ menu "Airoha pinctrl drivers"
|
||||
depends on ARCH_AIROHA || COMPILE_TEST
|
||||
|
||||
config PINCTRL_AIROHA
|
||||
tristate "Airoha EN7581 pin control"
|
||||
tristate "Airoha pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
depends on ARCH_AIROHA || COMPILE_TEST
|
||||
select PINMUX
|
||||
select GENERIC_PINCONF
|
||||
select GENERIC_PINCTRL_GROUPS
|
||||
@@ -13,8 +13,44 @@ config PINCTRL_AIROHA
|
||||
select GPIOLIB
|
||||
select GPIOLIB_IRQCHIP
|
||||
select REGMAP_MMIO
|
||||
imply PINCTRL_AIROHA_AN7563
|
||||
imply PINCTRL_AIROHA_AN7581
|
||||
imply PINCTRL_AIROHA_AN7583
|
||||
imply PINCTRL_AIROHA_EN7523
|
||||
help
|
||||
Shared pin controller and gpio driver code for different
|
||||
Airoha SoCs.
|
||||
|
||||
config PINCTRL_AIROHA_AN7563
|
||||
tristate "AN7563 pinctrl"
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
depends on PINCTRL_AIROHA
|
||||
help
|
||||
Say yes here to support pin controller and gpio driver
|
||||
on Airoha EN7581 SoC.
|
||||
on Airoha AN7563 and other compatible SoCs.
|
||||
|
||||
config PINCTRL_AIROHA_AN7581
|
||||
tristate "AN7581 pinctrl"
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
depends on PINCTRL_AIROHA
|
||||
help
|
||||
Say yes here to support pin controller and gpio driver
|
||||
on Airoha AN7581, AN7566, AN7551 and other compatible SoCs.
|
||||
|
||||
config PINCTRL_AIROHA_AN7583
|
||||
tristate "AN7583 pinctrl"
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
depends on PINCTRL_AIROHA
|
||||
help
|
||||
Say yes here to support pin controller and gpio driver
|
||||
on Airoha AN7583, AN7553, AN7567 and other compatible SoCs.
|
||||
|
||||
config PINCTRL_AIROHA_EN7523
|
||||
tristate "EN7523 pinctrl"
|
||||
depends on ARM || COMPILE_TEST
|
||||
depends on PINCTRL_AIROHA
|
||||
help
|
||||
Say yes here to support pin controller and gpio driver
|
||||
on Airoha EN7523, EN7529, EN7562 and other compatible SoCs.
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
# shared code
|
||||
obj-$(CONFIG_PINCTRL_AIROHA) += pinctrl-airoha.o
|
||||
|
||||
# SoC drivers
|
||||
obj-$(CONFIG_PINCTRL_AIROHA_AN7563) += pinctrl-an7563.o
|
||||
obj-$(CONFIG_PINCTRL_AIROHA_AN7581) += pinctrl-an7581.o
|
||||
obj-$(CONFIG_PINCTRL_AIROHA_AN7583) += pinctrl-an7583.o
|
||||
obj-$(CONFIG_PINCTRL_AIROHA_EN7523) += pinctrl-en7523.o
|
||||
|
||||
147
drivers/pinctrl/airoha/airoha-common.h
Normal file
147
drivers/pinctrl/airoha/airoha-common.h
Normal file
@@ -0,0 +1,147 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Author: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
* Author: Benjamin Larsson <benjamin.larsson@genexis.eu>
|
||||
* Author: Markus Gothe <markus.gothe@genexis.eu>
|
||||
*/
|
||||
|
||||
#ifndef __AIROHA_COMMON_HEADER__
|
||||
#define __AIROHA_COMMON_HEADER__
|
||||
|
||||
#include <dt-bindings/pinctrl/mt65xx.h>
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/bits.h>
|
||||
#include <linux/cleanup.h>
|
||||
#include <linux/gpio/driver.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/irqdomain.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
#include <linux/pinctrl/pinconf.h>
|
||||
#include <linux/pinctrl/pinconf-generic.h>
|
||||
#include <linux/pinctrl/pinmux.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "../core.h"
|
||||
#include "../pinconf.h"
|
||||
#include "../pinmux.h"
|
||||
|
||||
#define AIROHA_NUM_PINS 64
|
||||
#define AIROHA_PIN_BANK_SIZE (AIROHA_NUM_PINS / 2)
|
||||
#define AIROHA_REG_GPIOCTRL_NUM_PIN (AIROHA_NUM_PINS / 4)
|
||||
|
||||
#define PINCTRL_PIN_GROUP(id, table) \
|
||||
PINCTRL_PINGROUP(id, table##_pins, ARRAY_SIZE(table##_pins))
|
||||
|
||||
#define PINCTRL_FUNC_DESC(id, table) \
|
||||
{ \
|
||||
.desc = PINCTRL_PINFUNCTION(id, table##_groups, \
|
||||
ARRAY_SIZE(table##_groups)),\
|
||||
.groups = table##_func_group, \
|
||||
.group_size = ARRAY_SIZE(table##_func_group), \
|
||||
}
|
||||
|
||||
#define PINCTRL_CONF_DESC(p, offset, mask) \
|
||||
{ \
|
||||
.pin = p, \
|
||||
.reg = { offset, mask }, \
|
||||
}
|
||||
|
||||
struct airoha_pinctrl_reg {
|
||||
u32 offset;
|
||||
u32 mask;
|
||||
};
|
||||
|
||||
enum airoha_pinctrl_mux_func {
|
||||
AIROHA_FUNC_MUX,
|
||||
AIROHA_FUNC_PWM_MUX,
|
||||
AIROHA_FUNC_PWM_EXT_MUX,
|
||||
};
|
||||
|
||||
struct airoha_pinctrl_func_group {
|
||||
const char *name;
|
||||
struct {
|
||||
enum airoha_pinctrl_mux_func mux;
|
||||
u32 offset;
|
||||
u32 mask;
|
||||
u32 val;
|
||||
} regmap[2];
|
||||
int regmap_size;
|
||||
};
|
||||
|
||||
struct airoha_pinctrl_func {
|
||||
const struct pinfunction desc;
|
||||
const struct airoha_pinctrl_func_group *groups;
|
||||
u8 group_size;
|
||||
};
|
||||
|
||||
struct airoha_pinctrl_conf {
|
||||
u32 pin;
|
||||
struct airoha_pinctrl_reg reg;
|
||||
};
|
||||
|
||||
struct airoha_gpiochip_regs {
|
||||
/* gpio */
|
||||
const u32 *data;
|
||||
const u32 *dir;
|
||||
const u32 *out;
|
||||
/* irq */
|
||||
const u32 *status;
|
||||
const u32 *level;
|
||||
const u32 *edge;
|
||||
};
|
||||
|
||||
struct airoha_pinctrl_confs_info {
|
||||
const struct airoha_pinctrl_conf *confs;
|
||||
unsigned int num_confs;
|
||||
};
|
||||
|
||||
enum airoha_pinctrl_confs_type {
|
||||
AIROHA_PINCTRL_CONFS_PULLUP,
|
||||
AIROHA_PINCTRL_CONFS_PULLDOWN,
|
||||
AIROHA_PINCTRL_CONFS_DRIVE_E2,
|
||||
AIROHA_PINCTRL_CONFS_DRIVE_E4,
|
||||
AIROHA_PINCTRL_CONFS_PCIE_RST_OD,
|
||||
|
||||
AIROHA_PINCTRL_CONFS_MAX,
|
||||
};
|
||||
|
||||
struct airoha_pinctrl {
|
||||
struct pinctrl_dev *ctrl;
|
||||
|
||||
struct pinctrl_desc desc;
|
||||
const struct pingroup *grps;
|
||||
const struct airoha_pinctrl_func *funcs;
|
||||
const struct airoha_pinctrl_confs_info *confs_info;
|
||||
|
||||
struct regmap *chip_scu;
|
||||
struct regmap *regmap;
|
||||
|
||||
struct gpio_chip gpiochip;
|
||||
struct airoha_gpiochip_regs *gpio_regs;
|
||||
};
|
||||
|
||||
struct airoha_pinctrl_match_data {
|
||||
const char *chip_scu_compatible;
|
||||
const char *pinctrl_name;
|
||||
struct module *pinctrl_owner;
|
||||
const struct pinctrl_pin_desc *pins;
|
||||
const unsigned int num_pins;
|
||||
const struct pingroup *grps;
|
||||
const unsigned int num_grps;
|
||||
const struct airoha_pinctrl_func *funcs;
|
||||
const unsigned int num_funcs;
|
||||
const struct airoha_pinctrl_confs_info confs_info[AIROHA_PINCTRL_CONFS_MAX];
|
||||
};
|
||||
|
||||
int airoha_pinctrl_probe(struct platform_device *pdev);
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
1115
drivers/pinctrl/airoha/pinctrl-an7563.c
Normal file
1115
drivers/pinctrl/airoha/pinctrl-an7563.c
Normal file
File diff suppressed because it is too large
Load Diff
1487
drivers/pinctrl/airoha/pinctrl-an7581.c
Normal file
1487
drivers/pinctrl/airoha/pinctrl-an7581.c
Normal file
File diff suppressed because it is too large
Load Diff
1517
drivers/pinctrl/airoha/pinctrl-an7583.c
Normal file
1517
drivers/pinctrl/airoha/pinctrl-an7583.c
Normal file
File diff suppressed because it is too large
Load Diff
1157
drivers/pinctrl/airoha/pinctrl-en7523.c
Normal file
1157
drivers/pinctrl/airoha/pinctrl-en7523.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1018,7 +1018,8 @@ PIN_GROUP(I3C6, AA22, AB20);
|
||||
PIN_GROUP(I3C7, AF18, AE19);
|
||||
PIN_GROUP(I3C8, AD20, AC20);
|
||||
PIN_GROUP(I3C9, AA21, AB21);
|
||||
PIN_GROUP(JTAGM1, D12, F10, E11, F11, F13);
|
||||
PIN_GROUP(JTAGM1, F10, E11, F11, F13);
|
||||
PIN_GROUP(JTAGM1TRST, D12);
|
||||
PIN_GROUP(LPC0, AF26, AF25, B16, D14, B15, B14, C17, B13, E14, C15);
|
||||
PIN_GROUP(LPC1, C16, C14, C11, D9, F14, D10, C12, C13, AE16, AE17);
|
||||
PIN_GROUP(LTPI, U25, U26, Y26, AA24);
|
||||
@@ -1263,6 +1264,7 @@ static const struct pingroup aspeed_g7_soc1_groups[] = {
|
||||
GROUP(I3C8),
|
||||
GROUP(I3C9),
|
||||
GROUP(JTAGM1),
|
||||
GROUP(JTAGM1TRST),
|
||||
GROUP(LPC0),
|
||||
GROUP(LPC1),
|
||||
GROUP(LTPI),
|
||||
@@ -1528,7 +1530,7 @@ static const struct aspeed_g7_soc1_function aspeed_g7_soc1_functions[] = {
|
||||
FUNC(I3C7, (1), "I3C7"),
|
||||
FUNC(I3C8, (1), "I3C8"),
|
||||
FUNC(I3C9, (1), "I3C9"),
|
||||
FUNC(JTAGM1, (1), "JTAGM1"),
|
||||
FUNC(JTAGM1, (1, 1), "JTAGM1", "JTAGM1TRST"),
|
||||
FUNC(LPC0, (2), "LPC0"),
|
||||
FUNC(LPC1, (2), "LPC1"),
|
||||
FUNC(LTPI, (2), "LTPI"),
|
||||
|
||||
@@ -121,6 +121,7 @@ source "drivers/pinctrl/bcm/Kconfig.stb"
|
||||
config PINCTRL_IPROC_GPIO
|
||||
bool "Broadcom iProc GPIO (with PINCONF) driver"
|
||||
depends on ARCH_BCM_IPROC || COMPILE_TEST
|
||||
select GPIOLIB
|
||||
select GPIOLIB_IRQCHIP
|
||||
select PINCONF
|
||||
select GENERIC_PINCONF
|
||||
@@ -186,6 +187,7 @@ config PINCTRL_NS
|
||||
config PINCTRL_NSP_GPIO
|
||||
bool "Broadcom NSP GPIO (with PINCONF) driver"
|
||||
depends on ARCH_BCM_NSP || COMPILE_TEST
|
||||
select GPIOLIB
|
||||
select GPIOLIB_IRQCHIP
|
||||
select PINCONF
|
||||
select GENERIC_PINCONF
|
||||
|
||||
@@ -1350,7 +1350,6 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
|
||||
pc->pctl_desc = *pdata->pctl_desc;
|
||||
pc->pctl_dev = devm_pinctrl_register(dev, &pc->pctl_desc, pc);
|
||||
if (IS_ERR(pc->pctl_dev)) {
|
||||
gpiochip_remove(&pc->gpio_chip);
|
||||
return PTR_ERR(pc->pctl_dev);
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ static void nsp_gpio_irq_ack(struct irq_data *d)
|
||||
u32 trigger_type;
|
||||
|
||||
trigger_type = irq_get_trigger_type(d->irq);
|
||||
if (trigger_type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING))
|
||||
if (trigger_type & IRQ_TYPE_EDGE_BOTH)
|
||||
writel(val, chip->base + NSP_GPIO_EVENT);
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ static void nsp_gpio_irq_set_mask(struct irq_data *d, bool unmask)
|
||||
u32 trigger_type;
|
||||
|
||||
trigger_type = irq_get_trigger_type(d->irq);
|
||||
if (trigger_type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING))
|
||||
if (trigger_type & IRQ_TYPE_EDGE_BOTH)
|
||||
nsp_set_bit(chip, REG, NSP_GPIO_EVENT_INT_MASK, gpio, unmask);
|
||||
else
|
||||
nsp_set_bit(chip, REG, NSP_GPIO_INT_MASK, gpio, unmask);
|
||||
@@ -671,11 +671,8 @@ static int nsp_gpio_probe(struct platform_device *pdev)
|
||||
/* Install ISR for this GPIO controller. */
|
||||
ret = devm_request_irq(dev, irq, nsp_gpio_irq_handler,
|
||||
IRQF_SHARED, "gpio-a", &chip->gc);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Unable to request IRQ%d: %d\n",
|
||||
irq, ret);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
girq = &chip->gc.irq;
|
||||
gpio_irq_chip_set_chip(girq, &nsp_gpio_irq_chip);
|
||||
|
||||
@@ -547,14 +547,11 @@ static int imx1_pinctrl_parse_functions(struct device_node *np,
|
||||
*/
|
||||
static bool imx1_pinctrl_dt_is_flat_functions(struct device_node *np)
|
||||
{
|
||||
struct device_node *function_np;
|
||||
struct device_node *pinctrl_np;
|
||||
|
||||
for_each_child_of_node(np, function_np) {
|
||||
for_each_child_of_node_scoped(np, function_np) {
|
||||
if (of_property_present(function_np, "fsl,pins"))
|
||||
return true;
|
||||
|
||||
for_each_child_of_node(function_np, pinctrl_np) {
|
||||
for_each_child_of_node_scoped(function_np, pinctrl_np) {
|
||||
if (of_property_present(pinctrl_np, "fsl,pins"))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1414,7 +1414,7 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
|
||||
IRQF_SHARED | IRQF_NO_THREAD,
|
||||
dev_name(pctrl->dev), pctrl);
|
||||
if (ret)
|
||||
return dev_err_probe(pctrl->dev, ret, "failed to request interrupt\n");
|
||||
return ret;
|
||||
|
||||
/* Setup IRQ chip */
|
||||
girq = &pctrl->chip.irq;
|
||||
|
||||
@@ -329,6 +329,34 @@ static const struct pinctrl_pin_desc tgllp_pins[] = {
|
||||
PINCTRL_PIN(276, "SPI0_CLK_LOOPBK"),
|
||||
};
|
||||
|
||||
static const unsigned int tgllp_i2c0_pins[] = { 5, 6 };
|
||||
static const unsigned int tgllp_i2c1_pins[] = { 7, 8 };
|
||||
static const unsigned int tgllp_pwm0_pins[] = { 99 };
|
||||
static const unsigned int tgllp_uart1_pins[] = { 85, 86, 87, 88 };
|
||||
static const unsigned int tgllp_ssp2_pins[] = { 108, 109, 110, 111 };
|
||||
|
||||
static const struct intel_pingroup tgllp_groups[] = {
|
||||
PIN_GROUP("i2c0_grp", tgllp_i2c0_pins, 2),
|
||||
PIN_GROUP("i2c1_grp", tgllp_i2c1_pins, 2),
|
||||
PIN_GROUP("pwm0_grp", tgllp_pwm0_pins, 2),
|
||||
PIN_GROUP("uart1_grp", tgllp_uart1_pins, 2),
|
||||
PIN_GROUP("ssp2_grp", tgllp_ssp2_pins, 7),
|
||||
};
|
||||
|
||||
static const char * const tgllp_i2c0_groups[] = { "i2c0_grp" };
|
||||
static const char * const tgllp_i2c1_groups[] = { "i2c1_grp" };
|
||||
static const char * const tgllp_pwm0_groups[] = { "pwm0_grp" };
|
||||
static const char * const tgllp_uart1_groups[] = { "uart1_grp" };
|
||||
static const char * const tgllp_ssp2_groups[] = { "ssp2_grp" };
|
||||
|
||||
static const struct intel_function tgllp_functions[] = {
|
||||
FUNCTION("i2c0", tgllp_i2c0_groups),
|
||||
FUNCTION("i2c1", tgllp_i2c1_groups),
|
||||
FUNCTION("pwm0", tgllp_pwm0_groups),
|
||||
FUNCTION("uart1", tgllp_uart1_groups),
|
||||
FUNCTION("ssp2", tgllp_ssp2_groups),
|
||||
};
|
||||
|
||||
static const struct intel_padgroup tgllp_community0_gpps[] = {
|
||||
INTEL_GPP(0, 0, 25, 0), /* GPP_B */
|
||||
INTEL_GPP(1, 26, 41, 32), /* GPP_T */
|
||||
@@ -366,6 +394,10 @@ static const struct intel_community tgllp_communities[] = {
|
||||
static const struct intel_pinctrl_soc_data tgllp_soc_data = {
|
||||
.pins = tgllp_pins,
|
||||
.npins = ARRAY_SIZE(tgllp_pins),
|
||||
.groups = tgllp_groups,
|
||||
.ngroups = ARRAY_SIZE(tgllp_groups),
|
||||
.functions = tgllp_functions,
|
||||
.nfunctions = ARRAY_SIZE(tgllp_functions),
|
||||
.communities = tgllp_communities,
|
||||
.ncommunities = ARRAY_SIZE(tgllp_communities),
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@ config EINT_MTK
|
||||
default PINCTRL_MTK_PARIS
|
||||
|
||||
config PINCTRL_MTK
|
||||
bool
|
||||
tristate
|
||||
depends on OF
|
||||
select PINMUX
|
||||
select GENERIC_PINCONF
|
||||
@@ -22,13 +22,13 @@ config PINCTRL_MTK_V2
|
||||
tristate
|
||||
|
||||
config PINCTRL_MTK_MTMIPS
|
||||
bool
|
||||
tristate
|
||||
depends on RALINK
|
||||
select PINMUX
|
||||
select GENERIC_PINCONF
|
||||
|
||||
config PINCTRL_MTK_MOORE
|
||||
bool
|
||||
tristate
|
||||
depends on OF
|
||||
select GENERIC_PINCONF
|
||||
select GENERIC_PINCTRL_GROUPS
|
||||
@@ -48,42 +48,42 @@ config PINCTRL_MTK_PARIS
|
||||
|
||||
# For MIPS SoCs
|
||||
config PINCTRL_MT7620
|
||||
bool "MediaTek MT7620 pin control"
|
||||
tristate "MediaTek MT7620 pin control"
|
||||
depends on SOC_MT7620 || COMPILE_TEST
|
||||
depends on RALINK
|
||||
default SOC_MT7620
|
||||
select PINCTRL_MTK_MTMIPS
|
||||
|
||||
config PINCTRL_MT7621
|
||||
bool "MediaTek MT7621 pin control"
|
||||
tristate "MediaTek MT7621 pin control"
|
||||
depends on SOC_MT7621 || COMPILE_TEST
|
||||
depends on RALINK
|
||||
default SOC_MT7621
|
||||
select PINCTRL_MTK_MTMIPS
|
||||
|
||||
config PINCTRL_MT76X8
|
||||
bool "MediaTek MT76X8 pin control"
|
||||
tristate "MediaTek MT76X8 pin control"
|
||||
depends on SOC_MT7620 || COMPILE_TEST
|
||||
depends on RALINK
|
||||
default SOC_MT7620
|
||||
select PINCTRL_MTK_MTMIPS
|
||||
|
||||
config PINCTRL_RT2880
|
||||
bool "Ralink RT2880 pin control"
|
||||
tristate "Ralink RT2880 pin control"
|
||||
depends on SOC_RT288X || COMPILE_TEST
|
||||
depends on RALINK
|
||||
default SOC_RT288X
|
||||
select PINCTRL_MTK_MTMIPS
|
||||
|
||||
config PINCTRL_RT305X
|
||||
bool "Ralink RT305X pin control"
|
||||
tristate "Ralink RT305X pin control"
|
||||
depends on SOC_RT305X || COMPILE_TEST
|
||||
depends on RALINK
|
||||
default SOC_RT305X
|
||||
select PINCTRL_MTK_MTMIPS
|
||||
|
||||
config PINCTRL_RT3883
|
||||
bool "Ralink RT3883 pin control"
|
||||
tristate "Ralink RT3883 pin control"
|
||||
depends on SOC_RT3883 || COMPILE_TEST
|
||||
depends on RALINK
|
||||
default SOC_RT3883
|
||||
@@ -91,35 +91,35 @@ config PINCTRL_RT3883
|
||||
|
||||
# For ARMv7 SoCs
|
||||
config PINCTRL_MT2701
|
||||
bool "MediaTek MT2701 pin control"
|
||||
tristate "MediaTek MT2701 pin control"
|
||||
depends on MACH_MT7623 || MACH_MT2701 || COMPILE_TEST
|
||||
depends on OF
|
||||
default MACH_MT2701
|
||||
select PINCTRL_MTK
|
||||
|
||||
config PINCTRL_MT7623
|
||||
bool "MediaTek MT7623 pin control with generic binding"
|
||||
tristate "MediaTek MT7623 pin control with generic binding"
|
||||
depends on MACH_MT7623 || COMPILE_TEST
|
||||
depends on OF
|
||||
default MACH_MT7623
|
||||
select PINCTRL_MTK_MOORE
|
||||
|
||||
config PINCTRL_MT7629
|
||||
bool "MediaTek MT7629 pin control"
|
||||
tristate "MediaTek MT7629 pin control"
|
||||
depends on MACH_MT7629 || COMPILE_TEST
|
||||
depends on OF
|
||||
default MACH_MT7629
|
||||
select PINCTRL_MTK_MOORE
|
||||
|
||||
config PINCTRL_MT8135
|
||||
bool "MediaTek MT8135 pin control"
|
||||
tristate "MediaTek MT8135 pin control"
|
||||
depends on MACH_MT8135 || COMPILE_TEST
|
||||
depends on OF
|
||||
default MACH_MT8135
|
||||
select PINCTRL_MTK
|
||||
|
||||
config PINCTRL_MT8127
|
||||
bool "MediaTek MT8127 pin control"
|
||||
tristate "MediaTek MT8127 pin control"
|
||||
depends on MACH_MT8127 || COMPILE_TEST
|
||||
depends on OF
|
||||
default MACH_MT8127
|
||||
@@ -127,7 +127,7 @@ config PINCTRL_MT8127
|
||||
|
||||
# For ARMv8 SoCs
|
||||
config PINCTRL_MT2712
|
||||
bool "MediaTek MT2712 pin control"
|
||||
tristate "MediaTek MT2712 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
@@ -153,21 +153,31 @@ config PINCTRL_MT6779
|
||||
map specific eint which doesn't have real gpio pin.
|
||||
|
||||
config PINCTRL_MT6795
|
||||
bool "MediaTek MT6795 pin control"
|
||||
tristate "MediaTek MT6795 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
select PINCTRL_MTK_PARIS
|
||||
|
||||
config PINCTRL_MT6797
|
||||
bool "MediaTek MT6797 pin control"
|
||||
tristate "MediaTek MT6797 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
select PINCTRL_MTK_PARIS
|
||||
|
||||
config PINCTRL_MT6858
|
||||
tristate "MediaTek MT6858 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
select PINCTRL_MTK_PARIS
|
||||
help
|
||||
Say yes here to support pin controller and gpio driver
|
||||
on the MediaTek MT6858 SoC.
|
||||
|
||||
config PINCTRL_MT6878
|
||||
bool "MediaTek MT6878 pin control"
|
||||
tristate "MediaTek MT6878 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
@@ -177,7 +187,7 @@ config PINCTRL_MT6878
|
||||
on the MediaTek MT6878 SoC.
|
||||
|
||||
config PINCTRL_MT6893
|
||||
bool "MediaTek Dimensity MT6893 pin control"
|
||||
tristate "MediaTek Dimensity MT6893 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
@@ -187,63 +197,63 @@ config PINCTRL_MT6893
|
||||
on the MediaTek Dimensity 1200 MT6893 Smartphone SoC.
|
||||
|
||||
config PINCTRL_MT7622
|
||||
bool "MediaTek MT7622 pin control"
|
||||
tristate "MediaTek MT7622 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
select PINCTRL_MTK_MOORE
|
||||
|
||||
config PINCTRL_MT7981
|
||||
bool "MediaTek MT7981 pin control"
|
||||
tristate "MediaTek MT7981 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
select PINCTRL_MTK_MOORE
|
||||
|
||||
config PINCTRL_MT7986
|
||||
bool "MediaTek MT7986 pin control"
|
||||
tristate "MediaTek MT7986 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
select PINCTRL_MTK_MOORE
|
||||
|
||||
config PINCTRL_MT7988
|
||||
bool "Mediatek MT7988 pin control"
|
||||
tristate "Mediatek MT7988 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
select PINCTRL_MTK_MOORE
|
||||
|
||||
config PINCTRL_MT8167
|
||||
bool "MediaTek MT8167 pin control"
|
||||
tristate "MediaTek MT8167 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
select PINCTRL_MTK
|
||||
|
||||
config PINCTRL_MT8173
|
||||
bool "MediaTek MT8173 pin control"
|
||||
tristate "MediaTek MT8173 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
select PINCTRL_MTK
|
||||
|
||||
config PINCTRL_MT8183
|
||||
bool "MediaTek MT8183 pin control"
|
||||
tristate "MediaTek MT8183 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
select PINCTRL_MTK_PARIS
|
||||
|
||||
config PINCTRL_MT8186
|
||||
bool "MediaTek MT8186 pin control"
|
||||
tristate "MediaTek MT8186 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
select PINCTRL_MTK_PARIS
|
||||
|
||||
config PINCTRL_MT8188
|
||||
bool "MediaTek MT8188 pin control"
|
||||
tristate "MediaTek MT8188 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
@@ -255,7 +265,7 @@ config PINCTRL_MT8188
|
||||
map specific eint which doesn't have real gpio pin.
|
||||
|
||||
config PINCTRL_MT8189
|
||||
bool "MediaTek MT8189 pin control"
|
||||
tristate "MediaTek MT8189 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
@@ -267,21 +277,21 @@ config PINCTRL_MT8189
|
||||
map specific eint which doesn't have real gpio pin.
|
||||
|
||||
config PINCTRL_MT8192
|
||||
bool "MediaTek MT8192 pin control"
|
||||
tristate "MediaTek MT8192 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
select PINCTRL_MTK_PARIS
|
||||
|
||||
config PINCTRL_MT8195
|
||||
bool "MediaTek MT8195 pin control"
|
||||
tristate "MediaTek MT8195 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
select PINCTRL_MTK_PARIS
|
||||
|
||||
config PINCTRL_MT8196
|
||||
bool "MediaTek MT8196 pin control"
|
||||
tristate "MediaTek MT8196 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
@@ -293,14 +303,14 @@ config PINCTRL_MT8196
|
||||
map specific eint which doesn't have real gpio pin.
|
||||
|
||||
config PINCTRL_MT8365
|
||||
bool "MediaTek MT8365 pin control"
|
||||
tristate "MediaTek MT8365 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
select PINCTRL_MTK
|
||||
|
||||
config PINCTRL_MT8516
|
||||
bool "MediaTek MT8516 pin control"
|
||||
tristate "MediaTek MT8516 pin control"
|
||||
depends on OF
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
default ARM64 && ARCH_MEDIATEK
|
||||
@@ -308,7 +318,7 @@ config PINCTRL_MT8516
|
||||
|
||||
# For PMIC
|
||||
config PINCTRL_MT6397
|
||||
bool "MediaTek MT6397 pin control"
|
||||
tristate "MediaTek MT6397 pin control"
|
||||
depends on MFD_MT6397 || COMPILE_TEST
|
||||
depends on OF
|
||||
default MFD_MT6397
|
||||
|
||||
@@ -22,6 +22,7 @@ obj-$(CONFIG_PINCTRL_MT6765) += pinctrl-mt6765.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_MT6858) += pinctrl-mt6858.o
|
||||
obj-$(CONFIG_PINCTRL_MT6878) += pinctrl-mt6878.o
|
||||
obj-$(CONFIG_PINCTRL_MT6893) += pinctrl-mt6893.o
|
||||
obj-$(CONFIG_PINCTRL_MT7622) += pinctrl-mt7622.o
|
||||
|
||||
@@ -12,8 +12,10 @@
|
||||
*/
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/gpio/driver.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/irqchip/chained_irq.h>
|
||||
#include <linux/irqdomain.h>
|
||||
@@ -214,7 +216,7 @@ static int mtk_eint_set_type(struct irq_data *d, unsigned int type)
|
||||
writel(mask, reg);
|
||||
}
|
||||
|
||||
if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
|
||||
if (type & IRQ_TYPE_EDGE_BOTH) {
|
||||
reg = mtk_eint_get_offset(eint, d->hwirq, eint->regs->sens_clr);
|
||||
writel(mask, reg);
|
||||
} else {
|
||||
@@ -509,6 +511,27 @@ int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mtk_eint_find_irq);
|
||||
|
||||
static void mtk_eint_teardown(void *data)
|
||||
{
|
||||
struct mtk_eint *eint = data;
|
||||
unsigned int i, virq;
|
||||
|
||||
/* Detach the demux handler so it can no longer reference freed data. */
|
||||
irq_set_chained_handler_and_data(eint->irq, NULL, NULL);
|
||||
|
||||
/* Wait for any in-flight handler to finish before tearing down. */
|
||||
synchronize_irq(eint->irq);
|
||||
|
||||
/* Dispose of all child mappings before the domain is removed. */
|
||||
for (i = 0; i < eint->hw->ap_num; i++) {
|
||||
virq = irq_find_mapping(eint->domain, i);
|
||||
if (virq)
|
||||
irq_dispose_mapping(virq);
|
||||
}
|
||||
|
||||
irq_domain_remove(eint->domain);
|
||||
}
|
||||
|
||||
int mtk_eint_do_init(struct mtk_eint *eint, struct mtk_eint_pin *eint_pin)
|
||||
{
|
||||
unsigned int size, i, port, virq, inst = 0;
|
||||
@@ -601,7 +624,7 @@ int mtk_eint_do_init(struct mtk_eint *eint, struct mtk_eint_pin *eint_pin)
|
||||
irq_set_chained_handler_and_data(eint->irq, mtk_eint_irq_handler,
|
||||
eint);
|
||||
|
||||
return 0;
|
||||
return devm_add_action_or_reset(eint->dev, mtk_eint_teardown, eint);
|
||||
|
||||
err_eint:
|
||||
for (i = 0; i < eint->nbase; i++) {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <dt-bindings/pinctrl/mt65xx.h>
|
||||
#include <linux/gpio/driver.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
|
||||
@@ -594,7 +595,7 @@ static int mtk_build_gpiochip(struct mtk_pinctrl *hw)
|
||||
chip->base = -1;
|
||||
chip->ngpio = hw->soc->npins;
|
||||
|
||||
ret = gpiochip_add_data(chip, hw);
|
||||
ret = devm_gpiochip_add_data(hw->dev, chip, hw);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@@ -608,10 +609,8 @@ static int mtk_build_gpiochip(struct mtk_pinctrl *hw)
|
||||
if (!of_property_present(hw->dev->of_node, "gpio-ranges")) {
|
||||
ret = gpiochip_add_pin_range(chip, dev_name(hw->dev), 0, 0,
|
||||
chip->ngpio);
|
||||
if (ret < 0) {
|
||||
gpiochip_remove(chip);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -745,3 +744,7 @@ int mtk_moore_pinctrl_probe(struct platform_device *pdev,
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(mtk_moore_pinctrl_probe, "MTK_PINCTRL");
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek Pinctrl Common Driver V2 Moore");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -542,3 +542,7 @@ static int __init mtk_pinctrl_init(void)
|
||||
return platform_driver_register(&mtk_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(mtk_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT2701 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -591,3 +591,7 @@ static int __init mtk_pinctrl_init(void)
|
||||
}
|
||||
|
||||
arch_initcall(mtk_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT2712 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -49,6 +49,7 @@ static const struct of_device_id mt6397_pctrl_match[] = {
|
||||
{ .compatible = "mediatek,mt6397-pinctrl", },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt6397_pctrl_match);
|
||||
|
||||
static struct platform_driver mtk_pinctrl_driver = {
|
||||
.probe = mt6397_pinctrl_probe,
|
||||
@@ -59,3 +60,7 @@ static struct platform_driver mtk_pinctrl_driver = {
|
||||
};
|
||||
|
||||
builtin_platform_driver(mtk_pinctrl_driver);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT6397 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -607,6 +607,7 @@ static const struct of_device_id mt6795_pctrl_match[] = {
|
||||
{ .compatible = "mediatek,mt6795-pinctrl", .data = &mt6795_data },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt6795_pctrl_match);
|
||||
|
||||
static struct platform_driver mt6795_pinctrl_driver = {
|
||||
.driver = {
|
||||
@@ -622,3 +623,6 @@ static int __init mtk_pinctrl_init(void)
|
||||
return platform_driver_register(&mt6795_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(mtk_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT6795 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -61,6 +61,7 @@ static const struct of_device_id mt6797_pinctrl_of_match[] = {
|
||||
{ .compatible = "mediatek,mt6797-pinctrl", .data = &mt6797_data },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt6797_pinctrl_of_match);
|
||||
|
||||
static struct platform_driver mt6797_pinctrl_driver = {
|
||||
.driver = {
|
||||
@@ -75,3 +76,6 @@ static int __init mt6797_pinctrl_init(void)
|
||||
return platform_driver_register(&mt6797_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(mt6797_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT6797 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
1409
drivers/pinctrl/mediatek/pinctrl-mt6858.c
Normal file
1409
drivers/pinctrl/mediatek/pinctrl-mt6858.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1459,6 +1459,7 @@ static const struct of_device_id mt6878_pinctrl_of_match[] = {
|
||||
{ .compatible = "mediatek,mt6878-pinctrl", .data = &mt6878_data },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt6878_pinctrl_of_match);
|
||||
|
||||
static struct platform_driver mt6878_pinctrl_driver = {
|
||||
.driver = {
|
||||
@@ -1476,3 +1477,4 @@ static int __init mt6878_pinctrl_init(void)
|
||||
arch_initcall(mt6878_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT6878 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -859,6 +859,7 @@ static const struct of_device_id mt6893_pinctrl_of_match[] = {
|
||||
{ .compatible = "mediatek,mt6893-pinctrl", .data = &mt6893_data },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt6893_pinctrl_of_match);
|
||||
|
||||
static struct platform_driver mt6893_pinctrl_driver = {
|
||||
.driver = {
|
||||
@@ -877,3 +878,4 @@ static int __init mt6893_pinctrl_init(void)
|
||||
arch_initcall(mt6893_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT6893 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -135,3 +135,7 @@ static int __init mt7620_pinctrl_init(void)
|
||||
return platform_driver_register(&mt7620_pinctrl_driver);
|
||||
}
|
||||
core_initcall_sync(mt7620_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT7620 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -115,3 +115,7 @@ static int __init mt7621_pinctrl_init(void)
|
||||
return platform_driver_register(&mt7621_pinctrl_driver);
|
||||
}
|
||||
core_initcall_sync(mt7621_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT7621 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -874,6 +874,7 @@ static const struct of_device_id mt7622_pinctrl_of_match[] = {
|
||||
{ .compatible = "mediatek,mt7622-pinctrl", },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt7622_pinctrl_of_match);
|
||||
|
||||
static int mt7622_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
@@ -893,3 +894,7 @@ static int __init mt7622_pinctrl_init(void)
|
||||
return platform_driver_register(&mt7622_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(mt7622_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT7622 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -1413,6 +1413,7 @@ static const struct of_device_id mt7623_pctrl_match[] = {
|
||||
{ .compatible = "mediatek,mt7623-moore-pinctrl", },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt7623_pctrl_match);
|
||||
|
||||
static int mt7623_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
@@ -1440,3 +1441,7 @@ static int __init mtk_pinctrl_init(void)
|
||||
return platform_driver_register(&mtk_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(mtk_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT7623 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -430,6 +430,7 @@ static const struct of_device_id mt7629_pinctrl_of_match[] = {
|
||||
{ .compatible = "mediatek,mt7629-pinctrl", },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt7629_pinctrl_of_match);
|
||||
|
||||
static int mt7629_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
@@ -449,3 +450,7 @@ static int __init mt7629_pinctrl_init(void)
|
||||
return platform_driver_register(&mt7629_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(mt7629_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT7629 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -247,3 +247,7 @@ static int __init mt76x8_pinctrl_init(void)
|
||||
return platform_driver_register(&mt76x8_pinctrl_driver);
|
||||
}
|
||||
core_initcall_sync(mt76x8_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT76X8 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -1039,6 +1039,7 @@ static const struct of_device_id mt7981_pinctrl_of_match[] = {
|
||||
{ .compatible = "mediatek,mt7981-pinctrl", },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt7981_pinctrl_of_match);
|
||||
|
||||
static int mt7981_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
@@ -1058,3 +1059,7 @@ static int __init mt7981_pinctrl_init(void)
|
||||
return platform_driver_register(&mt7981_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(mt7981_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT7981 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -965,11 +965,13 @@ static const struct of_device_id mt7986a_pinctrl_of_match[] = {
|
||||
{.compatible = "mediatek,mt7986a-pinctrl",},
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt7986a_pinctrl_of_match);
|
||||
|
||||
static const struct of_device_id mt7986b_pinctrl_of_match[] = {
|
||||
{.compatible = "mediatek,mt7986b-pinctrl",},
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt7986b_pinctrl_of_match);
|
||||
|
||||
static int mt7986a_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
@@ -997,15 +999,18 @@ static struct platform_driver mt7986b_pinctrl_driver = {
|
||||
.probe = mt7986b_pinctrl_probe,
|
||||
};
|
||||
|
||||
static int __init mt7986a_pinctrl_init(void)
|
||||
{
|
||||
return platform_driver_register(&mt7986a_pinctrl_driver);
|
||||
}
|
||||
static struct platform_driver * const mt7986_pinctrl_drivers[] = {
|
||||
&mt7986a_pinctrl_driver,
|
||||
&mt7986b_pinctrl_driver,
|
||||
};
|
||||
|
||||
static int __init mt7986b_pinctrl_init(void)
|
||||
static int __init mt7986_pinctrl_init(void)
|
||||
{
|
||||
return platform_driver_register(&mt7986b_pinctrl_driver);
|
||||
return platform_register_drivers(mt7986_pinctrl_drivers,
|
||||
ARRAY_SIZE(mt7986_pinctrl_drivers));
|
||||
}
|
||||
arch_initcall(mt7986_pinctrl_init);
|
||||
|
||||
arch_initcall(mt7986a_pinctrl_init);
|
||||
arch_initcall(mt7986b_pinctrl_init);
|
||||
MODULE_DESCRIPTION("MediaTek MT7986 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -1525,6 +1525,7 @@ static const struct of_device_id mt7988_pinctrl_of_match[] = {
|
||||
{ .compatible = "mediatek,mt7988-pinctrl" },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt7988_pinctrl_of_match);
|
||||
|
||||
static int mt7988_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
@@ -1544,3 +1545,7 @@ static int __init mt7988_pinctrl_init(void)
|
||||
return platform_driver_register(&mt7988_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(mt7988_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT7988 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -293,6 +293,7 @@ static const struct of_device_id mt8127_pctrl_match[] = {
|
||||
{ .compatible = "mediatek,mt8127-pinctrl", .data = &mt8127_pinctrl_data },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt8127_pctrl_match);
|
||||
|
||||
static struct platform_driver mtk_pinctrl_driver = {
|
||||
.probe = mtk_pctrl_common_probe,
|
||||
@@ -307,3 +308,7 @@ static int __init mtk_pinctrl_init(void)
|
||||
return platform_driver_register(&mtk_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(mtk_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT8127 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -322,6 +322,7 @@ static const struct of_device_id mt8135_pctrl_match[] = {
|
||||
{ .compatible = "mediatek,mt8135-pinctrl", .data = &mt8135_pinctrl_data },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt8135_pctrl_match);
|
||||
|
||||
static struct platform_driver mtk_pinctrl_driver = {
|
||||
.probe = mtk_pctrl_common_probe,
|
||||
@@ -336,3 +337,7 @@ static int __init mtk_pinctrl_init(void)
|
||||
return platform_driver_register(&mtk_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(mtk_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT8135 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -343,3 +343,7 @@ static int __init mtk_pinctrl_init(void)
|
||||
return platform_driver_register(&mtk_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(mtk_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT8167 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -341,6 +341,7 @@ static const struct of_device_id mt8173_pctrl_match[] = {
|
||||
},
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt8173_pctrl_match);
|
||||
|
||||
static struct platform_driver mtk_pinctrl_driver = {
|
||||
.probe = mt8173_pinctrl_probe,
|
||||
@@ -356,3 +357,7 @@ static int __init mtk_pinctrl_init(void)
|
||||
return platform_driver_register(&mtk_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(mtk_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT8173 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -571,6 +571,7 @@ static const struct of_device_id mt8183_pinctrl_of_match[] = {
|
||||
{ .compatible = "mediatek,mt8183-pinctrl", .data = &mt8183_data },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt8183_pinctrl_of_match);
|
||||
|
||||
static struct platform_driver mt8183_pinctrl_driver = {
|
||||
.driver = {
|
||||
@@ -586,3 +587,6 @@ static int __init mt8183_pinctrl_init(void)
|
||||
return platform_driver_register(&mt8183_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(mt8183_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT8183 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -1249,6 +1249,7 @@ static const struct of_device_id mt8186_pinctrl_of_match[] = {
|
||||
{ .compatible = "mediatek,mt8186-pinctrl", .data = &mt8186_data },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt8186_pinctrl_of_match);
|
||||
|
||||
static struct platform_driver mt8186_pinctrl_driver = {
|
||||
.driver = {
|
||||
@@ -1265,3 +1266,6 @@ static int __init mt8186_pinctrl_init(void)
|
||||
}
|
||||
|
||||
arch_initcall(mt8186_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT8186 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -1653,6 +1653,7 @@ static const struct of_device_id mt8188_pinctrl_of_match[] = {
|
||||
{ .compatible = "mediatek,mt8188-pinctrl", .data = &mt8188_data },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt8188_pinctrl_of_match);
|
||||
|
||||
static struct platform_driver mt8188_pinctrl_driver = {
|
||||
.driver = {
|
||||
@@ -1671,3 +1672,4 @@ static int __init mt8188_pinctrl_init(void)
|
||||
arch_initcall(mt8188_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT8188 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -1679,6 +1679,7 @@ static const struct of_device_id mt8189_pinctrl_of_match[] = {
|
||||
{ .compatible = "mediatek,mt8189-pinctrl", .data = &mt8189_data },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt8189_pinctrl_of_match);
|
||||
|
||||
static struct platform_driver mt8189_pinctrl_driver = {
|
||||
.driver = {
|
||||
@@ -1696,3 +1697,4 @@ static int __init mt8189_pinctrl_init(void)
|
||||
arch_initcall(mt8189_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT8189 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -1414,6 +1414,7 @@ static const struct of_device_id mt8192_pinctrl_of_match[] = {
|
||||
{ .compatible = "mediatek,mt8192-pinctrl", .data = &mt8192_data },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt8192_pinctrl_of_match);
|
||||
|
||||
static struct platform_driver mt8192_pinctrl_driver = {
|
||||
.driver = {
|
||||
@@ -1431,3 +1432,4 @@ static int __init mt8192_pinctrl_init(void)
|
||||
arch_initcall(mt8192_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT8192 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -963,6 +963,7 @@ static const struct of_device_id mt8195_pinctrl_of_match[] = {
|
||||
{ .compatible = "mediatek,mt8195-pinctrl", .data = &mt8195_data },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt8195_pinctrl_of_match);
|
||||
|
||||
static struct platform_driver mt8195_pinctrl_driver = {
|
||||
.driver = {
|
||||
@@ -978,3 +979,6 @@ static int __init mt8195_pinctrl_init(void)
|
||||
return platform_driver_register(&mt8195_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(mt8195_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT8195 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -1839,6 +1839,7 @@ static const struct of_device_id mt8196_pinctrl_of_match[] = {
|
||||
{ .compatible = "mediatek,mt8196-pinctrl", .data = &mt8196_data },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt8196_pinctrl_of_match);
|
||||
|
||||
static struct platform_driver mt8196_pinctrl_driver = {
|
||||
.driver = {
|
||||
@@ -1856,3 +1857,4 @@ static int __init mt8196_pinctrl_init(void)
|
||||
arch_initcall(mt8196_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT8196 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -477,6 +477,7 @@ static const struct of_device_id mt8365_pctrl_match[] = {
|
||||
{ .compatible = "mediatek,mt8365-pinctrl", .data = &mt8365_pinctrl_data },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mt8365_pctrl_match);
|
||||
|
||||
static struct platform_driver mtk_pinctrl_driver = {
|
||||
.probe = mtk_pctrl_common_probe,
|
||||
@@ -494,4 +495,6 @@ static int __init mtk_pinctrl_init(void)
|
||||
arch_initcall(mtk_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT8365 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_AUTHOR("Zhiyong Tao <zhiyong.tao@mediatek.com>");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -343,3 +343,7 @@ static int __init mtk_pinctrl_init(void)
|
||||
return platform_driver_register(&mtk_pinctrl_driver);
|
||||
}
|
||||
arch_initcall(mtk_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MT8516 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -69,6 +69,7 @@ void mtk_rmw(struct mtk_pinctrl *pctl, u8 i, u32 reg, u32 mask, u32 set)
|
||||
|
||||
spin_unlock_irqrestore(&pctl->lock, flags);
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(mtk_rmw, "MTK_PINCTRL");
|
||||
|
||||
static int mtk_hw_pin_field_lookup(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
@@ -1242,11 +1243,7 @@ int mtk_pinconf_adv_drive_set(struct mtk_pinctrl *hw,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV_E1, e1);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return err;
|
||||
return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV_E1, e1);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mtk_pinconf_adv_drive_set);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <linux/io.h>
|
||||
#include <linux/gpio/driver.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
@@ -190,6 +191,7 @@ int mtk_pconf_spec_set_ies_smt_range(struct regmap *regmap,
|
||||
regmap_write(regmap, reg_addr, bit);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(mtk_pconf_spec_set_ies_smt_range, "MTK_PINCTRL");
|
||||
|
||||
static const struct mtk_pin_drv_grp *mtk_find_pin_drv_grp_by_pin(
|
||||
struct mtk_pinctrl *pctl, unsigned long pin) {
|
||||
@@ -297,6 +299,7 @@ int mtk_pctrl_spec_pull_set_samereg(struct regmap *regmap,
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(mtk_pctrl_spec_pull_set_samereg, "MTK_PINCTRL");
|
||||
|
||||
static int mtk_pconf_set_pull_select(struct mtk_pinctrl *pctl,
|
||||
unsigned int pin, bool enable, bool isup, unsigned int arg)
|
||||
@@ -1130,31 +1133,26 @@ int mtk_pctrl_init(struct platform_device *pdev,
|
||||
pctl->chip->parent = &pdev->dev;
|
||||
pctl->chip->base = -1;
|
||||
|
||||
ret = gpiochip_add_data(pctl->chip, pctl);
|
||||
ret = devm_gpiochip_add_data(&pdev->dev, pctl->chip, pctl);
|
||||
if (ret)
|
||||
return -EINVAL;
|
||||
|
||||
/* Register the GPIO to pin mappings. */
|
||||
ret = gpiochip_add_pin_range(pctl->chip, dev_name(&pdev->dev),
|
||||
0, 0, pctl->devdata->npins);
|
||||
if (ret) {
|
||||
ret = -EINVAL;
|
||||
goto chip_error;
|
||||
}
|
||||
if (ret)
|
||||
return -EINVAL;
|
||||
|
||||
/* Only initialize EINT if we have EINT pins */
|
||||
if (data->eint_hw.ap_num > 0) {
|
||||
ret = mtk_eint_init(pctl, pdev);
|
||||
if (ret)
|
||||
goto chip_error;
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
chip_error:
|
||||
gpiochip_remove(pctl->chip);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(mtk_pctrl_init, "MTK_PINCTRL");
|
||||
|
||||
int mtk_pctrl_common_probe(struct platform_device *pdev)
|
||||
{
|
||||
@@ -1166,3 +1164,7 @@ int mtk_pctrl_common_probe(struct platform_device *pdev)
|
||||
|
||||
return mtk_pctrl_init(pdev, data, NULL);
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(mtk_pctrl_common_probe, "MTK_PINCTRL");
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek Pinctrl Common Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
2378
drivers/pinctrl/mediatek/pinctrl-mtk-mt6858.h
Normal file
2378
drivers/pinctrl/mediatek/pinctrl-mtk-mt6858.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -349,3 +349,7 @@ int mtmips_pinctrl_init(struct platform_device *pdev,
|
||||
|
||||
return PTR_ERR_OR_ZERO(dev);
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(mtmips_pinctrl_init, "MTK_PINCTRL");
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek MIPS Pinctrl Common Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -957,7 +957,7 @@ static int mtk_build_gpiochip(struct mtk_pinctrl *hw)
|
||||
chip->base = -1;
|
||||
chip->ngpio = hw->soc->npins;
|
||||
|
||||
ret = gpiochip_add_data(chip, hw);
|
||||
ret = devm_gpiochip_add_data(hw->dev, chip, hw);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -59,3 +59,7 @@ static int __init rt2880_pinctrl_init(void)
|
||||
return platform_driver_register(&rt2880_pinctrl_driver);
|
||||
}
|
||||
core_initcall_sync(rt2880_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek RT2880 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -138,3 +138,7 @@ static int __init rt305x_pinctrl_init(void)
|
||||
return platform_driver_register(&rt305x_pinctrl_driver);
|
||||
}
|
||||
core_initcall_sync(rt305x_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek RT305X Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -106,3 +106,7 @@ static int __init rt3883_pinctrl_init(void)
|
||||
return platform_driver_register(&rt3883_pinctrl_driver);
|
||||
}
|
||||
core_initcall_sync(rt3883_pinctrl_init);
|
||||
|
||||
MODULE_DESCRIPTION("MediaTek RT3883 Pinctrl Driver");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_IMPORT_NS("MTK_PINCTRL");
|
||||
|
||||
@@ -469,9 +469,15 @@ static int aml_pinconf_get(struct pinctrl_dev *pcdev, unsigned int pin,
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
ret = aml_pinconf_get_output(info, pin);
|
||||
if (ret <= 0)
|
||||
if (ret < 0)
|
||||
return -EINVAL;
|
||||
arg = 1;
|
||||
arg = ret;
|
||||
break;
|
||||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
ret = aml_pinconf_get_output(info, pin);
|
||||
if (ret < 0)
|
||||
return -EINVAL;
|
||||
arg = !ret;
|
||||
break;
|
||||
case PIN_CONFIG_LEVEL:
|
||||
ret = aml_pinconf_get_output(info, pin);
|
||||
@@ -619,6 +625,7 @@ static int aml_pinconf_set(struct pinctrl_dev *pcdev, unsigned int pin,
|
||||
switch (param) {
|
||||
case PIN_CONFIG_DRIVE_STRENGTH_UA:
|
||||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
arg = pinconf_to_config_argument(configs[i]);
|
||||
break;
|
||||
@@ -643,6 +650,9 @@ static int aml_pinconf_set(struct pinctrl_dev *pcdev, unsigned int pin,
|
||||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
ret = aml_pinconf_set_output(info, pin, arg);
|
||||
break;
|
||||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
ret = aml_pinconf_set_output(info, pin, !arg);
|
||||
break;
|
||||
case PIN_CONFIG_LEVEL:
|
||||
ret = aml_pinconf_set_output_drive(info, pin, arg);
|
||||
break;
|
||||
|
||||
@@ -252,11 +252,11 @@ static int meson_pinconf_set_output_drive(struct meson_pinctrl *pc,
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = meson_pinconf_set_output(pc, pin, true);
|
||||
ret = meson_pinconf_set_drive(pc, pin, high);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return meson_pinconf_set_drive(pc, pin, high);
|
||||
return meson_pinconf_set_output(pc, pin, true);
|
||||
}
|
||||
|
||||
static int meson_pinconf_disable_bias(struct meson_pinctrl *pc,
|
||||
@@ -498,9 +498,9 @@ static int meson_pinconf_get(struct pinctrl_dev *pcdev, unsigned int pin,
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
ret = meson_pinconf_get_output(pc, pin);
|
||||
if (ret <= 0)
|
||||
if (ret < 0)
|
||||
return -EINVAL;
|
||||
arg = 1;
|
||||
arg = ret;
|
||||
break;
|
||||
case PIN_CONFIG_LEVEL:
|
||||
ret = meson_pinconf_get_output(pc, pin);
|
||||
|
||||
@@ -259,11 +259,10 @@ static int npcmgpio_set_irq_type(struct irq_data *d, unsigned int type)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
|
||||
if (type & IRQ_TYPE_LEVEL_MASK) {
|
||||
npcm_gpio_clr(&bank->chip, bank->base + NPCM7XX_GP_N_EVTYP, gpio);
|
||||
irq_set_handler_locked(d, handle_level_irq);
|
||||
} else if (type & (IRQ_TYPE_EDGE_BOTH | IRQ_TYPE_EDGE_RISING
|
||||
| IRQ_TYPE_EDGE_FALLING)) {
|
||||
} else if (type & IRQ_TYPE_EDGE_BOTH) {
|
||||
npcm_gpio_set(&bank->chip, bank->base + NPCM7XX_GP_N_EVTYP, gpio);
|
||||
irq_set_handler_locked(d, handle_edge_irq);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#define NPCM8XX_GCR_SRCNT 0x068
|
||||
#define NPCM8XX_GCR_FLOCKR1 0x074
|
||||
#define NPCM8XX_GCR_DSCNT 0x078
|
||||
#define NPCM8XX_GCR_INTCR4 0x0c0
|
||||
#define NPCM8XX_GCR_I2CSEGSEL 0x0e0
|
||||
#define NPCM8XX_GCR_MFSEL1 0x260
|
||||
#define NPCM8XX_GCR_MFSEL2 0x264
|
||||
@@ -77,6 +78,11 @@
|
||||
#define NPCM8XX_GPIO_PER_BANK 32
|
||||
#define NPCM8XX_GPIO_BANK_NUM 8
|
||||
#define NPCM8XX_GCR_NONE 0
|
||||
#define NPCM8XX_INTCR4_R1_RMII_EN BIT(12)
|
||||
#define NPCM8XX_INTCR4_R2_RMII_EN BIT(13)
|
||||
#define NPCM8XX_INTCR4_RMII3_EN BIT(14)
|
||||
#define NPCM8XX_GCR_DSCNT_RG2DS_SHIFT 6
|
||||
#define NPCM8XX_GCR_DSCNT_RG2DS_MASK GENMASK(7, 6)
|
||||
|
||||
#define NPCM8XX_DEBOUNCE_MAX 4
|
||||
#define NPCM8XX_DEBOUNCE_NSEC 40
|
||||
@@ -290,17 +296,33 @@ static void npcmgpio_irq_unmask(struct irq_data *d)
|
||||
|
||||
static unsigned int npcmgpio_irq_startup(struct irq_data *d)
|
||||
{
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
unsigned int gpio = irqd_to_hwirq(d);
|
||||
|
||||
/* active-high, input, clear interrupt, enable interrupt */
|
||||
npcmgpio_direction_input(gc, gpio);
|
||||
npcmgpio_irq_ack(d);
|
||||
npcmgpio_irq_unmask(d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int npcmgpio_irq_request_resources(struct irq_data *d)
|
||||
{
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
unsigned int gpio = irqd_to_hwirq(d);
|
||||
int ret;
|
||||
|
||||
ret = npcmgpio_direction_input(gc, gpio);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return gpiochip_reqres_irq(gc, gpio);
|
||||
}
|
||||
|
||||
static void npcmgpio_irq_release_resources(struct irq_data *d)
|
||||
{
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
unsigned int gpio = irqd_to_hwirq(d);
|
||||
|
||||
gpiochip_relres_irq(gc, gpio);
|
||||
}
|
||||
|
||||
static struct irq_chip npcmgpio_irqchip = {
|
||||
.name = "NPCM8XX-GPIO-IRQ",
|
||||
.irq_ack = npcmgpio_irq_ack,
|
||||
@@ -308,8 +330,9 @@ static struct irq_chip npcmgpio_irqchip = {
|
||||
.irq_mask = npcmgpio_irq_mask,
|
||||
.irq_set_type = npcmgpio_set_irq_type,
|
||||
.irq_startup = npcmgpio_irq_startup,
|
||||
.irq_request_resources = npcmgpio_irq_request_resources,
|
||||
.irq_release_resources = npcmgpio_irq_release_resources,
|
||||
.flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_IMMUTABLE,
|
||||
GPIOCHIP_IRQ_RESOURCE_HELPERS,
|
||||
};
|
||||
|
||||
static const int gpi36_pins[] = { 36 };
|
||||
@@ -537,7 +560,7 @@ static const int wdog2_pins[] = { 219 };
|
||||
|
||||
static const int bmcuart0a_pins[] = { 41, 42 };
|
||||
static const int bmcuart0b_pins[] = { 48, 49 };
|
||||
static const int bmcuart1_pins[] = { 43, 44, 62, 63 };
|
||||
static const int bmcuart1_pins[] = { 43, 63 };
|
||||
|
||||
static const int scipme_pins[] = { 169 };
|
||||
static const int smi_pins[] = { 170 };
|
||||
@@ -1282,6 +1305,7 @@ static struct pinfunction npcm8xx_funcs[] = {
|
||||
#define DRIVE_STRENGTH_LO_SHIFT 8
|
||||
#define DRIVE_STRENGTH_HI_SHIFT 12
|
||||
#define DRIVE_STRENGTH_MASK GENMASK(15, 8)
|
||||
#define DSTR_RG2 BIT(16)
|
||||
|
||||
#define DSTR(lo, hi) (((lo) << DRIVE_STRENGTH_LO_SHIFT) | \
|
||||
((hi) << DRIVE_STRENGTH_HI_SHIFT))
|
||||
@@ -1414,10 +1438,10 @@ static const struct npcm8xx_pincfg pincfg[] = {
|
||||
NPCM8XX_PINCFG(107, i3c5, MFSEL3, 22, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(108, sg1mdio, MFSEL4, 21, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(109, sg1mdio, MFSEL4, 21, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(110, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(111, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(112, rg2, MFSEL4, 24, ddr, MFSEL3, 26, none, NONE, 0, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(113, rg2, MFSEL4, 24, ddr, MFSEL3, 26, none, NONE, 0, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(110, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, none, NONE, 0, none, NONE, 0, DSTR_RG2 | SLEW),
|
||||
NPCM8XX_PINCFG(111, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, none, NONE, 0, none, NONE, 0, DSTR_RG2 | SLEW),
|
||||
NPCM8XX_PINCFG(112, rg2, MFSEL4, 24, ddr, MFSEL3, 26, none, NONE, 0, none, NONE, 0, none, NONE, 0, DSTR_RG2 | SLEW),
|
||||
NPCM8XX_PINCFG(113, rg2, MFSEL4, 24, ddr, MFSEL3, 26, none, NONE, 0, none, NONE, 0, none, NONE, 0, DSTR_RG2 | SLEW),
|
||||
NPCM8XX_PINCFG(114, smb0, MFSEL1, 6, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, 0),
|
||||
NPCM8XX_PINCFG(115, smb0, MFSEL1, 6, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, 0),
|
||||
NPCM8XX_PINCFG(116, smb1, MFSEL1, 7, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, 0),
|
||||
@@ -1440,14 +1464,14 @@ static const struct npcm8xx_pincfg pincfg[] = {
|
||||
NPCM8XX_PINCFG(133, smb10, MFSEL4, 13, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, 0),
|
||||
NPCM8XX_PINCFG(134, smb11, MFSEL4, 14, smb23b, MFSEL6, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, 0),
|
||||
NPCM8XX_PINCFG(135, smb11, MFSEL4, 14, smb23b, MFSEL6, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, 0),
|
||||
NPCM8XX_PINCFG(136, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW),
|
||||
NPCM8XX_PINCFG(137, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW),
|
||||
NPCM8XX_PINCFG(138, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW),
|
||||
NPCM8XX_PINCFG(139, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW),
|
||||
NPCM8XX_PINCFG(140, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW),
|
||||
NPCM8XX_PINCFG(141, smb7b, I2CSEGSEL, 27, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, 0),
|
||||
NPCM8XX_PINCFG(142, smb7d, I2CSEGSEL, 29, tp_smb1, MFSEL7, 11, none, NONE, 0, none, NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW),
|
||||
NPCM8XX_PINCFG(143, smb7d, I2CSEGSEL, 29, tp_smb1, MFSEL7, 11, none, NONE, 0, none, NONE, 0, none, NONE, 0, 0),
|
||||
NPCM8XX_PINCFG(136, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(137, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(138, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(139, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(140, jm1, MFSEL5, 15, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(141, smb7b, I2CSEGSEL, 27, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(142, smb7d, I2CSEGSEL, 29, tp_smb1, MFSEL7, 11, none, NONE, 0, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(143, smb7d, I2CSEGSEL, 29, tp_smb1, MFSEL7, 11, none, NONE, 0, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(144, pwm4, MFSEL2, 20, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, DSTR(4, 8)),
|
||||
NPCM8XX_PINCFG(145, pwm5, MFSEL2, 21, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, DSTR(4, 8)),
|
||||
NPCM8XX_PINCFG(146, pwm6, MFSEL2, 22, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, DSTR(4, 8)),
|
||||
@@ -1508,8 +1532,8 @@ static const struct npcm8xx_pincfg pincfg[] = {
|
||||
NPCM8XX_PINCFG(201, r1, MFSEL3, 9, none, NONE, 0, none, NONE, 0, none, NONE, 0, none, NONE, 0, GPO),
|
||||
NPCM8XX_PINCFG(202, smb0c, I2CSEGSEL, 1, fm0, MFSEL6, 16, none, NONE, 0, none, NONE, 0, none, NONE, 0, SLEW),
|
||||
NPCM8XX_PINCFG(203, faninx, MFSEL3, 3, spi1cs0, MFSEL3, 4, fm1, MFSEL6, 17, none, NONE, 0, none, NONE, 0, DSTR(8, 12)),
|
||||
NPCM8XX_PINCFG(208, rg2, MFSEL4, 24, ddr, MFSEL3, 26, none, NONE, 0, none, NONE, 0, none, NONE, 0, SLEW), /* DSCNT */
|
||||
NPCM8XX_PINCFG(209, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, none, NONE, 0, none, NONE, 0, SLEW), /* DSCNT */
|
||||
NPCM8XX_PINCFG(208, rg2, MFSEL4, 24, ddr, MFSEL3, 26, none, NONE, 0, none, NONE, 0, none, NONE, 0, DSTR_RG2 | SLEW),
|
||||
NPCM8XX_PINCFG(209, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, none, NONE, 0, none, NONE, 0, DSTR_RG2 | SLEW),
|
||||
NPCM8XX_PINCFG(210, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, none, NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW),
|
||||
NPCM8XX_PINCFG(211, rg2, MFSEL4, 24, ddr, MFSEL3, 26, rmii3, MFSEL5, 11, none, NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW),
|
||||
NPCM8XX_PINCFG(212, rg2, MFSEL4, 24, ddr, MFSEL3, 26, r3rxer, MFSEL6, 30, none, NONE, 0, none, NONE, 0, DSTR(8, 12) | SLEW),
|
||||
@@ -1559,7 +1583,7 @@ static const struct pinctrl_pin_desc npcm8xx_pins[] = {
|
||||
PINCTRL_PIN(4, "GPIO4/IOX2_DI/SMB1D_SDA"),
|
||||
PINCTRL_PIN(5, "GPIO5/IOX2_LD/SMB1D_SCL"),
|
||||
PINCTRL_PIN(6, "GPIO6/IOX2_CK/SMB2D_SDA"),
|
||||
PINCTRL_PIN(7, "GPIO7/IOX2_D0/SMB2D_SCL"),
|
||||
PINCTRL_PIN(7, "GPIO7/IOX2_DO/SMB2D_SCL"),
|
||||
PINCTRL_PIN(8, "GPIO8/LKGPO1/TP_GPIO0"),
|
||||
PINCTRL_PIN(9, "GPIO9/LKGPO2/TP_GPIO1"),
|
||||
PINCTRL_PIN(10, "GPIO10/IOXH_LD/SMB6D_SCL/SMB16_SCL"),
|
||||
@@ -1795,6 +1819,61 @@ static const struct pinctrl_pin_desc npcm8xx_pins[] = {
|
||||
PINCTRL_PIN(251, "JM2/CP1_GPIO"),
|
||||
};
|
||||
|
||||
static u32 npcm8xx_rmii_output_enable_mask(unsigned int pin)
|
||||
{
|
||||
switch (pin) {
|
||||
case 178:
|
||||
case 179:
|
||||
case 180:
|
||||
case 181:
|
||||
case 182:
|
||||
case 193:
|
||||
case 201:
|
||||
return NPCM8XX_INTCR4_R1_RMII_EN;
|
||||
case 84:
|
||||
case 85:
|
||||
case 86:
|
||||
case 87:
|
||||
case 88:
|
||||
case 89:
|
||||
case 200:
|
||||
return NPCM8XX_INTCR4_R2_RMII_EN;
|
||||
case 110:
|
||||
case 111:
|
||||
case 209:
|
||||
case 210:
|
||||
case 211:
|
||||
case 214:
|
||||
case 215:
|
||||
return NPCM8XX_INTCR4_RMII3_EN;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void npcm8xx_set_rmii_output_enable(struct regmap *gcr_regmap,
|
||||
const unsigned int *pin,
|
||||
int pin_number, int mode)
|
||||
{
|
||||
u32 mask = 0;
|
||||
u32 val = 0;
|
||||
u32 bit;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < pin_number; i++) {
|
||||
bit = npcm8xx_rmii_output_enable_mask(pin[i]);
|
||||
mask |= bit;
|
||||
|
||||
if ((mode == fn_r1 && bit == NPCM8XX_INTCR4_R1_RMII_EN) ||
|
||||
(mode == fn_r2 && bit == NPCM8XX_INTCR4_R2_RMII_EN) ||
|
||||
(mode == fn_rmii3 && bit == NPCM8XX_INTCR4_RMII3_EN))
|
||||
val |= bit;
|
||||
}
|
||||
|
||||
if (mask)
|
||||
regmap_update_bits(gcr_regmap, NPCM8XX_GCR_INTCR4, mask, val);
|
||||
}
|
||||
|
||||
/* Enable mode in pin group */
|
||||
static void npcm8xx_setfunc(struct regmap *gcr_regmap, const unsigned int *pin,
|
||||
int pin_number, int mode)
|
||||
@@ -1833,6 +1912,8 @@ static void npcm8xx_setfunc(struct regmap *gcr_regmap, const unsigned int *pin,
|
||||
BIT(cfg->bit4) : 0);
|
||||
}
|
||||
}
|
||||
|
||||
npcm8xx_set_rmii_output_enable(gcr_regmap, pin, pin_number, mode);
|
||||
}
|
||||
|
||||
static int npcm8xx_get_slew_rate(struct npcm8xx_gpio *bank,
|
||||
@@ -1892,6 +1973,56 @@ static int npcm8xx_set_slew_rate(struct npcm8xx_gpio *bank,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int npcm8xx_get_rg2_drive_strength(struct npcm8xx_pinctrl *npcm)
|
||||
{
|
||||
u32 val;
|
||||
int ret;
|
||||
|
||||
ret = regmap_read(npcm->gcr_regmap, NPCM8XX_GCR_DSCNT, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
switch ((val & NPCM8XX_GCR_DSCNT_RG2DS_MASK) >>
|
||||
NPCM8XX_GCR_DSCNT_RG2DS_SHIFT) {
|
||||
case 0:
|
||||
return 8;
|
||||
case 1:
|
||||
return 12;
|
||||
case 2:
|
||||
return 16;
|
||||
case 3:
|
||||
return 24;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
static int npcm8xx_set_rg2_drive_strength(struct npcm8xx_pinctrl *npcm, int nval)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
switch (nval) {
|
||||
case 8:
|
||||
val = 0;
|
||||
break;
|
||||
case 12:
|
||||
val = 1;
|
||||
break;
|
||||
case 16:
|
||||
val = 2;
|
||||
break;
|
||||
case 24:
|
||||
val = 3;
|
||||
break;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
return regmap_update_bits(npcm->gcr_regmap, NPCM8XX_GCR_DSCNT,
|
||||
NPCM8XX_GCR_DSCNT_RG2DS_MASK,
|
||||
val << NPCM8XX_GCR_DSCNT_RG2DS_SHIFT);
|
||||
}
|
||||
|
||||
static int npcm8xx_get_drive_strength(struct pinctrl_dev *pctldev,
|
||||
unsigned int pin)
|
||||
{
|
||||
@@ -1900,10 +2031,13 @@ static int npcm8xx_get_drive_strength(struct pinctrl_dev *pctldev,
|
||||
&npcm->gpio_bank[pin / NPCM8XX_GPIO_PER_BANK];
|
||||
int gpio = pin % bank->chip.gc.ngpio;
|
||||
unsigned long pinmask = BIT(gpio);
|
||||
int flg, val;
|
||||
u32 ds = 0;
|
||||
int flg, ds;
|
||||
u32 val;
|
||||
|
||||
flg = pincfg[pin].flag;
|
||||
if (flg & DSTR_RG2)
|
||||
return npcm8xx_get_rg2_drive_strength(npcm);
|
||||
|
||||
if (!(flg & DRIVE_STRENGTH_MASK))
|
||||
return -EINVAL;
|
||||
|
||||
@@ -1922,6 +2056,9 @@ static int npcm8xx_set_drive_strength(struct npcm8xx_pinctrl *npcm,
|
||||
int gpio = BIT(pin % bank->chip.gc.ngpio);
|
||||
int v;
|
||||
|
||||
if (pincfg[pin].flag & DSTR_RG2)
|
||||
return npcm8xx_set_rg2_drive_strength(npcm, nval);
|
||||
|
||||
v = pincfg[pin].flag & DRIVE_STRENGTH_MASK;
|
||||
|
||||
if (DSLO(v) == nval)
|
||||
@@ -2073,7 +2210,8 @@ static const struct pinmux_ops npcm8xx_pinmux_ops = {
|
||||
static int debounce_timing_setting(struct npcm8xx_gpio *bank, u32 gpio,
|
||||
u32 nanosecs)
|
||||
{
|
||||
void __iomem *DBNCS_offset = bank->base + NPCM8XX_GP_N_DBNCS0 + (gpio / 4);
|
||||
void __iomem *DBNCS_offset = bank->base + NPCM8XX_GP_N_DBNCS0 +
|
||||
(gpio / 16) * 4;
|
||||
int gpio_debounce = (gpio % 16) * 2, debounce_select, i;
|
||||
u32 dbncp_val, dbncp_val_mod;
|
||||
|
||||
@@ -2350,6 +2488,9 @@ static int npcm8xx_gpio_fw(struct npcm8xx_pinctrl *pctrl)
|
||||
if (ret < 0)
|
||||
return dev_err_probe(dev, ret, "Failed to retrieve IRQ for bank %u\n", id);
|
||||
|
||||
iowrite32(0, pctrl->gpio_bank[id].base + NPCM8XX_GP_N_EVEN);
|
||||
iowrite32(0xffffffff, pctrl->gpio_bank[id].base + NPCM8XX_GP_N_EVST);
|
||||
|
||||
pctrl->gpio_bank[id].irq = ret;
|
||||
pctrl->gpio_bank[id].irq_chip = npcmgpio_irqchip;
|
||||
pctrl->gpio_bank[id].irqbase = id * NPCM8XX_GPIO_PER_BANK;
|
||||
|
||||
@@ -60,6 +60,12 @@ static u32 get_pin_func(u32 pinmux)
|
||||
return pinmux & GENMASK(3, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* struct s32_pinctrl_mem_region - memory region for a set of SIUL2 registers
|
||||
* @map: regmap used for this range
|
||||
* @pin_range: the pins controlled by these registers
|
||||
* @name: name of the current range
|
||||
*/
|
||||
struct s32_pinctrl_mem_region {
|
||||
struct regmap *map;
|
||||
const struct s32_pin_range *pin_range;
|
||||
@@ -67,7 +73,7 @@ struct s32_pinctrl_mem_region {
|
||||
};
|
||||
|
||||
/*
|
||||
* Holds pin configuration for GPIO's.
|
||||
* struct gpio_pin_config - holds pin configuration for GPIO's
|
||||
* @pin_id: Pin ID for this GPIO
|
||||
* @config: Pin settings
|
||||
* @list: Linked list entry for each gpio pin
|
||||
@@ -79,20 +85,22 @@ struct gpio_pin_config {
|
||||
};
|
||||
|
||||
/*
|
||||
* Pad config save/restore for power suspend/resume.
|
||||
* struct s32_pinctrl_context - pad config save/restore for suspend/resume
|
||||
* @pads: saved values for the pads
|
||||
*/
|
||||
struct s32_pinctrl_context {
|
||||
unsigned int *pads;
|
||||
};
|
||||
|
||||
/*
|
||||
* struct s32_pinctrl - private driver data
|
||||
* @dev: a pointer back to containing device
|
||||
* @pctl: a pointer to the pinctrl device structure
|
||||
* @regions: reserved memory regions with start/end pin
|
||||
* @info: structure containing information about the pin
|
||||
* @gpio_configs: Saved configurations for GPIO pins
|
||||
* @gpiop_configs_lock: lock for the `gpio_configs` list
|
||||
* @s32_pinctrl_context: Configuration saved over system sleep
|
||||
* @gpio_configs: saved configurations for GPIO pins
|
||||
* @gpio_configs_lock: lock for the `gpio_configs` list
|
||||
* @saved_context: configuration saved over system sleep
|
||||
*/
|
||||
struct s32_pinctrl {
|
||||
struct device *dev;
|
||||
@@ -123,13 +131,13 @@ s32_get_region(struct pinctrl_dev *pctldev, unsigned int pin)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline int s32_check_pin(struct pinctrl_dev *pctldev,
|
||||
unsigned int pin)
|
||||
static int s32_check_pin(struct pinctrl_dev *pctldev,
|
||||
unsigned int pin)
|
||||
{
|
||||
return s32_get_region(pctldev, pin) ? 0 : -EINVAL;
|
||||
}
|
||||
|
||||
static inline int s32_regmap_read(struct pinctrl_dev *pctldev,
|
||||
static int s32_regmap_read(struct pinctrl_dev *pctldev,
|
||||
unsigned int pin, unsigned int *val)
|
||||
{
|
||||
struct s32_pinctrl_mem_region *region;
|
||||
@@ -145,7 +153,7 @@ static inline int s32_regmap_read(struct pinctrl_dev *pctldev,
|
||||
return regmap_read(region->map, offset, val);
|
||||
}
|
||||
|
||||
static inline int s32_regmap_write(struct pinctrl_dev *pctldev,
|
||||
static int s32_regmap_write(struct pinctrl_dev *pctldev,
|
||||
unsigned int pin,
|
||||
unsigned int val)
|
||||
{
|
||||
@@ -163,7 +171,7 @@ static inline int s32_regmap_write(struct pinctrl_dev *pctldev,
|
||||
|
||||
}
|
||||
|
||||
static inline int s32_regmap_update(struct pinctrl_dev *pctldev, unsigned int pin,
|
||||
static int s32_regmap_update(struct pinctrl_dev *pctldev, unsigned int pin,
|
||||
unsigned int mask, unsigned int val)
|
||||
{
|
||||
struct s32_pinctrl_mem_region *region;
|
||||
@@ -476,8 +484,8 @@ static int s32_get_slew_regval(int arg)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline void s32_pin_set_pull(enum pin_config_param param,
|
||||
unsigned int *mask, unsigned int *config)
|
||||
static void s32_pin_set_pull(enum pin_config_param param,
|
||||
unsigned int *mask, unsigned int *config)
|
||||
{
|
||||
switch (param) {
|
||||
case PIN_CONFIG_BIAS_DISABLE:
|
||||
@@ -966,11 +974,11 @@ int s32_pinctrl_probe(struct platform_device *pdev,
|
||||
return dev_err_probe(&pdev->dev, ret,
|
||||
"Fail to probe dt properties\n");
|
||||
|
||||
ipctl->pctl = devm_pinctrl_register(&pdev->dev, s32_pinctrl_desc,
|
||||
ipctl);
|
||||
if (IS_ERR(ipctl->pctl))
|
||||
return dev_err_probe(&pdev->dev, PTR_ERR(ipctl->pctl),
|
||||
"could not register s32 pinctrl driver\n");
|
||||
ret = devm_pinctrl_register_and_init(&pdev->dev, s32_pinctrl_desc,
|
||||
ipctl, &ipctl->pctl);
|
||||
if (ret)
|
||||
return dev_err_probe(&pdev->dev, ret,
|
||||
"Could not register s32 pinctrl driver\n");
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
saved_context = &ipctl->saved_context;
|
||||
@@ -982,7 +990,12 @@ int s32_pinctrl_probe(struct platform_device *pdev,
|
||||
return -ENOMEM;
|
||||
#endif
|
||||
|
||||
dev_info(&pdev->dev, "initialized s32 pinctrl driver\n");
|
||||
ret = pinctrl_enable(ipctl->pctl);
|
||||
if (ret)
|
||||
return dev_err_probe(&pdev->dev, ret,
|
||||
"Failed to enable pinctrl\n");
|
||||
|
||||
dev_info(&pdev->dev, "Initialized S32 pinctrl driver\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -817,7 +817,7 @@ static int aw9523_init_irq(struct aw9523 *awi, int irq)
|
||||
ret = devm_request_threaded_irq(dev, irq, NULL, aw9523_irq_thread_func,
|
||||
IRQF_ONESHOT, dev_name(dev), awi);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "Failed to request irq %d\n", irq);
|
||||
return ret;
|
||||
|
||||
girq = &awi->gpio.irq;
|
||||
gpio_irq_chip_set_chip(girq, &aw9523_irq_chip);
|
||||
|
||||
@@ -422,6 +422,9 @@ static int eic7700_pin_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
||||
else
|
||||
value &= ~EIC7700_ST;
|
||||
break;
|
||||
/* All pins are persistent over suspend */
|
||||
case PIN_CONFIG_PERSIST_STATE:
|
||||
return 0;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ static int mux_pinmux_set_mux(struct pinctrl_dev *pctldev,
|
||||
function = pinmux_generic_get_function(pctldev, func_selector);
|
||||
func = function->data;
|
||||
|
||||
ret = mux_state_select(func->mux_state);
|
||||
ret = mux_state_try_select(func->mux_state);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -42,33 +42,44 @@ int pinctrl_generic_to_map(struct pinctrl_dev *pctldev, struct device_node *pare
|
||||
ret = pinctrl_utils_add_map_mux(pctldev, maps, num_reserved_maps, num_maps, group_name,
|
||||
parent->name);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
goto err_free_map;
|
||||
|
||||
ret = pinctrl_generic_add_group(pctldev, group_name, pins, npins, data);
|
||||
if (ret < 0)
|
||||
return dev_err_probe(dev, ret, "failed to add group %s: %d\n",
|
||||
if (ret < 0) {
|
||||
dev_err_probe(dev, ret, "failed to add group %s: %d\n",
|
||||
group_name, ret);
|
||||
goto err_free_map;
|
||||
}
|
||||
|
||||
ret = pinconf_generic_parse_dt_config(np, pctldev, &configs, &num_configs);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "failed to parse pin config of group %s\n",
|
||||
if (ret) {
|
||||
dev_err_probe(dev, ret, "failed to parse pin config of group %s\n",
|
||||
group_name);
|
||||
goto err_free_map;
|
||||
}
|
||||
|
||||
if (num_configs == 0)
|
||||
return 0;
|
||||
|
||||
ret = pinctrl_utils_reserve_map(pctldev, maps, num_reserved_maps, num_maps, reserve);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err_free_map;
|
||||
|
||||
ret = pinctrl_utils_add_map_configs(pctldev, maps, num_reserved_maps, num_maps, group_name,
|
||||
configs,
|
||||
num_configs, PIN_MAP_TYPE_CONFIGS_GROUP);
|
||||
kfree(configs);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err_free_map;
|
||||
|
||||
return 0;
|
||||
|
||||
err_free_map:
|
||||
pinctrl_utils_free_map(pctldev, *maps, *num_maps);
|
||||
*maps = NULL;
|
||||
*num_maps = 0;
|
||||
*num_reserved_maps = 0;
|
||||
return ret;
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(pinctrl_generic_to_map);
|
||||
|
||||
|
||||
@@ -559,11 +559,8 @@ static int mcp23s08_irq_setup(struct mcp23s08 *mcp)
|
||||
err = devm_request_threaded_irq(chip->parent, mcp->irq, NULL,
|
||||
mcp23s08_irq,
|
||||
irqflags, dev_name(chip->parent), mcp);
|
||||
if (err != 0) {
|
||||
dev_err(chip->parent, "unable to request IRQ#%d: %d\n",
|
||||
mcp->irq, err);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2317,7 +2317,7 @@ static const struct irq_chip ocelot_irqchip = {
|
||||
|
||||
static int ocelot_irq_set_type(struct irq_data *data, unsigned int type)
|
||||
{
|
||||
if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
|
||||
if (type & IRQ_TYPE_LEVEL_MASK)
|
||||
irq_set_chip_handler_name_locked(data, &ocelot_level_irqchip,
|
||||
handle_level_irq, NULL);
|
||||
if (type & IRQ_TYPE_EDGE_BOTH)
|
||||
|
||||
@@ -483,7 +483,7 @@ static struct rockchip_mux_recalced_data rv1103b_mux_recalced_data[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct rockchip_mux_recalced_data rv1108_mux_recalced_data[] = {
|
||||
static const struct rockchip_mux_recalced_data rv1108_mux_recalced_data[] = {
|
||||
{
|
||||
.num = 1,
|
||||
.pin = 0,
|
||||
@@ -547,7 +547,7 @@ static struct rockchip_mux_recalced_data rv1108_mux_recalced_data[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct rockchip_mux_recalced_data rv1126_mux_recalced_data[] = {
|
||||
static const struct rockchip_mux_recalced_data rv1126_mux_recalced_data[] = {
|
||||
{
|
||||
.num = 0,
|
||||
.pin = 20,
|
||||
@@ -578,7 +578,7 @@ static struct rockchip_mux_recalced_data rv1126_mux_recalced_data[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct rockchip_mux_recalced_data rk3128_mux_recalced_data[] = {
|
||||
static const struct rockchip_mux_recalced_data rk3128_mux_recalced_data[] = {
|
||||
{
|
||||
.num = 2,
|
||||
.pin = 20,
|
||||
@@ -612,7 +612,7 @@ static struct rockchip_mux_recalced_data rk3128_mux_recalced_data[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct rockchip_mux_recalced_data rk3308_mux_recalced_data[] = {
|
||||
static const struct rockchip_mux_recalced_data rk3308_mux_recalced_data[] = {
|
||||
{
|
||||
/* gpio1b6_sel */
|
||||
.num = 1,
|
||||
@@ -721,7 +721,116 @@ static struct rockchip_mux_recalced_data rk3308_mux_recalced_data[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct rockchip_mux_recalced_data rk3328_mux_recalced_data[] = {
|
||||
static const struct rockchip_mux_recalced_data rk3308b_mux_recalced_data[] = {
|
||||
{
|
||||
/* gpio1b6_sel */
|
||||
.num = 1,
|
||||
.pin = 14,
|
||||
.reg = 0x28,
|
||||
.bit = 12,
|
||||
.mask = 0xf
|
||||
}, {
|
||||
/* gpio1b7_sel */
|
||||
.num = 1,
|
||||
.pin = 15,
|
||||
.reg = 0x2c,
|
||||
.bit = 0,
|
||||
.mask = 0x3
|
||||
}, {
|
||||
/* gpio1c2_sel */
|
||||
.num = 1,
|
||||
.pin = 18,
|
||||
.reg = 0x30,
|
||||
.bit = 4,
|
||||
.mask = 0xf
|
||||
}, {
|
||||
/* gpio1c3_sel */
|
||||
.num = 1,
|
||||
.pin = 19,
|
||||
.reg = 0x30,
|
||||
.bit = 8,
|
||||
.mask = 0xf
|
||||
}, {
|
||||
/* gpio1c4_sel */
|
||||
.num = 1,
|
||||
.pin = 20,
|
||||
.reg = 0x30,
|
||||
.bit = 12,
|
||||
.mask = 0xf
|
||||
}, {
|
||||
/* gpio1c5_sel */
|
||||
.num = 1,
|
||||
.pin = 21,
|
||||
.reg = 0x34,
|
||||
.bit = 0,
|
||||
.mask = 0xf
|
||||
}, {
|
||||
/* gpio1c6_sel */
|
||||
.num = 1,
|
||||
.pin = 22,
|
||||
.reg = 0x34,
|
||||
.bit = 4,
|
||||
.mask = 0xf
|
||||
}, {
|
||||
/* gpio1c7_sel */
|
||||
.num = 1,
|
||||
.pin = 23,
|
||||
.reg = 0x34,
|
||||
.bit = 8,
|
||||
.mask = 0xf
|
||||
}, {
|
||||
/* gpio2a2_sel_plus */
|
||||
.num = 2,
|
||||
.pin = 2,
|
||||
.reg = 0x608,
|
||||
.bit = 0,
|
||||
.mask = 0x7
|
||||
}, {
|
||||
/* gpio2a3_sel_plus */
|
||||
.num = 2,
|
||||
.pin = 3,
|
||||
.reg = 0x608,
|
||||
.bit = 4,
|
||||
.mask = 0x7
|
||||
}, {
|
||||
/* gpio2c0_sel_plus */
|
||||
.num = 2,
|
||||
.pin = 16,
|
||||
.reg = 0x610,
|
||||
.bit = 8,
|
||||
.mask = 0x7
|
||||
}, {
|
||||
/* gpio3b2_sel_plus */
|
||||
.num = 3,
|
||||
.pin = 10,
|
||||
.reg = 0x610,
|
||||
.bit = 0,
|
||||
.mask = 0x7
|
||||
}, {
|
||||
/* gpio3b3_sel_plus */
|
||||
.num = 3,
|
||||
.pin = 11,
|
||||
.reg = 0x610,
|
||||
.bit = 4,
|
||||
.mask = 0x7
|
||||
}, {
|
||||
/* gpio3b4_sel */
|
||||
.num = 3,
|
||||
.pin = 12,
|
||||
.reg = 0x68,
|
||||
.bit = 8,
|
||||
.mask = 0xf
|
||||
}, {
|
||||
/* gpio3b5_sel */
|
||||
.num = 3,
|
||||
.pin = 13,
|
||||
.reg = 0x68,
|
||||
.bit = 12,
|
||||
.mask = 0xf
|
||||
},
|
||||
};
|
||||
|
||||
static const struct rockchip_mux_recalced_data rk3328_mux_recalced_data[] = {
|
||||
{
|
||||
/* gpio2_b7_sel */
|
||||
.num = 2,
|
||||
@@ -793,7 +902,7 @@ static void rockchip_get_recalced_mux(struct rockchip_pin_bank *bank, int pin,
|
||||
{
|
||||
struct rockchip_pinctrl *info = bank->drvdata;
|
||||
struct rockchip_pin_ctrl *ctrl = info->ctrl;
|
||||
struct rockchip_mux_recalced_data *data;
|
||||
const struct rockchip_mux_recalced_data *data;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ctrl->niomux_recalced; i++) {
|
||||
@@ -811,7 +920,7 @@ static void rockchip_get_recalced_mux(struct rockchip_pin_bank *bank, int pin,
|
||||
*bit = data->bit;
|
||||
}
|
||||
|
||||
static struct rockchip_mux_route_data px30_mux_route_data[] = {
|
||||
static const struct rockchip_mux_route_data px30_mux_route_data[] = {
|
||||
RK_MUXROUTE_SAME(2, RK_PB4, 1, 0x184, BIT(16 + 7)), /* cif-d0m0 */
|
||||
RK_MUXROUTE_SAME(3, RK_PA1, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-d0m1 */
|
||||
RK_MUXROUTE_SAME(2, RK_PB6, 1, 0x184, BIT(16 + 7)), /* cif-d1m0 */
|
||||
@@ -862,7 +971,7 @@ static struct rockchip_mux_route_data px30_mux_route_data[] = {
|
||||
RK_MUXROUTE_SAME(1, RK_PB5, 2, 0x184, BIT(16 + 9) | BIT(9)), /* uart3-rtsm1 */
|
||||
};
|
||||
|
||||
static struct rockchip_mux_route_data rv1126_mux_route_data[] = {
|
||||
static const struct rockchip_mux_route_data rv1126_mux_route_data[] = {
|
||||
RK_MUXROUTE_GRF(3, RK_PD2, 1, 0x10260, WRITE_MASK_VAL(0, 0, 0)), /* I2S0_MCLK_M0 */
|
||||
RK_MUXROUTE_GRF(3, RK_PB0, 3, 0x10260, WRITE_MASK_VAL(0, 0, 1)), /* I2S0_MCLK_M1 */
|
||||
|
||||
@@ -959,7 +1068,7 @@ static struct rockchip_mux_route_data rv1126_mux_route_data[] = {
|
||||
RK_MUXROUTE_PMU(1, RK_PD0, 5, 0x0118, WRITE_MASK_VAL(2, 2, 1)), /* UART1_TX_M1 */
|
||||
};
|
||||
|
||||
static struct rockchip_mux_route_data rk3128_mux_route_data[] = {
|
||||
static const struct rockchip_mux_route_data rk3128_mux_route_data[] = {
|
||||
RK_MUXROUTE_SAME(1, RK_PB2, 1, 0x144, BIT(16 + 3) | BIT(16 + 4)), /* spi-0 */
|
||||
RK_MUXROUTE_SAME(1, RK_PD3, 3, 0x144, BIT(16 + 3) | BIT(16 + 4) | BIT(3)), /* spi-1 */
|
||||
RK_MUXROUTE_SAME(0, RK_PB5, 2, 0x144, BIT(16 + 3) | BIT(16 + 4) | BIT(4)), /* spi-2 */
|
||||
@@ -969,12 +1078,12 @@ static struct rockchip_mux_route_data rk3128_mux_route_data[] = {
|
||||
RK_MUXROUTE_SAME(2, RK_PA4, 2, 0x144, BIT(16 + 6) | BIT(6)), /* emmc-1 */
|
||||
};
|
||||
|
||||
static struct rockchip_mux_route_data rk3188_mux_route_data[] = {
|
||||
static const struct rockchip_mux_route_data rk3188_mux_route_data[] = {
|
||||
RK_MUXROUTE_SAME(0, RK_PD0, 1, 0xa0, BIT(16 + 11)), /* non-iomuxed emmc/flash pins on flash-dqs */
|
||||
RK_MUXROUTE_SAME(0, RK_PD0, 2, 0xa0, BIT(16 + 11) | BIT(11)), /* non-iomuxed emmc/flash pins on emmc-clk */
|
||||
};
|
||||
|
||||
static struct rockchip_mux_route_data rk3228_mux_route_data[] = {
|
||||
static const struct rockchip_mux_route_data rk3228_mux_route_data[] = {
|
||||
RK_MUXROUTE_SAME(0, RK_PD2, 1, 0x50, BIT(16)), /* pwm0-0 */
|
||||
RK_MUXROUTE_SAME(3, RK_PC5, 1, 0x50, BIT(16) | BIT(0)), /* pwm0-1 */
|
||||
RK_MUXROUTE_SAME(0, RK_PD3, 1, 0x50, BIT(16 + 1)), /* pwm1-0 */
|
||||
@@ -995,12 +1104,12 @@ static struct rockchip_mux_route_data rk3228_mux_route_data[] = {
|
||||
RK_MUXROUTE_SAME(3, RK_PB5, 1, 0x50, BIT(16 + 11) | BIT(11)), /* uart1-1_rx */
|
||||
};
|
||||
|
||||
static struct rockchip_mux_route_data rk3288_mux_route_data[] = {
|
||||
static const struct rockchip_mux_route_data rk3288_mux_route_data[] = {
|
||||
RK_MUXROUTE_SAME(7, RK_PC0, 2, 0x264, BIT(16 + 12) | BIT(12)), /* edphdmi_cecinoutt1 */
|
||||
RK_MUXROUTE_SAME(7, RK_PC7, 4, 0x264, BIT(16 + 12)), /* edphdmi_cecinout */
|
||||
};
|
||||
|
||||
static struct rockchip_mux_route_data rk3308_mux_route_data[] = {
|
||||
static const struct rockchip_mux_route_data rk3308_mux_route_data[] = {
|
||||
RK_MUXROUTE_SAME(0, RK_PC3, 1, 0x314, BIT(16 + 0) | BIT(0)), /* rtc_clk */
|
||||
RK_MUXROUTE_SAME(1, RK_PC6, 2, 0x314, BIT(16 + 2) | BIT(16 + 3)), /* uart2_rxm0 */
|
||||
RK_MUXROUTE_SAME(4, RK_PD2, 2, 0x314, BIT(16 + 2) | BIT(16 + 3) | BIT(2)), /* uart2_rxm1 */
|
||||
@@ -1016,7 +1125,36 @@ static struct rockchip_mux_route_data rk3308_mux_route_data[] = {
|
||||
RK_MUXROUTE_SAME(2, RK_PA4, 3, 0x600, BIT(16 + 2) | BIT(2)), /* pdm-clkm-m2 */
|
||||
};
|
||||
|
||||
static struct rockchip_mux_route_data rk3328_mux_route_data[] = {
|
||||
static const struct rockchip_mux_route_data rk3308b_mux_route_data[] = {
|
||||
RK_MUXROUTE_SAME(0, RK_PC3, 1, 0x314, BIT(16 + 0) | BIT(0)), /* rtc_clk */
|
||||
RK_MUXROUTE_SAME(1, RK_PC6, 2, 0x314, BIT(16 + 2) | BIT(16 + 3)), /* uart2_rxm0 */
|
||||
RK_MUXROUTE_SAME(4, RK_PD2, 2, 0x314, BIT(16 + 2) | BIT(16 + 3) | BIT(2)), /* uart2_rxm1 */
|
||||
RK_MUXROUTE_SAME(0, RK_PB7, 2, 0x608, BIT(16 + 8) | BIT(16 + 9)), /* i2c3_sdam0 */
|
||||
RK_MUXROUTE_SAME(3, RK_PB4, 2, 0x608, BIT(16 + 8) | BIT(16 + 9) | BIT(8)), /* i2c3_sdam1 */
|
||||
RK_MUXROUTE_SAME(2, RK_PA0, 3, 0x608, BIT(16 + 8) | BIT(16 + 9) | BIT(9)), /* i2c3_sdam2 */
|
||||
RK_MUXROUTE_SAME(1, RK_PA3, 2, 0x308, BIT(16 + 3)), /* i2s-8ch-1-sclktxm0 */
|
||||
RK_MUXROUTE_SAME(1, RK_PA4, 2, 0x308, BIT(16 + 3)), /* i2s-8ch-1-sclkrxm0 */
|
||||
RK_MUXROUTE_SAME(1, RK_PB5, 2, 0x308, BIT(16 + 3) | BIT(3)), /* i2s-8ch-1-sclktxm1 */
|
||||
RK_MUXROUTE_SAME(1, RK_PB6, 2, 0x308, BIT(16 + 3) | BIT(3)), /* i2s-8ch-1-sclkrxm1 */
|
||||
RK_MUXROUTE_SAME(1, RK_PA4, 3, 0x308, BIT(16 + 12) | BIT(16 + 13)), /* pdm-clkm0 */
|
||||
RK_MUXROUTE_SAME(1, RK_PB6, 4, 0x308, BIT(16 + 12) | BIT(16 + 13) | BIT(12)), /* pdm-clkm1 */
|
||||
RK_MUXROUTE_SAME(2, RK_PA6, 2, 0x308, BIT(16 + 12) | BIT(16 + 13) | BIT(13)), /* pdm-clkm2 */
|
||||
RK_MUXROUTE_SAME(2, RK_PA4, 3, 0x600, BIT(16 + 2) | BIT(2)), /* pdm-clkm-m2 */
|
||||
RK_MUXROUTE_SAME(3, RK_PB2, 3, 0x314, BIT(16 + 9)), /* spi1_miso */
|
||||
RK_MUXROUTE_SAME(2, RK_PA4, 2, 0x314, BIT(16 + 9) | BIT(9)), /* spi1_miso_m1 */
|
||||
RK_MUXROUTE_SAME(0, RK_PB3, 3, 0x314, BIT(16 + 10) | BIT(16 + 11)), /* owire_m0 */
|
||||
RK_MUXROUTE_SAME(1, RK_PC6, 7, 0x314, BIT(16 + 10) | BIT(16 + 11) | BIT(10)), /* owire_m1 */
|
||||
RK_MUXROUTE_SAME(2, RK_PA2, 5, 0x314, BIT(16 + 10) | BIT(16 + 11) | BIT(11)), /* owire_m2 */
|
||||
RK_MUXROUTE_SAME(0, RK_PB3, 2, 0x314, BIT(16 + 12) | BIT(16 + 13)), /* can_rxd_m0 */
|
||||
RK_MUXROUTE_SAME(1, RK_PC6, 5, 0x314, BIT(16 + 12) | BIT(16 + 13) | BIT(12)), /* can_rxd_m1 */
|
||||
RK_MUXROUTE_SAME(2, RK_PA2, 4, 0x314, BIT(16 + 12) | BIT(16 + 13) | BIT(13)), /* can_rxd_m2 */
|
||||
RK_MUXROUTE_SAME(1, RK_PC4, 3, 0x314, BIT(16 + 14)), /* mac_rxd0_m0 */
|
||||
RK_MUXROUTE_SAME(4, RK_PA2, 2, 0x314, BIT(16 + 14) | BIT(14)), /* mac_rxd0_m1 */
|
||||
RK_MUXROUTE_SAME(3, RK_PB4, 4, 0x314, BIT(16 + 15)), /* uart3_rx */
|
||||
RK_MUXROUTE_SAME(0, RK_PC1, 3, 0x314, BIT(16 + 15) | BIT(15)), /* uart3_rx_m1 */
|
||||
};
|
||||
|
||||
static const struct rockchip_mux_route_data rk3328_mux_route_data[] = {
|
||||
RK_MUXROUTE_SAME(1, RK_PA1, 2, 0x50, BIT(16) | BIT(16 + 1)), /* uart2dbg_rxm0 */
|
||||
RK_MUXROUTE_SAME(2, RK_PA1, 1, 0x50, BIT(16) | BIT(16 + 1) | BIT(0)), /* uart2dbg_rxm1 */
|
||||
RK_MUXROUTE_SAME(1, RK_PB3, 2, 0x50, BIT(16 + 2) | BIT(2)), /* gmac-m1_rxd0 */
|
||||
@@ -1031,7 +1169,7 @@ static struct rockchip_mux_route_data rk3328_mux_route_data[] = {
|
||||
RK_MUXROUTE_SAME(2, RK_PC0, 4, 0x50, BIT(16 + 9) | BIT(9)), /* cif_data5m1 */
|
||||
};
|
||||
|
||||
static struct rockchip_mux_route_data rk3399_mux_route_data[] = {
|
||||
static const struct rockchip_mux_route_data rk3399_mux_route_data[] = {
|
||||
RK_MUXROUTE_SAME(4, RK_PB0, 2, 0xe21c, BIT(16 + 10) | BIT(16 + 11)), /* uart2dbga_rx */
|
||||
RK_MUXROUTE_SAME(4, RK_PC0, 2, 0xe21c, BIT(16 + 10) | BIT(16 + 11) | BIT(10)), /* uart2dbgb_rx */
|
||||
RK_MUXROUTE_SAME(4, RK_PC3, 1, 0xe21c, BIT(16 + 10) | BIT(16 + 11) | BIT(11)), /* uart2dbgc_rx */
|
||||
@@ -1039,7 +1177,7 @@ static struct rockchip_mux_route_data rk3399_mux_route_data[] = {
|
||||
RK_MUXROUTE_SAME(4, RK_PD0, 1, 0xe21c, BIT(16 + 14) | BIT(14)), /* pcie_clkreqnb */
|
||||
};
|
||||
|
||||
static struct rockchip_mux_route_data rk3568_mux_route_data[] = {
|
||||
static const struct rockchip_mux_route_data rk3568_mux_route_data[] = {
|
||||
RK_MUXROUTE_PMU(0, RK_PB7, 1, 0x0110, WRITE_MASK_VAL(1, 0, 0)), /* PWM0 IO mux M0 */
|
||||
RK_MUXROUTE_PMU(0, RK_PC7, 2, 0x0110, WRITE_MASK_VAL(1, 0, 1)), /* PWM0 IO mux M1 */
|
||||
RK_MUXROUTE_PMU(0, RK_PC0, 1, 0x0110, WRITE_MASK_VAL(3, 2, 0)), /* PWM1 IO mux M0 */
|
||||
@@ -1140,7 +1278,7 @@ static bool rockchip_get_mux_route(struct rockchip_pin_bank *bank, int pin,
|
||||
{
|
||||
struct rockchip_pinctrl *info = bank->drvdata;
|
||||
struct rockchip_pin_ctrl *ctrl = info->ctrl;
|
||||
struct rockchip_mux_route_data *data;
|
||||
const struct rockchip_mux_route_data *data;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ctrl->niomux_routes; i++) {
|
||||
@@ -1188,6 +1326,12 @@ static int rockchip_get_mux(struct rockchip_pin_bank *bank, int pin)
|
||||
else
|
||||
regmap = info->regmap_base;
|
||||
|
||||
/* Banks with their own IOC block use its regmap for the iomux */
|
||||
if (bank->regmap_ioc)
|
||||
regmap = bank->regmap_ioc;
|
||||
else if (ctrl->type == RV1106)
|
||||
return -EINVAL;
|
||||
|
||||
if (ctrl->type == RV1103B && bank->bank_num == 2 && pin >= 12)
|
||||
return 0;
|
||||
|
||||
@@ -1317,6 +1461,12 @@ static int rockchip_set_mux(struct rockchip_pin_bank *bank, int pin, int mux)
|
||||
else
|
||||
regmap = info->regmap_base;
|
||||
|
||||
/* Banks with their own IOC block use its regmap for the iomux */
|
||||
if (bank->regmap_ioc)
|
||||
regmap = bank->regmap_ioc;
|
||||
else if (ctrl->type == RV1106)
|
||||
return -EINVAL;
|
||||
|
||||
if (ctrl->type == RV1103B && bank->bank_num == 2 && pin >= 12)
|
||||
return 0;
|
||||
|
||||
@@ -1725,6 +1875,78 @@ static int rv1103b_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define RV1106_DRV_BITS_PER_PIN 8
|
||||
#define RV1106_DRV_PINS_PER_REG 2
|
||||
#define RV1106_PULL_BITS_PER_PIN 2
|
||||
#define RV1106_PULL_PINS_PER_REG 8
|
||||
#define RV1106_SMT_BITS_PER_PIN 1
|
||||
#define RV1106_SMT_PINS_PER_REG 8
|
||||
|
||||
/*
|
||||
* Each bank has its own IOC block, referenced by the rockchip,grf
|
||||
* phandle of the bank node. The offsets below are relative to the
|
||||
* bank's own block.
|
||||
*/
|
||||
static const int rv1106_drv_offsets[] = { 0x10, 0x80, 0xc0, 0x100, 0x20 };
|
||||
static const int rv1106_pull_offsets[] = { 0x38, 0x1c0, 0x1d0, 0x1e0, 0x70 };
|
||||
static const int rv1106_smt_offsets[] = { 0x40, 0x280, 0x290, 0x2a0, 0xa0 };
|
||||
|
||||
static int rv1106_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank,
|
||||
int pin_num, struct regmap **regmap,
|
||||
int *reg, u8 *bit)
|
||||
{
|
||||
if (bank->bank_num >= ARRAY_SIZE(rv1106_drv_offsets) ||
|
||||
!bank->regmap_ioc)
|
||||
return -EINVAL;
|
||||
|
||||
/* Only pins 0-6 of GPIO0 have drive-strength registers */
|
||||
if (bank->bank_num == 0 && pin_num > 6)
|
||||
return -ENOTSUPP;
|
||||
|
||||
*regmap = bank->regmap_ioc;
|
||||
*reg = rv1106_drv_offsets[bank->bank_num];
|
||||
*reg += ((pin_num / RV1106_DRV_PINS_PER_REG) * 4);
|
||||
*bit = pin_num % RV1106_DRV_PINS_PER_REG;
|
||||
*bit *= RV1106_DRV_BITS_PER_PIN;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rv1106_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank,
|
||||
int pin_num, struct regmap **regmap,
|
||||
int *reg, u8 *bit)
|
||||
{
|
||||
if (bank->bank_num >= ARRAY_SIZE(rv1106_pull_offsets) ||
|
||||
!bank->regmap_ioc)
|
||||
return -EINVAL;
|
||||
|
||||
*regmap = bank->regmap_ioc;
|
||||
*reg = rv1106_pull_offsets[bank->bank_num];
|
||||
*reg += ((pin_num / RV1106_PULL_PINS_PER_REG) * 4);
|
||||
*bit = pin_num % RV1106_PULL_PINS_PER_REG;
|
||||
*bit *= RV1106_PULL_BITS_PER_PIN;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rv1106_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank,
|
||||
int pin_num,
|
||||
struct regmap **regmap,
|
||||
int *reg, u8 *bit)
|
||||
{
|
||||
if (bank->bank_num >= ARRAY_SIZE(rv1106_smt_offsets) ||
|
||||
!bank->regmap_ioc)
|
||||
return -EINVAL;
|
||||
|
||||
*regmap = bank->regmap_ioc;
|
||||
*reg = rv1106_smt_offsets[bank->bank_num];
|
||||
*reg += ((pin_num / RV1106_SMT_PINS_PER_REG) * 4);
|
||||
*bit = pin_num % RV1106_SMT_PINS_PER_REG;
|
||||
*bit *= RV1106_SMT_BITS_PER_PIN;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define RV1108_PULL_PMU_OFFSET 0x10
|
||||
#define RV1108_PULL_OFFSET 0x110
|
||||
#define RV1108_PULL_PINS_PER_REG 8
|
||||
@@ -3212,7 +3434,7 @@ static int rockchip_get_drive_perpin(struct rockchip_pin_bank *bank,
|
||||
u8 bit;
|
||||
int drv_type = bank->drv[pin_num / 8].drv_type;
|
||||
|
||||
if (ctrl->type == RV1103B && pin_num >= 12)
|
||||
if (ctrl->type == RV1103B && bank->bank_num == 2 && pin_num >= 12)
|
||||
drv_type = DRV_TYPE_IO_LEVEL_2_BIT;
|
||||
|
||||
ret = ctrl->drv_calc_reg(bank, pin_num, ®map, ®, &bit);
|
||||
@@ -3267,6 +3489,25 @@ static int rockchip_get_drive_perpin(struct rockchip_pin_bank *bank,
|
||||
case DRV_TYPE_IO_1V8_ONLY:
|
||||
rmask_bits = RK3288_DRV_BITS_PER_PIN;
|
||||
break;
|
||||
case DRV_TYPE_IO_LEVEL_2_BIT:
|
||||
ret = regmap_read(regmap, reg, &data);
|
||||
if (ret)
|
||||
return ret;
|
||||
data >>= bit;
|
||||
|
||||
return data & 0x3;
|
||||
case DRV_TYPE_IO_LEVEL_8_BIT:
|
||||
ret = regmap_read(regmap, reg, &data);
|
||||
if (ret)
|
||||
return ret;
|
||||
data >>= bit;
|
||||
data &= (1 << 8) - 1;
|
||||
|
||||
ret = hweight8(data);
|
||||
if (ret > 0)
|
||||
return ret - 1;
|
||||
else
|
||||
return -EINVAL;
|
||||
default:
|
||||
dev_err(dev, "unsupported pinctrl drive type: %d\n", drv_type);
|
||||
return -EINVAL;
|
||||
@@ -3310,6 +3551,7 @@ static int rockchip_set_drive_perpin(struct rockchip_pin_bank *bank,
|
||||
ret = strength;
|
||||
goto config;
|
||||
} else if (ctrl->type == RV1103B ||
|
||||
ctrl->type == RV1106 ||
|
||||
ctrl->type == RK3506 ||
|
||||
ctrl->type == RK3528 ||
|
||||
ctrl->type == RK3562 ||
|
||||
@@ -3390,25 +3632,6 @@ static int rockchip_set_drive_perpin(struct rockchip_pin_bank *bank,
|
||||
case DRV_TYPE_IO_1V8_ONLY:
|
||||
rmask_bits = RK3288_DRV_BITS_PER_PIN;
|
||||
break;
|
||||
case DRV_TYPE_IO_LEVEL_2_BIT:
|
||||
ret = regmap_read(regmap, reg, &data);
|
||||
if (ret)
|
||||
return ret;
|
||||
data >>= bit;
|
||||
|
||||
return data & 0x3;
|
||||
case DRV_TYPE_IO_LEVEL_8_BIT:
|
||||
ret = regmap_read(regmap, reg, &data);
|
||||
if (ret)
|
||||
return ret;
|
||||
data >>= bit;
|
||||
data &= (1 << 8) - 1;
|
||||
|
||||
ret = hweight8(data);
|
||||
if (ret > 0)
|
||||
return ret - 1;
|
||||
else
|
||||
return -EINVAL;
|
||||
default:
|
||||
dev_err(dev, "unsupported pinctrl drive type: %d\n", drv_type);
|
||||
return -EINVAL;
|
||||
@@ -3482,10 +3705,12 @@ static int rockchip_get_pull(struct rockchip_pin_bank *bank, int pin_num)
|
||||
: PIN_CONFIG_BIAS_DISABLE;
|
||||
case PX30:
|
||||
case RV1103B:
|
||||
case RV1106:
|
||||
case RV1108:
|
||||
case RK3188:
|
||||
case RK3288:
|
||||
case RK3308:
|
||||
case RK3308B:
|
||||
case RK3328:
|
||||
case RK3368:
|
||||
case RK3399:
|
||||
@@ -3547,11 +3772,13 @@ static int rockchip_set_pull(struct rockchip_pin_bank *bank,
|
||||
break;
|
||||
case PX30:
|
||||
case RV1103B:
|
||||
case RV1106:
|
||||
case RV1108:
|
||||
case RV1126:
|
||||
case RK3188:
|
||||
case RK3288:
|
||||
case RK3308:
|
||||
case RK3308B:
|
||||
case RK3328:
|
||||
case RK3368:
|
||||
case RK3399:
|
||||
@@ -3843,11 +4070,13 @@ static bool rockchip_pinconf_pull_valid(struct rockchip_pin_ctrl *ctrl,
|
||||
return pull ? false : true;
|
||||
case PX30:
|
||||
case RV1103B:
|
||||
case RV1106:
|
||||
case RV1108:
|
||||
case RV1126:
|
||||
case RK3188:
|
||||
case RK3288:
|
||||
case RK3308:
|
||||
case RK3308B:
|
||||
case RK3328:
|
||||
case RK3368:
|
||||
case RK3399:
|
||||
@@ -4296,6 +4525,16 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data(
|
||||
pmu_offs = ctrl->pmu_mux_offset;
|
||||
drv_pmu_offs = ctrl->pmu_drv_offset;
|
||||
drv_grf_offs = ctrl->grf_drv_offset;
|
||||
|
||||
/*
|
||||
* This function mutates the static per-SoC data. Most of it is
|
||||
* idempotent: recalculated iomux and drv offsets anchor at the
|
||||
* values calculated by a previous run. The pin count is not, so
|
||||
* reset it here; otherwise it accumulates when the probe runs
|
||||
* again after a probe deferral, shifting every bank's pin_base.
|
||||
*/
|
||||
ctrl->nr_pins = 0;
|
||||
|
||||
bank = ctrl->pin_banks;
|
||||
for (i = 0; i < ctrl->nr_banks; ++i, ++bank) {
|
||||
int bank_pins = 0;
|
||||
@@ -4370,7 +4609,18 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data(
|
||||
|
||||
bank_pins += 8;
|
||||
}
|
||||
}
|
||||
|
||||
return ctrl;
|
||||
}
|
||||
|
||||
static void iomux_recalced_routes_init(struct rockchip_pinctrl *info)
|
||||
{
|
||||
struct rockchip_pin_ctrl *ctrl = info->ctrl;
|
||||
struct rockchip_pin_bank *bank = ctrl->pin_banks;
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < ctrl->nr_banks; ++i, ++bank) {
|
||||
/* calculate the per-bank recalced_mask */
|
||||
for (j = 0; j < ctrl->niomux_recalced; j++) {
|
||||
int pin = 0;
|
||||
@@ -4391,8 +4641,6 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ctrl;
|
||||
}
|
||||
|
||||
#define RK3288_GRF_GPIO6C_IOMUX 0x64
|
||||
@@ -4443,6 +4691,76 @@ static int __maybe_unused rockchip_pinctrl_resume(struct device *dev)
|
||||
static SIMPLE_DEV_PM_OPS(rockchip_pinctrl_dev_pm_ops, rockchip_pinctrl_suspend,
|
||||
rockchip_pinctrl_resume);
|
||||
|
||||
#define RK3308B_GRF_SOC_CON13 0x608
|
||||
#define RK3308B_GRF_SOC_CON15 0x610
|
||||
|
||||
/* RK3308B_GRF_SOC_CON13 */
|
||||
#define RK3308B_GRF_I2C3_IOFUNC_SRC_CTRL (BIT(16 + 10) | BIT(10))
|
||||
#define RK3308B_GRF_GPIO2A3_SEL_SRC_CTRL (BIT(16 + 7) | BIT(7))
|
||||
#define RK3308B_GRF_GPIO2A2_SEL_SRC_CTRL (BIT(16 + 3) | BIT(3))
|
||||
|
||||
/* RK3308B_GRF_SOC_CON15 */
|
||||
#define RK3308B_GRF_GPIO2C0_SEL_SRC_CTRL (BIT(16 + 11) | BIT(11))
|
||||
#define RK3308B_GRF_GPIO3B3_SEL_SRC_CTRL (BIT(16 + 7) | BIT(7))
|
||||
#define RK3308B_GRF_GPIO3B2_SEL_SRC_CTRL (BIT(16 + 3) | BIT(3))
|
||||
|
||||
/*
|
||||
* RK3308B has 3-bit gpio##_sel_plus iomuxes over some 2-bit old ones.
|
||||
* Enable them by setting the gpio##_sel_src_ctrl registers.
|
||||
*/
|
||||
static int rk3308b_soc_sel_src_init(struct rockchip_pinctrl *info)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = regmap_write(info->regmap_base, RK3308B_GRF_SOC_CON13,
|
||||
RK3308B_GRF_I2C3_IOFUNC_SRC_CTRL |
|
||||
RK3308B_GRF_GPIO2A3_SEL_SRC_CTRL |
|
||||
RK3308B_GRF_GPIO2A2_SEL_SRC_CTRL);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return regmap_write(info->regmap_base, RK3308B_GRF_SOC_CON15,
|
||||
RK3308B_GRF_GPIO2C0_SEL_SRC_CTRL |
|
||||
RK3308B_GRF_GPIO3B3_SEL_SRC_CTRL |
|
||||
RK3308B_GRF_GPIO3B2_SEL_SRC_CTRL);
|
||||
}
|
||||
|
||||
#define RK3308_GRF_CHIP_ID 0x800
|
||||
|
||||
static int rk3308_soc_data_init(struct rockchip_pinctrl *info)
|
||||
{
|
||||
struct rockchip_pin_ctrl *ctrl = info->ctrl;
|
||||
unsigned int chip_id;
|
||||
int ret;
|
||||
|
||||
ret = regmap_read(info->regmap_base, RK3308_GRF_CHIP_ID, &chip_id);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
switch (chip_id) {
|
||||
case 0xcea:
|
||||
/* Original RK3308, no changes needed */
|
||||
break;
|
||||
case 0x3308:
|
||||
case 0x3308c:
|
||||
ctrl->type = RK3308B;
|
||||
ctrl->iomux_recalced = rk3308b_mux_recalced_data;
|
||||
ctrl->niomux_recalced = ARRAY_SIZE(rk3308b_mux_recalced_data);
|
||||
ctrl->iomux_routes = rk3308b_mux_route_data;
|
||||
ctrl->niomux_routes = ARRAY_SIZE(rk3308b_mux_route_data);
|
||||
|
||||
ret = rk3308b_soc_sel_src_init(info);
|
||||
if (ret)
|
||||
return ret;
|
||||
break;
|
||||
default:
|
||||
return dev_err_probe(info->dev, -EINVAL,
|
||||
"Unknown RK3308 chip_id: 0x%x\n", chip_id);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rockchip_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct rockchip_pinctrl *info;
|
||||
@@ -4452,6 +4770,7 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
|
||||
struct resource *res;
|
||||
void __iomem *base;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
if (!dev->of_node)
|
||||
return dev_err_probe(dev, -ENODEV, "device tree node not found\n");
|
||||
@@ -4505,6 +4824,52 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
|
||||
/* try to find the optional reference to the ioc1 syscon */
|
||||
info->regmap_ioc1 = syscon_regmap_lookup_by_phandle_optional(np, "rockchip,ioc1");
|
||||
|
||||
if (ctrl->type == RK3308) {
|
||||
ret = rk3308_soc_data_init(info);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
iomux_recalced_routes_init(info);
|
||||
|
||||
/*
|
||||
* On SoCs where each GPIO bank has its own IOC block, the bank nodes
|
||||
* carry a rockchip,grf phandle pointing at it. The bank number comes
|
||||
* from the gpio alias, as used by the gpio driver, falling back to
|
||||
* the node position for devicetrees without aliases. The fallback is
|
||||
* wrong when an SoC variant omits a bank, so aliases are needed
|
||||
* there.
|
||||
*/
|
||||
i = 0;
|
||||
for_each_child_of_node_scoped(np, child) {
|
||||
struct rockchip_pin_bank *bank = NULL;
|
||||
int id, j;
|
||||
|
||||
if (!of_match_node(rockchip_bank_match, child))
|
||||
continue;
|
||||
|
||||
id = of_alias_get_id(child, "gpio");
|
||||
if (id < 0)
|
||||
id = i;
|
||||
i++;
|
||||
|
||||
for (j = 0; j < ctrl->nr_banks; j++) {
|
||||
if (ctrl->pin_banks[j].bank_num == id) {
|
||||
bank = &ctrl->pin_banks[j];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!bank)
|
||||
continue;
|
||||
|
||||
bank->regmap_ioc = syscon_regmap_lookup_by_phandle_optional(
|
||||
child, "rockchip,grf");
|
||||
if (IS_ERR(bank->regmap_ioc))
|
||||
return dev_err_probe(dev, PTR_ERR(bank->regmap_ioc),
|
||||
"%pOFn: failed to look up bank ioc\n",
|
||||
child);
|
||||
}
|
||||
|
||||
ret = rockchip_pinctrl_register(pdev, info);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -4623,6 +4988,69 @@ static struct rockchip_pin_ctrl rv1103b_pin_ctrl __maybe_unused = {
|
||||
.schmitt_calc_reg = rv1103b_calc_schmitt_reg_and_bit,
|
||||
};
|
||||
|
||||
static struct rockchip_pin_bank rv1106_pin_banks[] = {
|
||||
PIN_BANK_IOMUX_FLAGS_OFFSET_DRV_FLAGS(0, 32, "gpio0",
|
||||
IOMUX_WIDTH_4BIT,
|
||||
IOMUX_WIDTH_4BIT,
|
||||
IOMUX_WIDTH_4BIT,
|
||||
IOMUX_WIDTH_4BIT,
|
||||
0, -1, -1, -1,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT),
|
||||
PIN_BANK_IOMUX_FLAGS_OFFSET_DRV_FLAGS(1, 32, "gpio1",
|
||||
IOMUX_WIDTH_4BIT,
|
||||
IOMUX_WIDTH_4BIT,
|
||||
IOMUX_WIDTH_4BIT,
|
||||
IOMUX_WIDTH_4BIT,
|
||||
0, -1, -1, -1,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT),
|
||||
PIN_BANK_IOMUX_FLAGS_OFFSET_DRV_FLAGS(2, 32, "gpio2",
|
||||
IOMUX_WIDTH_4BIT,
|
||||
IOMUX_WIDTH_4BIT,
|
||||
IOMUX_WIDTH_4BIT,
|
||||
IOMUX_WIDTH_4BIT,
|
||||
0x20, -1, -1, -1,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT),
|
||||
PIN_BANK_IOMUX_FLAGS_OFFSET_DRV_FLAGS(3, 32, "gpio3",
|
||||
IOMUX_WIDTH_4BIT,
|
||||
IOMUX_WIDTH_4BIT,
|
||||
IOMUX_WIDTH_4BIT,
|
||||
IOMUX_WIDTH_4BIT,
|
||||
0x40, -1, -1, -1,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT),
|
||||
PIN_BANK_IOMUX_FLAGS_OFFSET_DRV_FLAGS(4, 24, "gpio4",
|
||||
IOMUX_WIDTH_4BIT,
|
||||
IOMUX_WIDTH_4BIT,
|
||||
IOMUX_WIDTH_4BIT,
|
||||
0,
|
||||
0, -1, -1, -1,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT,
|
||||
DRV_TYPE_IO_LEVEL_8_BIT),
|
||||
};
|
||||
|
||||
static struct rockchip_pin_ctrl rv1106_pin_ctrl __maybe_unused = {
|
||||
.pin_banks = rv1106_pin_banks,
|
||||
.nr_banks = ARRAY_SIZE(rv1106_pin_banks),
|
||||
.label = "RV1106-GPIO",
|
||||
.type = RV1106,
|
||||
.pull_calc_reg = rv1106_calc_pull_reg_and_bit,
|
||||
.drv_calc_reg = rv1106_calc_drv_reg_and_bit,
|
||||
.schmitt_calc_reg = rv1106_calc_schmitt_reg_and_bit,
|
||||
};
|
||||
|
||||
static struct rockchip_pin_bank rv1108_pin_banks[] = {
|
||||
PIN_BANK_IOMUX_FLAGS(0, 32, "gpio0", IOMUX_SOURCE_PMU,
|
||||
IOMUX_SOURCE_PMU,
|
||||
@@ -5261,6 +5689,8 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = {
|
||||
.data = &px30_pin_ctrl },
|
||||
{ .compatible = "rockchip,rv1103b-pinctrl",
|
||||
.data = &rv1103b_pin_ctrl },
|
||||
{ .compatible = "rockchip,rv1106-pinctrl",
|
||||
.data = &rv1106_pin_ctrl },
|
||||
{ .compatible = "rockchip,rv1108-pinctrl",
|
||||
.data = &rv1108_pin_ctrl },
|
||||
{ .compatible = "rockchip,rv1126-pinctrl",
|
||||
|
||||
@@ -186,6 +186,7 @@
|
||||
enum rockchip_pinctrl_type {
|
||||
PX30,
|
||||
RV1103B,
|
||||
RV1106,
|
||||
RV1108,
|
||||
RV1126,
|
||||
RK2928,
|
||||
@@ -194,6 +195,7 @@ enum rockchip_pinctrl_type {
|
||||
RK3188,
|
||||
RK3288,
|
||||
RK3308,
|
||||
RK3308B,
|
||||
RK3328,
|
||||
RK3368,
|
||||
RK3399,
|
||||
@@ -295,6 +297,8 @@ struct rockchip_drv {
|
||||
* @dev: the pinctrl device bind to the bank
|
||||
* @reg_base: register base of the gpio bank
|
||||
* @regmap_pull: optional separate register for additional pull settings
|
||||
* @regmap_ioc: optional per-bank IO control regmap, for SoCs where each
|
||||
* bank has its own IOC block
|
||||
* @clk: clock of the gpio bank
|
||||
* @db_clk: clock of the gpio debounce
|
||||
* @irq: interrupt of the gpio bank
|
||||
@@ -323,6 +327,7 @@ struct rockchip_pin_bank {
|
||||
struct device *dev;
|
||||
void __iomem *reg_base;
|
||||
struct regmap *regmap_pull;
|
||||
struct regmap *regmap_ioc;
|
||||
struct clk *clk;
|
||||
struct clk *db_clk;
|
||||
int irq;
|
||||
@@ -400,9 +405,9 @@ struct rockchip_pin_ctrl {
|
||||
int pmu_mux_offset;
|
||||
int grf_drv_offset;
|
||||
int pmu_drv_offset;
|
||||
struct rockchip_mux_recalced_data *iomux_recalced;
|
||||
const struct rockchip_mux_recalced_data *iomux_recalced;
|
||||
u32 niomux_recalced;
|
||||
struct rockchip_mux_route_data *iomux_routes;
|
||||
const struct rockchip_mux_route_data *iomux_routes;
|
||||
u32 niomux_routes;
|
||||
|
||||
int (*pull_calc_reg)(struct rockchip_pin_bank *bank,
|
||||
|
||||
@@ -1085,7 +1085,7 @@ static void rp1_pctl_pin_dbg_show(struct pinctrl_dev *pctldev,
|
||||
|
||||
seq_printf(s, "function %s (%s) in %s; irq %d (%s)",
|
||||
rp1_func_names[fsel].name, rp1_func_names[func].name,
|
||||
value ? "hi" : "lo",
|
||||
str_hi_lo(value),
|
||||
irq, irq_type_names[pin->irq_type]);
|
||||
}
|
||||
|
||||
|
||||
@@ -727,10 +727,8 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev)
|
||||
stmfx_pinctrl_irq_thread_fn,
|
||||
IRQF_ONESHOT,
|
||||
dev_name(pctl->dev), pctl);
|
||||
if (ret) {
|
||||
dev_err(pctl->dev, "cannot request irq%d\n", irq);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
dev_info(pctl->dev,
|
||||
"%ld GPIOs available\n", hweight_long(pctl->gpio_valid_mask));
|
||||
|
||||
@@ -525,7 +525,7 @@ static int sx150x_irq_set_type(struct irq_data *d, unsigned int flow_type)
|
||||
struct sx150x_pinctrl *pctl = gpiochip_get_data(gc);
|
||||
unsigned int n, val = 0;
|
||||
|
||||
if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
|
||||
if (flow_type & IRQ_TYPE_LEVEL_MASK)
|
||||
return -EINVAL;
|
||||
|
||||
n = irqd_to_hwirq(d);
|
||||
@@ -550,6 +550,9 @@ static irqreturn_t sx150x_irq_thread_fn(int irq, void *dev_id)
|
||||
if (err < 0)
|
||||
return IRQ_NONE;
|
||||
|
||||
if (!val)
|
||||
return IRQ_NONE;
|
||||
|
||||
err = regmap_write(pctl->regmap, pctl->data->reg_irq_src, val);
|
||||
if (err < 0)
|
||||
return IRQ_NONE;
|
||||
@@ -850,6 +853,7 @@ static const struct i2c_device_id sx150x_id[] = {
|
||||
{ .name = "sx1509q", .driver_data = (kernel_ulong_t)&sx1509q_device_data },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, sx150x_id);
|
||||
|
||||
static const struct of_device_id sx150x_of_match[] = {
|
||||
{ .compatible = "semtech,sx1501q", .data = &sx1501q_device_data },
|
||||
@@ -1122,6 +1126,7 @@ static int sx150x_probe(struct i2c_client *client)
|
||||
I2C_FUNC_SMBUS_WRITE_WORD_DATA;
|
||||
struct device *dev = &client->dev;
|
||||
struct sx150x_pinctrl *pctl;
|
||||
u32 irq_type;
|
||||
int ret;
|
||||
|
||||
if (!i2c_check_functionality(client->adapter, i2c_funcs))
|
||||
@@ -1221,10 +1226,24 @@ static int sx150x_probe(struct i2c_client *client)
|
||||
girq->handler = handle_bad_irq;
|
||||
girq->threaded = true;
|
||||
|
||||
irq_type = irq_get_trigger_type(client->irq);
|
||||
switch (irq_type) {
|
||||
case IRQF_TRIGGER_FALLING:
|
||||
case IRQF_TRIGGER_LOW:
|
||||
break;
|
||||
case IRQF_TRIGGER_NONE:
|
||||
irq_type = IRQF_TRIGGER_FALLING;
|
||||
break;
|
||||
default:
|
||||
return dev_err_probe(dev, -EINVAL,
|
||||
"unsupported irq trigger type %x\n",
|
||||
irq_type);
|
||||
}
|
||||
|
||||
ret = devm_request_threaded_irq(dev, client->irq, NULL,
|
||||
sx150x_irq_thread_fn,
|
||||
IRQF_ONESHOT | IRQF_SHARED |
|
||||
IRQF_TRIGGER_FALLING,
|
||||
irq_type,
|
||||
client->name, pctl);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user