Pin control changes for the v5.16 kernel cycle
Core changes: - Add infrastructure for per-parent interrupt data to support the Apple pin controller. New drivers: - New combined pin control and GPIO driver for the Apple SoC. This is used in all modern Apple silicon such as the M1 laptops but also in at least recent iPhone variants. - New subdriver for the Qualcomm SM6350 - New subdriver for the Qualcomm QCM2290 - New subdriver for the Qualcomm PM6350 - New subdriver for the Uniphier NX1 - New subdriver for the Samsung ExynosAutoV9 - New subdriver for the Mediatek MT7986 - New subdriver for the nVidia Tegra194 Improvements: - Improve power management in the Mediatek driver. - Improvements to the Renesas internal consistency checker. - Convert the Rockchip pin control device tree bindings to YAML. - Finally convert the Qualcomm PMIC SSBI and SPMI MPP GPIO driver to use hierarchical interrupts. - Convert the Qualcomm PMIC MPP device tree bindings to YAML. -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmGEimgACgkQQRCzN7AZ XXPelQ/+M7WhOfa52zSCBMB90OrgPD1NsZnWc6+QaC96Nwh2xvf51zngt4BOdU5K e/K85vLN8iwM9XekFRAFA5tKbm8rGXfhKMs3neuK2tQEebRJWusBAKgarYMtGAIL dDm2i4C3LVBQDKGvjEqedctoLdVDs8mqaZFkGyrM0H6Q4cHK2jIxvtK6UImWEM4y eKJPIJgvahKmVZoh6maMynn6b7hNs94DxLNgO+6GaSXuucJ0hJ4rqLKx/rKOW7/W GVaxZfwSQ88zdPTSUagSXz1Q4zll32pBtcPzGPwYlsRnl/dQyWNVY0Rlon+i/Ost DCoNkcKhrZ6qYsqlv3pqHIZvfSCWvP4krk/kJdt/ufMz2El/vO7CEMbcea2d1ZfR rNz6upEUfvRJk3iihdjHR+KFk4AUaeGPqg/xZKkoxB7g9pk5asysiL29wuaTukwL Av1b2hRZE7ES843rjPy88vnRi22DB0WdcHH5H7gqeOfhCoOuChZN09Al5g5aPNaP mH8ydPXKhZZX13vZggpfKfMEltwhb5yU0diy6ECZHhV5RdTWfAzLP8cHgeiZZXJY zXRO9z/Et9xRdWeoENmh26l3vfkr6RlfkxvA1BC8nfrYVOGyjUTnRYVlpG/QfiqQ b4VP2NO5l/oioDp8TSK/JdY2e5VtPTJAjwQUzZU5I1kVgD+VLsk= =4Ms6 -----END PGP SIGNATURE----- Merge tag 'pinctrl-v5.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control updates from Linus Walleij: "The most interesting aspect is that we now have initial support for the Apple pin controller as used in the M1 laptops and the iPhones which is a step forward for using Linux efficiently on this Apple silicon. Core changes: - Add infrastructure for per-parent interrupt data to support the Apple pin controller. New drivers: - New combined pin control and GPIO driver for the Apple SoC. This is used in all modern Apple silicon such as the M1 laptops but also in at least recent iPhone variants. - New subdriver for the Qualcomm SM6350 - New subdriver for the Qualcomm QCM2290 - New subdriver for the Qualcomm PM6350 - New subdriver for the Uniphier NX1 - New subdriver for the Samsung ExynosAutoV9 - New subdriver for the Mediatek MT7986 - New subdriver for the nVidia Tegra194 Improvements: - Improve power management in the Mediatek driver. - Improvements to the Renesas internal consistency checker. - Convert the Rockchip pin control device tree bindings to YAML. - Finally convert the Qualcomm PMIC SSBI and SPMI MPP GPIO driver to use hierarchical interrupts. - Convert the Qualcomm PMIC MPP device tree bindings to YAML" * tag 'pinctrl-v5.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (55 commits) pinctrl: add pinctrl/GPIO driver for Apple SoCs dt-bindings: pinctrl: Add apple,npins property to apple,pinctrl dt-bindings: pinctrl: add #interrupt-cells to apple,pinctrl gpio: Allow per-parent interrupt data pinctrl: tegra: Fix warnings and error pinctrl: intel: Kconfig: Add configuration menu to Intel pin control pinctrl: tegra: Use correct offset for pin group pinctrl: core: fix possible memory leak in pinctrl_enable() pinctrl: bcm2835: Allow building driver as a module pinctrl: equilibrium: Fix function addition in multiple groups pinctrl: tegra: Add pinmux support for Tegra194 pinctrl: tegra: include lpdr pin properties pinctrl: mediatek: add support for MT7986 SoC dt-bindings: pinctrl: update bindings for MT7986 SoC pinctrl: microchip sgpio: use reset driver dt-bindings: pinctrl: pinctrl-microchip-sgpio: Add reset binding dt-bindings: pinctrl: qcom,pmic-mpp: switch to #interrupt-cells pinctrl: qcom: spmi-mpp: add support for hierarchical IRQ chip pinctrl: qcom: spmi-mpp: hardcode IRQ counts pinctrl: qcom: ssbi-mpp: add support for hierarchical IRQ chip ...
This commit is contained in:
commit
5a1bcbd965
|
@ -34,6 +34,10 @@ properties:
|
|||
gpio-ranges:
|
||||
maxItems: 1
|
||||
|
||||
apple,npins:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
description: The number of pins in this GPIO controller.
|
||||
|
||||
interrupts:
|
||||
description: One interrupt for each of the (up to 7) interrupt
|
||||
groups supported by the controller sorted by interrupt group
|
||||
|
@ -43,6 +47,9 @@ properties:
|
|||
|
||||
interrupt-controller: true
|
||||
|
||||
'#interrupt-cells':
|
||||
const: 2
|
||||
|
||||
patternProperties:
|
||||
'-pins$':
|
||||
type: object
|
||||
|
@ -66,6 +73,7 @@ required:
|
|||
- gpio-controller
|
||||
- '#gpio-cells'
|
||||
- gpio-ranges
|
||||
- apple,npins
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
|
@ -86,8 +94,10 @@ examples:
|
|||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
gpio-ranges = <&pinctrl 0 0 212>;
|
||||
apple,npins = <212>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
interrupt-parent = <&aic>;
|
||||
interrupts = <AIC_IRQ 16 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<AIC_IRQ 17 IRQ_TYPE_LEVEL_HIGH>,
|
||||
|
|
|
@ -0,0 +1,363 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/mediatek,mt7986-pinctrl.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Mediatek MT7986 Pin Controller Device Tree Bindings
|
||||
|
||||
maintainers:
|
||||
- Sean Wang <sean.wang@kernel.org>
|
||||
|
||||
description: |+
|
||||
The MediaTek's MT7986 Pin controller is used to control SoC pins.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- mediatek,mt7986a-pinctrl
|
||||
- mediatek,mt7986b-pinctrl
|
||||
|
||||
reg:
|
||||
minItems: 8
|
||||
maxItems: 8
|
||||
|
||||
reg-names:
|
||||
items:
|
||||
- const: gpio
|
||||
- const: iocfg_rt
|
||||
- const: iocfg_rb
|
||||
- const: iocfg_lt
|
||||
- const: iocfg_lb
|
||||
- const: iocfg_tr
|
||||
- const: iocfg_tl
|
||||
- const: eint
|
||||
|
||||
gpio-controller: true
|
||||
|
||||
"#gpio-cells":
|
||||
const: 2
|
||||
description: |
|
||||
Number of cells in GPIO specifier. Since the generic GPIO
|
||||
binding is used, the amount of cells must be specified as 2. See the below
|
||||
mentioned gpio binding representation for description of particular cells.
|
||||
|
||||
gpio-ranges:
|
||||
minItems: 1
|
||||
maxItems: 5
|
||||
description: |
|
||||
GPIO valid number range.
|
||||
|
||||
interrupt-controller: true
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
"#interrupt-cells":
|
||||
const: 2
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- reg-names
|
||||
- gpio-controller
|
||||
- "#gpio-cells"
|
||||
|
||||
patternProperties:
|
||||
'-pins$':
|
||||
type: object
|
||||
additionalProperties: false
|
||||
|
||||
patternProperties:
|
||||
'.*mux.*':
|
||||
type: object
|
||||
additionalProperties: false
|
||||
description: |
|
||||
pinmux configuration nodes.
|
||||
|
||||
The following table shows the effective values of "group", "function"
|
||||
properties and chip pinout pins
|
||||
|
||||
groups function pins (in pin#)
|
||||
---------------------------------------------------------------------
|
||||
"watchdog" "watchdog" 0
|
||||
"wifi_led" "led" 1, 2
|
||||
"i2c" "i2c" 3, 4
|
||||
"uart1_0" "uart" 7, 8, 9, 10
|
||||
"pcie_clk" "pcie" 9
|
||||
"pcie_wake" "pcie" 10
|
||||
"spi1_0" "spi" 11, 12, 13, 14
|
||||
"pwm1_1" "pwm" 20,
|
||||
"pwm0" "pwm" 21,
|
||||
"pwm1_0" "pwm" 22,
|
||||
"snfi" "flash" 23, 24, 25, 26, 27, 28
|
||||
"spi1_2" "spi" 29, 30, 31, 32
|
||||
"emmc_45" "emmc" 22, 23, 24, 25, 26, 27, 28, 29, 30,
|
||||
31, 32
|
||||
"spi1_1" "spi" 23, 24, 25, 26
|
||||
"uart1_2" "uart" 29, 30, 31, 32
|
||||
"uart1_1" "uart" 23, 24, 25, 26
|
||||
"uart2_0" "uart" 29, 30, 31, 32
|
||||
"spi0" "spi" 33, 34, 35, 36
|
||||
"spi0_wp_hold" "spi" 37, 38
|
||||
"uart1_3_rx_tx" "uart" 35, 36
|
||||
"uart1_3_cts_rts" "uart" 37, 38
|
||||
"uart2_1" "uart" 33, 34, 35, 36
|
||||
"spi1_3" "spi" 33, 34, 35, 36
|
||||
"uart0" "uart" 39, 40
|
||||
"pcie_pereset" "pcie" 41
|
||||
"uart1" "uart" 42, 43, 44, 45
|
||||
"uart2" "uart" 46, 47, 48, 49
|
||||
"emmc_51" "emmc" 50, 51, 52, 53, 54, 55, 56, 57, 57,
|
||||
59, 60, 61
|
||||
"pcm" "audio" 62, 63, 64, 65
|
||||
"i2s" "audio" 62, 63, 64, 65
|
||||
"switch_int" "eth" 66
|
||||
"mdc_mdio" "eth" 67
|
||||
|
||||
$ref: "/schemas/pinctrl/pinmux-node.yaml"
|
||||
properties:
|
||||
function:
|
||||
description: |
|
||||
A string containing the name of the function to mux to the group.
|
||||
There is no "audio", "pcie" functions on mt7986b, you can only use
|
||||
those functions on mt7986a.
|
||||
enum: [audio, emmc, eth, i2c, led, flash, pcie, pwm, spi, uart,
|
||||
watchdog, wifi]
|
||||
groups:
|
||||
description: |
|
||||
An array of strings. Each string contains the name of a group.
|
||||
There is no "pcie_pereset", "uart1", "uart2" "emmc_51", "pcm",
|
||||
and "i2s" groups on mt7986b, you can only use those groups on
|
||||
mt7986a.
|
||||
required:
|
||||
- function
|
||||
- groups
|
||||
|
||||
allOf:
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: audio
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [pcm, i2s]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: emmc
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [emmc, emmc_rst]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: eth
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [switch_int, mdc_mdio]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: i2c
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [i2c]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: led
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [wifi_led]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: flash
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [snfi]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: pcie
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [pcie_clk, pcie_wake, pcie_pereset]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: pwm
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [pwm0, pwm1_0, pwm1_1]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: spi
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [spi0, spi0_wp_hold, spi1_0, spi1_1, spi1_2, spi1_3]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: uart
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [uart1_0, uart1_1, uart1_2, uart1_3_rx_tx,
|
||||
uart1_3_cts_rts, uart2_0, uart2_1, uart0, uart1, uart2]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: watchdog
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [watchdog]
|
||||
- if:
|
||||
properties:
|
||||
function:
|
||||
const: wifi
|
||||
then:
|
||||
properties:
|
||||
groups:
|
||||
enum: [wf_2g, wf_5g, wf_dbdc]
|
||||
'.*conf.*':
|
||||
type: object
|
||||
additionalProperties: false
|
||||
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.
|
||||
There is no PIN 41 to PIN 65 above on mt7686b, you can only use
|
||||
those pins on mt7986a.
|
||||
enum: [SYS_WATCHDOG, WF2G_LED, WF5G_LED, I2C_SCL, I2C_SDA, GPIO_0,
|
||||
GPIO_1, GPIO_2, GPIO_3, GPIO_4, GPIO_5, GPIO_6, GPIO_7,
|
||||
GPIO_8, GPIO_9, GPIO_10, GPIO_11, GPIO_12, GPIO_13, GPIO_14,
|
||||
GPIO_15, PWM0, PWM1, SPI0_CLK, SPI0_MOSI, SPI0_MISO, SPI0_CS,
|
||||
SPI0_HOLD, SPI0_WP, SPI1_CLK, SPI1_MOSI, SPI1_MISO, SPI1_CS,
|
||||
SPI2_CLK, SPI2_MOSI, SPI2_MISO, SPI2_CS, SPI2_HOLD, SPI2_WP,
|
||||
UART0_RXD, UART0_TXD, PCIE_PERESET_N, UART1_RXD, UART1_TXD,
|
||||
UART1_CTS, UART1_RTS, UART2_RXD, UART2_TXD, UART2_CTS,
|
||||
UART2_RTS, EMMC_DATA_0, EMMC_DATA_1, EMMC_DATA_2,
|
||||
EMMC_DATA_3, EMMC_DATA_4, EMMC_DATA_5, EMMC_DATA_6,
|
||||
EMMC_DATA_7, EMMC_CMD, EMMC_CK, EMMC_DSL, EMMC_RSTB, PCM_DTX,
|
||||
PCM_DRX, PCM_CLK, PCM_FS, MT7531_INT, SMI_MDC, SMI_MDIO,
|
||||
WF0_DIG_RESETB, WF0_CBA_RESETB, WF0_XO_REQ, WF0_TOP_CLK,
|
||||
WF0_TOP_DATA, WF0_HB1, WF0_HB2, WF0_HB3, WF0_HB4, WF0_HB0,
|
||||
WF0_HB0_B, WF0_HB5, WF0_HB6, WF0_HB7, WF0_HB8, WF0_HB9,
|
||||
WF0_HB10, WF1_DIG_RESETB, WF1_CBA_RESETB, WF1_XO_REQ,
|
||||
WF1_TOP_CLK, WF1_TOP_DATA, WF1_HB1, WF1_HB2, WF1_HB3,
|
||||
WF1_HB4, WF1_HB0, WF1_HB0_B, WF1_HB5, WF1_HB6, WF1_HB7,
|
||||
WF1_HB8]
|
||||
|
||||
bias-disable: true
|
||||
|
||||
bias-pull-up: true
|
||||
|
||||
bias-pull-down: true
|
||||
|
||||
input-enable: true
|
||||
|
||||
input-disable: true
|
||||
|
||||
output-enable: true
|
||||
|
||||
output-low: true
|
||||
|
||||
output-high: true
|
||||
|
||||
input-schmitt-enable: true
|
||||
|
||||
input-schmitt-disable: true
|
||||
|
||||
drive-strength:
|
||||
enum: [2, 4, 6, 8, 10, 12, 14, 16]
|
||||
|
||||
mediatek,pull-up-adv:
|
||||
description: |
|
||||
Valid arguments for 'mediatek,pull-up-adv' are '0', '1', '2', '3'
|
||||
Pull up setings for 2 pull resistors, R0 and R1. Valid arguments
|
||||
are described as below:
|
||||
0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled.
|
||||
1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled.
|
||||
2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled.
|
||||
3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled.
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
enum: [0, 1, 2, 3]
|
||||
|
||||
mediatek,pull-down-adv:
|
||||
description: |
|
||||
Valid arguments for 'mediatek,pull-up-adv' are '0', '1', '2', '3'
|
||||
Pull down setings for 2 pull resistors, R0 and R1. Valid arguments
|
||||
are described as below:
|
||||
0: (R1, R0) = (0, 0) which means R1 disabled and R0 disabled.
|
||||
1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled.
|
||||
2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled.
|
||||
3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled.
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
enum: [0, 1, 2, 3]
|
||||
|
||||
required:
|
||||
- pins
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/irq.h>
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
|
||||
soc {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
pio: pinctrl@1001f000 {
|
||||
compatible = "mediatek,mt7986a-pinctrl";
|
||||
reg = <0 0x1001f000 0 0x1000>,
|
||||
<0 0x11c30000 0 0x1000>,
|
||||
<0 0x11c40000 0 0x1000>,
|
||||
<0 0x11e20000 0 0x1000>,
|
||||
<0 0x11e30000 0 0x1000>,
|
||||
<0 0x11f00000 0 0x1000>,
|
||||
<0 0x11f10000 0 0x1000>,
|
||||
<0 0x1000b000 0 0x1000>;
|
||||
reg-names = "gpio", "iocfg_rt", "iocfg_rb", "iocfg_lt",
|
||||
"iocfg_lb", "iocfg_tr", "iocfg_tl", "eint";
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
gpio-ranges = <&pio 0 0 100>;
|
||||
interrupt-controller;
|
||||
interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-parent = <&gic>;
|
||||
#interrupt-cells = <2>;
|
||||
|
||||
uart1_pins: uart1-pins {
|
||||
mux {
|
||||
function = "uart";
|
||||
groups = "uart1";
|
||||
};
|
||||
};
|
||||
|
||||
uart2_pins: uart2-pins {
|
||||
mux {
|
||||
function = "uart";
|
||||
groups = "uart2";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
|
@ -68,6 +68,13 @@ properties:
|
|||
clock, and larger than zero.
|
||||
default: 12500000
|
||||
|
||||
resets:
|
||||
maxItems: 1
|
||||
|
||||
reset-names:
|
||||
items:
|
||||
- const: switch
|
||||
|
||||
patternProperties:
|
||||
"^gpio@[0-1]$":
|
||||
type: object
|
||||
|
|
|
@ -49,6 +49,12 @@ properties:
|
|||
description: The interrupt outputs to sysirq.
|
||||
maxItems: 1
|
||||
|
||||
mediatek,rsel_resistance_in_si_unit:
|
||||
type: boolean
|
||||
description: |
|
||||
Identifying i2c pins pull up/down type which is RSEL. It can support
|
||||
RSEL define or si unit value(ohm) to set different resistance.
|
||||
|
||||
#PIN CONFIGURATION NODES
|
||||
patternProperties:
|
||||
'-pins$':
|
||||
|
@ -82,9 +88,85 @@ patternProperties:
|
|||
drive-strength:
|
||||
enum: [2, 4, 6, 8, 10, 12, 14, 16]
|
||||
|
||||
bias-pull-down: true
|
||||
bias-pull-down:
|
||||
description: |
|
||||
For pull down type is normal, it don't need add RSEL & R1R0 define
|
||||
and resistance value.
|
||||
For pull down type is PUPD/R0/R1 type, it can add R1R0 define to
|
||||
set different resistance. It can support "MTK_PUPD_SET_R1R0_00" &
|
||||
"MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" & "MTK_PUPD_SET_R1R0_11"
|
||||
define in mt8195.
|
||||
For pull down type is RSEL, it can add RSEL define & resistance value(ohm)
|
||||
to set different resistance by identifying property "mediatek,rsel_resistance_in_si_unit".
|
||||
It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001"
|
||||
& "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" & "MTK_PULL_SET_RSEL_100"
|
||||
& "MTK_PULL_SET_RSEL_101" & "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111"
|
||||
define in mt8195. It can also support resistance value(ohm) "75000" & "5000" in mt8195.
|
||||
oneOf:
|
||||
- enum: [100, 101, 102, 103]
|
||||
- description: mt8195 pull down PUPD/R0/R1 type define value.
|
||||
- enum: [200, 201, 202, 203, 204, 205, 206, 207]
|
||||
- description: mt8195 pull down RSEL type define value.
|
||||
- enum: [75000, 5000]
|
||||
- description: mt8195 pull down RSEL type si unit value(ohm).
|
||||
|
||||
bias-pull-up: true
|
||||
An example of using RSEL define:
|
||||
pincontroller {
|
||||
i2c0_pin {
|
||||
pinmux = <PINMUX_GPIO8__FUNC_SDA0>;
|
||||
bias-pull-down = <MTK_PULL_SET_RSEL_001>;
|
||||
};
|
||||
};
|
||||
An example of using si unit resistance value(ohm):
|
||||
&pio {
|
||||
mediatek,rsel_resistance_in_si_unit;
|
||||
}
|
||||
pincontroller {
|
||||
i2c0_pin {
|
||||
pinmux = <PINMUX_GPIO8__FUNC_SDA0>;
|
||||
bias-pull-down = <75000>;
|
||||
};
|
||||
};
|
||||
|
||||
bias-pull-up:
|
||||
description: |
|
||||
For pull up type is normal, it don't need add RSEL & R1R0 define
|
||||
and resistance value.
|
||||
For pull up type is PUPD/R0/R1 type, it can add R1R0 define to
|
||||
set different resistance. It can support "MTK_PUPD_SET_R1R0_00" &
|
||||
"MTK_PUPD_SET_R1R0_01" & "MTK_PUPD_SET_R1R0_10" & "MTK_PUPD_SET_R1R0_11"
|
||||
define in mt8195.
|
||||
For pull up type is RSEL, it can add RSEL define & resistance value(ohm)
|
||||
to set different resistance by identifying property "mediatek,rsel_resistance_in_si_unit".
|
||||
It can support "MTK_PULL_SET_RSEL_000" & "MTK_PULL_SET_RSEL_001"
|
||||
& "MTK_PULL_SET_RSEL_010" & "MTK_PULL_SET_RSEL_011" & "MTK_PULL_SET_RSEL_100"
|
||||
& "MTK_PULL_SET_RSEL_101" & "MTK_PULL_SET_RSEL_110" & "MTK_PULL_SET_RSEL_111"
|
||||
define in mt8195. It can also support resistance value(ohm)
|
||||
"1000" & "1500" & "2000" & "3000" & "4000" & "5000" & "10000" & "75000" in mt8195.
|
||||
oneOf:
|
||||
- enum: [100, 101, 102, 103]
|
||||
- description: mt8195 pull up PUPD/R0/R1 type define value.
|
||||
- enum: [200, 201, 202, 203, 204, 205, 206, 207]
|
||||
- description: mt8195 pull up RSEL type define value.
|
||||
- enum: [1000, 1500, 2000, 3000, 4000, 5000, 10000, 75000]
|
||||
- description: mt8195 pull up RSEL type si unit value(ohm).
|
||||
An example of using RSEL define:
|
||||
pincontroller {
|
||||
i2c0_pin {
|
||||
pinmux = <PINMUX_GPIO8__FUNC_SDA0>;
|
||||
bias-pull-up = <MTK_PULL_SET_RSEL_001>;
|
||||
};
|
||||
};
|
||||
An example of using si unit resistance value(ohm):
|
||||
&pio {
|
||||
mediatek,rsel_resistance_in_si_unit;
|
||||
}
|
||||
pincontroller {
|
||||
i2c0_pin {
|
||||
pinmux = <PINMUX_GPIO8__FUNC_SDA0>;
|
||||
bias-pull-up = <1000>;
|
||||
};
|
||||
};
|
||||
|
||||
bias-disable: true
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ properties:
|
|||
- qcom,pm660l-gpio
|
||||
- qcom,pm6150-gpio
|
||||
- qcom,pm6150l-gpio
|
||||
- qcom,pm6350-gpio
|
||||
- qcom,pm7325-gpio
|
||||
- qcom,pm8005-gpio
|
||||
- qcom,pm8008-gpio
|
||||
|
@ -103,6 +104,7 @@ $defs:
|
|||
this subnode. Valid pins are
|
||||
- gpio1-gpio10 for pm6150
|
||||
- gpio1-gpio12 for pm6150l
|
||||
- gpio1-gpio9 for pm6350
|
||||
- gpio1-gpio10 for pm7325
|
||||
- gpio1-gpio4 for pm8005
|
||||
- gpio1-gpio2 for pm8008
|
||||
|
@ -170,6 +172,8 @@ $defs:
|
|||
input-enable: true
|
||||
output-high: true
|
||||
output-low: true
|
||||
output-enable: true
|
||||
output-disable: true
|
||||
power-source: true
|
||||
|
||||
qcom,drive-strength:
|
||||
|
|
|
@ -1,187 +0,0 @@
|
|||
Qualcomm PMIC Multi-Purpose Pin (MPP) block
|
||||
|
||||
This binding describes the MPP block(s) found in the 8xxx series
|
||||
of PMIC's from Qualcomm.
|
||||
|
||||
- compatible:
|
||||
Usage: required
|
||||
Value type: <string>
|
||||
Definition: Should contain one of:
|
||||
"qcom,pm8018-mpp",
|
||||
"qcom,pm8019-mpp",
|
||||
"qcom,pm8038-mpp",
|
||||
"qcom,pm8058-mpp",
|
||||
"qcom,pm8821-mpp",
|
||||
"qcom,pm8841-mpp",
|
||||
"qcom,pm8916-mpp",
|
||||
"qcom,pm8917-mpp",
|
||||
"qcom,pm8921-mpp",
|
||||
"qcom,pm8941-mpp",
|
||||
"qcom,pm8950-mpp",
|
||||
"qcom,pmi8950-mpp",
|
||||
"qcom,pm8994-mpp",
|
||||
"qcom,pma8084-mpp",
|
||||
"qcom,pmi8994-mpp",
|
||||
|
||||
And must contain either "qcom,spmi-mpp" or "qcom,ssbi-mpp"
|
||||
if the device is on an spmi bus or an ssbi bus respectively.
|
||||
|
||||
- reg:
|
||||
Usage: required
|
||||
Value type: <prop-encoded-array>
|
||||
Definition: Register base of the MPP block and length.
|
||||
|
||||
- interrupts:
|
||||
Usage: required
|
||||
Value type: <prop-encoded-array>
|
||||
Definition: Must contain an array of encoded interrupt specifiers for
|
||||
each available MPP
|
||||
|
||||
- gpio-controller:
|
||||
Usage: required
|
||||
Value type: <none>
|
||||
Definition: Mark the device node as a GPIO controller
|
||||
|
||||
- #gpio-cells:
|
||||
Usage: required
|
||||
Value type: <u32>
|
||||
Definition: Must be 2;
|
||||
the first cell will be used to define MPP number and the
|
||||
second denotes the flags for this MPP
|
||||
|
||||
Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for
|
||||
a general description of GPIO and interrupt bindings.
|
||||
|
||||
Please refer to pinctrl-bindings.txt in this directory for details of the
|
||||
common pinctrl bindings used by client devices, including the meaning of the
|
||||
phrase "pin configuration node".
|
||||
|
||||
The pin configuration nodes act as a container for an arbitrary number of
|
||||
subnodes. Each of these subnodes represents some desired configuration for a
|
||||
pin or a list of pins. This configuration can include the
|
||||
mux function to select on those pin(s), and various pin configuration
|
||||
parameters, as listed below.
|
||||
|
||||
SUBNODES:
|
||||
|
||||
The name of each subnode is not important; all subnodes should be enumerated
|
||||
and processed purely based on their content.
|
||||
|
||||
Each subnode only affects those parameters that are explicitly listed. In
|
||||
other words, a subnode that lists a mux function but no pin configuration
|
||||
parameters implies no information about any pin configuration parameters.
|
||||
Similarly, a pin subnode that describes a pullup parameter implies no
|
||||
information about e.g. the mux function.
|
||||
|
||||
The following generic properties as defined in pinctrl-bindings.txt are valid
|
||||
to specify in a pin configuration subnode:
|
||||
|
||||
- pins:
|
||||
Usage: required
|
||||
Value type: <string-array>
|
||||
Definition: List of MPP pins affected by the properties specified in
|
||||
this subnode. Valid pins are:
|
||||
mpp1-mpp4 for pm8841
|
||||
mpp1-mpp4 for pm8916
|
||||
mpp1-mpp8 for pm8941
|
||||
mpp1-mpp4 for pm8950
|
||||
mpp1-mpp4 for pmi8950
|
||||
mpp1-mpp4 for pma8084
|
||||
|
||||
- function:
|
||||
Usage: required
|
||||
Value type: <string>
|
||||
Definition: Specify the alternative function to be configured for the
|
||||
specified pins. Valid values are:
|
||||
"digital",
|
||||
"analog",
|
||||
"sink"
|
||||
|
||||
- bias-disable:
|
||||
Usage: optional
|
||||
Value type: <none>
|
||||
Definition: The specified pins should be configured as no pull.
|
||||
|
||||
- bias-pull-up:
|
||||
Usage: optional
|
||||
Value type: <u32>
|
||||
Definition: The specified pins should be configured as pull up.
|
||||
Valid values are 600, 10000 and 30000 in bidirectional mode
|
||||
only, i.e. when operating in qcom,analog-mode and input and
|
||||
outputs are enabled. The hardware ignores the configuration
|
||||
when operating in other modes.
|
||||
|
||||
- bias-high-impedance:
|
||||
Usage: optional
|
||||
Value type: <none>
|
||||
Definition: The specified pins will put in high-Z mode and disabled.
|
||||
|
||||
- input-enable:
|
||||
Usage: optional
|
||||
Value type: <none>
|
||||
Definition: The specified pins are put in input mode, i.e. their input
|
||||
buffer is enabled
|
||||
|
||||
- output-high:
|
||||
Usage: optional
|
||||
Value type: <none>
|
||||
Definition: The specified pins are configured in output mode, driven
|
||||
high.
|
||||
|
||||
- output-low:
|
||||
Usage: optional
|
||||
Value type: <none>
|
||||
Definition: The specified pins are configured in output mode, driven
|
||||
low.
|
||||
|
||||
- power-source:
|
||||
Usage: optional
|
||||
Value type: <u32>
|
||||
Definition: Selects the power source for the specified pins. Valid power
|
||||
sources are defined in <dt-bindings/pinctrl/qcom,pmic-mpp.h>
|
||||
|
||||
- qcom,analog-level:
|
||||
Usage: optional
|
||||
Value type: <u32>
|
||||
Definition: Selects the source for analog output. Valued values are
|
||||
defined in <dt-binding/pinctrl/qcom,pmic-mpp.h>
|
||||
PMIC_MPP_AOUT_LVL_*
|
||||
|
||||
- qcom,dtest:
|
||||
Usage: optional
|
||||
Value type: <u32>
|
||||
Definition: Selects which dtest rail to be routed in the various functions.
|
||||
Valid values are 1-4
|
||||
|
||||
- qcom,amux-route:
|
||||
Usage: optional
|
||||
Value type: <u32>
|
||||
Definition: Selects the source for analog input. Valid values are
|
||||
defined in <dt-bindings/pinctrl/qcom,pmic-mpp.h>
|
||||
PMIC_MPP_AMUX_ROUTE_CH5, PMIC_MPP_AMUX_ROUTE_CH6...
|
||||
- qcom,paired:
|
||||
Usage: optional
|
||||
Value type: <none>
|
||||
Definition: Indicates that the pin should be operating in paired mode.
|
||||
|
||||
Example:
|
||||
|
||||
mpps@a000 {
|
||||
compatible = "qcom,pm8841-mpp", "qcom,spmi-mpp";
|
||||
reg = <0xa000>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupts = <4 0xa0 0 0>, <4 0xa1 0 0>, <4 0xa2 0 0>, <4 0xa3 0 0>;
|
||||
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pm8841_default>;
|
||||
|
||||
pm8841_default: default {
|
||||
gpio {
|
||||
pins = "mpp1", "mpp2", "mpp3", "mpp4";
|
||||
function = "digital";
|
||||
input-enable;
|
||||
power-source = <PM8841_MPP_S3>;
|
||||
};
|
||||
};
|
||||
};
|
|
@ -0,0 +1,188 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/qcom,pmic-mpp.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Qualcomm PMIC Multi-Purpose Pin (MPP) block
|
||||
|
||||
maintainers:
|
||||
- Bjorn Andersson <bjorn.andersson@linaro.org>
|
||||
|
||||
description:
|
||||
This binding describes the MPP block(s) found in the 8xxx series of
|
||||
PMIC's from Qualcomm.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
items:
|
||||
- enum:
|
||||
- qcom,pm8018-mpp
|
||||
- qcom,pm8019-mpp
|
||||
- qcom,pm8038-mpp
|
||||
- qcom,pm8058-mpp
|
||||
- qcom,pm8821-mpp
|
||||
- qcom,pm8841-mpp
|
||||
- qcom,pm8916-mpp
|
||||
- qcom,pm8917-mpp
|
||||
- qcom,pm8921-mpp
|
||||
- qcom,pm8941-mpp
|
||||
- qcom,pm8950-mpp
|
||||
- qcom,pmi8950-mpp
|
||||
- qcom,pm8994-mpp
|
||||
- qcom,pma8084-mpp
|
||||
- qcom,pmi8994-mpp
|
||||
|
||||
- enum:
|
||||
- qcom,spmi-mpp
|
||||
- qcom,ssbi-mpp
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
interrupt-controller: true
|
||||
|
||||
'#interrupt-cells':
|
||||
const: 2
|
||||
|
||||
gpio-controller: true
|
||||
gpio-line-names: true
|
||||
|
||||
gpio-ranges:
|
||||
maxItems: 1
|
||||
|
||||
'#gpio-cells':
|
||||
const: 2
|
||||
description:
|
||||
The first cell will be used to define gpio number and the
|
||||
second denotes the flags for this gpio
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- gpio-controller
|
||||
- '#gpio-cells'
|
||||
- gpio-ranges
|
||||
- interrupt-controller
|
||||
|
||||
patternProperties:
|
||||
'-state$':
|
||||
oneOf:
|
||||
- $ref: "#/$defs/qcom-pmic-mpp-state"
|
||||
- patternProperties:
|
||||
"mpp":
|
||||
$ref: "#/$defs/qcom-pmic-mpp-state"
|
||||
additionalProperties: false
|
||||
|
||||
$defs:
|
||||
qcom-pmic-mpp-state:
|
||||
type: object
|
||||
allOf:
|
||||
- $ref: "pinmux-node.yaml"
|
||||
- $ref: "pincfg-node.yaml"
|
||||
properties:
|
||||
pins:
|
||||
description:
|
||||
List of gpio pins affected by the properties specified in
|
||||
this subnode. Valid pins are
|
||||
- mpp1-mpp4 for pm8841
|
||||
- mpp1-mpp4 for pm8916
|
||||
- mpp1-mpp8 for pm8941
|
||||
- mpp1-mpp4 for pm8950
|
||||
- mpp1-mpp4 for pmi8950
|
||||
- mpp1-mpp4 for pma8084
|
||||
|
||||
items:
|
||||
pattern: "^mpp([0-9]+)$"
|
||||
|
||||
function:
|
||||
items:
|
||||
- enum:
|
||||
- digital
|
||||
- analog
|
||||
- sink
|
||||
|
||||
bias-disable: true
|
||||
bias-pull-up: true
|
||||
bias-high-impedance: true
|
||||
input-enable: true
|
||||
output-high: true
|
||||
output-low: true
|
||||
power-source: true
|
||||
|
||||
qcom,analog-level:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
description:
|
||||
Selects the source for analog output. Valued values are defined in
|
||||
<dt-binding/pinctrl/qcom,pmic-mpp.h> PMIC_MPP_AOUT_LVL_*
|
||||
enum: [0, 1, 2, 3, 4, 5, 6, 7]
|
||||
|
||||
qcom,atest:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
description:
|
||||
Selects ATEST rail to route to GPIO when it's
|
||||
configured in analog-pass-through mode.
|
||||
enum: [1, 2, 3, 4]
|
||||
|
||||
qcom,dtest:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
description:
|
||||
Selects DTEST rail to route to GPIO when it's
|
||||
configured as digital input.
|
||||
enum: [1, 2, 3, 4]
|
||||
|
||||
qcom,amux-route:
|
||||
$ref: /schemas/types.yaml#/definitions/uint32
|
||||
description:
|
||||
Selects the source for analog input. Valid values are defined in
|
||||
<dt-bindings/pinctrl/qcom,pmic-mpp.h> PMIC_MPP_AMUX_ROUTE_CH5,
|
||||
PMIC_MPP_AMUX_ROUTE_CH6...
|
||||
enum: [0, 1, 2, 3, 4, 5, 6, 7]
|
||||
|
||||
qcom,paired:
|
||||
- description:
|
||||
Indicates that the pin should be operating in paired mode.
|
||||
|
||||
required:
|
||||
- pins
|
||||
- function
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
|
||||
|
||||
pm8841_mpp: mpps@a000 {
|
||||
compatible = "qcom,pm8841-mpp", "qcom,spmi-mpp";
|
||||
reg = <0xa000 0>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
gpio-ranges = <&pm8841_mpp 0 0 4>;
|
||||
gpio-line-names = "VDD_PX_BIAS", "WLAN_LED_CTRL",
|
||||
"BT_LED_CTRL", "GPIO-F";
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pm8841_default>;
|
||||
|
||||
mpp1-state {
|
||||
pins = "mpp1";
|
||||
function = "digital";
|
||||
input-enable;
|
||||
power-source = <PM8841_MPP_S3>;
|
||||
};
|
||||
|
||||
default-state {
|
||||
gpio-mpp {
|
||||
pins = "mpp1", "mpp2", "mpp3", "mpp4";
|
||||
function = "digital";
|
||||
input-enable;
|
||||
power-source = <PM8841_MPP_S3>;
|
||||
};
|
||||
};
|
||||
};
|
||||
...
|
|
@ -0,0 +1,165 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/qcom,qcm2290-pinctrl.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Qualcomm Technologies, Inc. QCM2290 TLMM block
|
||||
|
||||
maintainers:
|
||||
- Shawn Guo <shawn.guo@linaro.org>
|
||||
|
||||
description:
|
||||
This binding describes the Top Level Mode Multiplexer block found in the
|
||||
QCM2290 platform.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: qcom,qcm2290-tlmm
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
interrupts:
|
||||
description: Specifies the TLMM summary IRQ
|
||||
maxItems: 1
|
||||
|
||||
interrupt-controller: true
|
||||
|
||||
'#interrupt-cells':
|
||||
description:
|
||||
Specifies the PIN numbers and Flags, as defined in defined in
|
||||
include/dt-bindings/interrupt-controller/irq.h
|
||||
const: 2
|
||||
|
||||
gpio-controller: true
|
||||
|
||||
'#gpio-cells':
|
||||
description: Specifying the pin number and flags, as defined in
|
||||
include/dt-bindings/gpio/gpio.h
|
||||
const: 2
|
||||
|
||||
gpio-ranges:
|
||||
maxItems: 1
|
||||
|
||||
wakeup-parent:
|
||||
maxItems: 1
|
||||
|
||||
#PIN CONFIGURATION NODES
|
||||
patternProperties:
|
||||
'-state$':
|
||||
oneOf:
|
||||
- $ref: "#/$defs/qcom-qcm2290-tlmm-state"
|
||||
- patternProperties:
|
||||
".*":
|
||||
$ref: "#/$defs/qcom-qcm2290-tlmm-state"
|
||||
|
||||
'$defs':
|
||||
qcom-qcm2290-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"
|
||||
|
||||
properties:
|
||||
pins:
|
||||
description:
|
||||
List of gpio pins affected by the properties specified in this
|
||||
subnode.
|
||||
items:
|
||||
oneOf:
|
||||
- pattern: "^gpio([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-6])$"
|
||||
- enum: [ sdc1_rclk, sdc1_clk, sdc1_cmd, sdc1_data,
|
||||
sdc2_clk, sdc2_cmd, sdc2_data ]
|
||||
minItems: 1
|
||||
maxItems: 36
|
||||
|
||||
function:
|
||||
description:
|
||||
Specify the alternative function to be configured for the specified
|
||||
pins.
|
||||
|
||||
enum: [ adsp_ext, agera_pll, atest, cam_mclk, cci_async, cci_i2c,
|
||||
cci_timer0, cci_timer1, cci_timer2, cci_timer3, char_exec,
|
||||
cri_trng, cri_trng0, cri_trng1, dac_calib, dbg_out, ddr_bist,
|
||||
ddr_pxi0, ddr_pxi1, ddr_pxi2, ddr_pxi3, gcc_gp1, gcc_gp2,
|
||||
gcc_gp3, gpio, gp_pdm0, gp_pdm1, gp_pdm2, gsm0_tx, gsm1_tx,
|
||||
jitter_bist, mdp_vsync, mdp_vsync_out_0, mdp_vsync_out_1,
|
||||
mpm_pwr, mss_lte, m_voc, nav_gpio, pa_indicator, pbs0, pbs1,
|
||||
pbs2, pbs3, pbs4, pbs5, pbs6, pbs7, pbs8, pbs9, pbs10, pbs11,
|
||||
pbs12, pbs13, pbs14, pbs15, pbs_out, phase_flag, pll_bist,
|
||||
pll_bypassnl, pll_reset, prng_rosc, pwm_0, pwm_1, pwm_2, pwm_3,
|
||||
pwm_4, pwm_5, pwm_6, pwm_7, pwm_8, pwm_9, qdss_cti, qdss_gpio,
|
||||
qup0, qup1, qup2, qup3, qup4, qup5, sdc1_tb, sdc2_tb, sd_write,
|
||||
ssbi_wtr1, tgu_ch0, tgu_ch1, tgu_ch2, tgu_ch3, tsense_pwm,
|
||||
uim1_clk, uim1_data, uim1_present, uim1_reset, uim2_clk,
|
||||
uim2_data, uim2_present, uim2_reset, usb_phy, vfr_1,
|
||||
vsense_trigger, wlan1_adc0, wlan1_adc1 ]
|
||||
|
||||
drive-strength:
|
||||
enum: [2, 4, 6, 8, 10, 12, 14, 16]
|
||||
default: 2
|
||||
description:
|
||||
Selects the drive strength for the specified pins, in mA.
|
||||
|
||||
bias-pull-down: true
|
||||
|
||||
bias-pull-up: true
|
||||
|
||||
bias-disable: true
|
||||
|
||||
output-high: true
|
||||
|
||||
output-low: true
|
||||
|
||||
required:
|
||||
- pins
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- interrupts
|
||||
- interrupt-controller
|
||||
- '#interrupt-cells'
|
||||
- gpio-controller
|
||||
- '#gpio-cells'
|
||||
- gpio-ranges
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
tlmm: pinctrl@500000 {
|
||||
compatible = "qcom,qcm2290-tlmm";
|
||||
reg = <0x500000 0x300000>;
|
||||
interrupts = <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
gpio-ranges = <&tlmm 0 0 127>;
|
||||
|
||||
sdc2_on_state: sdc2-on-state {
|
||||
clk {
|
||||
pins = "sdc2_clk";
|
||||
bias-disable;
|
||||
drive-strength = <16>;
|
||||
};
|
||||
|
||||
cmd {
|
||||
pins = "sdc2_cmd";
|
||||
bias-pull-up;
|
||||
drive-strength = <10>;
|
||||
};
|
||||
|
||||
data {
|
||||
pins = "sdc2_data";
|
||||
bias-pull-up;
|
||||
drive-strength = <10>;
|
||||
};
|
||||
};
|
||||
};
|
|
@ -0,0 +1,148 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/qcom,sm6350-pinctrl.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Qualcomm Technologies, Inc. SM6350 TLMM block
|
||||
|
||||
maintainers:
|
||||
- Konrad Dybcio <konrad.dybcio@somainline.org>
|
||||
|
||||
description: |
|
||||
This binding describes the Top Level Mode Multiplexer (TLMM) block found
|
||||
in the SM6350 platform.
|
||||
|
||||
allOf:
|
||||
- $ref: /schemas/pinctrl/qcom,tlmm-common.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: qcom,sm6350-tlmm
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
interrupts: true
|
||||
interrupt-controller: true
|
||||
'#interrupt-cells': true
|
||||
gpio-controller: true
|
||||
gpio-reserved-ranges: true
|
||||
'#gpio-cells': true
|
||||
gpio-ranges: true
|
||||
wakeup-parent: true
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
patternProperties:
|
||||
'-state$':
|
||||
oneOf:
|
||||
- $ref: "#/$defs/qcom-sm6350-tlmm-state"
|
||||
- patternProperties:
|
||||
".*":
|
||||
$ref: "#/$defs/qcom-sm6350-tlmm-state"
|
||||
|
||||
$defs:
|
||||
qcom-sm6350-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"
|
||||
|
||||
properties:
|
||||
pins:
|
||||
description:
|
||||
List of gpio pins affected by the properties specified in this
|
||||
subnode.
|
||||
items:
|
||||
oneOf:
|
||||
- pattern: "^gpio([0-9]|[1-9][0-9]|1[0-4][0-9]|15[0-7])$"
|
||||
- enum: [ sdc1_clk, sdc1_cmd, sdc1_data, sdc2_clk, sdc2_cmd, sdc2_data ]
|
||||
minItems: 1
|
||||
maxItems: 36
|
||||
|
||||
function:
|
||||
description:
|
||||
Specify the alternative function to be configured for the specified
|
||||
pins.
|
||||
|
||||
enum: [ adsp_ext, agera_pll, atest_char, atest_char0, atest_char1, atest_char2,
|
||||
atest_char3, atest_tsens, atest_tsens2, atest_usb1, atest_usb10, atest_usb11,
|
||||
atest_usb12, atest_usb13, atest_usb2, atest_usb20, atest_usb21, atest_usb22,
|
||||
atest_usb23, audio_ref, btfm_slimbus, cam_mclk0, cam_mclk1, cam_mclk2, cam_mclk3,
|
||||
cam_mclk4, cci_async, cci_i2c, cci_timer0, cci_timer1, cci_timer2, cci_timer3,
|
||||
cci_timer4, cri_trng, dbg_out, ddr_bist, ddr_pxi0, ddr_pxi1, ddr_pxi2, ddr_pxi3,
|
||||
dp_hot, edp_lcd, gcc_gp1, gcc_gp2, gcc_gp3, gp_pdm0, gp_pdm1, gp_pdm2, gpio,
|
||||
gps_tx, ibi_i3c, jitter_bist, ldo_en, ldo_update, lpass_ext, m_voc, mclk,
|
||||
mdp_vsync, mdp_vsync0, mdp_vsync1, mdp_vsync2, mdp_vsync3, mi2s_0, mi2s_1, mi2s_2,
|
||||
mss_lte, nav_gpio, nav_pps, pa_indicator, pcie0_clk, phase_flag0, phase_flag1,
|
||||
phase_flag10, phase_flag11, phase_flag12, phase_flag13, phase_flag14, phase_flag15,
|
||||
phase_flag16, phase_flag17, phase_flag18, phase_flag19, phase_flag2, phase_flag20,
|
||||
phase_flag21, phase_flag22, phase_flag23, phase_flag24, phase_flag25, phase_flag26,
|
||||
phase_flag27, phase_flag28, phase_flag29, phase_flag3, phase_flag30, phase_flag31,
|
||||
phase_flag4, phase_flag5, phase_flag6, phase_flag7, phase_flag8, phase_flag9,
|
||||
pll_bist, pll_bypassnl, pll_reset, prng_rosc, qdss_cti, qdss_gpio, qdss_gpio0,
|
||||
qdss_gpio1, qdss_gpio10, qdss_gpio11, qdss_gpio12, qdss_gpio13, qdss_gpio14,
|
||||
qdss_gpio15, qdss_gpio2, qdss_gpio3, qdss_gpio4, qdss_gpio5, qdss_gpio6,
|
||||
qdss_gpio7, qdss_gpio8, qdss_gpio9, qlink0_enable, qlink0_request, qlink0_wmss,
|
||||
qlink1_enable, qlink1_request, qlink1_wmss, qup00, qup01, qup02, qup10, qup11,
|
||||
qup12, qup13_f1, qup13_f2, qup14, rffe0_clk, rffe0_data, rffe1_clk, rffe1_data,
|
||||
rffe2_clk, rffe2_data, rffe3_clk, rffe3_data, rffe4_clk, rffe4_data, sd_write,
|
||||
sdc1_tb, sdc2_tb, sp_cmu, tgu_ch0, tgu_ch1, tgu_ch2, tgu_ch3, tsense_pwm1,
|
||||
tsense_pwm2, uim1_clk, uim1_data, uim1_present, uim1_reset, uim2_clk, uim2_data,
|
||||
uim2_present, uim2_reset, usb_phy, vfr_1, vsense_trigger, wlan1_adc0, wlan1_adc1,
|
||||
wlan2_adc0, wlan2_adc1, ]
|
||||
|
||||
|
||||
bias-disable: true
|
||||
bias-pull-down: true
|
||||
bias-pull-up: true
|
||||
drive-strength: true
|
||||
input-enable: true
|
||||
output-high: true
|
||||
output-low: true
|
||||
|
||||
required:
|
||||
- pins
|
||||
- function
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
pinctrl@f100000 {
|
||||
compatible = "qcom,sm6350-tlmm";
|
||||
reg = <0x0f100000 0x300000>;
|
||||
interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
gpio-ranges = <&tlmm 0 0 157>;
|
||||
|
||||
gpio-wo-subnode-state {
|
||||
pins = "gpio1";
|
||||
function = "gpio";
|
||||
};
|
||||
|
||||
uart-w-subnodes-state {
|
||||
rx {
|
||||
pins = "gpio25";
|
||||
function = "qup13_f2";
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
tx {
|
||||
pins = "gpio26";
|
||||
function = "qup13_f2";
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
};
|
||||
...
|
|
@ -1,114 +0,0 @@
|
|||
* Rockchip Pinmux Controller
|
||||
|
||||
The Rockchip Pinmux Controller, enables the IC
|
||||
to share one PAD to several functional blocks. The sharing is done by
|
||||
multiplexing the PAD input/output signals. For each PAD there are several
|
||||
muxing options with option 0 being the use as a GPIO.
|
||||
|
||||
Please refer to pinctrl-bindings.txt in this directory for details of the
|
||||
common pinctrl bindings used by client devices, including the meaning of the
|
||||
phrase "pin configuration node".
|
||||
|
||||
The Rockchip pin configuration node is a node of a group of pins which can be
|
||||
used for a specific device or function. This node represents both mux and
|
||||
config of the pins in that group. The 'pins' selects the function mode(also
|
||||
named pin mode) this pin can work on and the 'config' configures various pad
|
||||
settings such as pull-up, etc.
|
||||
|
||||
The pins are grouped into up to 5 individual pin banks which need to be
|
||||
defined as gpio sub-nodes of the pinmux controller.
|
||||
|
||||
Required properties for iomux controller:
|
||||
- compatible: should be
|
||||
"rockchip,px30-pinctrl": for Rockchip PX30
|
||||
"rockchip,rv1108-pinctrl": for Rockchip RV1108
|
||||
"rockchip,rk2928-pinctrl": for Rockchip RK2928
|
||||
"rockchip,rk3066a-pinctrl": for Rockchip RK3066a
|
||||
"rockchip,rk3066b-pinctrl": for Rockchip RK3066b
|
||||
"rockchip,rk3128-pinctrl": for Rockchip RK3128
|
||||
"rockchip,rk3188-pinctrl": for Rockchip RK3188
|
||||
"rockchip,rk3228-pinctrl": for Rockchip RK3228
|
||||
"rockchip,rk3288-pinctrl": for Rockchip RK3288
|
||||
"rockchip,rk3308-pinctrl": for Rockchip RK3308
|
||||
"rockchip,rk3328-pinctrl": for Rockchip RK3328
|
||||
"rockchip,rk3368-pinctrl": for Rockchip RK3368
|
||||
"rockchip,rk3399-pinctrl": for Rockchip RK3399
|
||||
"rockchip,rk3568-pinctrl": for Rockchip RK3568
|
||||
|
||||
- rockchip,grf: phandle referencing a syscon providing the
|
||||
"general register files"
|
||||
|
||||
Optional properties for iomux controller:
|
||||
- rockchip,pmu: phandle referencing a syscon providing the pmu registers
|
||||
as some SoCs carry parts of the iomux controller registers there.
|
||||
Required for at least rk3188 and rk3288. On the rk3368 this should
|
||||
point to the PMUGRF syscon.
|
||||
|
||||
Deprecated properties for iomux controller:
|
||||
- reg: first element is the general register space of the iomux controller
|
||||
It should be large enough to contain also separate pull registers.
|
||||
second element is the separate pull register space of the rk3188.
|
||||
Use rockchip,grf and rockchip,pmu described above instead.
|
||||
|
||||
Required properties for gpio sub nodes:
|
||||
See rockchip,gpio-bank.yaml
|
||||
|
||||
Required properties for pin configuration node:
|
||||
- rockchip,pins: 3 integers array, represents a group of pins mux and config
|
||||
setting. The format is rockchip,pins = <PIN_BANK PIN_BANK_IDX MUX &phandle>.
|
||||
The MUX 0 means gpio and MUX 1 to N mean the specific device function.
|
||||
The phandle of a node containing the generic pinconfig options
|
||||
to use, as described in pinctrl-bindings.txt in this directory.
|
||||
|
||||
Examples:
|
||||
|
||||
#include <dt-bindings/pinctrl/rockchip.h>
|
||||
|
||||
...
|
||||
|
||||
pinctrl@20008000 {
|
||||
compatible = "rockchip,rk3066a-pinctrl";
|
||||
rockchip,grf = <&grf>;
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
|
||||
gpio0: gpio0@20034000 {
|
||||
compatible = "rockchip,gpio-bank";
|
||||
reg = <0x20034000 0x100>;
|
||||
interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk_gates8 9>;
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
|
||||
...
|
||||
|
||||
pcfg_pull_default: pcfg_pull_default {
|
||||
bias-pull-pin-default
|
||||
};
|
||||
|
||||
uart2 {
|
||||
uart2_xfer: uart2-xfer {
|
||||
rockchip,pins = <1 RK_PB0 1 &pcfg_pull_default>,
|
||||
<1 RK_PB1 1 &pcfg_pull_default>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
uart2: serial@20064000 {
|
||||
compatible = "snps,dw-apb-uart";
|
||||
reg = <0x20064000 0x400>;
|
||||
interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
|
||||
reg-shift = <2>;
|
||||
reg-io-width = <1>;
|
||||
clocks = <&mux_uart2>;
|
||||
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart2_xfer>;
|
||||
};
|
|
@ -0,0 +1,184 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/rockchip,pinctrl.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Rockchip Pinmux Controller
|
||||
|
||||
maintainers:
|
||||
- Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
description: |
|
||||
The Rockchip Pinmux Controller enables the IC to share one PAD
|
||||
to several functional blocks. The sharing is done by multiplexing
|
||||
the PAD input/output signals. For each PAD there are several muxing
|
||||
options with option 0 being used as a GPIO.
|
||||
|
||||
Please refer to pinctrl-bindings.txt in this directory for details of the
|
||||
common pinctrl bindings used by client devices, including the meaning of the
|
||||
phrase "pin configuration node".
|
||||
|
||||
The Rockchip pin configuration node is a node of a group of pins which can be
|
||||
used for a specific device or function. This node represents both mux and
|
||||
config of the pins in that group. The 'pins' selects the function mode
|
||||
(also named pin mode) this pin can work on and the 'config' configures
|
||||
various pad settings such as pull-up, etc.
|
||||
|
||||
The pins are grouped into up to 9 individual pin banks which need to be
|
||||
defined as gpio sub-nodes of the pinmux controller.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- rockchip,px30-pinctrl
|
||||
- rockchip,rk2928-pinctrl
|
||||
- rockchip,rk3066a-pinctrl
|
||||
- rockchip,rk3066b-pinctrl
|
||||
- rockchip,rk3128-pinctrl
|
||||
- rockchip,rk3188-pinctrl
|
||||
- rockchip,rk3228-pinctrl
|
||||
- rockchip,rk3288-pinctrl
|
||||
- rockchip,rk3308-pinctrl
|
||||
- rockchip,rk3328-pinctrl
|
||||
- rockchip,rk3368-pinctrl
|
||||
- rockchip,rk3399-pinctrl
|
||||
- rockchip,rk3568-pinctrl
|
||||
- rockchip,rv1108-pinctrl
|
||||
|
||||
rockchip,grf:
|
||||
$ref: "/schemas/types.yaml#/definitions/phandle"
|
||||
description:
|
||||
The phandle of the syscon node for the GRF registers.
|
||||
|
||||
rockchip,pmu:
|
||||
$ref: "/schemas/types.yaml#/definitions/phandle"
|
||||
description:
|
||||
The phandle of the syscon node for the PMU registers,
|
||||
as some SoCs carry parts of the iomux controller registers there.
|
||||
Required for at least rk3188 and rk3288. On the rk3368 this should
|
||||
point to the PMUGRF syscon.
|
||||
|
||||
"#address-cells":
|
||||
enum: [1, 2]
|
||||
|
||||
"#size-cells":
|
||||
enum: [1, 2]
|
||||
|
||||
ranges: true
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- rockchip,grf
|
||||
- "#address-cells"
|
||||
- "#size-cells"
|
||||
- ranges
|
||||
|
||||
patternProperties:
|
||||
"gpio@[0-9a-f]+$":
|
||||
type: object
|
||||
|
||||
$ref: "/schemas/gpio/rockchip,gpio-bank.yaml#"
|
||||
|
||||
unevaluatedProperties: false
|
||||
|
||||
"pcfg-[a-z0-9-]+$":
|
||||
type: object
|
||||
properties:
|
||||
bias-disable: true
|
||||
|
||||
bias-pull-down: true
|
||||
|
||||
bias-pull-pin-default: true
|
||||
|
||||
bias-pull-up: true
|
||||
|
||||
drive-strength:
|
||||
minimum: 0
|
||||
maximum: 20
|
||||
|
||||
input-enable: true
|
||||
|
||||
input-schmitt-enable: true
|
||||
|
||||
output-high: true
|
||||
|
||||
output-low: true
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
additionalProperties:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: object
|
||||
properties:
|
||||
rockchip,pins:
|
||||
$ref: "/schemas/types.yaml#/definitions/uint32-matrix"
|
||||
minItems: 1
|
||||
items:
|
||||
items:
|
||||
- minimum: 0
|
||||
maximum: 8
|
||||
description:
|
||||
Pin bank.
|
||||
- minimum: 0
|
||||
maximum: 31
|
||||
description:
|
||||
Pin bank index.
|
||||
- minimum: 0
|
||||
maximum: 6
|
||||
description:
|
||||
Mux 0 means GPIO and mux 1 to N means
|
||||
the specific device function.
|
||||
- description:
|
||||
The phandle of a node contains the generic pinconfig options
|
||||
to use as described in pinctrl-bindings.txt.
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
#include <dt-bindings/pinctrl/rockchip.h>
|
||||
|
||||
pinctrl: pinctrl {
|
||||
compatible = "rockchip,rk3066a-pinctrl";
|
||||
rockchip,grf = <&grf>;
|
||||
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
|
||||
gpio0: gpio@20034000 {
|
||||
compatible = "rockchip,gpio-bank";
|
||||
reg = <0x20034000 0x100>;
|
||||
interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk_gates8 9>;
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
|
||||
pcfg_pull_default: pcfg-pull-default {
|
||||
bias-pull-pin-default;
|
||||
};
|
||||
|
||||
uart2 {
|
||||
uart2_xfer: uart2-xfer {
|
||||
rockchip,pins = <1 RK_PB0 1 &pcfg_pull_default>,
|
||||
<1 RK_PB1 1 &pcfg_pull_default>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
uart2: serial@20064000 {
|
||||
compatible = "snps,dw-apb-uart";
|
||||
reg = <0x20064000 0x400>;
|
||||
interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&mux_uart2>;
|
||||
pinctrl-0 = <&uart2_xfer>;
|
||||
pinctrl-names = "default";
|
||||
reg-io-width = <1>;
|
||||
reg-shift = <2>;
|
||||
};
|
|
@ -23,6 +23,7 @@ Required Properties:
|
|||
- "samsung,exynos5433-pinctrl": for Exynos5433 compatible pin-controller.
|
||||
- "samsung,exynos7-pinctrl": for Exynos7 compatible pin-controller.
|
||||
- "samsung,exynos850-pinctrl": for Exynos850 compatible pin-controller.
|
||||
- "samsung,exynosautov9-pinctrl": for ExynosAutov9 compatible pin-controller.
|
||||
|
||||
- reg: Base address of the pin controller hardware module and length of
|
||||
the address space it occupies.
|
||||
|
|
|
@ -24,6 +24,7 @@ properties:
|
|||
- socionext,uniphier-ld11-pinctrl
|
||||
- socionext,uniphier-ld20-pinctrl
|
||||
- socionext,uniphier-pxs3-pinctrl
|
||||
- socionext,uniphier-nx1-pinctrl
|
||||
|
||||
required:
|
||||
- compatible
|
||||
|
|
|
@ -1534,9 +1534,14 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc,
|
|||
}
|
||||
|
||||
if (gc->irq.parent_handler) {
|
||||
void *data = gc->irq.parent_handler_data ?: gc;
|
||||
|
||||
for (i = 0; i < gc->irq.num_parents; i++) {
|
||||
void *data;
|
||||
|
||||
if (gc->irq.per_parent_data)
|
||||
data = gc->irq.parent_handler_data_array[i];
|
||||
else
|
||||
data = gc->irq.parent_handler_data ?: gc;
|
||||
|
||||
/*
|
||||
* The parent IRQ chip is already using the chip_data
|
||||
* for this IRQ chip, so our callbacks simply use the
|
||||
|
|
|
@ -31,6 +31,22 @@ config DEBUG_PINCTRL
|
|||
help
|
||||
Say Y here to add some extra checks and diagnostics to PINCTRL calls.
|
||||
|
||||
config PINCTRL_APPLE_GPIO
|
||||
tristate "Apple SoC GPIO pin controller driver"
|
||||
depends on ARCH_APPLE
|
||||
select PINMUX
|
||||
select GPIOLIB
|
||||
select GPIOLIB_IRQCHIP
|
||||
select GENERIC_PINCTRL_GROUPS
|
||||
select GENERIC_PINMUX_FUNCTIONS
|
||||
select OF_GPIO
|
||||
help
|
||||
This is the driver for the GPIO controller found on Apple ARM SoCs,
|
||||
including M1.
|
||||
|
||||
This driver can also be built as a module. If so, the module
|
||||
will be called pinctrl-apple-gpio.
|
||||
|
||||
config PINCTRL_ARTPEC6
|
||||
bool "Axis ARTPEC-6 pin controller driver"
|
||||
depends on MACH_ARTPEC6
|
||||
|
|
|
@ -8,6 +8,7 @@ obj-$(CONFIG_PINMUX) += pinmux.o
|
|||
obj-$(CONFIG_PINCONF) += pinconf.o
|
||||
obj-$(CONFIG_OF) += devicetree.o
|
||||
obj-$(CONFIG_GENERIC_PINCONF) += pinconf-generic.o
|
||||
obj-$(CONFIG_PINCTRL_APPLE_GPIO) += pinctrl-apple-gpio.o
|
||||
obj-$(CONFIG_PINCTRL_ARTPEC6) += pinctrl-artpec6.o
|
||||
obj-$(CONFIG_PINCTRL_AS3722) += pinctrl-as3722.o
|
||||
obj-$(CONFIG_PINCTRL_AXP209) += pinctrl-axp209.o
|
||||
|
|
|
@ -18,7 +18,7 @@ config PINCTRL_BCM281XX
|
|||
framework. GPIO is provided by a separate GPIO driver.
|
||||
|
||||
config PINCTRL_BCM2835
|
||||
bool "Broadcom BCM2835 GPIO (with PINCONF) driver"
|
||||
tristate "Broadcom BCM2835 GPIO (with PINCONF) driver"
|
||||
depends on OF && (ARCH_BCM2835 || ARCH_BRCMSTB || COMPILE_TEST)
|
||||
select PINMUX
|
||||
select PINCONF
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <linux/irqdesc.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_irq.h>
|
||||
|
@ -1332,4 +1333,10 @@ static struct platform_driver bcm2835_pinctrl_driver = {
|
|||
.suppress_bind_attrs = true,
|
||||
},
|
||||
};
|
||||
builtin_platform_driver(bcm2835_pinctrl_driver);
|
||||
module_platform_driver(bcm2835_pinctrl_driver);
|
||||
|
||||
MODULE_AUTHOR("Chris Boot");
|
||||
MODULE_AUTHOR("Simon Arlott");
|
||||
MODULE_AUTHOR("Stephen Warren");
|
||||
MODULE_DESCRIPTION("Broadcom BCM2835/2711 pinctrl and GPIO driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
|
|
@ -2100,6 +2100,8 @@ int pinctrl_enable(struct pinctrl_dev *pctldev)
|
|||
if (error) {
|
||||
dev_err(pctldev->dev, "could not claim hogs: %i\n",
|
||||
error);
|
||||
pinctrl_free_pindescs(pctldev, pctldev->desc->pins,
|
||||
pctldev->desc->npins);
|
||||
mutex_destroy(&pctldev->mutex);
|
||||
kfree(pctldev);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Intel pin control drivers
|
||||
|
||||
if (X86 || COMPILE_TEST)
|
||||
menu "Intel pinctrl drivers"
|
||||
depends on X86 || COMPILE_TEST
|
||||
|
||||
config PINCTRL_BAYTRAIL
|
||||
bool "Intel Baytrail GPIO pin control"
|
||||
|
@ -168,4 +168,4 @@ config PINCTRL_TIGERLAKE
|
|||
This pinctrl driver provides an interface that allows configuring
|
||||
of Intel Tiger Lake PCH pins and using them as GPIOs.
|
||||
|
||||
endif
|
||||
endmenu
|
||||
|
|
|
@ -119,6 +119,13 @@ config PINCTRL_MT7622
|
|||
default ARM64 && ARCH_MEDIATEK
|
||||
select PINCTRL_MTK_MOORE
|
||||
|
||||
config PINCTRL_MT7986
|
||||
bool "Mediatek MT7986 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"
|
||||
depends on OF
|
||||
|
|
|
@ -17,6 +17,7 @@ obj-$(CONFIG_PINCTRL_MT6797) += pinctrl-mt6797.o
|
|||
obj-$(CONFIG_PINCTRL_MT7622) += pinctrl-mt7622.o
|
||||
obj-$(CONFIG_PINCTRL_MT7623) += pinctrl-mt7623.o
|
||||
obj-$(CONFIG_PINCTRL_MT7629) += pinctrl-mt7629.o
|
||||
obj-$(CONFIG_PINCTRL_MT7986) += pinctrl-mt7986.o
|
||||
obj-$(CONFIG_PINCTRL_MT8167) += pinctrl-mt8167.o
|
||||
obj-$(CONFIG_PINCTRL_MT8173) += pinctrl-mt8173.o
|
||||
obj-$(CONFIG_PINCTRL_MT8183) += pinctrl-mt8183.o
|
||||
|
|
|
@ -60,6 +60,8 @@ static int mtk_pinmux_set_mux(struct pinctrl_dev *pctldev,
|
|||
int pin = grp->pins[i];
|
||||
|
||||
desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin];
|
||||
if (!desc->name)
|
||||
return -ENOTSUPP;
|
||||
|
||||
mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_MODE,
|
||||
pin_modes[i]);
|
||||
|
@ -76,6 +78,8 @@ static int mtk_pinmux_gpio_request_enable(struct pinctrl_dev *pctldev,
|
|||
const struct mtk_pin_desc *desc;
|
||||
|
||||
desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin];
|
||||
if (!desc->name)
|
||||
return -ENOTSUPP;
|
||||
|
||||
return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_MODE,
|
||||
hw->soc->gpio_m);
|
||||
|
@ -89,6 +93,8 @@ static int mtk_pinmux_gpio_set_direction(struct pinctrl_dev *pctldev,
|
|||
const struct mtk_pin_desc *desc;
|
||||
|
||||
desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin];
|
||||
if (!desc->name)
|
||||
return -ENOTSUPP;
|
||||
|
||||
/* hardware would take 0 as input direction */
|
||||
return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR, !input);
|
||||
|
@ -103,6 +109,8 @@ static int mtk_pinconf_get(struct pinctrl_dev *pctldev,
|
|||
const struct mtk_pin_desc *desc;
|
||||
|
||||
desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin];
|
||||
if (!desc->name)
|
||||
return -ENOTSUPP;
|
||||
|
||||
switch (param) {
|
||||
case PIN_CONFIG_BIAS_DISABLE:
|
||||
|
@ -218,6 +226,8 @@ static int mtk_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
int cfg, err = 0;
|
||||
|
||||
desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin];
|
||||
if (!desc->name)
|
||||
return -ENOTSUPP;
|
||||
|
||||
for (cfg = 0; cfg < num_configs; cfg++) {
|
||||
param = pinconf_to_config_param(configs[cfg]);
|
||||
|
@ -435,6 +445,8 @@ static int mtk_gpio_get(struct gpio_chip *chip, unsigned int gpio)
|
|||
int value, err;
|
||||
|
||||
desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio];
|
||||
if (!desc->name)
|
||||
return -ENOTSUPP;
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DI, &value);
|
||||
if (err)
|
||||
|
@ -449,6 +461,10 @@ static void mtk_gpio_set(struct gpio_chip *chip, unsigned int gpio, int value)
|
|||
const struct mtk_pin_desc *desc;
|
||||
|
||||
desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio];
|
||||
if (!desc->name) {
|
||||
dev_err(hw->dev, "Failed to set gpio %d\n", gpio);
|
||||
return;
|
||||
}
|
||||
|
||||
mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DO, !!value);
|
||||
}
|
||||
|
@ -490,6 +506,8 @@ static int mtk_gpio_set_config(struct gpio_chip *chip, unsigned int offset,
|
|||
u32 debounce;
|
||||
|
||||
desc = (const struct mtk_pin_desc *)&hw->soc->pins[offset];
|
||||
if (!desc->name)
|
||||
return -ENOTSUPP;
|
||||
|
||||
if (!hw->eint ||
|
||||
pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE ||
|
||||
|
|
|
@ -0,0 +1,927 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* The MT7986 driver based on Linux generic pinctrl binding.
|
||||
*
|
||||
* Copyright (C) 2021 MediaTek Inc.
|
||||
* Author: Sam Shih <sam.shih@mediatek.com>
|
||||
*/
|
||||
|
||||
#include "pinctrl-moore.h"
|
||||
|
||||
#define MT7986_PIN(_number, _name) MTK_PIN(_number, _name, 0, _number, DRV_GRP4)
|
||||
#define MT7986_NOT_BALLOUT_PIN(_number) { .number = _number, .name = NULL }
|
||||
|
||||
#define PIN_FIELD_BASE(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit, \
|
||||
_x_bits) \
|
||||
PIN_FIELD_CALC(_s_pin, _e_pin, _i_base, _s_addr, _x_addrs, _s_bit, \
|
||||
_x_bits, 32, 0)
|
||||
|
||||
/**
|
||||
* enum - Locking variants of the iocfg bases
|
||||
*
|
||||
* MT7986 have multiple bases to program pin configuration listed as the below:
|
||||
* iocfg_rt:0x11c30000, iocfg_rb:0x11c40000, iocfg_lt:0x11e20000,
|
||||
* iocfg_lb:0x11e30000, iocfg_tr:0x11f00000, iocfg_tl:0x11f10000,
|
||||
* _i_based could be used to indicate what base the pin should be mapped into.
|
||||
*
|
||||
* Each iocfg register base control different group of pads on the SoC
|
||||
*
|
||||
*
|
||||
* chip carrier
|
||||
*
|
||||
* A B C D E F G H
|
||||
* +------------------------+
|
||||
* 8 | o o o o o o o o |
|
||||
* 7 | o o o o o o o o |
|
||||
* 6 | o o o o o o o o |
|
||||
* 5 | o o o o o o o o |
|
||||
* 4 | o o o o o o o o |
|
||||
* 3 | o o o o o o o o |
|
||||
* 2 | o o o o o o o o |
|
||||
* 1 | o o o o o o o o |
|
||||
* +------------------------+
|
||||
*
|
||||
* inside Chip carrier
|
||||
*
|
||||
* A B C D E F G H
|
||||
* +------------------------+
|
||||
* 8 | |
|
||||
* 7 | TL TR |
|
||||
* 6 | +---------+ |
|
||||
* 5 | LT | | RT |
|
||||
* 4 | | | |
|
||||
* 3 | LB | | RB |
|
||||
* 2 | +---------+ |
|
||||
* 1 | |
|
||||
* +------------------------+
|
||||
*
|
||||
*/
|
||||
|
||||
enum {
|
||||
GPIO_BASE,
|
||||
IOCFG_RT_BASE,
|
||||
IOCFG_RB_BASE,
|
||||
IOCFG_LT_BASE,
|
||||
IOCFG_LB_BASE,
|
||||
IOCFG_TR_BASE,
|
||||
IOCFG_TL_BASE,
|
||||
};
|
||||
|
||||
static const char *const mt7986_pinctrl_register_base_names[] = {
|
||||
"gpio", "iocfg_rt", "iocfg_rb", "iocfg_lt", "iocfg_lb", "iocfg_tr",
|
||||
"iocfg_tl",
|
||||
};
|
||||
|
||||
static const struct mtk_pin_field_calc mt7986_pin_mode_range[] = {
|
||||
PIN_FIELD(0, 100, 0x300, 0x10, 0, 4),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_field_calc mt7986_pin_dir_range[] = {
|
||||
PIN_FIELD(0, 100, 0x0, 0x10, 0, 1),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_field_calc mt7986_pin_di_range[] = {
|
||||
PIN_FIELD(0, 100, 0x200, 0x10, 0, 1),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_field_calc mt7986_pin_do_range[] = {
|
||||
PIN_FIELD(0, 100, 0x100, 0x10, 0, 1),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_field_calc mt7986_pin_ies_range[] = {
|
||||
PIN_FIELD_BASE(0, 0, IOCFG_RB_BASE, 0x40, 0x10, 17, 1),
|
||||
PIN_FIELD_BASE(1, 2, IOCFG_LT_BASE, 0x20, 0x10, 10, 1),
|
||||
PIN_FIELD_BASE(3, 4, IOCFG_LB_BASE, 0x20, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(5, 6, IOCFG_RB_BASE, 0x40, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(7, 10, IOCFG_LT_BASE, 0x20, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(11, 14, IOCFG_RB_BASE, 0x40, 0x10, 8, 1),
|
||||
PIN_FIELD_BASE(15, 20, IOCFG_RB_BASE, 0x40, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(21, 23, IOCFG_RT_BASE, 0x30, 0x10, 12, 1),
|
||||
PIN_FIELD_BASE(24, 24, IOCFG_RT_BASE, 0x30, 0x10, 18, 1),
|
||||
PIN_FIELD_BASE(25, 25, IOCFG_RT_BASE, 0x30, 0x10, 17, 1),
|
||||
PIN_FIELD_BASE(26, 27, IOCFG_RT_BASE, 0x30, 0x10, 15, 1),
|
||||
PIN_FIELD_BASE(28, 29, IOCFG_RT_BASE, 0x30, 0x10, 19, 1),
|
||||
PIN_FIELD_BASE(30, 30, IOCFG_RT_BASE, 0x30, 0x10, 23, 1),
|
||||
PIN_FIELD_BASE(31, 31, IOCFG_RT_BASE, 0x30, 0x10, 22, 1),
|
||||
PIN_FIELD_BASE(32, 32, IOCFG_RT_BASE, 0x30, 0x10, 21, 1),
|
||||
PIN_FIELD_BASE(33, 33, IOCFG_LT_BASE, 0x20, 0x10, 4, 1),
|
||||
PIN_FIELD_BASE(34, 34, IOCFG_LT_BASE, 0x20, 0x10, 8, 1),
|
||||
PIN_FIELD_BASE(35, 35, IOCFG_LT_BASE, 0x20, 0x10, 7, 1),
|
||||
PIN_FIELD_BASE(36, 37, IOCFG_LT_BASE, 0x20, 0x10, 5, 1),
|
||||
PIN_FIELD_BASE(38, 38, IOCFG_LT_BASE, 0x20, 0x10, 9, 1),
|
||||
PIN_FIELD_BASE(39, 40, IOCFG_RB_BASE, 0x40, 0x10, 18, 1),
|
||||
PIN_FIELD_BASE(41, 41, IOCFG_RB_BASE, 0x40, 0x10, 12, 1),
|
||||
PIN_FIELD_BASE(42, 43, IOCFG_RB_BASE, 0x40, 0x10, 22, 1),
|
||||
PIN_FIELD_BASE(44, 45, IOCFG_RB_BASE, 0x40, 0x10, 20, 1),
|
||||
PIN_FIELD_BASE(46, 47, IOCFG_RB_BASE, 0x40, 0x10, 26, 1),
|
||||
PIN_FIELD_BASE(48, 49, IOCFG_RB_BASE, 0x40, 0x10, 24, 1),
|
||||
PIN_FIELD_BASE(50, 57, IOCFG_RT_BASE, 0x30, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(58, 58, IOCFG_RT_BASE, 0x30, 0x10, 1, 1),
|
||||
PIN_FIELD_BASE(59, 59, IOCFG_RT_BASE, 0x30, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(60, 61, IOCFG_RT_BASE, 0x30, 0x10, 10, 1),
|
||||
PIN_FIELD_BASE(62, 62, IOCFG_RB_BASE, 0x40, 0x10, 15, 1),
|
||||
PIN_FIELD_BASE(63, 63, IOCFG_RB_BASE, 0x40, 0x10, 14, 1),
|
||||
PIN_FIELD_BASE(64, 64, IOCFG_RB_BASE, 0x40, 0x10, 13, 1),
|
||||
PIN_FIELD_BASE(65, 65, IOCFG_RB_BASE, 0x40, 0x10, 16, 1),
|
||||
PIN_FIELD_BASE(66, 68, IOCFG_LB_BASE, 0x20, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(69, 69, IOCFG_TR_BASE, 0x30, 0x10, 1, 1),
|
||||
PIN_FIELD_BASE(70, 70, IOCFG_TR_BASE, 0x30, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(71, 71, IOCFG_TR_BASE, 0x30, 0x10, 16, 1),
|
||||
PIN_FIELD_BASE(72, 73, IOCFG_TR_BASE, 0x30, 0x10, 14, 1),
|
||||
PIN_FIELD_BASE(74, 74, IOCFG_TR_BASE, 0x30, 0x10, 4, 1),
|
||||
PIN_FIELD_BASE(75, 77, IOCFG_TR_BASE, 0x30, 0x10, 6, 1),
|
||||
PIN_FIELD_BASE(78, 79, IOCFG_TR_BASE, 0x30, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(80, 84, IOCFG_TR_BASE, 0x30, 0x10, 9, 1),
|
||||
PIN_FIELD_BASE(85, 85, IOCFG_TR_BASE, 0x30, 0x10, 5, 1),
|
||||
PIN_FIELD_BASE(86, 86, IOCFG_TL_BASE, 0x30, 0x10, 1, 1),
|
||||
PIN_FIELD_BASE(87, 87, IOCFG_TL_BASE, 0x30, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(88, 88, IOCFG_TL_BASE, 0x30, 0x10, 14, 1),
|
||||
PIN_FIELD_BASE(89, 90, IOCFG_TL_BASE, 0x30, 0x10, 12, 1),
|
||||
PIN_FIELD_BASE(91, 94, IOCFG_TL_BASE, 0x30, 0x10, 4, 1),
|
||||
PIN_FIELD_BASE(95, 96, IOCFG_TL_BASE, 0x30, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(97, 100, IOCFG_TL_BASE, 0x30, 0x10, 8, 1),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_field_calc mt7986_pin_smt_range[] = {
|
||||
PIN_FIELD_BASE(0, 0, IOCFG_RB_BASE, 0xf0, 0x10, 17, 1),
|
||||
PIN_FIELD_BASE(1, 2, IOCFG_LT_BASE, 0x90, 0x10, 10, 1),
|
||||
PIN_FIELD_BASE(3, 4, IOCFG_LB_BASE, 0x90, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(5, 6, IOCFG_RB_BASE, 0xf0, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(7, 10, IOCFG_LT_BASE, 0x90, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(11, 14, IOCFG_RB_BASE, 0xf0, 0x10, 8, 1),
|
||||
PIN_FIELD_BASE(15, 20, IOCFG_RB_BASE, 0xf0, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(21, 23, IOCFG_RT_BASE, 0xc0, 0x10, 12, 1),
|
||||
PIN_FIELD_BASE(24, 24, IOCFG_RT_BASE, 0xc0, 0x10, 18, 1),
|
||||
PIN_FIELD_BASE(25, 25, IOCFG_RT_BASE, 0xc0, 0x10, 17, 1),
|
||||
PIN_FIELD_BASE(26, 27, IOCFG_RT_BASE, 0xc0, 0x10, 15, 1),
|
||||
PIN_FIELD_BASE(28, 29, IOCFG_RT_BASE, 0xc0, 0x10, 19, 1),
|
||||
PIN_FIELD_BASE(30, 30, IOCFG_RT_BASE, 0xc0, 0x10, 23, 1),
|
||||
PIN_FIELD_BASE(31, 31, IOCFG_RT_BASE, 0xc0, 0x10, 22, 1),
|
||||
PIN_FIELD_BASE(32, 32, IOCFG_RT_BASE, 0xc0, 0x10, 21, 1),
|
||||
PIN_FIELD_BASE(33, 33, IOCFG_LT_BASE, 0x90, 0x10, 4, 1),
|
||||
PIN_FIELD_BASE(34, 34, IOCFG_LT_BASE, 0x90, 0x10, 8, 1),
|
||||
PIN_FIELD_BASE(35, 35, IOCFG_LT_BASE, 0x90, 0x10, 7, 1),
|
||||
PIN_FIELD_BASE(36, 37, IOCFG_LT_BASE, 0x90, 0x10, 5, 1),
|
||||
PIN_FIELD_BASE(38, 38, IOCFG_LT_BASE, 0x90, 0x10, 9, 1),
|
||||
PIN_FIELD_BASE(39, 40, IOCFG_RB_BASE, 0xf0, 0x10, 18, 1),
|
||||
PIN_FIELD_BASE(41, 41, IOCFG_RB_BASE, 0xf0, 0x10, 12, 1),
|
||||
PIN_FIELD_BASE(42, 43, IOCFG_RB_BASE, 0xf0, 0x10, 22, 1),
|
||||
PIN_FIELD_BASE(44, 45, IOCFG_RB_BASE, 0xf0, 0x10, 20, 1),
|
||||
PIN_FIELD_BASE(46, 47, IOCFG_RB_BASE, 0xf0, 0x10, 26, 1),
|
||||
PIN_FIELD_BASE(48, 49, IOCFG_RB_BASE, 0xf0, 0x10, 24, 1),
|
||||
PIN_FIELD_BASE(50, 57, IOCFG_RT_BASE, 0xc0, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(58, 58, IOCFG_RT_BASE, 0xc0, 0x10, 1, 1),
|
||||
PIN_FIELD_BASE(59, 59, IOCFG_RT_BASE, 0xc0, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(60, 61, IOCFG_RT_BASE, 0xc0, 0x10, 10, 1),
|
||||
PIN_FIELD_BASE(62, 62, IOCFG_RB_BASE, 0xf0, 0x10, 15, 1),
|
||||
PIN_FIELD_BASE(63, 63, IOCFG_RB_BASE, 0xf0, 0x10, 14, 1),
|
||||
PIN_FIELD_BASE(64, 64, IOCFG_RB_BASE, 0xf0, 0x10, 13, 1),
|
||||
PIN_FIELD_BASE(65, 65, IOCFG_RB_BASE, 0xf0, 0x10, 16, 1),
|
||||
PIN_FIELD_BASE(66, 68, IOCFG_LB_BASE, 0x90, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(69, 69, IOCFG_TR_BASE, 0x80, 0x10, 1, 1),
|
||||
PIN_FIELD_BASE(70, 70, IOCFG_TR_BASE, 0x80, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(71, 71, IOCFG_TR_BASE, 0x80, 0x10, 16, 1),
|
||||
PIN_FIELD_BASE(72, 73, IOCFG_TR_BASE, 0x80, 0x10, 14, 1),
|
||||
PIN_FIELD_BASE(74, 74, IOCFG_TR_BASE, 0x80, 0x10, 4, 1),
|
||||
PIN_FIELD_BASE(75, 77, IOCFG_TR_BASE, 0x80, 0x10, 6, 1),
|
||||
PIN_FIELD_BASE(78, 79, IOCFG_TR_BASE, 0x80, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(80, 84, IOCFG_TR_BASE, 0x80, 0x10, 9, 1),
|
||||
PIN_FIELD_BASE(85, 85, IOCFG_TR_BASE, 0x80, 0x10, 5, 1),
|
||||
PIN_FIELD_BASE(86, 86, IOCFG_TL_BASE, 0x70, 0x10, 1, 1),
|
||||
PIN_FIELD_BASE(87, 87, IOCFG_TL_BASE, 0x70, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(88, 88, IOCFG_TL_BASE, 0x70, 0x10, 14, 1),
|
||||
PIN_FIELD_BASE(89, 90, IOCFG_TL_BASE, 0x70, 0x10, 12, 1),
|
||||
PIN_FIELD_BASE(91, 94, IOCFG_TL_BASE, 0x70, 0x10, 4, 1),
|
||||
PIN_FIELD_BASE(95, 96, IOCFG_TL_BASE, 0x70, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(97, 100, IOCFG_TL_BASE, 0x70, 0x10, 8, 1),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_field_calc mt7986_pin_pu_range[] = {
|
||||
PIN_FIELD_BASE(69, 69, IOCFG_TR_BASE, 0x50, 0x10, 1, 1),
|
||||
PIN_FIELD_BASE(70, 70, IOCFG_TR_BASE, 0x50, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(71, 71, IOCFG_TR_BASE, 0x50, 0x10, 16, 1),
|
||||
PIN_FIELD_BASE(72, 73, IOCFG_TR_BASE, 0x50, 0x10, 14, 1),
|
||||
PIN_FIELD_BASE(74, 74, IOCFG_TR_BASE, 0x50, 0x10, 4, 1),
|
||||
PIN_FIELD_BASE(75, 77, IOCFG_TR_BASE, 0x50, 0x10, 6, 1),
|
||||
PIN_FIELD_BASE(78, 79, IOCFG_TR_BASE, 0x50, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(80, 84, IOCFG_TR_BASE, 0x50, 0x10, 9, 1),
|
||||
PIN_FIELD_BASE(85, 85, IOCFG_TR_BASE, 0x50, 0x10, 5, 1),
|
||||
PIN_FIELD_BASE(86, 86, IOCFG_TL_BASE, 0x50, 0x10, 1, 1),
|
||||
PIN_FIELD_BASE(87, 87, IOCFG_TL_BASE, 0x50, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(88, 88, IOCFG_TL_BASE, 0x50, 0x10, 14, 1),
|
||||
PIN_FIELD_BASE(89, 90, IOCFG_TL_BASE, 0x50, 0x10, 12, 1),
|
||||
PIN_FIELD_BASE(91, 94, IOCFG_TL_BASE, 0x50, 0x10, 4, 1),
|
||||
PIN_FIELD_BASE(95, 96, IOCFG_TL_BASE, 0x50, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(97, 100, IOCFG_TL_BASE, 0x50, 0x10, 8, 1),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_field_calc mt7986_pin_pd_range[] = {
|
||||
PIN_FIELD_BASE(69, 69, IOCFG_TR_BASE, 0x40, 0x10, 1, 1),
|
||||
PIN_FIELD_BASE(70, 70, IOCFG_TR_BASE, 0x40, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(71, 71, IOCFG_TR_BASE, 0x40, 0x10, 16, 1),
|
||||
PIN_FIELD_BASE(72, 73, IOCFG_TR_BASE, 0x40, 0x10, 14, 1),
|
||||
PIN_FIELD_BASE(74, 74, IOCFG_TR_BASE, 0x40, 0x10, 4, 1),
|
||||
PIN_FIELD_BASE(75, 77, IOCFG_TR_BASE, 0x40, 0x10, 6, 1),
|
||||
PIN_FIELD_BASE(78, 79, IOCFG_TR_BASE, 0x40, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(80, 84, IOCFG_TR_BASE, 0x40, 0x10, 9, 1),
|
||||
PIN_FIELD_BASE(85, 85, IOCFG_TR_BASE, 0x40, 0x10, 5, 1),
|
||||
PIN_FIELD_BASE(86, 86, IOCFG_TL_BASE, 0x40, 0x10, 1, 1),
|
||||
PIN_FIELD_BASE(87, 87, IOCFG_TL_BASE, 0x40, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(88, 88, IOCFG_TL_BASE, 0x40, 0x10, 14, 1),
|
||||
PIN_FIELD_BASE(89, 90, IOCFG_TL_BASE, 0x40, 0x10, 12, 1),
|
||||
PIN_FIELD_BASE(91, 94, IOCFG_TL_BASE, 0x40, 0x10, 4, 1),
|
||||
PIN_FIELD_BASE(95, 96, IOCFG_TL_BASE, 0x40, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(97, 100, IOCFG_TL_BASE, 0x40, 0x10, 8, 1),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_field_calc mt7986_pin_drv_range[] = {
|
||||
PIN_FIELD_BASE(0, 0, IOCFG_RB_BASE, 0x10, 0x10, 21, 3),
|
||||
PIN_FIELD_BASE(1, 2, IOCFG_LT_BASE, 0x10, 0x10, 0, 3),
|
||||
PIN_FIELD_BASE(3, 4, IOCFG_LB_BASE, 0x00, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(5, 5, IOCFG_RB_BASE, 0x00, 0x10, 0, 3),
|
||||
PIN_FIELD_BASE(6, 6, IOCFG_RB_BASE, 0x00, 0x10, 21, 3),
|
||||
PIN_FIELD_BASE(7, 10, IOCFG_LT_BASE, 0x00, 0x10, 0, 3),
|
||||
PIN_FIELD_BASE(11, 12, IOCFG_RB_BASE, 0x00, 0x10, 24, 3),
|
||||
PIN_FIELD_BASE(13, 14, IOCFG_RB_BASE, 0x10, 0x10, 0, 3),
|
||||
PIN_FIELD_BASE(15, 20, IOCFG_RB_BASE, 0x00, 0x10, 3, 3),
|
||||
PIN_FIELD_BASE(21, 23, IOCFG_RT_BASE, 0x10, 0x10, 6, 3),
|
||||
PIN_FIELD_BASE(24, 24, IOCFG_RT_BASE, 0x10, 0x10, 24, 3),
|
||||
PIN_FIELD_BASE(25, 25, IOCFG_RT_BASE, 0x10, 0x10, 21, 3),
|
||||
PIN_FIELD_BASE(26, 27, IOCFG_RT_BASE, 0x10, 0x10, 15, 3),
|
||||
PIN_FIELD_BASE(28, 28, IOCFG_RT_BASE, 0x10, 0x10, 27, 3),
|
||||
PIN_FIELD_BASE(29, 29, IOCFG_RT_BASE, 0x20, 0x10, 0, 3),
|
||||
PIN_FIELD_BASE(30, 30, IOCFG_RT_BASE, 0x20, 0x10, 9, 3),
|
||||
PIN_FIELD_BASE(31, 31, IOCFG_RT_BASE, 0x20, 0x10, 6, 3),
|
||||
PIN_FIELD_BASE(32, 32, IOCFG_RT_BASE, 0x20, 0x10, 3, 3),
|
||||
PIN_FIELD_BASE(33, 33, IOCFG_LT_BASE, 0x00, 0x10, 12, 3),
|
||||
PIN_FIELD_BASE(34, 34, IOCFG_LT_BASE, 0x00, 0x10, 24, 3),
|
||||
PIN_FIELD_BASE(35, 35, IOCFG_LT_BASE, 0x00, 0x10, 21, 3),
|
||||
PIN_FIELD_BASE(36, 37, IOCFG_LT_BASE, 0x00, 0x10, 15, 3),
|
||||
PIN_FIELD_BASE(38, 38, IOCFG_LT_BASE, 0x00, 0x10, 27, 3),
|
||||
PIN_FIELD_BASE(39, 39, IOCFG_RB_BASE, 0x10, 0x10, 27, 3),
|
||||
PIN_FIELD_BASE(40, 40, IOCFG_RB_BASE, 0x20, 0x10, 0, 3),
|
||||
PIN_FIELD_BASE(41, 41, IOCFG_RB_BASE, 0x10, 0x10, 6, 3),
|
||||
PIN_FIELD_BASE(42, 43, IOCFG_RB_BASE, 0x20, 0x10, 9, 3),
|
||||
PIN_FIELD_BASE(44, 45, IOCFG_RB_BASE, 0x20, 0x10, 3, 3),
|
||||
PIN_FIELD_BASE(46, 47, IOCFG_RB_BASE, 0x20, 0x10, 21, 3),
|
||||
PIN_FIELD_BASE(48, 49, IOCFG_RB_BASE, 0x20, 0x10, 15, 3),
|
||||
PIN_FIELD_BASE(50, 57, IOCFG_RT_BASE, 0x00, 0x10, 6, 3),
|
||||
PIN_FIELD_BASE(58, 58, IOCFG_RT_BASE, 0x00, 0x10, 3, 3),
|
||||
PIN_FIELD_BASE(59, 59, IOCFG_RT_BASE, 0x00, 0x10, 0, 3),
|
||||
PIN_FIELD_BASE(60, 61, IOCFG_RT_BASE, 0x10, 0x10, 0, 3),
|
||||
PIN_FIELD_BASE(62, 62, IOCFG_RB_BASE, 0x10, 0x10, 15, 3),
|
||||
PIN_FIELD_BASE(63, 63, IOCFG_RB_BASE, 0x10, 0x10, 12, 3),
|
||||
PIN_FIELD_BASE(64, 64, IOCFG_RB_BASE, 0x10, 0x10, 9, 3),
|
||||
PIN_FIELD_BASE(65, 65, IOCFG_RB_BASE, 0x10, 0x10, 18, 3),
|
||||
PIN_FIELD_BASE(66, 68, IOCFG_LB_BASE, 0x00, 0x10, 2, 3),
|
||||
PIN_FIELD_BASE(69, 69, IOCFG_TR_BASE, 0x00, 0x10, 3, 3),
|
||||
PIN_FIELD_BASE(70, 70, IOCFG_TR_BASE, 0x00, 0x10, 0, 3),
|
||||
PIN_FIELD_BASE(71, 71, IOCFG_TR_BASE, 0x10, 0x10, 18, 3),
|
||||
PIN_FIELD_BASE(72, 73, IOCFG_TR_BASE, 0x10, 0x10, 12, 3),
|
||||
PIN_FIELD_BASE(74, 77, IOCFG_TR_BASE, 0x00, 0x10, 15, 3),
|
||||
PIN_FIELD_BASE(78, 79, IOCFG_TR_BASE, 0x00, 0x10, 6, 3),
|
||||
PIN_FIELD_BASE(80, 80, IOCFG_TR_BASE, 0x00, 0x10, 27, 3),
|
||||
PIN_FIELD_BASE(81, 84, IOCFG_TR_BASE, 0x10, 0x10, 0, 3),
|
||||
PIN_FIELD_BASE(85, 85, IOCFG_TR_BASE, 0x00, 0x10, 12, 3),
|
||||
PIN_FIELD_BASE(86, 86, IOCFG_TL_BASE, 0x00, 0x10, 3, 3),
|
||||
PIN_FIELD_BASE(87, 87, IOCFG_TL_BASE, 0x00, 0x10, 0, 3),
|
||||
PIN_FIELD_BASE(88, 88, IOCFG_TL_BASE, 0x10, 0x10, 12, 3),
|
||||
PIN_FIELD_BASE(89, 90, IOCFG_TL_BASE, 0x10, 0x10, 6, 3),
|
||||
PIN_FIELD_BASE(91, 94, IOCFG_TL_BASE, 0x00, 0x10, 12, 3),
|
||||
PIN_FIELD_BASE(95, 96, IOCFG_TL_BASE, 0x00, 0x10, 6, 3),
|
||||
PIN_FIELD_BASE(97, 98, IOCFG_TL_BASE, 0x00, 0x10, 24, 3),
|
||||
PIN_FIELD_BASE(99, 100, IOCFG_TL_BASE, 0x10, 0x10, 2, 3),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_field_calc mt7986_pin_pupd_range[] = {
|
||||
PIN_FIELD_BASE(0, 0, IOCFG_RB_BASE, 0x60, 0x10, 17, 1),
|
||||
PIN_FIELD_BASE(1, 2, IOCFG_LT_BASE, 0x30, 0x10, 10, 1),
|
||||
PIN_FIELD_BASE(3, 4, IOCFG_LB_BASE, 0x40, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(5, 6, IOCFG_RB_BASE, 0x60, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(7, 10, IOCFG_LT_BASE, 0x30, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(11, 14, IOCFG_RB_BASE, 0x60, 0x10, 8, 1),
|
||||
PIN_FIELD_BASE(15, 20, IOCFG_RB_BASE, 0x60, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(21, 23, IOCFG_RT_BASE, 0x40, 0x10, 12, 1),
|
||||
PIN_FIELD_BASE(24, 24, IOCFG_RT_BASE, 0x40, 0x10, 18, 1),
|
||||
PIN_FIELD_BASE(25, 25, IOCFG_RT_BASE, 0x40, 0x10, 17, 1),
|
||||
PIN_FIELD_BASE(26, 27, IOCFG_RT_BASE, 0x40, 0x10, 15, 1),
|
||||
PIN_FIELD_BASE(28, 29, IOCFG_RT_BASE, 0x40, 0x10, 19, 1),
|
||||
PIN_FIELD_BASE(30, 30, IOCFG_RT_BASE, 0x40, 0x10, 23, 1),
|
||||
PIN_FIELD_BASE(31, 31, IOCFG_RT_BASE, 0x40, 0x10, 22, 1),
|
||||
PIN_FIELD_BASE(32, 32, IOCFG_RT_BASE, 0x40, 0x10, 21, 1),
|
||||
PIN_FIELD_BASE(33, 33, IOCFG_LT_BASE, 0x30, 0x10, 4, 1),
|
||||
PIN_FIELD_BASE(34, 34, IOCFG_LT_BASE, 0x30, 0x10, 8, 1),
|
||||
PIN_FIELD_BASE(35, 35, IOCFG_LT_BASE, 0x30, 0x10, 7, 1),
|
||||
PIN_FIELD_BASE(36, 37, IOCFG_LT_BASE, 0x30, 0x10, 5, 1),
|
||||
PIN_FIELD_BASE(38, 38, IOCFG_LT_BASE, 0x30, 0x10, 9, 1),
|
||||
PIN_FIELD_BASE(39, 40, IOCFG_RB_BASE, 0x60, 0x10, 18, 1),
|
||||
PIN_FIELD_BASE(41, 41, IOCFG_RB_BASE, 0x60, 0x10, 12, 1),
|
||||
PIN_FIELD_BASE(42, 43, IOCFG_RB_BASE, 0x60, 0x10, 22, 1),
|
||||
PIN_FIELD_BASE(44, 45, IOCFG_RB_BASE, 0x60, 0x10, 20, 1),
|
||||
PIN_FIELD_BASE(46, 47, IOCFG_RB_BASE, 0x60, 0x10, 26, 1),
|
||||
PIN_FIELD_BASE(48, 49, IOCFG_RB_BASE, 0x60, 0x10, 24, 1),
|
||||
PIN_FIELD_BASE(50, 57, IOCFG_RT_BASE, 0x40, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(58, 58, IOCFG_RT_BASE, 0x40, 0x10, 1, 1),
|
||||
PIN_FIELD_BASE(59, 59, IOCFG_RT_BASE, 0x40, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(60, 61, IOCFG_RT_BASE, 0x40, 0x10, 10, 1),
|
||||
PIN_FIELD_BASE(62, 62, IOCFG_RB_BASE, 0x60, 0x10, 15, 1),
|
||||
PIN_FIELD_BASE(63, 63, IOCFG_RB_BASE, 0x60, 0x10, 14, 1),
|
||||
PIN_FIELD_BASE(64, 64, IOCFG_RB_BASE, 0x60, 0x10, 13, 1),
|
||||
PIN_FIELD_BASE(65, 65, IOCFG_RB_BASE, 0x60, 0x10, 16, 1),
|
||||
PIN_FIELD_BASE(66, 68, IOCFG_LB_BASE, 0x40, 0x10, 2, 1),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_field_calc mt7986_pin_r0_range[] = {
|
||||
PIN_FIELD_BASE(0, 0, IOCFG_RB_BASE, 0x70, 0x10, 17, 1),
|
||||
PIN_FIELD_BASE(1, 2, IOCFG_LT_BASE, 0x40, 0x10, 10, 1),
|
||||
PIN_FIELD_BASE(3, 4, IOCFG_LB_BASE, 0x50, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(5, 6, IOCFG_RB_BASE, 0x70, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(7, 10, IOCFG_LT_BASE, 0x40, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(11, 14, IOCFG_RB_BASE, 0x70, 0x10, 8, 1),
|
||||
PIN_FIELD_BASE(15, 20, IOCFG_RB_BASE, 0x70, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(21, 23, IOCFG_RT_BASE, 0x50, 0x10, 12, 1),
|
||||
PIN_FIELD_BASE(24, 24, IOCFG_RT_BASE, 0x50, 0x10, 18, 1),
|
||||
PIN_FIELD_BASE(25, 25, IOCFG_RT_BASE, 0x50, 0x10, 17, 1),
|
||||
PIN_FIELD_BASE(26, 27, IOCFG_RT_BASE, 0x50, 0x10, 15, 1),
|
||||
PIN_FIELD_BASE(28, 29, IOCFG_RT_BASE, 0x50, 0x10, 19, 1),
|
||||
PIN_FIELD_BASE(30, 30, IOCFG_RT_BASE, 0x50, 0x10, 23, 1),
|
||||
PIN_FIELD_BASE(31, 31, IOCFG_RT_BASE, 0x50, 0x10, 22, 1),
|
||||
PIN_FIELD_BASE(32, 32, IOCFG_RT_BASE, 0x50, 0x10, 21, 1),
|
||||
PIN_FIELD_BASE(33, 33, IOCFG_LT_BASE, 0x40, 0x10, 4, 1),
|
||||
PIN_FIELD_BASE(34, 34, IOCFG_LT_BASE, 0x40, 0x10, 8, 1),
|
||||
PIN_FIELD_BASE(35, 35, IOCFG_LT_BASE, 0x40, 0x10, 7, 1),
|
||||
PIN_FIELD_BASE(36, 37, IOCFG_LT_BASE, 0x40, 0x10, 5, 1),
|
||||
PIN_FIELD_BASE(38, 38, IOCFG_LT_BASE, 0x40, 0x10, 9, 1),
|
||||
PIN_FIELD_BASE(39, 40, IOCFG_RB_BASE, 0x70, 0x10, 18, 1),
|
||||
PIN_FIELD_BASE(41, 41, IOCFG_RB_BASE, 0x70, 0x10, 12, 1),
|
||||
PIN_FIELD_BASE(42, 43, IOCFG_RB_BASE, 0x70, 0x10, 22, 1),
|
||||
PIN_FIELD_BASE(44, 45, IOCFG_RB_BASE, 0x70, 0x10, 20, 1),
|
||||
PIN_FIELD_BASE(46, 47, IOCFG_RB_BASE, 0x70, 0x10, 26, 1),
|
||||
PIN_FIELD_BASE(48, 49, IOCFG_RB_BASE, 0x70, 0x10, 24, 1),
|
||||
PIN_FIELD_BASE(50, 57, IOCFG_RT_BASE, 0x50, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(58, 58, IOCFG_RT_BASE, 0x50, 0x10, 1, 1),
|
||||
PIN_FIELD_BASE(59, 59, IOCFG_RT_BASE, 0x50, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(60, 61, IOCFG_RT_BASE, 0x50, 0x10, 10, 1),
|
||||
PIN_FIELD_BASE(62, 62, IOCFG_RB_BASE, 0x70, 0x10, 15, 1),
|
||||
PIN_FIELD_BASE(63, 63, IOCFG_RB_BASE, 0x70, 0x10, 14, 1),
|
||||
PIN_FIELD_BASE(64, 64, IOCFG_RB_BASE, 0x70, 0x10, 13, 1),
|
||||
PIN_FIELD_BASE(65, 65, IOCFG_RB_BASE, 0x70, 0x10, 16, 1),
|
||||
PIN_FIELD_BASE(66, 68, IOCFG_LB_BASE, 0x50, 0x10, 2, 1),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_field_calc mt7986_pin_r1_range[] = {
|
||||
PIN_FIELD_BASE(0, 0, IOCFG_RB_BASE, 0x80, 0x10, 17, 1),
|
||||
PIN_FIELD_BASE(1, 2, IOCFG_LT_BASE, 0x50, 0x10, 10, 1),
|
||||
PIN_FIELD_BASE(3, 4, IOCFG_LB_BASE, 0x60, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(5, 6, IOCFG_RB_BASE, 0x80, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(7, 10, IOCFG_LT_BASE, 0x50, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(11, 14, IOCFG_RB_BASE, 0x80, 0x10, 8, 1),
|
||||
PIN_FIELD_BASE(15, 20, IOCFG_RB_BASE, 0x80, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(21, 23, IOCFG_RT_BASE, 0x60, 0x10, 12, 1),
|
||||
PIN_FIELD_BASE(24, 24, IOCFG_RT_BASE, 0x60, 0x10, 18, 1),
|
||||
PIN_FIELD_BASE(25, 25, IOCFG_RT_BASE, 0x60, 0x10, 17, 1),
|
||||
PIN_FIELD_BASE(26, 27, IOCFG_RT_BASE, 0x60, 0x10, 15, 1),
|
||||
PIN_FIELD_BASE(28, 29, IOCFG_RT_BASE, 0x60, 0x10, 19, 1),
|
||||
PIN_FIELD_BASE(30, 30, IOCFG_RT_BASE, 0x60, 0x10, 23, 1),
|
||||
PIN_FIELD_BASE(31, 31, IOCFG_RT_BASE, 0x60, 0x10, 22, 1),
|
||||
PIN_FIELD_BASE(32, 32, IOCFG_RT_BASE, 0x60, 0x10, 21, 1),
|
||||
PIN_FIELD_BASE(33, 33, IOCFG_LT_BASE, 0x50, 0x10, 4, 1),
|
||||
PIN_FIELD_BASE(34, 34, IOCFG_LT_BASE, 0x50, 0x10, 8, 1),
|
||||
PIN_FIELD_BASE(35, 35, IOCFG_LT_BASE, 0x50, 0x10, 7, 1),
|
||||
PIN_FIELD_BASE(36, 37, IOCFG_LT_BASE, 0x50, 0x10, 5, 1),
|
||||
PIN_FIELD_BASE(38, 38, IOCFG_LT_BASE, 0x50, 0x10, 9, 1),
|
||||
PIN_FIELD_BASE(39, 40, IOCFG_RB_BASE, 0x80, 0x10, 18, 1),
|
||||
PIN_FIELD_BASE(41, 41, IOCFG_RB_BASE, 0x80, 0x10, 12, 1),
|
||||
PIN_FIELD_BASE(42, 43, IOCFG_RB_BASE, 0x80, 0x10, 22, 1),
|
||||
PIN_FIELD_BASE(44, 45, IOCFG_RB_BASE, 0x80, 0x10, 20, 1),
|
||||
PIN_FIELD_BASE(46, 47, IOCFG_RB_BASE, 0x80, 0x10, 26, 1),
|
||||
PIN_FIELD_BASE(48, 49, IOCFG_RB_BASE, 0x80, 0x10, 24, 1),
|
||||
PIN_FIELD_BASE(50, 57, IOCFG_RT_BASE, 0x60, 0x10, 2, 1),
|
||||
PIN_FIELD_BASE(58, 58, IOCFG_RT_BASE, 0x60, 0x10, 1, 1),
|
||||
PIN_FIELD_BASE(59, 59, IOCFG_RT_BASE, 0x60, 0x10, 0, 1),
|
||||
PIN_FIELD_BASE(60, 61, IOCFG_RT_BASE, 0x60, 0x10, 10, 1),
|
||||
PIN_FIELD_BASE(62, 62, IOCFG_RB_BASE, 0x80, 0x10, 15, 1),
|
||||
PIN_FIELD_BASE(63, 63, IOCFG_RB_BASE, 0x80, 0x10, 14, 1),
|
||||
PIN_FIELD_BASE(64, 64, IOCFG_RB_BASE, 0x80, 0x10, 13, 1),
|
||||
PIN_FIELD_BASE(65, 65, IOCFG_RB_BASE, 0x80, 0x10, 16, 1),
|
||||
PIN_FIELD_BASE(66, 68, IOCFG_LB_BASE, 0x60, 0x10, 2, 1),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_reg_calc mt7986_reg_cals[] = {
|
||||
[PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt7986_pin_mode_range),
|
||||
[PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt7986_pin_dir_range),
|
||||
[PINCTRL_PIN_REG_DI] = MTK_RANGE(mt7986_pin_di_range),
|
||||
[PINCTRL_PIN_REG_DO] = MTK_RANGE(mt7986_pin_do_range),
|
||||
[PINCTRL_PIN_REG_SMT] = MTK_RANGE(mt7986_pin_smt_range),
|
||||
[PINCTRL_PIN_REG_IES] = MTK_RANGE(mt7986_pin_ies_range),
|
||||
[PINCTRL_PIN_REG_DRV] = MTK_RANGE(mt7986_pin_drv_range),
|
||||
[PINCTRL_PIN_REG_PU] = MTK_RANGE(mt7986_pin_pu_range),
|
||||
[PINCTRL_PIN_REG_PD] = MTK_RANGE(mt7986_pin_pd_range),
|
||||
[PINCTRL_PIN_REG_PUPD] = MTK_RANGE(mt7986_pin_pupd_range),
|
||||
[PINCTRL_PIN_REG_R0] = MTK_RANGE(mt7986_pin_r0_range),
|
||||
[PINCTRL_PIN_REG_R1] = MTK_RANGE(mt7986_pin_r1_range),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_desc mt7986a_pins[] = {
|
||||
MT7986_PIN(0, "SYS_WATCHDOG"),
|
||||
MT7986_PIN(1, "WF2G_LED"),
|
||||
MT7986_PIN(2, "WF5G_LED"),
|
||||
MT7986_PIN(3, "I2C_SCL"),
|
||||
MT7986_PIN(4, "I2C_SDA"),
|
||||
MT7986_PIN(5, "GPIO_0"),
|
||||
MT7986_PIN(6, "GPIO_1"),
|
||||
MT7986_PIN(7, "GPIO_2"),
|
||||
MT7986_PIN(8, "GPIO_3"),
|
||||
MT7986_PIN(9, "GPIO_4"),
|
||||
MT7986_PIN(10, "GPIO_5"),
|
||||
MT7986_PIN(11, "GPIO_6"),
|
||||
MT7986_PIN(12, "GPIO_7"),
|
||||
MT7986_PIN(13, "GPIO_8"),
|
||||
MT7986_PIN(14, "GPIO_9"),
|
||||
MT7986_PIN(15, "GPIO_10"),
|
||||
MT7986_PIN(16, "GPIO_11"),
|
||||
MT7986_PIN(17, "GPIO_12"),
|
||||
MT7986_PIN(18, "GPIO_13"),
|
||||
MT7986_PIN(19, "GPIO_14"),
|
||||
MT7986_PIN(20, "GPIO_15"),
|
||||
MT7986_PIN(21, "PWM0"),
|
||||
MT7986_PIN(22, "PWM1"),
|
||||
MT7986_PIN(23, "SPI0_CLK"),
|
||||
MT7986_PIN(24, "SPI0_MOSI"),
|
||||
MT7986_PIN(25, "SPI0_MISO"),
|
||||
MT7986_PIN(26, "SPI0_CS"),
|
||||
MT7986_PIN(27, "SPI0_HOLD"),
|
||||
MT7986_PIN(28, "SPI0_WP"),
|
||||
MT7986_PIN(29, "SPI1_CLK"),
|
||||
MT7986_PIN(30, "SPI1_MOSI"),
|
||||
MT7986_PIN(31, "SPI1_MISO"),
|
||||
MT7986_PIN(32, "SPI1_CS"),
|
||||
MT7986_PIN(33, "SPI2_CLK"),
|
||||
MT7986_PIN(34, "SPI2_MOSI"),
|
||||
MT7986_PIN(35, "SPI2_MISO"),
|
||||
MT7986_PIN(36, "SPI2_CS"),
|
||||
MT7986_PIN(37, "SPI2_HOLD"),
|
||||
MT7986_PIN(38, "SPI2_WP"),
|
||||
MT7986_PIN(39, "UART0_RXD"),
|
||||
MT7986_PIN(40, "UART0_TXD"),
|
||||
MT7986_PIN(41, "PCIE_PERESET_N"),
|
||||
MT7986_PIN(42, "UART1_RXD"),
|
||||
MT7986_PIN(43, "UART1_TXD"),
|
||||
MT7986_PIN(44, "UART1_CTS"),
|
||||
MT7986_PIN(45, "UART1_RTS"),
|
||||
MT7986_PIN(46, "UART2_RXD"),
|
||||
MT7986_PIN(47, "UART2_TXD"),
|
||||
MT7986_PIN(48, "UART2_CTS"),
|
||||
MT7986_PIN(49, "UART2_RTS"),
|
||||
MT7986_PIN(50, "EMMC_DATA_0"),
|
||||
MT7986_PIN(51, "EMMC_DATA_1"),
|
||||
MT7986_PIN(52, "EMMC_DATA_2"),
|
||||
MT7986_PIN(53, "EMMC_DATA_3"),
|
||||
MT7986_PIN(54, "EMMC_DATA_4"),
|
||||
MT7986_PIN(55, "EMMC_DATA_5"),
|
||||
MT7986_PIN(56, "EMMC_DATA_6"),
|
||||
MT7986_PIN(57, "EMMC_DATA_7"),
|
||||
MT7986_PIN(58, "EMMC_CMD"),
|
||||
MT7986_PIN(59, "EMMC_CK"),
|
||||
MT7986_PIN(60, "EMMC_DSL"),
|
||||
MT7986_PIN(61, "EMMC_RSTB"),
|
||||
MT7986_PIN(62, "PCM_DTX"),
|
||||
MT7986_PIN(63, "PCM_DRX"),
|
||||
MT7986_PIN(64, "PCM_CLK"),
|
||||
MT7986_PIN(65, "PCM_FS"),
|
||||
MT7986_PIN(66, "MT7531_INT"),
|
||||
MT7986_PIN(67, "SMI_MDC"),
|
||||
MT7986_PIN(68, "SMI_MDIO"),
|
||||
MT7986_PIN(69, "WF0_DIG_RESETB"),
|
||||
MT7986_PIN(70, "WF0_CBA_RESETB"),
|
||||
MT7986_PIN(71, "WF0_XO_REQ"),
|
||||
MT7986_PIN(72, "WF0_TOP_CLK"),
|
||||
MT7986_PIN(73, "WF0_TOP_DATA"),
|
||||
MT7986_PIN(74, "WF0_HB1"),
|
||||
MT7986_PIN(75, "WF0_HB2"),
|
||||
MT7986_PIN(76, "WF0_HB3"),
|
||||
MT7986_PIN(77, "WF0_HB4"),
|
||||
MT7986_PIN(78, "WF0_HB0"),
|
||||
MT7986_PIN(79, "WF0_HB0_B"),
|
||||
MT7986_PIN(80, "WF0_HB5"),
|
||||
MT7986_PIN(81, "WF0_HB6"),
|
||||
MT7986_PIN(82, "WF0_HB7"),
|
||||
MT7986_PIN(83, "WF0_HB8"),
|
||||
MT7986_PIN(84, "WF0_HB9"),
|
||||
MT7986_PIN(85, "WF0_HB10"),
|
||||
MT7986_PIN(86, "WF1_DIG_RESETB"),
|
||||
MT7986_PIN(87, "WF1_CBA_RESETB"),
|
||||
MT7986_PIN(88, "WF1_XO_REQ"),
|
||||
MT7986_PIN(89, "WF1_TOP_CLK"),
|
||||
MT7986_PIN(90, "WF1_TOP_DATA"),
|
||||
MT7986_PIN(91, "WF1_HB1"),
|
||||
MT7986_PIN(92, "WF1_HB2"),
|
||||
MT7986_PIN(93, "WF1_HB3"),
|
||||
MT7986_PIN(94, "WF1_HB4"),
|
||||
MT7986_PIN(95, "WF1_HB0"),
|
||||
MT7986_PIN(96, "WF1_HB0_B"),
|
||||
MT7986_PIN(97, "WF1_HB5"),
|
||||
MT7986_PIN(98, "WF1_HB6"),
|
||||
MT7986_PIN(99, "WF1_HB7"),
|
||||
MT7986_PIN(100, "WF1_HB8"),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_desc mt7986b_pins[] = {
|
||||
MT7986_PIN(0, "SYS_WATCHDOG"),
|
||||
MT7986_PIN(1, "WF2G_LED"),
|
||||
MT7986_PIN(2, "WF5G_LED"),
|
||||
MT7986_PIN(3, "I2C_SCL"),
|
||||
MT7986_PIN(4, "I2C_SDA"),
|
||||
MT7986_PIN(5, "GPIO_0"),
|
||||
MT7986_PIN(6, "GPIO_1"),
|
||||
MT7986_PIN(7, "GPIO_2"),
|
||||
MT7986_PIN(8, "GPIO_3"),
|
||||
MT7986_PIN(9, "GPIO_4"),
|
||||
MT7986_PIN(10, "GPIO_5"),
|
||||
MT7986_PIN(11, "GPIO_6"),
|
||||
MT7986_PIN(12, "GPIO_7"),
|
||||
MT7986_PIN(13, "GPIO_8"),
|
||||
MT7986_PIN(14, "GPIO_9"),
|
||||
MT7986_PIN(15, "GPIO_10"),
|
||||
MT7986_PIN(16, "GPIO_11"),
|
||||
MT7986_PIN(17, "GPIO_12"),
|
||||
MT7986_PIN(18, "GPIO_13"),
|
||||
MT7986_PIN(19, "GPIO_14"),
|
||||
MT7986_PIN(20, "GPIO_15"),
|
||||
MT7986_PIN(21, "PWM0"),
|
||||
MT7986_PIN(22, "PWM1"),
|
||||
MT7986_PIN(23, "SPI0_CLK"),
|
||||
MT7986_PIN(24, "SPI0_MOSI"),
|
||||
MT7986_PIN(25, "SPI0_MISO"),
|
||||
MT7986_PIN(26, "SPI0_CS"),
|
||||
MT7986_PIN(27, "SPI0_HOLD"),
|
||||
MT7986_PIN(28, "SPI0_WP"),
|
||||
MT7986_PIN(29, "SPI1_CLK"),
|
||||
MT7986_PIN(30, "SPI1_MOSI"),
|
||||
MT7986_PIN(31, "SPI1_MISO"),
|
||||
MT7986_PIN(32, "SPI1_CS"),
|
||||
MT7986_PIN(33, "SPI2_CLK"),
|
||||
MT7986_PIN(34, "SPI2_MOSI"),
|
||||
MT7986_PIN(35, "SPI2_MISO"),
|
||||
MT7986_PIN(36, "SPI2_CS"),
|
||||
MT7986_PIN(37, "SPI2_HOLD"),
|
||||
MT7986_PIN(38, "SPI2_WP"),
|
||||
MT7986_PIN(39, "UART0_RXD"),
|
||||
MT7986_PIN(40, "UART0_TXD"),
|
||||
MT7986_NOT_BALLOUT_PIN(41),
|
||||
MT7986_NOT_BALLOUT_PIN(42),
|
||||
MT7986_NOT_BALLOUT_PIN(43),
|
||||
MT7986_NOT_BALLOUT_PIN(44),
|
||||
MT7986_NOT_BALLOUT_PIN(45),
|
||||
MT7986_NOT_BALLOUT_PIN(46),
|
||||
MT7986_NOT_BALLOUT_PIN(47),
|
||||
MT7986_NOT_BALLOUT_PIN(48),
|
||||
MT7986_NOT_BALLOUT_PIN(49),
|
||||
MT7986_NOT_BALLOUT_PIN(50),
|
||||
MT7986_NOT_BALLOUT_PIN(51),
|
||||
MT7986_NOT_BALLOUT_PIN(52),
|
||||
MT7986_NOT_BALLOUT_PIN(53),
|
||||
MT7986_NOT_BALLOUT_PIN(54),
|
||||
MT7986_NOT_BALLOUT_PIN(55),
|
||||
MT7986_NOT_BALLOUT_PIN(56),
|
||||
MT7986_NOT_BALLOUT_PIN(57),
|
||||
MT7986_NOT_BALLOUT_PIN(58),
|
||||
MT7986_NOT_BALLOUT_PIN(59),
|
||||
MT7986_NOT_BALLOUT_PIN(60),
|
||||
MT7986_NOT_BALLOUT_PIN(61),
|
||||
MT7986_NOT_BALLOUT_PIN(62),
|
||||
MT7986_NOT_BALLOUT_PIN(63),
|
||||
MT7986_NOT_BALLOUT_PIN(64),
|
||||
MT7986_NOT_BALLOUT_PIN(65),
|
||||
MT7986_PIN(66, "MT7531_INT"),
|
||||
MT7986_PIN(67, "SMI_MDC"),
|
||||
MT7986_PIN(68, "SMI_MDIO"),
|
||||
MT7986_PIN(69, "WF0_DIG_RESETB"),
|
||||
MT7986_PIN(70, "WF0_CBA_RESETB"),
|
||||
MT7986_PIN(71, "WF0_XO_REQ"),
|
||||
MT7986_PIN(72, "WF0_TOP_CLK"),
|
||||
MT7986_PIN(73, "WF0_TOP_DATA"),
|
||||
MT7986_PIN(74, "WF0_HB1"),
|
||||
MT7986_PIN(75, "WF0_HB2"),
|
||||
MT7986_PIN(76, "WF0_HB3"),
|
||||
MT7986_PIN(77, "WF0_HB4"),
|
||||
MT7986_PIN(78, "WF0_HB0"),
|
||||
MT7986_PIN(79, "WF0_HB0_B"),
|
||||
MT7986_PIN(80, "WF0_HB5"),
|
||||
MT7986_PIN(81, "WF0_HB6"),
|
||||
MT7986_PIN(82, "WF0_HB7"),
|
||||
MT7986_PIN(83, "WF0_HB8"),
|
||||
MT7986_PIN(84, "WF0_HB9"),
|
||||
MT7986_PIN(85, "WF0_HB10"),
|
||||
MT7986_PIN(86, "WF1_DIG_RESETB"),
|
||||
MT7986_PIN(87, "WF1_CBA_RESETB"),
|
||||
MT7986_PIN(88, "WF1_XO_REQ"),
|
||||
MT7986_PIN(89, "WF1_TOP_CLK"),
|
||||
MT7986_PIN(90, "WF1_TOP_DATA"),
|
||||
MT7986_PIN(91, "WF1_HB1"),
|
||||
MT7986_PIN(92, "WF1_HB2"),
|
||||
MT7986_PIN(93, "WF1_HB3"),
|
||||
MT7986_PIN(94, "WF1_HB4"),
|
||||
MT7986_PIN(95, "WF1_HB0"),
|
||||
MT7986_PIN(96, "WF1_HB0_B"),
|
||||
MT7986_PIN(97, "WF1_HB5"),
|
||||
MT7986_PIN(98, "WF1_HB6"),
|
||||
MT7986_PIN(99, "WF1_HB7"),
|
||||
MT7986_PIN(100, "WF1_HB8"),
|
||||
};
|
||||
|
||||
/* List all groups consisting of these pins dedicated to the enablement of
|
||||
* certain hardware block and the corresponding mode for all of the pins.
|
||||
* The hardware probably has multiple combinations of these pinouts.
|
||||
*/
|
||||
|
||||
static int mt7986_watchdog_pins[] = { 0, };
|
||||
static int mt7986_watchdog_funcs[] = { 1, };
|
||||
|
||||
static int mt7986_wifi_led_pins[] = { 1, 2, };
|
||||
static int mt7986_wifi_led_funcs[] = { 1, 1, };
|
||||
|
||||
static int mt7986_i2c_pins[] = { 3, 4, };
|
||||
static int mt7986_i2c_funcs[] = { 1, 1, };
|
||||
|
||||
static int mt7986_uart1_0_pins[] = { 7, 8, 9, 10, };
|
||||
static int mt7986_uart1_0_funcs[] = { 3, 3, 3, 3, };
|
||||
|
||||
static int mt7986_spi1_0_pins[] = { 11, 12, 13, 14, };
|
||||
static int mt7986_spi1_0_funcs[] = { 3, 3, 3, 3, };
|
||||
|
||||
static int mt7986_pwm1_1_pins[] = { 20, };
|
||||
static int mt7986_pwm1_1_funcs[] = { 2, };
|
||||
|
||||
static int mt7986_pwm0_pins[] = { 21, };
|
||||
static int mt7986_pwm0_funcs[] = { 1, };
|
||||
|
||||
static int mt7986_pwm1_0_pins[] = { 22, };
|
||||
static int mt7986_pwm1_0_funcs[] = { 1, };
|
||||
|
||||
static int mt7986_emmc_45_pins[] = {
|
||||
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, };
|
||||
static int mt7986_emmc_45_funcs[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, };
|
||||
|
||||
static int mt7986_snfi_pins[] = { 23, 24, 25, 26, 27, 28, };
|
||||
static int mt7986_snfi_funcs[] = { 1, 1, 1, 1, 1, 1, };
|
||||
|
||||
static int mt7986_spi1_1_pins[] = { 23, 24, 25, 26, };
|
||||
static int mt7986_spi1_1_funcs[] = { 3, 3, 3, 3, };
|
||||
|
||||
static int mt7986_uart1_1_pins[] = { 23, 24, 25, 26, };
|
||||
static int mt7986_uart1_1_funcs[] = { 4, 4, 4, 4, };
|
||||
|
||||
static int mt7986_spi1_2_pins[] = { 29, 30, 31, 32, };
|
||||
static int mt7986_spi1_2_funcs[] = { 1, 1, 1, 1, };
|
||||
|
||||
static int mt7986_uart1_2_pins[] = { 29, 30, 31, 32, };
|
||||
static int mt7986_uart1_2_funcs[] = { 3, 3, 3, 3, };
|
||||
|
||||
static int mt7986_uart2_0_pins[] = { 29, 30, 31, 32, };
|
||||
static int mt7986_uart2_0_funcs[] = { 4, 4, 4, 4, };
|
||||
|
||||
static int mt7986_spi0_pins[] = { 33, 34, 35, 36, };
|
||||
static int mt7986_spi0_funcs[] = { 1, 1, 1, 1, };
|
||||
|
||||
static int mt7986_spi0_wp_hold_pins[] = { 37, 38, };
|
||||
static int mt7986_spi0_wp_hold_funcs[] = { 1, 1, };
|
||||
|
||||
static int mt7986_uart2_1_pins[] = { 33, 34, 35, 36, };
|
||||
static int mt7986_uart2_1_funcs[] = { 3, 3, 3, 3, };
|
||||
|
||||
static int mt7986_uart1_3_rx_tx_pins[] = { 35, 36, };
|
||||
static int mt7986_uart1_3_rx_tx_funcs[] = { 2, 2, };
|
||||
|
||||
static int mt7986_uart1_3_cts_rts_pins[] = { 37, 38, };
|
||||
static int mt7986_uart1_3_cts_rts_funcs[] = { 2, 2, };
|
||||
|
||||
static int mt7986_spi1_3_pins[] = { 33, 34, 35, 36, };
|
||||
static int mt7986_spi1_3_funcs[] = { 4, 4, 4, 4, };
|
||||
|
||||
static int mt7986_uart0_pins[] = { 39, 40, };
|
||||
static int mt7986_uart0_funcs[] = { 1, 1, };
|
||||
|
||||
static int mt7986_pcie_reset_pins[] = { 41, };
|
||||
static int mt7986_pcie_reset_funcs[] = { 1, };
|
||||
|
||||
static int mt7986_uart1_pins[] = { 42, 43, 44, 45, };
|
||||
static int mt7986_uart1_funcs[] = { 1, 1, 1, 1, };
|
||||
|
||||
static int mt7986_uart2_pins[] = { 46, 47, 48, 49, };
|
||||
static int mt7986_uart2_funcs[] = { 1, 1, 1, 1, };
|
||||
|
||||
static int mt7986_emmc_51_pins[] = {
|
||||
50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, };
|
||||
static int mt7986_emmc_51_funcs[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, };
|
||||
|
||||
static int mt7986_pcm_pins[] = { 62, 63, 64, 65, };
|
||||
static int mt7986_pcm_funcs[] = { 1, 1, 1, 1, };
|
||||
|
||||
static int mt7986_i2s_pins[] = { 62, 63, 64, 65, };
|
||||
static int mt7986_i2s_funcs[] = { 1, 1, 1, 1, };
|
||||
|
||||
static int mt7986_switch_int_pins[] = { 66, };
|
||||
static int mt7986_switch_int_funcs[] = { 1, };
|
||||
|
||||
static int mt7986_mdc_mdio_pins[] = { 67, 68, };
|
||||
static int mt7986_mdc_mdio_funcs[] = { 1, 1, };
|
||||
|
||||
static int mt7986_wf_2g_pins[] = {74, 75, 76, 77, 78, 79, 80, 81, 82, 83, };
|
||||
static int mt7986_wf_2g_funcs[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, };
|
||||
|
||||
static int mt7986_wf_5g_pins[] = {91, 92, 93, 94, 95, 96, 97, 98, 99, 100, };
|
||||
static int mt7986_wf_5g_funcs[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, };
|
||||
|
||||
static int mt7986_wf_dbdc_pins[] = {
|
||||
74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, };
|
||||
static int mt7986_wf_dbdc_funcs[] = {
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, };
|
||||
|
||||
static int mt7986_pcie_clk_pins[] = { 9, };
|
||||
static int mt7986_pcie_clk_funcs[] = { 1, };
|
||||
|
||||
static int mt7986_pcie_wake_pins[] = { 10, };
|
||||
static int mt7986_pcie_wake_funcs[] = { 1, };
|
||||
|
||||
static const struct group_desc mt7986_groups[] = {
|
||||
PINCTRL_PIN_GROUP("watchdog", mt7986_watchdog),
|
||||
PINCTRL_PIN_GROUP("wifi_led", mt7986_wifi_led),
|
||||
PINCTRL_PIN_GROUP("i2c", mt7986_i2c),
|
||||
PINCTRL_PIN_GROUP("uart1_0", mt7986_uart1_0),
|
||||
PINCTRL_PIN_GROUP("pcie_clk", mt7986_pcie_clk),
|
||||
PINCTRL_PIN_GROUP("pcie_wake", mt7986_pcie_wake),
|
||||
PINCTRL_PIN_GROUP("spi1_0", mt7986_spi1_0),
|
||||
PINCTRL_PIN_GROUP("pwm1_1", mt7986_pwm1_1),
|
||||
PINCTRL_PIN_GROUP("pwm0", mt7986_pwm0),
|
||||
PINCTRL_PIN_GROUP("pwm1_0", mt7986_pwm1_0),
|
||||
PINCTRL_PIN_GROUP("emmc_45", mt7986_emmc_45),
|
||||
PINCTRL_PIN_GROUP("snfi", mt7986_snfi),
|
||||
PINCTRL_PIN_GROUP("spi1_1", mt7986_spi1_1),
|
||||
PINCTRL_PIN_GROUP("uart1_1", mt7986_uart1_1),
|
||||
PINCTRL_PIN_GROUP("spi1_2", mt7986_spi1_2),
|
||||
PINCTRL_PIN_GROUP("uart1_2", mt7986_uart1_2),
|
||||
PINCTRL_PIN_GROUP("uart2_0", mt7986_uart2_0),
|
||||
PINCTRL_PIN_GROUP("spi0", mt7986_spi0),
|
||||
PINCTRL_PIN_GROUP("spi0_wp_hold", mt7986_spi0_wp_hold),
|
||||
PINCTRL_PIN_GROUP("uart2_1", mt7986_uart2_1),
|
||||
PINCTRL_PIN_GROUP("uart1_3_rx_tx", mt7986_uart1_3_rx_tx),
|
||||
PINCTRL_PIN_GROUP("uart1_3_cts_rts", mt7986_uart1_3_cts_rts),
|
||||
PINCTRL_PIN_GROUP("spi1_3", mt7986_spi1_3),
|
||||
PINCTRL_PIN_GROUP("uart0", mt7986_uart0),
|
||||
PINCTRL_PIN_GROUP("switch_int", mt7986_switch_int),
|
||||
PINCTRL_PIN_GROUP("mdc_mdio", mt7986_mdc_mdio),
|
||||
PINCTRL_PIN_GROUP("pcie_pereset", mt7986_pcie_reset),
|
||||
PINCTRL_PIN_GROUP("uart1", mt7986_uart1),
|
||||
PINCTRL_PIN_GROUP("uart2", mt7986_uart2),
|
||||
PINCTRL_PIN_GROUP("emmc_51", mt7986_emmc_51),
|
||||
PINCTRL_PIN_GROUP("pcm", mt7986_pcm),
|
||||
PINCTRL_PIN_GROUP("i2s", mt7986_i2s),
|
||||
PINCTRL_PIN_GROUP("wf_2g", mt7986_wf_2g),
|
||||
PINCTRL_PIN_GROUP("wf_5g", mt7986_wf_5g),
|
||||
PINCTRL_PIN_GROUP("wf_dbdc", mt7986_wf_dbdc),
|
||||
};
|
||||
|
||||
/* Joint those groups owning the same capability in user point of view which
|
||||
* allows that people tend to use through the device tree.
|
||||
*/
|
||||
|
||||
static const char *mt7986_audio_groups[] = { "pcm", "i2s" };
|
||||
static const char *mt7986_emmc_groups[] = {
|
||||
"emmc_45", "emmc_51", };
|
||||
static const char *mt7986_ethernet_groups[] = {
|
||||
"switch_int", "mdc_mdio", };
|
||||
static const char *mt7986_i2c_groups[] = { "i2c", };
|
||||
static const char *mt7986_led_groups[] = { "wifi_led", };
|
||||
static const char *mt7986_flash_groups[] = { "snfi", };
|
||||
static const char *mt7986_pcie_groups[] = {
|
||||
"pcie_clk", "pcie_wake", "pcie_pereset" };
|
||||
static const char *mt7986_pwm_groups[] = { "pwm0", "pwm1_0", "pwm1_1", };
|
||||
static const char *mt7986_spi_groups[] = {
|
||||
"spi0", "spi0_wp_hold", "spi1_0", "spi1_1", "spi1_2", "spi1_3", };
|
||||
static const char *mt7986_uart_groups[] = {
|
||||
"uart1_0", "uart1_1", "uart1_2", "uart1_3_rx_tx", "uart1_3_cts_rts",
|
||||
"uart2_0", "uart2_1", "uart0", "uart1", "uart2",
|
||||
};
|
||||
static const char *mt7986_wdt_groups[] = { "watchdog", };
|
||||
static const char *mt7986_wf_groups[] = { "wf_2g", "wf_5g", "wf_dbdc", };
|
||||
|
||||
static const struct function_desc mt7986_functions[] = {
|
||||
{"audio", mt7986_audio_groups, ARRAY_SIZE(mt7986_audio_groups)},
|
||||
{"emmc", mt7986_emmc_groups, ARRAY_SIZE(mt7986_emmc_groups)},
|
||||
{"eth", mt7986_ethernet_groups, ARRAY_SIZE(mt7986_ethernet_groups)},
|
||||
{"i2c", mt7986_i2c_groups, ARRAY_SIZE(mt7986_i2c_groups)},
|
||||
{"led", mt7986_led_groups, ARRAY_SIZE(mt7986_led_groups)},
|
||||
{"flash", mt7986_flash_groups, ARRAY_SIZE(mt7986_flash_groups)},
|
||||
{"pcie", mt7986_pcie_groups, ARRAY_SIZE(mt7986_pcie_groups)},
|
||||
{"pwm", mt7986_pwm_groups, ARRAY_SIZE(mt7986_pwm_groups)},
|
||||
{"spi", mt7986_spi_groups, ARRAY_SIZE(mt7986_spi_groups)},
|
||||
{"uart", mt7986_uart_groups, ARRAY_SIZE(mt7986_uart_groups)},
|
||||
{"watchdog", mt7986_wdt_groups, ARRAY_SIZE(mt7986_wdt_groups)},
|
||||
{"wifi", mt7986_wf_groups, ARRAY_SIZE(mt7986_wf_groups)},
|
||||
};
|
||||
|
||||
static const struct mtk_eint_hw mt7986a_eint_hw = {
|
||||
.port_mask = 7,
|
||||
.ports = 7,
|
||||
.ap_num = ARRAY_SIZE(mt7986a_pins),
|
||||
.db_cnt = 16,
|
||||
};
|
||||
|
||||
static const struct mtk_eint_hw mt7986b_eint_hw = {
|
||||
.port_mask = 7,
|
||||
.ports = 7,
|
||||
.ap_num = ARRAY_SIZE(mt7986b_pins),
|
||||
.db_cnt = 16,
|
||||
};
|
||||
|
||||
static struct mtk_pin_soc mt7986a_data = {
|
||||
.reg_cal = mt7986_reg_cals,
|
||||
.pins = mt7986a_pins,
|
||||
.npins = ARRAY_SIZE(mt7986a_pins),
|
||||
.grps = mt7986_groups,
|
||||
.ngrps = ARRAY_SIZE(mt7986_groups),
|
||||
.funcs = mt7986_functions,
|
||||
.nfuncs = ARRAY_SIZE(mt7986_functions),
|
||||
.eint_hw = &mt7986a_eint_hw,
|
||||
.gpio_m = 0,
|
||||
.ies_present = false,
|
||||
.base_names = mt7986_pinctrl_register_base_names,
|
||||
.nbase_names = ARRAY_SIZE(mt7986_pinctrl_register_base_names),
|
||||
.bias_set_combo = mtk_pinconf_bias_set_combo,
|
||||
.bias_get_combo = mtk_pinconf_bias_get_combo,
|
||||
.drive_set = mtk_pinconf_drive_set_rev1,
|
||||
.drive_get = mtk_pinconf_drive_get_rev1,
|
||||
.adv_pull_get = mtk_pinconf_adv_pull_get,
|
||||
.adv_pull_set = mtk_pinconf_adv_pull_set,
|
||||
};
|
||||
|
||||
static struct mtk_pin_soc mt7986b_data = {
|
||||
.reg_cal = mt7986_reg_cals,
|
||||
.pins = mt7986b_pins,
|
||||
.npins = ARRAY_SIZE(mt7986b_pins),
|
||||
.grps = mt7986_groups,
|
||||
.ngrps = ARRAY_SIZE(mt7986_groups),
|
||||
.funcs = mt7986_functions,
|
||||
.nfuncs = ARRAY_SIZE(mt7986_functions),
|
||||
.eint_hw = &mt7986b_eint_hw,
|
||||
.gpio_m = 0,
|
||||
.ies_present = false,
|
||||
.base_names = mt7986_pinctrl_register_base_names,
|
||||
.nbase_names = ARRAY_SIZE(mt7986_pinctrl_register_base_names),
|
||||
.bias_set_combo = mtk_pinconf_bias_set_combo,
|
||||
.bias_get_combo = mtk_pinconf_bias_get_combo,
|
||||
.drive_set = mtk_pinconf_drive_set_rev1,
|
||||
.drive_get = mtk_pinconf_drive_get_rev1,
|
||||
.adv_pull_get = mtk_pinconf_adv_pull_get,
|
||||
.adv_pull_set = mtk_pinconf_adv_pull_set,
|
||||
};
|
||||
|
||||
static const struct of_device_id mt7986a_pinctrl_of_match[] = {
|
||||
{.compatible = "mediatek,mt7986a-pinctrl",},
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct of_device_id mt7986b_pinctrl_of_match[] = {
|
||||
{.compatible = "mediatek,mt7986b-pinctrl",},
|
||||
{}
|
||||
};
|
||||
|
||||
static int mt7986a_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
return mtk_moore_pinctrl_probe(pdev, &mt7986a_data);
|
||||
}
|
||||
|
||||
static int mt7986b_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
return mtk_moore_pinctrl_probe(pdev, &mt7986b_data);
|
||||
}
|
||||
|
||||
static struct platform_driver mt7986a_pinctrl_driver = {
|
||||
.driver = {
|
||||
.name = "mt7986a-pinctrl",
|
||||
.of_match_table = mt7986a_pinctrl_of_match,
|
||||
},
|
||||
.probe = mt7986a_pinctrl_probe,
|
||||
};
|
||||
|
||||
static struct platform_driver mt7986b_pinctrl_driver = {
|
||||
.driver = {
|
||||
.name = "mt7986b-pinctrl",
|
||||
.of_match_table = mt7986b_pinctrl_of_match,
|
||||
},
|
||||
.probe = mt7986b_pinctrl_probe,
|
||||
};
|
||||
|
||||
static int __init mt7986a_pinctrl_init(void)
|
||||
{
|
||||
return platform_driver_register(&mt7986a_pinctrl_driver);
|
||||
}
|
||||
|
||||
static int __init mt7986b_pinctrl_init(void)
|
||||
{
|
||||
return platform_driver_register(&mt7986b_pinctrl_driver);
|
||||
}
|
||||
|
||||
arch_initcall(mt7986a_pinctrl_init);
|
||||
arch_initcall(mt7986b_pinctrl_init);
|
|
@ -779,6 +779,135 @@ static const struct mtk_pin_field_calc mt8195_pin_drv_adv_range[] = {
|
|||
PIN_FIELD_BASE(45, 45, 1, 0x040, 0x10, 9, 3),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_field_calc mt8195_pin_rsel_range[] = {
|
||||
PIN_FIELD_BASE(8, 8, 4, 0x0c0, 0x10, 15, 3),
|
||||
PIN_FIELD_BASE(9, 9, 4, 0x0c0, 0x10, 0, 3),
|
||||
PIN_FIELD_BASE(10, 10, 4, 0x0c0, 0x10, 18, 3),
|
||||
PIN_FIELD_BASE(11, 11, 4, 0x0c0, 0x10, 3, 3),
|
||||
PIN_FIELD_BASE(12, 12, 4, 0x0c0, 0x10, 21, 3),
|
||||
PIN_FIELD_BASE(13, 13, 4, 0x0c0, 0x10, 6, 3),
|
||||
PIN_FIELD_BASE(14, 14, 4, 0x0c0, 0x10, 24, 3),
|
||||
PIN_FIELD_BASE(15, 15, 4, 0x0c0, 0x10, 9, 3),
|
||||
PIN_FIELD_BASE(16, 16, 4, 0x0c0, 0x10, 27, 3),
|
||||
PIN_FIELD_BASE(17, 17, 4, 0x0c0, 0x10, 12, 3),
|
||||
PIN_FIELD_BASE(29, 29, 2, 0x080, 0x10, 0, 3),
|
||||
PIN_FIELD_BASE(30, 30, 2, 0x080, 0x10, 3, 3),
|
||||
PIN_FIELD_BASE(34, 34, 1, 0x0e0, 0x10, 0, 3),
|
||||
PIN_FIELD_BASE(35, 35, 1, 0x0e0, 0x10, 3, 3),
|
||||
PIN_FIELD_BASE(44, 44, 1, 0x0e0, 0x10, 6, 3),
|
||||
PIN_FIELD_BASE(45, 45, 1, 0x0e0, 0x10, 9, 3),
|
||||
};
|
||||
|
||||
static const struct mtk_pin_rsel mt8195_pin_rsel_val_range[] = {
|
||||
PIN_RSEL(8, 17, 0x0, 75000, 75000),
|
||||
PIN_RSEL(8, 17, 0x1, 10000, 5000),
|
||||
PIN_RSEL(8, 17, 0x2, 5000, 75000),
|
||||
PIN_RSEL(8, 17, 0x3, 4000, 5000),
|
||||
PIN_RSEL(8, 17, 0x4, 3000, 75000),
|
||||
PIN_RSEL(8, 17, 0x5, 2000, 5000),
|
||||
PIN_RSEL(8, 17, 0x6, 1500, 75000),
|
||||
PIN_RSEL(8, 17, 0x7, 1000, 5000),
|
||||
PIN_RSEL(29, 30, 0x0, 75000, 75000),
|
||||
PIN_RSEL(29, 30, 0x1, 10000, 5000),
|
||||
PIN_RSEL(29, 30, 0x2, 5000, 75000),
|
||||
PIN_RSEL(29, 30, 0x3, 4000, 5000),
|
||||
PIN_RSEL(29, 30, 0x4, 3000, 75000),
|
||||
PIN_RSEL(29, 30, 0x5, 2000, 5000),
|
||||
PIN_RSEL(29, 30, 0x6, 1500, 75000),
|
||||
PIN_RSEL(29, 30, 0x7, 1000, 5000),
|
||||
PIN_RSEL(34, 35, 0x0, 75000, 75000),
|
||||
PIN_RSEL(34, 35, 0x1, 10000, 5000),
|
||||
PIN_RSEL(34, 35, 0x2, 5000, 75000),
|
||||
PIN_RSEL(34, 35, 0x3, 4000, 5000),
|
||||
PIN_RSEL(34, 35, 0x4, 3000, 75000),
|
||||
PIN_RSEL(34, 35, 0x5, 2000, 5000),
|
||||
PIN_RSEL(34, 35, 0x6, 1500, 75000),
|
||||
PIN_RSEL(34, 35, 0x7, 1000, 5000),
|
||||
PIN_RSEL(44, 45, 0x0, 75000, 75000),
|
||||
PIN_RSEL(44, 45, 0x1, 10000, 5000),
|
||||
PIN_RSEL(44, 45, 0x2, 5000, 75000),
|
||||
PIN_RSEL(44, 45, 0x3, 4000, 5000),
|
||||
PIN_RSEL(44, 45, 0x4, 3000, 75000),
|
||||
PIN_RSEL(44, 45, 0x5, 2000, 5000),
|
||||
PIN_RSEL(44, 45, 0x6, 1500, 75000),
|
||||
PIN_RSEL(44, 45, 0x7, 1000, 5000),
|
||||
};
|
||||
|
||||
static const unsigned int mt8195_pull_type[] = {
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 0 */, MTK_PULL_PUPD_R1R0_TYPE /* 1 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 2 */, MTK_PULL_PUPD_R1R0_TYPE /* 3 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 4 */, MTK_PULL_PUPD_R1R0_TYPE /* 5 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 6 */, MTK_PULL_PU_PD_TYPE /* 7 */,
|
||||
MTK_PULL_PU_PD_RSEL_TYPE /* 8 */, MTK_PULL_PU_PD_RSEL_TYPE /* 9 */,
|
||||
MTK_PULL_PU_PD_RSEL_TYPE /* 10 */, MTK_PULL_PU_PD_RSEL_TYPE /* 11 */,
|
||||
MTK_PULL_PU_PD_RSEL_TYPE /* 12 */, MTK_PULL_PU_PD_RSEL_TYPE /* 13 */,
|
||||
MTK_PULL_PU_PD_RSEL_TYPE /* 14 */, MTK_PULL_PU_PD_RSEL_TYPE /* 15 */,
|
||||
MTK_PULL_PU_PD_RSEL_TYPE /* 16 */, MTK_PULL_PU_PD_RSEL_TYPE /* 17 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 18 */, MTK_PULL_PU_PD_TYPE /* 19 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 20 */, MTK_PULL_PU_PD_TYPE /* 21 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 22 */, MTK_PULL_PU_PD_TYPE /* 23 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 24 */, MTK_PULL_PU_PD_TYPE /* 25 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 26 */, MTK_PULL_PU_PD_TYPE /* 27 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 28 */, MTK_PULL_PU_PD_RSEL_TYPE /* 29 */,
|
||||
MTK_PULL_PU_PD_RSEL_TYPE /* 30 */, MTK_PULL_PU_PD_TYPE /* 31 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 32 */, MTK_PULL_PU_PD_TYPE /* 33 */,
|
||||
MTK_PULL_PU_PD_RSEL_TYPE /* 34 */, MTK_PULL_PU_PD_RSEL_TYPE /* 35 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 36 */, MTK_PULL_PU_PD_TYPE /* 37 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 38 */, MTK_PULL_PU_PD_TYPE /* 39 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 40 */, MTK_PULL_PU_PD_TYPE /* 41 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 42 */, MTK_PULL_PU_PD_TYPE /* 43 */,
|
||||
MTK_PULL_PU_PD_RSEL_TYPE /* 44 */, MTK_PULL_PU_PD_RSEL_TYPE /* 45 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 46 */, MTK_PULL_PU_PD_TYPE /* 47 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 48 */, MTK_PULL_PU_PD_TYPE /* 49 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 50 */, MTK_PULL_PU_PD_TYPE /* 51 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 52 */, MTK_PULL_PU_PD_TYPE /* 53 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 54 */, MTK_PULL_PU_PD_TYPE /* 55 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 56 */, MTK_PULL_PU_PD_TYPE /* 57 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 58 */, MTK_PULL_PU_PD_TYPE /* 59 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 60 */, MTK_PULL_PU_PD_TYPE /* 61 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 62 */, MTK_PULL_PU_PD_TYPE /* 63 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 64 */, MTK_PULL_PU_PD_TYPE /* 65 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 66 */, MTK_PULL_PU_PD_TYPE /* 67 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 68 */, MTK_PULL_PU_PD_TYPE /* 69 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 70 */, MTK_PULL_PU_PD_TYPE /* 71 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 72 */, MTK_PULL_PU_PD_TYPE /* 73 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 74 */, MTK_PULL_PU_PD_TYPE /* 75 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 76 */, MTK_PULL_PUPD_R1R0_TYPE /* 77 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 78 */, MTK_PULL_PUPD_R1R0_TYPE /* 79 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 80 */, MTK_PULL_PUPD_R1R0_TYPE /* 81 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 82 */, MTK_PULL_PUPD_R1R0_TYPE /* 83 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 84 */, MTK_PULL_PUPD_R1R0_TYPE /* 85 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 86 */, MTK_PULL_PUPD_R1R0_TYPE /* 87 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 88 */, MTK_PULL_PUPD_R1R0_TYPE /* 89 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 90 */, MTK_PULL_PUPD_R1R0_TYPE /* 91 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 92 */, MTK_PULL_PUPD_R1R0_TYPE /* 93 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 94 */, MTK_PULL_PUPD_R1R0_TYPE /* 95 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 96 */, MTK_PULL_PU_PD_TYPE /* 97 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 98 */, MTK_PULL_PU_PD_TYPE /* 99 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 100 */, MTK_PULL_PU_PD_TYPE /* 101 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 102 */, MTK_PULL_PU_PD_TYPE /* 103 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 104 */, MTK_PULL_PUPD_R1R0_TYPE /* 105 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 106 */, MTK_PULL_PUPD_R1R0_TYPE /* 107 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 108 */, MTK_PULL_PU_PD_TYPE /* 109 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 110 */, MTK_PULL_PUPD_R1R0_TYPE /* 111 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 112 */, MTK_PULL_PUPD_R1R0_TYPE /* 113 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 114 */, MTK_PULL_PUPD_R1R0_TYPE /* 115 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 116 */, MTK_PULL_PUPD_R1R0_TYPE /* 117 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 118 */, MTK_PULL_PUPD_R1R0_TYPE /* 119 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 120 */, MTK_PULL_PUPD_R1R0_TYPE /* 121 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 122 */, MTK_PULL_PUPD_R1R0_TYPE /* 123 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 124 */, MTK_PULL_PUPD_R1R0_TYPE /* 125 */,
|
||||
MTK_PULL_PUPD_R1R0_TYPE /* 126 */, MTK_PULL_PUPD_R1R0_TYPE /* 127 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 128 */, MTK_PULL_PU_PD_TYPE /* 129 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 130 */, MTK_PULL_PU_PD_TYPE /* 131 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 132 */, MTK_PULL_PU_PD_TYPE /* 133 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 134 */, MTK_PULL_PU_PD_TYPE /* 135 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 136 */, MTK_PULL_PU_PD_TYPE /* 137 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 138 */, MTK_PULL_PU_PD_TYPE /* 139 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 140 */, MTK_PULL_PU_PD_TYPE /* 141 */,
|
||||
MTK_PULL_PU_PD_TYPE /* 142 */, MTK_PULL_PU_PD_TYPE /* 143 */,
|
||||
};
|
||||
|
||||
static const struct mtk_pin_reg_calc mt8195_reg_cals[PINCTRL_PIN_REG_MAX] = {
|
||||
[PINCTRL_PIN_REG_MODE] = MTK_RANGE(mt8195_pin_mode_range),
|
||||
[PINCTRL_PIN_REG_DIR] = MTK_RANGE(mt8195_pin_dir_range),
|
||||
|
@ -793,6 +922,7 @@ static const struct mtk_pin_reg_calc mt8195_reg_cals[PINCTRL_PIN_REG_MAX] = {
|
|||
[PINCTRL_PIN_REG_R0] = MTK_RANGE(mt8195_pin_r0_range),
|
||||
[PINCTRL_PIN_REG_R1] = MTK_RANGE(mt8195_pin_r1_range),
|
||||
[PINCTRL_PIN_REG_DRV_ADV] = MTK_RANGE(mt8195_pin_drv_adv_range),
|
||||
[PINCTRL_PIN_REG_RSEL] = MTK_RANGE(mt8195_pin_rsel_range),
|
||||
};
|
||||
|
||||
static const char * const mt8195_pinctrl_register_base_names[] = {
|
||||
|
@ -817,6 +947,9 @@ static const struct mtk_pin_soc mt8195_data = {
|
|||
.gpio_m = 0,
|
||||
.base_names = mt8195_pinctrl_register_base_names,
|
||||
.nbase_names = ARRAY_SIZE(mt8195_pinctrl_register_base_names),
|
||||
.pull_type = mt8195_pull_type,
|
||||
.pin_rsel = mt8195_pin_rsel_val_range,
|
||||
.npin_rsel = ARRAY_SIZE(mt8195_pin_rsel_val_range),
|
||||
.bias_set_combo = mtk_pinconf_bias_set_combo,
|
||||
.bias_get_combo = mtk_pinconf_bias_get_combo,
|
||||
.drive_set = mtk_pinconf_drive_set_rev1,
|
||||
|
@ -839,6 +972,7 @@ static struct platform_driver mt8195_pinctrl_driver = {
|
|||
.driver = {
|
||||
.name = "mt8195-pinctrl",
|
||||
.of_match_table = mt8195_pinctrl_of_match,
|
||||
.pm = &mtk_paris_pinctrl_pm_ops,
|
||||
},
|
||||
.probe = mt8195_pinctrl_probe,
|
||||
};
|
||||
|
|
|
@ -661,6 +661,181 @@ out:
|
|||
return err;
|
||||
}
|
||||
|
||||
static int mtk_hw_pin_rsel_lookup(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 pullup, u32 arg, u32 *rsel_val)
|
||||
{
|
||||
const struct mtk_pin_rsel *rsel;
|
||||
int check;
|
||||
bool found = false;
|
||||
|
||||
rsel = hw->soc->pin_rsel;
|
||||
|
||||
for (check = 0; check <= hw->soc->npin_rsel - 1; check++) {
|
||||
if (desc->number >= rsel[check].s_pin &&
|
||||
desc->number <= rsel[check].e_pin) {
|
||||
if (pullup) {
|
||||
if (rsel[check].up_rsel == arg) {
|
||||
found = true;
|
||||
*rsel_val = rsel[check].rsel_index;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (rsel[check].down_rsel == arg) {
|
||||
found = true;
|
||||
*rsel_val = rsel[check].rsel_index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
dev_err(hw->dev, "Not support rsel value %d Ohm for pin = %d (%s)\n",
|
||||
arg, desc->number, desc->name);
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mtk_pinconf_bias_set_rsel(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 pullup, u32 arg)
|
||||
{
|
||||
int err, rsel_val;
|
||||
|
||||
if (hw->rsel_si_unit) {
|
||||
/* find pin rsel_index from pin_rsel array*/
|
||||
err = mtk_hw_pin_rsel_lookup(hw, desc, pullup, arg, &rsel_val);
|
||||
if (err)
|
||||
goto out;
|
||||
} else {
|
||||
if (arg < MTK_PULL_SET_RSEL_000 ||
|
||||
arg > MTK_PULL_SET_RSEL_111) {
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
rsel_val = arg - MTK_PULL_SET_RSEL_000;
|
||||
}
|
||||
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_RSEL, rsel_val);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, MTK_ENABLE);
|
||||
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
int mtk_pinconf_bias_set_combo(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 pullup, u32 arg)
|
||||
{
|
||||
int err = -ENOTSUPP;
|
||||
u32 try_all_type;
|
||||
|
||||
if (hw->soc->pull_type)
|
||||
try_all_type = hw->soc->pull_type[desc->number];
|
||||
else
|
||||
try_all_type = MTK_PULL_TYPE_MASK;
|
||||
|
||||
if (try_all_type & MTK_PULL_RSEL_TYPE) {
|
||||
err = mtk_pinconf_bias_set_rsel(hw, desc, pullup, arg);
|
||||
if (!err)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (try_all_type & MTK_PULL_PU_PD_TYPE) {
|
||||
err = mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, arg);
|
||||
if (!err)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (try_all_type & MTK_PULL_PULLSEL_TYPE) {
|
||||
err = mtk_pinconf_bias_set_pullsel_pullen(hw, desc,
|
||||
pullup, arg);
|
||||
if (!err)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (try_all_type & MTK_PULL_PUPD_R1R0_TYPE)
|
||||
err = mtk_pinconf_bias_set_pupd_r1_r0(hw, desc, pullup, arg);
|
||||
|
||||
if (err)
|
||||
dev_err(hw->dev, "Invalid pull argument\n");
|
||||
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_combo);
|
||||
|
||||
static int mtk_rsel_get_si_unit(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 pullup, u32 rsel_val, u32 *si_unit)
|
||||
{
|
||||
const struct mtk_pin_rsel *rsel;
|
||||
int check;
|
||||
|
||||
rsel = hw->soc->pin_rsel;
|
||||
|
||||
for (check = 0; check <= hw->soc->npin_rsel - 1; check++) {
|
||||
if (desc->number >= rsel[check].s_pin &&
|
||||
desc->number <= rsel[check].e_pin) {
|
||||
if (rsel_val == rsel[check].rsel_index) {
|
||||
if (pullup)
|
||||
*si_unit = rsel[check].up_rsel;
|
||||
else
|
||||
*si_unit = rsel[check].down_rsel;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mtk_pinconf_bias_get_rsel(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 *pullup, u32 *enable)
|
||||
{
|
||||
int pu, pd, rsel, err;
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_RSEL, &rsel);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PU, &pu);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &pd);
|
||||
|
||||
if (pu == 0 && pd == 0) {
|
||||
*pullup = 0;
|
||||
*enable = MTK_DISABLE;
|
||||
} else if (pu == 1 && pd == 0) {
|
||||
*pullup = 1;
|
||||
if (hw->rsel_si_unit)
|
||||
mtk_rsel_get_si_unit(hw, desc, *pullup, rsel, enable);
|
||||
else
|
||||
*enable = rsel + MTK_PULL_SET_RSEL_000;
|
||||
} else if (pu == 0 && pd == 1) {
|
||||
*pullup = 0;
|
||||
if (hw->rsel_si_unit)
|
||||
mtk_rsel_get_si_unit(hw, desc, *pullup, rsel, enable);
|
||||
else
|
||||
*enable = rsel + MTK_PULL_SET_RSEL_000;
|
||||
} else {
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int mtk_pinconf_bias_get_pu_pd(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 *pullup, u32 *enable)
|
||||
|
@ -742,44 +917,40 @@ out:
|
|||
return err;
|
||||
}
|
||||
|
||||
int mtk_pinconf_bias_set_combo(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 pullup, u32 arg)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, arg);
|
||||
if (!err)
|
||||
goto out;
|
||||
|
||||
err = mtk_pinconf_bias_set_pullsel_pullen(hw, desc, pullup, arg);
|
||||
if (!err)
|
||||
goto out;
|
||||
|
||||
err = mtk_pinconf_bias_set_pupd_r1_r0(hw, desc, pullup, arg);
|
||||
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mtk_pinconf_bias_set_combo);
|
||||
|
||||
int mtk_pinconf_bias_get_combo(struct mtk_pinctrl *hw,
|
||||
const struct mtk_pin_desc *desc,
|
||||
u32 *pullup, u32 *enable)
|
||||
{
|
||||
int err;
|
||||
int err = -ENOTSUPP;
|
||||
u32 try_all_type;
|
||||
|
||||
err = mtk_pinconf_bias_get_pu_pd(hw, desc, pullup, enable);
|
||||
if (!err)
|
||||
goto out;
|
||||
if (hw->soc->pull_type)
|
||||
try_all_type = hw->soc->pull_type[desc->number];
|
||||
else
|
||||
try_all_type = MTK_PULL_TYPE_MASK;
|
||||
|
||||
err = mtk_pinconf_bias_get_pullsel_pullen(hw, desc, pullup, enable);
|
||||
if (!err)
|
||||
goto out;
|
||||
if (try_all_type & MTK_PULL_RSEL_TYPE) {
|
||||
err = mtk_pinconf_bias_get_rsel(hw, desc, pullup, enable);
|
||||
if (!err)
|
||||
return err;
|
||||
}
|
||||
|
||||
err = mtk_pinconf_bias_get_pupd_r1_r0(hw, desc, pullup, enable);
|
||||
if (try_all_type & MTK_PULL_PU_PD_TYPE) {
|
||||
err = mtk_pinconf_bias_get_pu_pd(hw, desc, pullup, enable);
|
||||
if (!err)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (try_all_type & MTK_PULL_PULLSEL_TYPE) {
|
||||
err = mtk_pinconf_bias_get_pullsel_pullen(hw, desc,
|
||||
pullup, enable);
|
||||
if (!err)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (try_all_type & MTK_PULL_PUPD_R1R0_TYPE)
|
||||
err = mtk_pinconf_bias_get_pupd_r1_r0(hw, desc, pullup, enable);
|
||||
|
||||
out:
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mtk_pinconf_bias_get_combo);
|
||||
|
|
|
@ -17,6 +17,22 @@
|
|||
#define MTK_ENABLE 1
|
||||
#define MTK_PULLDOWN 0
|
||||
#define MTK_PULLUP 1
|
||||
#define MTK_PULL_PU_PD_TYPE BIT(0)
|
||||
#define MTK_PULL_PULLSEL_TYPE BIT(1)
|
||||
#define MTK_PULL_PUPD_R1R0_TYPE BIT(2)
|
||||
/* MTK_PULL_RSEL_TYPE can select resistance and can be
|
||||
* turned on/off itself. But it can't be selected pull up/down
|
||||
*/
|
||||
#define MTK_PULL_RSEL_TYPE BIT(3)
|
||||
/* MTK_PULL_PU_PD_RSEL_TYPE is a type which is controlled by
|
||||
* MTK_PULL_PU_PD_TYPE and MTK_PULL_RSEL_TYPE.
|
||||
*/
|
||||
#define MTK_PULL_PU_PD_RSEL_TYPE (MTK_PULL_PU_PD_TYPE \
|
||||
| MTK_PULL_RSEL_TYPE)
|
||||
#define MTK_PULL_TYPE_MASK (MTK_PULL_PU_PD_TYPE |\
|
||||
MTK_PULL_PULLSEL_TYPE |\
|
||||
MTK_PULL_PUPD_R1R0_TYPE |\
|
||||
MTK_PULL_RSEL_TYPE)
|
||||
|
||||
#define EINT_NA U16_MAX
|
||||
#define NO_EINT_SUPPORT EINT_NA
|
||||
|
@ -42,6 +58,14 @@
|
|||
PIN_FIELD_CALC(_s_pin, _e_pin, 0, _s_addr, _x_addrs, _s_bit, \
|
||||
_x_bits, 32, 1)
|
||||
|
||||
#define PIN_RSEL(_s_pin, _e_pin, _rsel_index, _up_resl, _down_rsel) { \
|
||||
.s_pin = _s_pin, \
|
||||
.e_pin = _e_pin, \
|
||||
.rsel_index = _rsel_index, \
|
||||
.up_rsel = _up_resl, \
|
||||
.down_rsel = _down_rsel, \
|
||||
}
|
||||
|
||||
/* List these attributes which could be modified for the pin */
|
||||
enum {
|
||||
PINCTRL_PIN_REG_MODE,
|
||||
|
@ -67,6 +91,7 @@ enum {
|
|||
PINCTRL_PIN_REG_DRV_E0,
|
||||
PINCTRL_PIN_REG_DRV_E1,
|
||||
PINCTRL_PIN_REG_DRV_ADV,
|
||||
PINCTRL_PIN_REG_RSEL,
|
||||
PINCTRL_PIN_REG_MAX,
|
||||
};
|
||||
|
||||
|
@ -129,6 +154,22 @@ struct mtk_pin_field_calc {
|
|||
u8 fixed;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct mtk_pin_rsel - the structure that provides bias resistance selection.
|
||||
* @s_pin: the start pin within the rsel range
|
||||
* @e_pin: the end pin within the rsel range
|
||||
* @rsel_index: the rsel bias resistance index
|
||||
* @up_rsel: the pullup rsel bias resistance value
|
||||
* @down_rsel: the pulldown rsel bias resistance value
|
||||
*/
|
||||
struct mtk_pin_rsel {
|
||||
u16 s_pin;
|
||||
u16 e_pin;
|
||||
u16 rsel_index;
|
||||
u32 up_rsel;
|
||||
u32 down_rsel;
|
||||
};
|
||||
|
||||
/* struct mtk_pin_reg_calc - the structure that holds all ranges used to
|
||||
* determine which register the pin would make use of
|
||||
* for certain pin attribute.
|
||||
|
@ -206,6 +247,9 @@ struct mtk_pin_soc {
|
|||
bool ies_present;
|
||||
const char * const *base_names;
|
||||
unsigned int nbase_names;
|
||||
const unsigned int *pull_type;
|
||||
const struct mtk_pin_rsel *pin_rsel;
|
||||
unsigned int npin_rsel;
|
||||
|
||||
/* Specific pinconfig operations */
|
||||
int (*bias_disable_set)(struct mtk_pinctrl *hw,
|
||||
|
@ -254,6 +298,8 @@ struct mtk_pinctrl {
|
|||
const char **grp_names;
|
||||
/* lock pin's register resource to avoid multiple threads issue*/
|
||||
spinlock_t lock;
|
||||
/* identify rsel setting by si unit or rsel define in dts node */
|
||||
bool rsel_si_unit;
|
||||
};
|
||||
|
||||
void mtk_rmw(struct mtk_pinctrl *pctl, u8 i, u32 reg, u32 mask, u32 set);
|
||||
|
|
|
@ -577,10 +577,11 @@ static int mtk_hw_get_value_wrap(struct mtk_pinctrl *hw, unsigned int gpio, int
|
|||
mtk_hw_get_value_wrap(hw, gpio, PINCTRL_PIN_REG_DRV)
|
||||
|
||||
ssize_t mtk_pctrl_show_one_pin(struct mtk_pinctrl *hw,
|
||||
unsigned int gpio, char *buf, unsigned int bufLen)
|
||||
unsigned int gpio, char *buf, unsigned int buf_len)
|
||||
{
|
||||
int pinmux, pullup, pullen, len = 0, r1 = -1, r0 = -1;
|
||||
int pinmux, pullup, pullen, len = 0, r1 = -1, r0 = -1, rsel = -1;
|
||||
const struct mtk_pin_desc *desc;
|
||||
u32 try_all_type;
|
||||
|
||||
if (gpio >= hw->soc->npins)
|
||||
return -EINVAL;
|
||||
|
@ -591,26 +592,41 @@ ssize_t mtk_pctrl_show_one_pin(struct mtk_pinctrl *hw,
|
|||
pinmux -= hw->soc->nfuncs;
|
||||
|
||||
mtk_pinconf_bias_get_combo(hw, desc, &pullup, &pullen);
|
||||
if (pullen == MTK_PUPD_SET_R1R0_00) {
|
||||
pullen = 0;
|
||||
r1 = 0;
|
||||
r0 = 0;
|
||||
} else if (pullen == MTK_PUPD_SET_R1R0_01) {
|
||||
|
||||
if (hw->soc->pull_type)
|
||||
try_all_type = hw->soc->pull_type[desc->number];
|
||||
|
||||
if (hw->rsel_si_unit && (try_all_type & MTK_PULL_RSEL_TYPE)) {
|
||||
rsel = pullen;
|
||||
pullen = 1;
|
||||
r1 = 0;
|
||||
r0 = 1;
|
||||
} else if (pullen == MTK_PUPD_SET_R1R0_10) {
|
||||
pullen = 1;
|
||||
r1 = 1;
|
||||
r0 = 0;
|
||||
} else if (pullen == MTK_PUPD_SET_R1R0_11) {
|
||||
pullen = 1;
|
||||
r1 = 1;
|
||||
r0 = 1;
|
||||
} else if (pullen != MTK_DISABLE && pullen != MTK_ENABLE) {
|
||||
pullen = 0;
|
||||
} else {
|
||||
/* Case for: R1R0 */
|
||||
if (pullen == MTK_PUPD_SET_R1R0_00) {
|
||||
pullen = 0;
|
||||
r1 = 0;
|
||||
r0 = 0;
|
||||
} else if (pullen == MTK_PUPD_SET_R1R0_01) {
|
||||
pullen = 1;
|
||||
r1 = 0;
|
||||
r0 = 1;
|
||||
} else if (pullen == MTK_PUPD_SET_R1R0_10) {
|
||||
pullen = 1;
|
||||
r1 = 1;
|
||||
r0 = 0;
|
||||
} else if (pullen == MTK_PUPD_SET_R1R0_11) {
|
||||
pullen = 1;
|
||||
r1 = 1;
|
||||
r0 = 1;
|
||||
}
|
||||
|
||||
/* Case for: RSEL */
|
||||
if (pullen >= MTK_PULL_SET_RSEL_000 &&
|
||||
pullen <= MTK_PULL_SET_RSEL_111) {
|
||||
rsel = pullen - MTK_PULL_SET_RSEL_000;
|
||||
pullen = 1;
|
||||
}
|
||||
}
|
||||
len += scnprintf(buf + len, bufLen - len,
|
||||
len += scnprintf(buf + len, buf_len - len,
|
||||
"%03d: %1d%1d%1d%1d%02d%1d%1d%1d%1d",
|
||||
gpio,
|
||||
pinmux,
|
||||
|
@ -624,10 +640,12 @@ ssize_t mtk_pctrl_show_one_pin(struct mtk_pinctrl *hw,
|
|||
pullup);
|
||||
|
||||
if (r1 != -1) {
|
||||
len += scnprintf(buf + len, bufLen - len, " (%1d %1d)\n",
|
||||
len += scnprintf(buf + len, buf_len - len, " (%1d %1d)\n",
|
||||
r1, r0);
|
||||
} else if (rsel != -1) {
|
||||
len += scnprintf(buf + len, buf_len - len, " (%1d)\n", rsel);
|
||||
} else {
|
||||
len += scnprintf(buf + len, bufLen - len, "\n");
|
||||
len += scnprintf(buf + len, buf_len - len, "\n");
|
||||
}
|
||||
|
||||
return len;
|
||||
|
@ -970,6 +988,12 @@ int mtk_paris_pinctrl_probe(struct platform_device *pdev,
|
|||
|
||||
hw->nbase = hw->soc->nbase_names;
|
||||
|
||||
if (of_find_property(hw->dev->of_node,
|
||||
"mediatek,rsel_resistance_in_si_unit", NULL))
|
||||
hw->rsel_si_unit = true;
|
||||
else
|
||||
hw->rsel_si_unit = false;
|
||||
|
||||
spin_lock_init(&hw->lock);
|
||||
|
||||
err = mtk_pctrl_build_state(pdev);
|
||||
|
|
|
@ -22,7 +22,6 @@ if (ARCH_U8500 || ARCH_NOMADIK)
|
|||
|
||||
config PINCTRL_NOMADIK
|
||||
bool "Nomadik pin controller driver"
|
||||
depends on ARCH_U8500 || ARCH_NOMADIK
|
||||
depends on OF && GPIOLIB
|
||||
select PINMUX
|
||||
select PINCONF
|
||||
|
|
|
@ -0,0 +1,534 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Apple SoC pinctrl+GPIO+external IRQ driver
|
||||
*
|
||||
* Copyright (C) The Asahi Linux Contributors
|
||||
* Copyright (C) 2020 Corellium LLC
|
||||
*
|
||||
* Based on: pinctrl-pistachio.c
|
||||
* Copyright (C) 2014 Imagination Technologies Ltd.
|
||||
* Copyright (C) 2014 Google, Inc.
|
||||
*/
|
||||
|
||||
#include <dt-bindings/pinctrl/apple.h>
|
||||
#include <linux/gpio/driver.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
#include <linux/pinctrl/pinmux.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/regmap.h>
|
||||
|
||||
#include "pinctrl-utils.h"
|
||||
#include "core.h"
|
||||
#include "pinmux.h"
|
||||
|
||||
struct apple_gpio_pinctrl {
|
||||
struct device *dev;
|
||||
struct pinctrl_dev *pctldev;
|
||||
|
||||
void __iomem *base;
|
||||
struct regmap *map;
|
||||
|
||||
struct pinctrl_desc pinctrl_desc;
|
||||
struct gpio_chip gpio_chip;
|
||||
struct irq_chip irq_chip;
|
||||
u8 irqgrps[0];
|
||||
};
|
||||
|
||||
#define REG_GPIO(x) (4 * (x))
|
||||
#define REG_GPIOx_DATA BIT(0)
|
||||
#define REG_GPIOx_MODE GENMASK(3, 1)
|
||||
#define REG_GPIOx_OUT 1
|
||||
#define REG_GPIOx_IN_IRQ_HI 2
|
||||
#define REG_GPIOx_IN_IRQ_LO 3
|
||||
#define REG_GPIOx_IN_IRQ_UP 4
|
||||
#define REG_GPIOx_IN_IRQ_DN 5
|
||||
#define REG_GPIOx_IN_IRQ_ANY 6
|
||||
#define REG_GPIOx_IN_IRQ_OFF 7
|
||||
#define REG_GPIOx_PERIPH GENMASK(6, 5)
|
||||
#define REG_GPIOx_PULL GENMASK(8, 7)
|
||||
#define REG_GPIOx_PULL_OFF 0
|
||||
#define REG_GPIOx_PULL_DOWN 1
|
||||
#define REG_GPIOx_PULL_UP_STRONG 2
|
||||
#define REG_GPIOx_PULL_UP 3
|
||||
#define REG_GPIOx_INPUT_ENABLE BIT(9)
|
||||
#define REG_GPIOx_DRIVE_STRENGTH0 GENMASK(11, 10)
|
||||
#define REG_GPIOx_SCHMITT BIT(15)
|
||||
#define REG_GPIOx_GRP GENMASK(18, 16)
|
||||
#define REG_GPIOx_LOCK BIT(21)
|
||||
#define REG_GPIOx_DRIVE_STRENGTH1 GENMASK(23, 22)
|
||||
#define REG_IRQ(g, x) (0x800 + 0x40 * (g) + 4 * ((x) >> 5))
|
||||
|
||||
struct regmap_config regmap_config = {
|
||||
.reg_bits = 32,
|
||||
.val_bits = 32,
|
||||
.reg_stride = 4,
|
||||
.cache_type = REGCACHE_FLAT,
|
||||
.max_register = 512 * sizeof(u32),
|
||||
.num_reg_defaults_raw = 512,
|
||||
.use_relaxed_mmio = true
|
||||
};
|
||||
|
||||
// No locking needed to mask/unmask IRQs as the interrupt mode is per pin-register.
|
||||
static void apple_gpio_set_reg(struct apple_gpio_pinctrl *pctl,
|
||||
unsigned int pin, u32 mask, u32 value)
|
||||
{
|
||||
regmap_update_bits(pctl->map, REG_GPIO(pin), mask, value);
|
||||
}
|
||||
|
||||
static uint32_t apple_gpio_get_reg(struct apple_gpio_pinctrl *pctl,
|
||||
unsigned int pin)
|
||||
{
|
||||
unsigned int val = 0;
|
||||
|
||||
regmap_read(pctl->map, REG_GPIO(pin), &val);
|
||||
return val;
|
||||
}
|
||||
|
||||
/* Pin controller functions */
|
||||
|
||||
static int apple_gpio_dt_node_to_map(struct pinctrl_dev *pctldev,
|
||||
struct device_node *node,
|
||||
struct pinctrl_map **map,
|
||||
unsigned *num_maps)
|
||||
{
|
||||
unsigned reserved_maps;
|
||||
struct apple_gpio_pinctrl *pctl;
|
||||
u32 pinfunc, pin, func;
|
||||
int num_pins, i, ret;
|
||||
const char *group_name;
|
||||
const char *function_name;
|
||||
|
||||
*map = NULL;
|
||||
*num_maps = 0;
|
||||
reserved_maps = 0;
|
||||
|
||||
pctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
ret = of_property_count_u32_elems(node, "pinmux");
|
||||
if (ret <= 0) {
|
||||
dev_err(pctl->dev,
|
||||
"missing or empty pinmux property in node %pOFn.\n",
|
||||
node);
|
||||
return ret;
|
||||
}
|
||||
|
||||
num_pins = ret;
|
||||
|
||||
ret = pinctrl_utils_reserve_map(pctldev, map, &reserved_maps, num_maps,
|
||||
num_pins);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
for (i = 0; i < num_pins; i++) {
|
||||
ret = of_property_read_u32_index(node, "pinmux", i, &pinfunc);
|
||||
if (ret)
|
||||
goto free_map;
|
||||
|
||||
pin = APPLE_PIN(pinfunc);
|
||||
func = APPLE_FUNC(pinfunc);
|
||||
|
||||
if (func >= pinmux_generic_get_function_count(pctldev)) {
|
||||
ret = -EINVAL;
|
||||
goto free_map;
|
||||
}
|
||||
|
||||
group_name = pinctrl_generic_get_group_name(pctldev, pin);
|
||||
function_name =
|
||||
pinmux_generic_get_function_name(pctl->pctldev, func);
|
||||
ret = pinctrl_utils_add_map_mux(pctl->pctldev, map,
|
||||
&reserved_maps, num_maps,
|
||||
group_name, function_name);
|
||||
if (ret)
|
||||
goto free_map;
|
||||
}
|
||||
|
||||
free_map:
|
||||
if (ret < 0)
|
||||
pinctrl_utils_free_map(pctldev, *map, *num_maps);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct pinctrl_ops apple_gpio_pinctrl_ops = {
|
||||
.get_groups_count = pinctrl_generic_get_group_count,
|
||||
.get_group_name = pinctrl_generic_get_group_name,
|
||||
.get_group_pins = pinctrl_generic_get_group_pins,
|
||||
.dt_node_to_map = apple_gpio_dt_node_to_map,
|
||||
.dt_free_map = pinctrl_utils_free_map,
|
||||
};
|
||||
|
||||
/* Pin multiplexer functions */
|
||||
|
||||
static int apple_gpio_pinmux_set(struct pinctrl_dev *pctldev, unsigned func,
|
||||
unsigned group)
|
||||
{
|
||||
struct apple_gpio_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
apple_gpio_set_reg(
|
||||
pctl, group, REG_GPIOx_PERIPH | REG_GPIOx_INPUT_ENABLE,
|
||||
FIELD_PREP(REG_GPIOx_PERIPH, func) | REG_GPIOx_INPUT_ENABLE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct pinmux_ops apple_gpio_pinmux_ops = {
|
||||
.get_functions_count = pinmux_generic_get_function_count,
|
||||
.get_function_name = pinmux_generic_get_function_name,
|
||||
.get_function_groups = pinmux_generic_get_function_groups,
|
||||
.set_mux = apple_gpio_pinmux_set,
|
||||
.strict = true,
|
||||
};
|
||||
|
||||
/* GPIO chip functions */
|
||||
|
||||
static int apple_gpio_get_direction(struct gpio_chip *chip,
|
||||
unsigned int offset)
|
||||
{
|
||||
struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip);
|
||||
unsigned int reg = apple_gpio_get_reg(pctl, offset);
|
||||
|
||||
return (FIELD_GET(REG_GPIOx_MODE, reg) == REG_GPIOx_OUT) ?
|
||||
GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN;
|
||||
}
|
||||
|
||||
static int apple_gpio_get(struct gpio_chip *chip, unsigned offset)
|
||||
{
|
||||
struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip);
|
||||
unsigned int reg = apple_gpio_get_reg(pctl, offset);
|
||||
|
||||
/*
|
||||
* If this is an input GPIO, read the actual value (not the
|
||||
* cached regmap value)
|
||||
*/
|
||||
if (FIELD_GET(REG_GPIOx_MODE, reg) != REG_GPIOx_OUT)
|
||||
reg = readl_relaxed(pctl->base + REG_GPIO(offset));
|
||||
|
||||
return !!(reg & REG_GPIOx_DATA);
|
||||
}
|
||||
|
||||
static void apple_gpio_set(struct gpio_chip *chip, unsigned int offset,
|
||||
int value)
|
||||
{
|
||||
struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip);
|
||||
|
||||
apple_gpio_set_reg(pctl, offset, REG_GPIOx_DATA,
|
||||
value ? REG_GPIOx_DATA : 0);
|
||||
}
|
||||
|
||||
static int apple_gpio_direction_input(struct gpio_chip *chip,
|
||||
unsigned int offset)
|
||||
{
|
||||
struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip);
|
||||
|
||||
apple_gpio_set_reg(pctl, offset,
|
||||
REG_GPIOx_PERIPH | REG_GPIOx_MODE | REG_GPIOx_DATA |
|
||||
REG_GPIOx_INPUT_ENABLE,
|
||||
FIELD_PREP(REG_GPIOx_MODE, REG_GPIOx_IN_IRQ_OFF) |
|
||||
REG_GPIOx_INPUT_ENABLE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int apple_gpio_direction_output(struct gpio_chip *chip,
|
||||
unsigned int offset, int value)
|
||||
{
|
||||
struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip);
|
||||
|
||||
apple_gpio_set_reg(pctl, offset,
|
||||
REG_GPIOx_PERIPH | REG_GPIOx_MODE | REG_GPIOx_DATA,
|
||||
FIELD_PREP(REG_GPIOx_MODE, REG_GPIOx_OUT) |
|
||||
(value ? REG_GPIOx_DATA : 0));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* IRQ chip functions */
|
||||
|
||||
static void apple_gpio_irq_ack(struct irq_data *data)
|
||||
{
|
||||
struct apple_gpio_pinctrl *pctl =
|
||||
gpiochip_get_data(irq_data_get_irq_chip_data(data));
|
||||
unsigned int irqgrp =
|
||||
FIELD_GET(REG_GPIOx_GRP, apple_gpio_get_reg(pctl, data->hwirq));
|
||||
|
||||
writel(BIT(data->hwirq & 31),
|
||||
pctl->base + REG_IRQ(irqgrp, data->hwirq));
|
||||
}
|
||||
|
||||
static int apple_gpio_irq_type(unsigned int type)
|
||||
{
|
||||
switch (type & IRQ_TYPE_SENSE_MASK) {
|
||||
case IRQ_TYPE_EDGE_RISING:
|
||||
return REG_GPIOx_IN_IRQ_UP;
|
||||
case IRQ_TYPE_EDGE_FALLING:
|
||||
return REG_GPIOx_IN_IRQ_DN;
|
||||
case IRQ_TYPE_EDGE_BOTH:
|
||||
return REG_GPIOx_IN_IRQ_ANY;
|
||||
case IRQ_TYPE_LEVEL_HIGH:
|
||||
return REG_GPIOx_IN_IRQ_HI;
|
||||
case IRQ_TYPE_LEVEL_LOW:
|
||||
return REG_GPIOx_IN_IRQ_LO;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
static void apple_gpio_irq_mask(struct irq_data *data)
|
||||
{
|
||||
struct apple_gpio_pinctrl *pctl =
|
||||
gpiochip_get_data(irq_data_get_irq_chip_data(data));
|
||||
apple_gpio_set_reg(pctl, data->hwirq, REG_GPIOx_MODE,
|
||||
FIELD_PREP(REG_GPIOx_MODE, REG_GPIOx_IN_IRQ_OFF));
|
||||
}
|
||||
|
||||
static void apple_gpio_irq_unmask(struct irq_data *data)
|
||||
{
|
||||
struct apple_gpio_pinctrl *pctl =
|
||||
gpiochip_get_data(irq_data_get_irq_chip_data(data));
|
||||
int irqtype = apple_gpio_irq_type(irqd_get_trigger_type(data));
|
||||
|
||||
apple_gpio_set_reg(pctl, data->hwirq, REG_GPIOx_MODE,
|
||||
FIELD_PREP(REG_GPIOx_MODE, irqtype));
|
||||
}
|
||||
|
||||
static unsigned int apple_gpio_irq_startup(struct irq_data *data)
|
||||
{
|
||||
struct gpio_chip *chip = irq_data_get_irq_chip_data(data);
|
||||
struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip);
|
||||
|
||||
apple_gpio_set_reg(pctl, data->hwirq, REG_GPIOx_GRP,
|
||||
FIELD_PREP(REG_GPIOx_GRP, 0));
|
||||
|
||||
apple_gpio_direction_input(chip, data->hwirq);
|
||||
apple_gpio_irq_unmask(data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int apple_gpio_irq_set_type(struct irq_data *data,
|
||||
unsigned int type)
|
||||
{
|
||||
struct apple_gpio_pinctrl *pctl =
|
||||
gpiochip_get_data(irq_data_get_irq_chip_data(data));
|
||||
int irqtype = apple_gpio_irq_type(type);
|
||||
|
||||
if (irqtype < 0)
|
||||
return irqtype;
|
||||
|
||||
apple_gpio_set_reg(pctl, data->hwirq, REG_GPIOx_MODE,
|
||||
FIELD_PREP(REG_GPIOx_MODE, irqtype));
|
||||
|
||||
if (type & IRQ_TYPE_LEVEL_MASK)
|
||||
irq_set_handler_locked(data, handle_level_irq);
|
||||
else
|
||||
irq_set_handler_locked(data, handle_edge_irq);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void apple_gpio_irq_handler(struct irq_desc *desc)
|
||||
{
|
||||
struct irq_chip *chip = irq_desc_get_chip(desc);
|
||||
u8 *grpp = irq_desc_get_handler_data(desc);
|
||||
struct apple_gpio_pinctrl *pctl;
|
||||
unsigned int pinh, pinl;
|
||||
unsigned long pending;
|
||||
struct gpio_chip *gc;
|
||||
|
||||
pctl = container_of(grpp - *grpp, typeof(*pctl), irqgrps[0]);
|
||||
gc = &pctl->gpio_chip;
|
||||
|
||||
chained_irq_enter(chip, desc);
|
||||
for (pinh = 0; pinh < gc->ngpio; pinh += 32) {
|
||||
pending = readl_relaxed(pctl->base + REG_IRQ(*grpp, pinh));
|
||||
for_each_set_bit(pinl, &pending, 32)
|
||||
generic_handle_domain_irq(gc->irq.domain, pinh + pinl);
|
||||
}
|
||||
chained_irq_exit(chip, desc);
|
||||
}
|
||||
|
||||
static struct irq_chip apple_gpio_irqchip = {
|
||||
.name = "Apple-GPIO",
|
||||
.irq_startup = apple_gpio_irq_startup,
|
||||
.irq_ack = apple_gpio_irq_ack,
|
||||
.irq_mask = apple_gpio_irq_mask,
|
||||
.irq_unmask = apple_gpio_irq_unmask,
|
||||
.irq_set_type = apple_gpio_irq_set_type,
|
||||
};
|
||||
|
||||
/* Probe & register */
|
||||
|
||||
static int apple_gpio_register(struct apple_gpio_pinctrl *pctl)
|
||||
{
|
||||
struct gpio_irq_chip *girq = &pctl->gpio_chip.irq;
|
||||
void **irq_data = NULL;
|
||||
int ret;
|
||||
|
||||
if (!of_property_read_bool(pctl->dev->of_node, "gpio-controller"))
|
||||
return dev_err_probe(pctl->dev, -ENODEV,
|
||||
"No gpio-controller property\n");
|
||||
|
||||
pctl->irq_chip = apple_gpio_irqchip;
|
||||
|
||||
pctl->gpio_chip.label = dev_name(pctl->dev);
|
||||
pctl->gpio_chip.request = gpiochip_generic_request;
|
||||
pctl->gpio_chip.free = gpiochip_generic_free;
|
||||
pctl->gpio_chip.get_direction = apple_gpio_get_direction;
|
||||
pctl->gpio_chip.direction_input = apple_gpio_direction_input;
|
||||
pctl->gpio_chip.direction_output = apple_gpio_direction_output;
|
||||
pctl->gpio_chip.get = apple_gpio_get;
|
||||
pctl->gpio_chip.set = apple_gpio_set;
|
||||
pctl->gpio_chip.base = -1;
|
||||
pctl->gpio_chip.ngpio = pctl->pinctrl_desc.npins;
|
||||
pctl->gpio_chip.parent = pctl->dev;
|
||||
pctl->gpio_chip.of_node = pctl->dev->of_node;
|
||||
|
||||
if (girq->num_parents) {
|
||||
int i;
|
||||
|
||||
girq->chip = &pctl->irq_chip;
|
||||
girq->parent_handler = apple_gpio_irq_handler;
|
||||
|
||||
girq->parents = kmalloc_array(girq->num_parents,
|
||||
sizeof(*girq->parents),
|
||||
GFP_KERNEL);
|
||||
irq_data = kmalloc_array(girq->num_parents, sizeof(*irq_data),
|
||||
GFP_KERNEL);
|
||||
if (!girq->parents || !irq_data) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
for (i = 0; i < girq->num_parents; i++) {
|
||||
ret = platform_get_irq(to_platform_device(pctl->dev),
|
||||
i);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
||||
girq->parents[i] = ret;
|
||||
pctl->irqgrps[i] = i;
|
||||
irq_data[i] = &pctl->irqgrps[i];
|
||||
}
|
||||
|
||||
girq->parent_handler_data_array = irq_data;
|
||||
girq->per_parent_data = true;
|
||||
girq->default_type = IRQ_TYPE_NONE;
|
||||
girq->handler = handle_level_irq;
|
||||
}
|
||||
|
||||
ret = devm_gpiochip_add_data(pctl->dev, &pctl->gpio_chip, pctl);
|
||||
out:
|
||||
kfree(girq->parents);
|
||||
kfree(irq_data);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int apple_gpio_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct apple_gpio_pinctrl *pctl;
|
||||
struct pinctrl_pin_desc *pins;
|
||||
unsigned int npins;
|
||||
const char **pin_names;
|
||||
unsigned int *pin_nums;
|
||||
static const char* pinmux_functions[] = {
|
||||
"gpio", "periph1", "periph2", "periph3"
|
||||
};
|
||||
unsigned int i, nirqs = 0;
|
||||
int res;
|
||||
|
||||
if (of_property_read_bool(pdev->dev.of_node, "interrupt-controller")) {
|
||||
res = platform_irq_count(pdev);
|
||||
if (res > 0)
|
||||
nirqs = res;
|
||||
}
|
||||
|
||||
pctl = devm_kzalloc(&pdev->dev, struct_size(pctl, irqgrps, nirqs),
|
||||
GFP_KERNEL);
|
||||
if (!pctl)
|
||||
return -ENOMEM;
|
||||
pctl->dev = &pdev->dev;
|
||||
pctl->gpio_chip.irq.num_parents = nirqs;
|
||||
dev_set_drvdata(&pdev->dev, pctl);
|
||||
|
||||
if (of_property_read_u32(pdev->dev.of_node, "apple,npins", &npins))
|
||||
return dev_err_probe(&pdev->dev, -EINVAL,
|
||||
"apple,npins property not found\n");
|
||||
|
||||
pins = devm_kmalloc_array(&pdev->dev, npins, sizeof(pins[0]),
|
||||
GFP_KERNEL);
|
||||
pin_names = devm_kmalloc_array(&pdev->dev, npins, sizeof(pin_names[0]),
|
||||
GFP_KERNEL);
|
||||
pin_nums = devm_kmalloc_array(&pdev->dev, npins, sizeof(pin_nums[0]),
|
||||
GFP_KERNEL);
|
||||
if (!pins || !pin_names || !pin_nums)
|
||||
return -ENOMEM;
|
||||
|
||||
pctl->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(pctl->base))
|
||||
return PTR_ERR(pctl->base);
|
||||
|
||||
pctl->map = devm_regmap_init_mmio(&pdev->dev, pctl->base, ®map_config);
|
||||
if (IS_ERR(pctl->map))
|
||||
return dev_err_probe(&pdev->dev, PTR_ERR(pctl->map),
|
||||
"Failed to create regmap\n");
|
||||
|
||||
for (i = 0; i < npins; i++) {
|
||||
pins[i].number = i;
|
||||
pins[i].name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "PIN%u", i);
|
||||
pins[i].drv_data = pctl;
|
||||
pin_names[i] = pins[i].name;
|
||||
pin_nums[i] = i;
|
||||
}
|
||||
|
||||
pctl->pinctrl_desc.name = dev_name(pctl->dev);
|
||||
pctl->pinctrl_desc.pins = pins;
|
||||
pctl->pinctrl_desc.npins = npins;
|
||||
pctl->pinctrl_desc.pctlops = &apple_gpio_pinctrl_ops;
|
||||
pctl->pinctrl_desc.pmxops = &apple_gpio_pinmux_ops;
|
||||
|
||||
pctl->pctldev = devm_pinctrl_register(&pdev->dev, &pctl->pinctrl_desc, pctl);
|
||||
if (IS_ERR(pctl->pctldev))
|
||||
return dev_err_probe(&pdev->dev, PTR_ERR(pctl->pctldev),
|
||||
"Failed to register pinctrl device.\n");
|
||||
|
||||
for (i = 0; i < npins; i++) {
|
||||
res = pinctrl_generic_add_group(pctl->pctldev, pins[i].name,
|
||||
pin_nums + i, 1, pctl);
|
||||
if (res < 0)
|
||||
return dev_err_probe(pctl->dev, res,
|
||||
"Failed to register group");
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(pinmux_functions); ++i) {
|
||||
res = pinmux_generic_add_function(pctl->pctldev, pinmux_functions[i],
|
||||
pin_names, npins, pctl);
|
||||
if (res < 0)
|
||||
return dev_err_probe(pctl->dev, res,
|
||||
"Failed to register function.");
|
||||
}
|
||||
|
||||
return apple_gpio_register(pctl);
|
||||
}
|
||||
|
||||
static const struct of_device_id apple_gpio_pinctrl_of_match[] = {
|
||||
{ .compatible = "apple,pinctrl", },
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct platform_driver apple_gpio_pinctrl_driver = {
|
||||
.driver = {
|
||||
.name = "apple-gpio-pinctrl",
|
||||
.of_match_table = apple_gpio_pinctrl_of_match,
|
||||
.suppress_bind_attrs = true,
|
||||
},
|
||||
.probe = apple_gpio_pinctrl_probe,
|
||||
};
|
||||
module_platform_driver(apple_gpio_pinctrl_driver);
|
||||
|
||||
MODULE_DESCRIPTION("Apple pinctrl/GPIO driver");
|
||||
MODULE_AUTHOR("Stan Skowronek <stan@corellium.com>");
|
||||
MODULE_AUTHOR("Joey Gouly <joey.gouly@arm.com>");
|
||||
MODULE_LICENSE("GPL v2");
|
|
@ -675,6 +675,11 @@ static int eqbr_build_functions(struct eqbr_pinctrl_drv_data *drvdata)
|
|||
return ret;
|
||||
|
||||
for (i = 0; i < nr_funcs; i++) {
|
||||
|
||||
/* Ignore the same function with multiple groups */
|
||||
if (funcs[i].name == NULL)
|
||||
continue;
|
||||
|
||||
ret = pinmux_generic_add_function(drvdata->pctl_dev,
|
||||
funcs[i].name,
|
||||
funcs[i].groups,
|
||||
|
@ -815,7 +820,7 @@ static int pinctrl_reg(struct eqbr_pinctrl_drv_data *drvdata)
|
|||
|
||||
ret = eqbr_build_functions(drvdata);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to build groups\n");
|
||||
dev_err(dev, "Failed to build functions\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -412,7 +412,7 @@ static const struct pinctrl_pin_desc gemini_3512_pins[] = {
|
|||
PINCTRL_PIN(249, "P16 GPIO0 17"),
|
||||
PINCTRL_PIN(250, "P17 GPIO0 18"),
|
||||
PINCTRL_PIN(251, "P18 GPIO0 19"),
|
||||
/* Row R (for some reason Q us skipped) */
|
||||
/* Row R (for some reason Q is skipped) */
|
||||
PINCTRL_PIN(252, "R1 IDE DD6"),
|
||||
PINCTRL_PIN(253, "R2 IDE DD8"),
|
||||
PINCTRL_PIN(254, "R3 IDE DD7"),
|
||||
|
@ -1306,7 +1306,7 @@ static const struct pinctrl_pin_desc gemini_3516_pins[] = {
|
|||
PINCTRL_PIN(277, "P18 PCI AD1"),
|
||||
PINCTRL_PIN(278, "P19 PCI AD3"),
|
||||
PINCTRL_PIN(279, "P20 PCI AD5"),
|
||||
/* Row R (for some reason Q us skipped) */
|
||||
/* Row R (for some reason Q is skipped) */
|
||||
PINCTRL_PIN(280, "R1 IDE DD13"),
|
||||
PINCTRL_PIN(281, "R2 IDE DD12"),
|
||||
PINCTRL_PIN(282, "R3 IDE DD10"),
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <linux/pinctrl/pinmux.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/reset.h>
|
||||
|
||||
#include "core.h"
|
||||
#include "pinconf.h"
|
||||
|
@ -803,6 +804,7 @@ static int microchip_sgpio_probe(struct platform_device *pdev)
|
|||
int div_clock = 0, ret, port, i, nbanks;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct fwnode_handle *fwnode;
|
||||
struct reset_control *reset;
|
||||
struct sgpio_priv *priv;
|
||||
struct clk *clk;
|
||||
u32 val;
|
||||
|
@ -813,6 +815,11 @@ static int microchip_sgpio_probe(struct platform_device *pdev)
|
|||
|
||||
priv->dev = dev;
|
||||
|
||||
reset = devm_reset_control_get_optional_shared(&pdev->dev, "switch");
|
||||
if (IS_ERR(reset))
|
||||
return dev_err_probe(dev, PTR_ERR(reset), "Failed to get reset\n");
|
||||
reset_control_reset(reset);
|
||||
|
||||
clk = devm_clk_get(dev, NULL);
|
||||
if (IS_ERR(clk))
|
||||
return dev_err_probe(dev, PTR_ERR(clk), "Failed to get clock\n");
|
||||
|
|
|
@ -1588,7 +1588,7 @@ static int st_pctl_probe_dt(struct platform_device *pdev,
|
|||
|
||||
st_pctl_dt_child_count(info, np);
|
||||
if (!info->nbanks) {
|
||||
dev_err(&pdev->dev, "you need atleast one gpio bank\n");
|
||||
dev_err(&pdev->dev, "you need at least one gpio bank\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
@ -166,6 +166,14 @@ config PINCTRL_MSM8998
|
|||
This is the pinctrl, pinmux, pinconf and gpiolib driver for the
|
||||
Qualcomm TLMM block found in the Qualcomm MSM8998 platform.
|
||||
|
||||
config PINCTRL_QCM2290
|
||||
tristate "Qualcomm QCM2290 pin controller driver"
|
||||
depends on OF
|
||||
depends on PINCTRL_MSM
|
||||
help
|
||||
This is the pinctrl, pinmux, pinconf and gpiolib driver for the
|
||||
TLMM block found in the Qualcomm QCM2290 platform.
|
||||
|
||||
config PINCTRL_QCS404
|
||||
tristate "Qualcomm QCS404 pin controller driver"
|
||||
depends on OF
|
||||
|
@ -283,6 +291,15 @@ config PINCTRL_SM6125
|
|||
Qualcomm Technologies Inc TLMM block found on the Qualcomm
|
||||
Technologies Inc SM6125 platform.
|
||||
|
||||
config PINCTRL_SM6350
|
||||
tristate "Qualcomm Technologies Inc SM6350 pin controller driver"
|
||||
depends on GPIOLIB && OF
|
||||
depends on PINCTRL_MSM
|
||||
help
|
||||
This is the pinctrl, pinmux, pinconf and gpiolib driver for the
|
||||
Qualcomm Technologies Inc TLMM block found on the Qualcomm
|
||||
Technologies Inc SM6350 platform.
|
||||
|
||||
config PINCTRL_SM8150
|
||||
tristate "Qualcomm Technologies Inc SM8150 pin controller driver"
|
||||
depends on OF
|
||||
|
|
|
@ -17,6 +17,7 @@ obj-$(CONFIG_PINCTRL_MSM8976) += pinctrl-msm8976.o
|
|||
obj-$(CONFIG_PINCTRL_MSM8994) += pinctrl-msm8994.o
|
||||
obj-$(CONFIG_PINCTRL_MSM8996) += pinctrl-msm8996.o
|
||||
obj-$(CONFIG_PINCTRL_MSM8998) += pinctrl-msm8998.o
|
||||
obj-$(CONFIG_PINCTRL_QCM2290) += pinctrl-qcm2290.o
|
||||
obj-$(CONFIG_PINCTRL_QCS404) += pinctrl-qcs404.o
|
||||
obj-$(CONFIG_PINCTRL_QDF2XXX) += pinctrl-qdf2xxx.o
|
||||
obj-$(CONFIG_PINCTRL_MDM9607) += pinctrl-mdm9607.o
|
||||
|
@ -33,6 +34,7 @@ obj-$(CONFIG_PINCTRL_SDM845) += pinctrl-sdm845.o
|
|||
obj-$(CONFIG_PINCTRL_SDX55) += pinctrl-sdx55.o
|
||||
obj-$(CONFIG_PINCTRL_SM6115) += pinctrl-sm6115.o
|
||||
obj-$(CONFIG_PINCTRL_SM6125) += pinctrl-sm6125.o
|
||||
obj-$(CONFIG_PINCTRL_SM6350) += pinctrl-sm6350.o
|
||||
obj-$(CONFIG_PINCTRL_SM8150) += pinctrl-sm8150.o
|
||||
obj-$(CONFIG_PINCTRL_SM8250) += pinctrl-sm8250.o
|
||||
obj-$(CONFIG_PINCTRL_SM8350) += pinctrl-sm8350.o
|
||||
|
|
|
@ -338,26 +338,32 @@ static const unsigned int sdc2_data_pins[] = { 122 };
|
|||
* the pingroup table below.
|
||||
*/
|
||||
enum msm8226_functions {
|
||||
MSM_MUX_gpio,
|
||||
MSM_MUX_cci_i2c0,
|
||||
MSM_MUX_audio_pcm,
|
||||
MSM_MUX_blsp_i2c1,
|
||||
MSM_MUX_blsp_i2c2,
|
||||
MSM_MUX_blsp_i2c3,
|
||||
MSM_MUX_blsp_i2c4,
|
||||
MSM_MUX_blsp_i2c5,
|
||||
MSM_MUX_blsp_spi1,
|
||||
MSM_MUX_blsp_spi2,
|
||||
MSM_MUX_blsp_spi3,
|
||||
MSM_MUX_blsp_spi4,
|
||||
MSM_MUX_blsp_spi5,
|
||||
MSM_MUX_blsp_uart1,
|
||||
MSM_MUX_blsp_uart2,
|
||||
MSM_MUX_blsp_uart3,
|
||||
MSM_MUX_blsp_uart4,
|
||||
MSM_MUX_blsp_uart5,
|
||||
MSM_MUX_blsp_uim1,
|
||||
MSM_MUX_blsp_uim2,
|
||||
MSM_MUX_blsp_uim3,
|
||||
MSM_MUX_blsp_uim4,
|
||||
MSM_MUX_blsp_uim5,
|
||||
MSM_MUX_cam_mclk0,
|
||||
MSM_MUX_cam_mclk1,
|
||||
MSM_MUX_cci_i2c0,
|
||||
MSM_MUX_gpio,
|
||||
MSM_MUX_sdc3,
|
||||
MSM_MUX_wlan,
|
||||
MSM_MUX_NA,
|
||||
};
|
||||
|
@ -382,6 +388,10 @@ static const char * const gpio_groups[] = {
|
|||
"gpio111", "gpio112", "gpio113", "gpio114", "gpio115", "gpio116",
|
||||
};
|
||||
|
||||
static const char * const audio_pcm_groups[] = {
|
||||
"gpio63", "gpio64", "gpio65", "gpio66"
|
||||
};
|
||||
|
||||
static const char * const blsp_uart1_groups[] = {
|
||||
"gpio0", "gpio1", "gpio2", "gpio3"
|
||||
};
|
||||
|
@ -412,6 +422,16 @@ static const char * const blsp_spi3_groups[] = {
|
|||
"gpio8", "gpio9", "gpio10", "gpio11"
|
||||
};
|
||||
|
||||
static const char * const blsp_uart4_groups[] = {
|
||||
"gpio12", "gpio13", "gpio14", "gpio15"
|
||||
};
|
||||
|
||||
static const char * const blsp_uim4_groups[] = { "gpio12", "gpio13" };
|
||||
static const char * const blsp_i2c4_groups[] = { "gpio14", "gpio15" };
|
||||
static const char * const blsp_spi4_groups[] = {
|
||||
"gpio12", "gpio13", "gpio14", "gpio15"
|
||||
};
|
||||
|
||||
static const char * const blsp_uart5_groups[] = {
|
||||
"gpio16", "gpio17", "gpio18", "gpio19"
|
||||
};
|
||||
|
@ -427,31 +447,41 @@ static const char * const cci_i2c0_groups[] = { "gpio29", "gpio30" };
|
|||
static const char * const cam_mclk0_groups[] = { "gpio26" };
|
||||
static const char * const cam_mclk1_groups[] = { "gpio27" };
|
||||
|
||||
static const char * const sdc3_groups[] = {
|
||||
"gpio39", "gpio40", "gpio41", "gpio42", "gpio43", "gpio44"
|
||||
};
|
||||
|
||||
static const char * const wlan_groups[] = {
|
||||
"gpio40", "gpio41", "gpio42", "gpio43", "gpio44"
|
||||
};
|
||||
|
||||
static const struct msm_function msm8226_functions[] = {
|
||||
FUNCTION(gpio),
|
||||
FUNCTION(cci_i2c0),
|
||||
FUNCTION(blsp_uim1),
|
||||
FUNCTION(blsp_uim2),
|
||||
FUNCTION(blsp_uim3),
|
||||
FUNCTION(blsp_uim5),
|
||||
FUNCTION(audio_pcm),
|
||||
FUNCTION(blsp_i2c1),
|
||||
FUNCTION(blsp_i2c2),
|
||||
FUNCTION(blsp_i2c3),
|
||||
FUNCTION(blsp_i2c4),
|
||||
FUNCTION(blsp_i2c5),
|
||||
FUNCTION(blsp_spi1),
|
||||
FUNCTION(blsp_spi2),
|
||||
FUNCTION(blsp_spi3),
|
||||
FUNCTION(blsp_spi4),
|
||||
FUNCTION(blsp_spi5),
|
||||
FUNCTION(blsp_uart1),
|
||||
FUNCTION(blsp_uart2),
|
||||
FUNCTION(blsp_uart3),
|
||||
FUNCTION(blsp_uart4),
|
||||
FUNCTION(blsp_uart5),
|
||||
FUNCTION(blsp_uim1),
|
||||
FUNCTION(blsp_uim2),
|
||||
FUNCTION(blsp_uim3),
|
||||
FUNCTION(blsp_uim4),
|
||||
FUNCTION(blsp_uim5),
|
||||
FUNCTION(cam_mclk0),
|
||||
FUNCTION(cam_mclk1),
|
||||
FUNCTION(cci_i2c0),
|
||||
FUNCTION(gpio),
|
||||
FUNCTION(sdc3),
|
||||
FUNCTION(wlan),
|
||||
};
|
||||
|
||||
|
@ -468,10 +498,10 @@ static const struct msm_pingroup msm8226_groups[] = {
|
|||
PINGROUP(9, blsp_spi3, blsp_uart3, blsp_uim3, NA, NA, NA, NA),
|
||||
PINGROUP(10, blsp_spi3, blsp_uart3, blsp_i2c3, NA, NA, NA, NA),
|
||||
PINGROUP(11, blsp_spi3, blsp_uart3, blsp_i2c3, NA, NA, NA, NA),
|
||||
PINGROUP(12, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(13, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(14, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(15, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(12, blsp_spi4, blsp_uart4, blsp_uim4, NA, NA, NA, NA),
|
||||
PINGROUP(13, blsp_spi4, blsp_uart4, blsp_uim4, NA, NA, NA, NA),
|
||||
PINGROUP(14, blsp_spi4, blsp_uart4, blsp_i2c4, NA, NA, NA, NA),
|
||||
PINGROUP(15, blsp_spi4, blsp_uart4, blsp_i2c4, NA, NA, NA, NA),
|
||||
PINGROUP(16, blsp_spi5, blsp_uart5, blsp_uim5, NA, NA, NA, NA),
|
||||
PINGROUP(17, blsp_spi5, blsp_uart5, blsp_uim5, NA, NA, NA, NA),
|
||||
PINGROUP(18, blsp_spi5, blsp_uart5, blsp_i2c5, NA, NA, NA, NA),
|
||||
|
@ -495,12 +525,12 @@ static const struct msm_pingroup msm8226_groups[] = {
|
|||
PINGROUP(36, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(37, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(38, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(39, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(40, wlan, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(41, wlan, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(42, wlan, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(43, wlan, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(44, wlan, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(39, NA, sdc3, NA, NA, NA, NA, NA),
|
||||
PINGROUP(40, wlan, sdc3, NA, NA, NA, NA, NA),
|
||||
PINGROUP(41, wlan, sdc3, NA, NA, NA, NA, NA),
|
||||
PINGROUP(42, wlan, sdc3, NA, NA, NA, NA, NA),
|
||||
PINGROUP(43, wlan, sdc3, NA, NA, NA, NA, NA),
|
||||
PINGROUP(44, wlan, sdc3, NA, NA, NA, NA, NA),
|
||||
PINGROUP(45, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(46, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(47, NA, NA, NA, NA, NA, NA, NA),
|
||||
|
@ -519,10 +549,10 @@ static const struct msm_pingroup msm8226_groups[] = {
|
|||
PINGROUP(60, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(61, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(62, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(63, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(64, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(65, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(66, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(63, audio_pcm, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(64, audio_pcm, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(65, audio_pcm, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(66, audio_pcm, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(67, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(68, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(69, NA, NA, NA, NA, NA, NA, NA),
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -427,6 +427,9 @@ static int pmic_gpio_config_get(struct pinctrl_dev *pctldev,
|
|||
return -EINVAL;
|
||||
arg = 1;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
arg = pad->output_enabled;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
arg = pad->out_value;
|
||||
break;
|
||||
|
@ -506,6 +509,9 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
pad->input_enabled = arg ? true : false;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
pad->output_enabled = arg ? true : false;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
pad->output_enabled = true;
|
||||
pad->out_value = arg;
|
||||
|
@ -1141,6 +1147,7 @@ static const struct of_device_id pmic_gpio_of_match[] = {
|
|||
{ .compatible = "qcom,pm660l-gpio", .data = (void *) 12 },
|
||||
{ .compatible = "qcom,pm6150-gpio", .data = (void *) 10 },
|
||||
{ .compatible = "qcom,pm6150l-gpio", .data = (void *) 12 },
|
||||
{ .compatible = "qcom,pm6350-gpio", .data = (void *) 9 },
|
||||
{ .compatible = "qcom,pm7325-gpio", .data = (void *) 10 },
|
||||
{ .compatible = "qcom,pm8005-gpio", .data = (void *) 4 },
|
||||
{ .compatible = "qcom,pm8008-gpio", .data = (void *) 2 },
|
||||
|
|
|
@ -103,7 +103,6 @@
|
|||
/**
|
||||
* struct pmic_mpp_pad - keep current MPP settings
|
||||
* @base: Address base in SPMI device.
|
||||
* @irq: IRQ number which this MPP generate.
|
||||
* @is_enabled: Set to false when MPP should be put in high Z state.
|
||||
* @out_value: Cached pin output value.
|
||||
* @output_enabled: Set to true if MPP output logic is enabled.
|
||||
|
@ -121,7 +120,6 @@
|
|||
*/
|
||||
struct pmic_mpp_pad {
|
||||
u16 base;
|
||||
int irq;
|
||||
bool is_enabled;
|
||||
bool out_value;
|
||||
bool output_enabled;
|
||||
|
@ -143,6 +141,7 @@ struct pmic_mpp_state {
|
|||
struct regmap *map;
|
||||
struct pinctrl_dev *ctrl;
|
||||
struct gpio_chip chip;
|
||||
struct irq_chip irq;
|
||||
};
|
||||
|
||||
static const struct pinconf_generic_params pmic_mpp_bindings[] = {
|
||||
|
@ -622,16 +621,6 @@ static int pmic_mpp_of_xlate(struct gpio_chip *chip,
|
|||
return gpio_desc->args[0] - PMIC_MPP_PHYSICAL_OFFSET;
|
||||
}
|
||||
|
||||
static int pmic_mpp_to_irq(struct gpio_chip *chip, unsigned pin)
|
||||
{
|
||||
struct pmic_mpp_state *state = gpiochip_get_data(chip);
|
||||
struct pmic_mpp_pad *pad;
|
||||
|
||||
pad = state->ctrl->desc->pins[pin].drv_data;
|
||||
|
||||
return pad->irq;
|
||||
}
|
||||
|
||||
static void pmic_mpp_dbg_show(struct seq_file *s, struct gpio_chip *chip)
|
||||
{
|
||||
struct pmic_mpp_state *state = gpiochip_get_data(chip);
|
||||
|
@ -651,7 +640,6 @@ static const struct gpio_chip pmic_mpp_gpio_template = {
|
|||
.request = gpiochip_generic_request,
|
||||
.free = gpiochip_generic_free,
|
||||
.of_xlate = pmic_mpp_of_xlate,
|
||||
.to_irq = pmic_mpp_to_irq,
|
||||
.dbg_show = pmic_mpp_dbg_show,
|
||||
};
|
||||
|
||||
|
@ -796,13 +784,53 @@ static int pmic_mpp_populate(struct pmic_mpp_state *state,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pmic_mpp_domain_translate(struct irq_domain *domain,
|
||||
struct irq_fwspec *fwspec,
|
||||
unsigned long *hwirq,
|
||||
unsigned int *type)
|
||||
{
|
||||
struct pmic_mpp_state *state = container_of(domain->host_data,
|
||||
struct pmic_mpp_state,
|
||||
chip);
|
||||
|
||||
if (fwspec->param_count != 2 ||
|
||||
fwspec->param[0] < 1 || fwspec->param[0] > state->chip.ngpio)
|
||||
return -EINVAL;
|
||||
|
||||
*hwirq = fwspec->param[0] - PMIC_MPP_PHYSICAL_OFFSET;
|
||||
*type = fwspec->param[1];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int pmic_mpp_child_offset_to_irq(struct gpio_chip *chip,
|
||||
unsigned int offset)
|
||||
{
|
||||
return offset + PMIC_MPP_PHYSICAL_OFFSET;
|
||||
}
|
||||
|
||||
static int pmic_mpp_child_to_parent_hwirq(struct gpio_chip *chip,
|
||||
unsigned int child_hwirq,
|
||||
unsigned int child_type,
|
||||
unsigned int *parent_hwirq,
|
||||
unsigned int *parent_type)
|
||||
{
|
||||
*parent_hwirq = child_hwirq + 0xc0;
|
||||
*parent_type = child_type;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pmic_mpp_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct irq_domain *parent_domain;
|
||||
struct device_node *parent_node;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct pinctrl_pin_desc *pindesc;
|
||||
struct pinctrl_desc *pctrldesc;
|
||||
struct pmic_mpp_pad *pad, *pads;
|
||||
struct pmic_mpp_state *state;
|
||||
struct gpio_irq_chip *girq;
|
||||
int ret, npins, i;
|
||||
u32 reg;
|
||||
|
||||
|
@ -812,11 +840,7 @@ static int pmic_mpp_probe(struct platform_device *pdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
npins = platform_irq_count(pdev);
|
||||
if (!npins)
|
||||
return -EINVAL;
|
||||
if (npins < 0)
|
||||
return npins;
|
||||
npins = (uintptr_t) device_get_match_data(&pdev->dev);
|
||||
|
||||
BUG_ON(npins > ARRAY_SIZE(pmic_mpp_groups));
|
||||
|
||||
|
@ -861,10 +885,6 @@ static int pmic_mpp_probe(struct platform_device *pdev)
|
|||
pindesc->number = i;
|
||||
pindesc->name = pmic_mpp_groups[i];
|
||||
|
||||
pad->irq = platform_get_irq(pdev, i);
|
||||
if (pad->irq < 0)
|
||||
return pad->irq;
|
||||
|
||||
pad->base = reg + i * PMIC_MPP_ADDRESS_RANGE;
|
||||
|
||||
ret = pmic_mpp_populate(state, pad);
|
||||
|
@ -884,6 +904,34 @@ static int pmic_mpp_probe(struct platform_device *pdev)
|
|||
if (IS_ERR(state->ctrl))
|
||||
return PTR_ERR(state->ctrl);
|
||||
|
||||
parent_node = of_irq_find_parent(state->dev->of_node);
|
||||
if (!parent_node)
|
||||
return -ENXIO;
|
||||
|
||||
parent_domain = irq_find_host(parent_node);
|
||||
of_node_put(parent_node);
|
||||
if (!parent_domain)
|
||||
return -ENXIO;
|
||||
|
||||
state->irq.name = "spmi-mpp",
|
||||
state->irq.irq_ack = irq_chip_ack_parent,
|
||||
state->irq.irq_mask = irq_chip_mask_parent,
|
||||
state->irq.irq_unmask = irq_chip_unmask_parent,
|
||||
state->irq.irq_set_type = irq_chip_set_type_parent,
|
||||
state->irq.irq_set_wake = irq_chip_set_wake_parent,
|
||||
state->irq.flags = IRQCHIP_MASK_ON_SUSPEND,
|
||||
|
||||
girq = &state->chip.irq;
|
||||
girq->chip = &state->irq;
|
||||
girq->default_type = IRQ_TYPE_NONE;
|
||||
girq->handler = handle_level_irq;
|
||||
girq->fwnode = of_node_to_fwnode(state->dev->of_node);
|
||||
girq->parent_domain = parent_domain;
|
||||
girq->child_to_parent_hwirq = pmic_mpp_child_to_parent_hwirq;
|
||||
girq->populate_parent_alloc_arg = gpiochip_populate_parent_fwspec_fourcell;
|
||||
girq->child_offset_to_irq = pmic_mpp_child_offset_to_irq;
|
||||
girq->child_irq_domain_ops.translate = pmic_mpp_domain_translate;
|
||||
|
||||
ret = gpiochip_add_data(&state->chip, state);
|
||||
if (ret) {
|
||||
dev_err(state->dev, "can't add gpio chip\n");
|
||||
|
@ -912,16 +960,15 @@ static int pmic_mpp_remove(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
static const struct of_device_id pmic_mpp_of_match[] = {
|
||||
{ .compatible = "qcom,pm8019-mpp" }, /* 6 MPP's */
|
||||
{ .compatible = "qcom,pm8841-mpp" }, /* 4 MPP's */
|
||||
{ .compatible = "qcom,pm8916-mpp" }, /* 4 MPP's */
|
||||
{ .compatible = "qcom,pm8941-mpp" }, /* 8 MPP's */
|
||||
{ .compatible = "qcom,pm8950-mpp" }, /* 4 MPP's */
|
||||
{ .compatible = "qcom,pmi8950-mpp" }, /* 4 MPP's */
|
||||
{ .compatible = "qcom,pm8994-mpp" }, /* 8 MPP's */
|
||||
{ .compatible = "qcom,pma8084-mpp" }, /* 8 MPP's */
|
||||
{ .compatible = "qcom,pmi8994-mpp" }, /* 4 MPP's */
|
||||
{ .compatible = "qcom,spmi-mpp" }, /* Generic */
|
||||
{ .compatible = "qcom,pm8019-mpp", .data = (void *) 6 },
|
||||
{ .compatible = "qcom,pm8841-mpp", .data = (void *) 4 },
|
||||
{ .compatible = "qcom,pm8916-mpp", .data = (void *) 4 },
|
||||
{ .compatible = "qcom,pm8941-mpp", .data = (void *) 8 },
|
||||
{ .compatible = "qcom,pm8950-mpp", .data = (void *) 4 },
|
||||
{ .compatible = "qcom,pmi8950-mpp", .data = (void *) 4 },
|
||||
{ .compatible = "qcom,pm8994-mpp", .data = (void *) 8 },
|
||||
{ .compatible = "qcom,pma8084-mpp", .data = (void *) 8 },
|
||||
{ .compatible = "qcom,pmi8994-mpp", .data = (void *) 4 },
|
||||
{ },
|
||||
};
|
||||
|
||||
|
|
|
@ -87,7 +87,6 @@
|
|||
/**
|
||||
* struct pm8xxx_pin_data - dynamic configuration for a pin
|
||||
* @reg: address of the control register
|
||||
* @irq: IRQ from the PMIC interrupt controller
|
||||
* @mode: operating mode for the pin (digital, analog or current sink)
|
||||
* @input: pin is input
|
||||
* @output: pin is output
|
||||
|
@ -103,7 +102,6 @@
|
|||
*/
|
||||
struct pm8xxx_pin_data {
|
||||
unsigned reg;
|
||||
int irq;
|
||||
|
||||
u8 mode;
|
||||
|
||||
|
@ -126,6 +124,7 @@ struct pm8xxx_mpp {
|
|||
struct regmap *regmap;
|
||||
struct pinctrl_dev *pctrl;
|
||||
struct gpio_chip chip;
|
||||
struct irq_chip irq;
|
||||
|
||||
struct pinctrl_desc desc;
|
||||
unsigned npins;
|
||||
|
@ -148,6 +147,8 @@ static const struct pin_config_item pm8xxx_conf_items[] = {
|
|||
#endif
|
||||
|
||||
#define PM8XXX_MAX_MPPS 12
|
||||
#define PM8XXX_MPP_PHYSICAL_OFFSET 1
|
||||
|
||||
static const char * const pm8xxx_groups[PM8XXX_MAX_MPPS] = {
|
||||
"mpp1", "mpp2", "mpp3", "mpp4", "mpp5", "mpp6", "mpp7", "mpp8",
|
||||
"mpp9", "mpp10", "mpp11", "mpp12",
|
||||
|
@ -492,12 +493,16 @@ static int pm8xxx_mpp_get(struct gpio_chip *chip, unsigned offset)
|
|||
struct pm8xxx_mpp *pctrl = gpiochip_get_data(chip);
|
||||
struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data;
|
||||
bool state;
|
||||
int ret;
|
||||
int ret, irq;
|
||||
|
||||
if (!pin->input)
|
||||
return !!pin->output_value;
|
||||
|
||||
ret = irq_get_irqchip_state(pin->irq, IRQCHIP_STATE_LINE_LEVEL, &state);
|
||||
irq = chip->to_irq(chip, offset);
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
|
||||
ret = irq_get_irqchip_state(irq, IRQCHIP_STATE_LINE_LEVEL, &state);
|
||||
if (!ret)
|
||||
ret = !!state;
|
||||
|
||||
|
@ -524,18 +529,10 @@ static int pm8xxx_mpp_of_xlate(struct gpio_chip *chip,
|
|||
if (flags)
|
||||
*flags = gpio_desc->args[1];
|
||||
|
||||
return gpio_desc->args[0] - 1;
|
||||
return gpio_desc->args[0] - PM8XXX_MPP_PHYSICAL_OFFSET;
|
||||
}
|
||||
|
||||
|
||||
static int pm8xxx_mpp_to_irq(struct gpio_chip *chip, unsigned offset)
|
||||
{
|
||||
struct pm8xxx_mpp *pctrl = gpiochip_get_data(chip);
|
||||
struct pm8xxx_pin_data *pin = pctrl->desc.pins[offset].drv_data;
|
||||
|
||||
return pin->irq;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
#include <linux/seq_file.h>
|
||||
|
||||
|
@ -558,7 +555,7 @@ static void pm8xxx_mpp_dbg_show_one(struct seq_file *s,
|
|||
"abus3",
|
||||
};
|
||||
|
||||
seq_printf(s, " mpp%-2d:", offset + 1);
|
||||
seq_printf(s, " mpp%-2d:", offset + PM8XXX_MPP_PHYSICAL_OFFSET);
|
||||
|
||||
switch (pin->mode) {
|
||||
case PM8XXX_MPP_DIGITAL:
|
||||
|
@ -640,7 +637,6 @@ static const struct gpio_chip pm8xxx_mpp_template = {
|
|||
.get = pm8xxx_mpp_get,
|
||||
.set = pm8xxx_mpp_set,
|
||||
.of_xlate = pm8xxx_mpp_of_xlate,
|
||||
.to_irq = pm8xxx_mpp_to_irq,
|
||||
.dbg_show = pm8xxx_mpp_dbg_show,
|
||||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
@ -732,14 +728,62 @@ static int pm8xxx_pin_populate(struct pm8xxx_mpp *pctrl,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int pm8xxx_mpp_domain_translate(struct irq_domain *domain,
|
||||
struct irq_fwspec *fwspec,
|
||||
unsigned long *hwirq,
|
||||
unsigned int *type)
|
||||
{
|
||||
struct pm8xxx_mpp *pctrl = container_of(domain->host_data,
|
||||
struct pm8xxx_mpp, chip);
|
||||
|
||||
if (fwspec->param_count != 2 ||
|
||||
fwspec->param[0] < PM8XXX_MPP_PHYSICAL_OFFSET ||
|
||||
fwspec->param[0] > pctrl->chip.ngpio)
|
||||
return -EINVAL;
|
||||
|
||||
*hwirq = fwspec->param[0] - PM8XXX_MPP_PHYSICAL_OFFSET;
|
||||
*type = fwspec->param[1];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int pm8xxx_mpp_child_offset_to_irq(struct gpio_chip *chip,
|
||||
unsigned int offset)
|
||||
{
|
||||
return offset + PM8XXX_MPP_PHYSICAL_OFFSET;
|
||||
}
|
||||
|
||||
static int pm8821_mpp_child_to_parent_hwirq(struct gpio_chip *chip,
|
||||
unsigned int child_hwirq,
|
||||
unsigned int child_type,
|
||||
unsigned int *parent_hwirq,
|
||||
unsigned int *parent_type)
|
||||
{
|
||||
*parent_hwirq = child_hwirq + 24;
|
||||
*parent_type = child_type;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pm8xxx_mpp_child_to_parent_hwirq(struct gpio_chip *chip,
|
||||
unsigned int child_hwirq,
|
||||
unsigned int child_type,
|
||||
unsigned int *parent_hwirq,
|
||||
unsigned int *parent_type)
|
||||
{
|
||||
*parent_hwirq = child_hwirq + 0x80;
|
||||
*parent_type = child_type;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id pm8xxx_mpp_of_match[] = {
|
||||
{ .compatible = "qcom,pm8018-mpp" },
|
||||
{ .compatible = "qcom,pm8038-mpp" },
|
||||
{ .compatible = "qcom,pm8058-mpp" },
|
||||
{ .compatible = "qcom,pm8917-mpp" },
|
||||
{ .compatible = "qcom,pm8821-mpp" },
|
||||
{ .compatible = "qcom,pm8921-mpp" },
|
||||
{ .compatible = "qcom,ssbi-mpp" },
|
||||
{ .compatible = "qcom,pm8018-mpp", .data = (void *) 6 },
|
||||
{ .compatible = "qcom,pm8038-mpp", .data = (void *) 6 },
|
||||
{ .compatible = "qcom,pm8058-mpp", .data = (void *) 12 },
|
||||
{ .compatible = "qcom,pm8821-mpp", .data = (void *) 4 },
|
||||
{ .compatible = "qcom,pm8917-mpp", .data = (void *) 10 },
|
||||
{ .compatible = "qcom,pm8921-mpp", .data = (void *) 12 },
|
||||
{ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, pm8xxx_mpp_of_match);
|
||||
|
@ -747,22 +791,20 @@ MODULE_DEVICE_TABLE(of, pm8xxx_mpp_of_match);
|
|||
static int pm8xxx_mpp_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct pm8xxx_pin_data *pin_data;
|
||||
struct irq_domain *parent_domain;
|
||||
struct device_node *parent_node;
|
||||
struct pinctrl_pin_desc *pins;
|
||||
struct gpio_irq_chip *girq;
|
||||
struct pm8xxx_mpp *pctrl;
|
||||
int ret;
|
||||
int i, npins;
|
||||
int i;
|
||||
|
||||
pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
|
||||
if (!pctrl)
|
||||
return -ENOMEM;
|
||||
|
||||
pctrl->dev = &pdev->dev;
|
||||
npins = platform_irq_count(pdev);
|
||||
if (!npins)
|
||||
return -EINVAL;
|
||||
if (npins < 0)
|
||||
return npins;
|
||||
pctrl->npins = npins;
|
||||
pctrl->npins = (uintptr_t) device_get_match_data(&pdev->dev);
|
||||
|
||||
pctrl->regmap = dev_get_regmap(pdev->dev.parent, NULL);
|
||||
if (!pctrl->regmap) {
|
||||
|
@ -789,9 +831,6 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev)
|
|||
|
||||
for (i = 0; i < pctrl->desc.npins; i++) {
|
||||
pin_data[i].reg = SSBI_REG_ADDR_MPP(i);
|
||||
pin_data[i].irq = platform_get_irq(pdev, i);
|
||||
if (pin_data[i].irq < 0)
|
||||
return pin_data[i].irq;
|
||||
|
||||
ret = pm8xxx_pin_populate(pctrl, &pin_data[i]);
|
||||
if (ret)
|
||||
|
@ -822,6 +861,36 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev)
|
|||
pctrl->chip.of_gpio_n_cells = 2;
|
||||
pctrl->chip.label = dev_name(pctrl->dev);
|
||||
pctrl->chip.ngpio = pctrl->npins;
|
||||
|
||||
parent_node = of_irq_find_parent(pctrl->dev->of_node);
|
||||
if (!parent_node)
|
||||
return -ENXIO;
|
||||
|
||||
parent_domain = irq_find_host(parent_node);
|
||||
of_node_put(parent_node);
|
||||
if (!parent_domain)
|
||||
return -ENXIO;
|
||||
|
||||
pctrl->irq.name = "ssbi-mpp";
|
||||
pctrl->irq.irq_mask_ack = irq_chip_mask_ack_parent;
|
||||
pctrl->irq.irq_unmask = irq_chip_unmask_parent;
|
||||
pctrl->irq.irq_set_type = irq_chip_set_type_parent;
|
||||
pctrl->irq.flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SKIP_SET_WAKE;
|
||||
|
||||
girq = &pctrl->chip.irq;
|
||||
girq->chip = &pctrl->irq;
|
||||
girq->default_type = IRQ_TYPE_NONE;
|
||||
girq->handler = handle_level_irq;
|
||||
girq->fwnode = of_node_to_fwnode(pctrl->dev->of_node);
|
||||
girq->parent_domain = parent_domain;
|
||||
if (of_device_is_compatible(pdev->dev.of_node, "qcom,pm8821-mpp"))
|
||||
girq->child_to_parent_hwirq = pm8821_mpp_child_to_parent_hwirq;
|
||||
else
|
||||
girq->child_to_parent_hwirq = pm8xxx_mpp_child_to_parent_hwirq;
|
||||
girq->populate_parent_alloc_arg = gpiochip_populate_parent_fwspec_twocell;
|
||||
girq->child_offset_to_irq = pm8xxx_mpp_child_offset_to_irq;
|
||||
girq->child_irq_domain_ops.translate = pm8xxx_mpp_domain_translate;
|
||||
|
||||
ret = gpiochip_add_data(&pctrl->chip, pctrl);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed register gpiochip\n");
|
||||
|
|
|
@ -675,8 +675,10 @@ static unsigned int sh_pfc_walk_regs(struct sh_pfc *pfc,
|
|||
do_reg(pfc, pfc->info->drive_regs[i].reg, n++);
|
||||
|
||||
if (pfc->info->bias_regs)
|
||||
for (i = 0; pfc->info->bias_regs[i].puen; i++) {
|
||||
do_reg(pfc, pfc->info->bias_regs[i].puen, n++);
|
||||
for (i = 0; pfc->info->bias_regs[i].puen ||
|
||||
pfc->info->bias_regs[i].pud; i++) {
|
||||
if (pfc->info->bias_regs[i].puen)
|
||||
do_reg(pfc, pfc->info->bias_regs[i].puen, n++);
|
||||
if (pfc->info->bias_regs[i].pud)
|
||||
do_reg(pfc, pfc->info->bias_regs[i].pud, n++);
|
||||
}
|
||||
|
@ -741,12 +743,15 @@ static int sh_pfc_suspend_init(struct sh_pfc *pfc) { return 0; }
|
|||
#define SH_PFC_MAX_REGS 300
|
||||
#define SH_PFC_MAX_ENUMS 3000
|
||||
|
||||
static unsigned int sh_pfc_errors __initdata = 0;
|
||||
static unsigned int sh_pfc_warnings __initdata = 0;
|
||||
static u32 *sh_pfc_regs __initdata = NULL;
|
||||
static u32 sh_pfc_num_regs __initdata = 0;
|
||||
static u16 *sh_pfc_enums __initdata = NULL;
|
||||
static u32 sh_pfc_num_enums __initdata = 0;
|
||||
static unsigned int sh_pfc_errors __initdata;
|
||||
static unsigned int sh_pfc_warnings __initdata;
|
||||
static struct {
|
||||
u32 reg;
|
||||
u32 bits;
|
||||
} *sh_pfc_regs __initdata;
|
||||
static u32 sh_pfc_num_regs __initdata;
|
||||
static u16 *sh_pfc_enums __initdata;
|
||||
static u32 sh_pfc_num_enums __initdata;
|
||||
|
||||
#define sh_pfc_err(fmt, ...) \
|
||||
do { \
|
||||
|
@ -778,22 +783,30 @@ static bool __init same_name(const char *a, const char *b)
|
|||
return !strcmp(a, b);
|
||||
}
|
||||
|
||||
static void __init sh_pfc_check_reg(const char *drvname, u32 reg)
|
||||
static void __init sh_pfc_check_reg(const char *drvname, u32 reg, u32 bits)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < sh_pfc_num_regs; i++)
|
||||
if (reg == sh_pfc_regs[i]) {
|
||||
sh_pfc_err("reg 0x%x conflict\n", reg);
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < sh_pfc_num_regs; i++) {
|
||||
if (reg != sh_pfc_regs[i].reg)
|
||||
continue;
|
||||
|
||||
if (bits & sh_pfc_regs[i].bits)
|
||||
sh_pfc_err("reg 0x%x: bits 0x%x conflict\n", reg,
|
||||
bits & sh_pfc_regs[i].bits);
|
||||
|
||||
sh_pfc_regs[i].bits |= bits;
|
||||
return;
|
||||
}
|
||||
|
||||
if (sh_pfc_num_regs == SH_PFC_MAX_REGS) {
|
||||
pr_warn_once("%s: Please increase SH_PFC_MAX_REGS\n", drvname);
|
||||
return;
|
||||
}
|
||||
|
||||
sh_pfc_regs[sh_pfc_num_regs++] = reg;
|
||||
sh_pfc_regs[sh_pfc_num_regs].reg = reg;
|
||||
sh_pfc_regs[sh_pfc_num_regs].bits = bits;
|
||||
sh_pfc_num_regs++;
|
||||
}
|
||||
|
||||
static int __init sh_pfc_check_enum(const char *drvname, u16 enum_id)
|
||||
|
@ -848,7 +861,8 @@ static void __init sh_pfc_check_cfg_reg(const char *drvname,
|
|||
{
|
||||
unsigned int i, n, rw, fw;
|
||||
|
||||
sh_pfc_check_reg(drvname, cfg_reg->reg);
|
||||
sh_pfc_check_reg(drvname, cfg_reg->reg,
|
||||
GENMASK(cfg_reg->reg_width - 1, 0));
|
||||
|
||||
if (cfg_reg->field_width) {
|
||||
n = cfg_reg->reg_width / cfg_reg->field_width;
|
||||
|
@ -879,22 +893,17 @@ check_enum_ids:
|
|||
static void __init sh_pfc_check_drive_reg(const struct sh_pfc_soc_info *info,
|
||||
const struct pinmux_drive_reg *drive)
|
||||
{
|
||||
const char *drvname = info->name;
|
||||
unsigned long seen = 0, mask;
|
||||
unsigned int i;
|
||||
|
||||
sh_pfc_check_reg(info->name, drive->reg);
|
||||
for (i = 0; i < ARRAY_SIZE(drive->fields); i++) {
|
||||
const struct pinmux_drive_reg_field *field = &drive->fields[i];
|
||||
|
||||
if (!field->pin && !field->offset && !field->size)
|
||||
continue;
|
||||
|
||||
mask = GENMASK(field->offset + field->size, field->offset);
|
||||
if (mask & seen)
|
||||
sh_pfc_err("drive_reg 0x%x: field %u overlap\n",
|
||||
drive->reg, i);
|
||||
seen |= mask;
|
||||
sh_pfc_check_reg(info->name, drive->reg,
|
||||
GENMASK(field->offset + field->size - 1,
|
||||
field->offset));
|
||||
|
||||
sh_pfc_check_pin(info, drive->reg, field->pin);
|
||||
}
|
||||
|
@ -904,21 +913,28 @@ static void __init sh_pfc_check_bias_reg(const struct sh_pfc_soc_info *info,
|
|||
const struct pinmux_bias_reg *bias)
|
||||
{
|
||||
unsigned int i;
|
||||
u32 bits;
|
||||
|
||||
sh_pfc_check_reg(info->name, bias->puen);
|
||||
for (i = 0, bits = 0; i < ARRAY_SIZE(bias->pins); i++)
|
||||
if (bias->pins[i] != SH_PFC_PIN_NONE)
|
||||
bits |= BIT(i);
|
||||
|
||||
if (bias->puen)
|
||||
sh_pfc_check_reg(info->name, bias->puen, bits);
|
||||
if (bias->pud)
|
||||
sh_pfc_check_reg(info->name, bias->pud);
|
||||
sh_pfc_check_reg(info->name, bias->pud, bits);
|
||||
for (i = 0; i < ARRAY_SIZE(bias->pins); i++)
|
||||
sh_pfc_check_pin(info, bias->puen, bias->pins[i]);
|
||||
}
|
||||
|
||||
static void __init sh_pfc_check_info(const struct sh_pfc_soc_info *info)
|
||||
{
|
||||
const struct pinmux_bias_reg *bias_regs = info->bias_regs;
|
||||
const char *drvname = info->name;
|
||||
unsigned int *refcnts;
|
||||
unsigned int i, j, k;
|
||||
|
||||
pr_info("Checking %s\n", drvname);
|
||||
pr_info("sh_pfc: Checking %s\n", drvname);
|
||||
sh_pfc_num_regs = 0;
|
||||
sh_pfc_num_enums = 0;
|
||||
|
||||
|
@ -1010,16 +1026,17 @@ static void __init sh_pfc_check_info(const struct sh_pfc_soc_info *info)
|
|||
sh_pfc_check_drive_reg(info, &info->drive_regs[i]);
|
||||
|
||||
/* Check bias registers */
|
||||
for (i = 0; info->bias_regs && info->bias_regs[i].puen; i++)
|
||||
sh_pfc_check_bias_reg(info, &info->bias_regs[i]);
|
||||
for (i = 0; bias_regs && (bias_regs[i].puen || bias_regs[i].pud); i++)
|
||||
sh_pfc_check_bias_reg(info, &bias_regs[i]);
|
||||
|
||||
/* Check ioctrl registers */
|
||||
for (i = 0; info->ioctrl_regs && info->ioctrl_regs[i].reg; i++)
|
||||
sh_pfc_check_reg(drvname, info->ioctrl_regs[i].reg);
|
||||
sh_pfc_check_reg(drvname, info->ioctrl_regs[i].reg, U32_MAX);
|
||||
|
||||
/* Check data registers */
|
||||
for (i = 0; info->data_regs && info->data_regs[i].reg; i++) {
|
||||
sh_pfc_check_reg(drvname, info->data_regs[i].reg);
|
||||
sh_pfc_check_reg(drvname, info->data_regs[i].reg,
|
||||
GENMASK(info->data_regs[i].reg_width - 1, 0));
|
||||
sh_pfc_check_reg_enums(drvname, info->data_regs[i].reg,
|
||||
info->data_regs[i].enum_ids,
|
||||
info->data_regs[i].reg_width);
|
||||
|
@ -1064,7 +1081,7 @@ static void __init sh_pfc_check_driver(const struct platform_driver *pdrv)
|
|||
if (!sh_pfc_enums)
|
||||
goto free_regs;
|
||||
|
||||
pr_warn("Checking builtin pinmux tables\n");
|
||||
pr_warn("sh_pfc: Checking builtin pinmux tables\n");
|
||||
|
||||
for (i = 0; pdrv->id_table[i].name[0]; i++)
|
||||
sh_pfc_check_info((void *)pdrv->id_table[i].driver_data);
|
||||
|
@ -1074,7 +1091,7 @@ static void __init sh_pfc_check_driver(const struct platform_driver *pdrv)
|
|||
sh_pfc_check_info(pdrv->driver.of_match_table[i].data);
|
||||
#endif
|
||||
|
||||
pr_warn("Detected %u errors and %u warnings\n", sh_pfc_errors,
|
||||
pr_warn("sh_pfc: Detected %u errors and %u warnings\n", sh_pfc_errors,
|
||||
sh_pfc_warnings);
|
||||
|
||||
kfree(sh_pfc_enums);
|
||||
|
|
|
@ -2369,6 +2369,14 @@ static const unsigned int intc_ex_irq5_mux[] = {
|
|||
IRQ5_MARK,
|
||||
};
|
||||
|
||||
/* - MLB+ ------------------------------------------------------------------- */
|
||||
static const unsigned int mlb_3pin_pins[] = {
|
||||
RCAR_GP_PIN(5, 23), RCAR_GP_PIN(5, 24), RCAR_GP_PIN(5, 25),
|
||||
};
|
||||
static const unsigned int mlb_3pin_mux[] = {
|
||||
MLB_CLK_MARK, MLB_SIG_MARK, MLB_DAT_MARK,
|
||||
};
|
||||
|
||||
/* - MSIOF0 ----------------------------------------------------------------- */
|
||||
static const unsigned int msiof0_clk_pins[] = {
|
||||
/* SCK */
|
||||
|
@ -3987,6 +3995,7 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
|
|||
SH_PFC_PIN_GROUP(intc_ex_irq3),
|
||||
SH_PFC_PIN_GROUP(intc_ex_irq4),
|
||||
SH_PFC_PIN_GROUP(intc_ex_irq5),
|
||||
SH_PFC_PIN_GROUP(mlb_3pin),
|
||||
SH_PFC_PIN_GROUP(msiof0_clk),
|
||||
SH_PFC_PIN_GROUP(msiof0_sync),
|
||||
SH_PFC_PIN_GROUP(msiof0_ss1),
|
||||
|
@ -4380,6 +4389,10 @@ static const char * const intc_ex_groups[] = {
|
|||
"intc_ex_irq5",
|
||||
};
|
||||
|
||||
static const char * const mlb_3pin_groups[] = {
|
||||
"mlb_3pin",
|
||||
};
|
||||
|
||||
static const char * const msiof0_groups[] = {
|
||||
"msiof0_clk",
|
||||
"msiof0_sync",
|
||||
|
@ -4709,6 +4722,7 @@ static const struct sh_pfc_function pinmux_functions[] = {
|
|||
SH_PFC_FUNCTION(i2c5),
|
||||
SH_PFC_FUNCTION(i2c6),
|
||||
SH_PFC_FUNCTION(intc_ex),
|
||||
SH_PFC_FUNCTION(mlb_3pin),
|
||||
SH_PFC_FUNCTION(msiof0),
|
||||
SH_PFC_FUNCTION(msiof1),
|
||||
SH_PFC_FUNCTION(msiof2),
|
||||
|
|
|
@ -2453,6 +2453,16 @@ static const unsigned int intc_ex_irq5_mux[] = {
|
|||
IRQ5_MARK,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_PINCTRL_PFC_R8A77951
|
||||
/* - MLB+ ------------------------------------------------------------------- */
|
||||
static const unsigned int mlb_3pin_pins[] = {
|
||||
RCAR_GP_PIN(5, 23), RCAR_GP_PIN(5, 24), RCAR_GP_PIN(5, 25),
|
||||
};
|
||||
static const unsigned int mlb_3pin_mux[] = {
|
||||
MLB_CLK_MARK, MLB_SIG_MARK, MLB_DAT_MARK,
|
||||
};
|
||||
#endif /* CONFIG_PINCTRL_PFC_R8A77951 */
|
||||
|
||||
/* - MSIOF0 ----------------------------------------------------------------- */
|
||||
static const unsigned int msiof0_clk_pins[] = {
|
||||
/* SCK */
|
||||
|
@ -4235,7 +4245,7 @@ static const unsigned int vin5_clk_mux[] = {
|
|||
static const struct {
|
||||
struct sh_pfc_pin_group common[328];
|
||||
#ifdef CONFIG_PINCTRL_PFC_R8A77951
|
||||
struct sh_pfc_pin_group automotive[30];
|
||||
struct sh_pfc_pin_group automotive[31];
|
||||
#endif
|
||||
} pinmux_groups = {
|
||||
.common = {
|
||||
|
@ -4600,6 +4610,7 @@ static const struct {
|
|||
SH_PFC_PIN_GROUP(drif3_ctrl_b),
|
||||
SH_PFC_PIN_GROUP(drif3_data0_b),
|
||||
SH_PFC_PIN_GROUP(drif3_data1_b),
|
||||
SH_PFC_PIN_GROUP(mlb_3pin),
|
||||
}
|
||||
#endif /* CONFIG_PINCTRL_PFC_R8A77951 */
|
||||
};
|
||||
|
@ -4795,6 +4806,12 @@ static const char * const intc_ex_groups[] = {
|
|||
"intc_ex_irq5",
|
||||
};
|
||||
|
||||
#ifdef CONFIG_PINCTRL_PFC_R8A77951
|
||||
static const char * const mlb_3pin_groups[] = {
|
||||
"mlb_3pin",
|
||||
};
|
||||
#endif /* CONFIG_PINCTRL_PFC_R8A77951 */
|
||||
|
||||
static const char * const msiof0_groups[] = {
|
||||
"msiof0_clk",
|
||||
"msiof0_sync",
|
||||
|
@ -5144,7 +5161,7 @@ static const char * const vin5_groups[] = {
|
|||
static const struct {
|
||||
struct sh_pfc_function common[55];
|
||||
#ifdef CONFIG_PINCTRL_PFC_R8A77951
|
||||
struct sh_pfc_function automotive[4];
|
||||
struct sh_pfc_function automotive[5];
|
||||
#endif
|
||||
} pinmux_functions = {
|
||||
.common = {
|
||||
|
@ -5210,6 +5227,7 @@ static const struct {
|
|||
SH_PFC_FUNCTION(drif1),
|
||||
SH_PFC_FUNCTION(drif2),
|
||||
SH_PFC_FUNCTION(drif3),
|
||||
SH_PFC_FUNCTION(mlb_3pin),
|
||||
}
|
||||
#endif /* CONFIG_PINCTRL_PFC_R8A77951 */
|
||||
};
|
||||
|
|
|
@ -2458,6 +2458,16 @@ static const unsigned int intc_ex_irq5_mux[] = {
|
|||
IRQ5_MARK,
|
||||
};
|
||||
|
||||
#if defined(CONFIG_PINCTRL_PFC_R8A77960) || defined(CONFIG_PINCTRL_PFC_R8A77961)
|
||||
/* - MLB+ ------------------------------------------------------------------- */
|
||||
static const unsigned int mlb_3pin_pins[] = {
|
||||
RCAR_GP_PIN(5, 23), RCAR_GP_PIN(5, 24), RCAR_GP_PIN(5, 25),
|
||||
};
|
||||
static const unsigned int mlb_3pin_mux[] = {
|
||||
MLB_CLK_MARK, MLB_SIG_MARK, MLB_DAT_MARK,
|
||||
};
|
||||
#endif /* CONFIG_PINCTRL_PFC_R8A77960 || CONFIG_PINCTRL_PFC_R8A77961 */
|
||||
|
||||
/* - MSIOF0 ----------------------------------------------------------------- */
|
||||
static const unsigned int msiof0_clk_pins[] = {
|
||||
/* SCK */
|
||||
|
@ -4210,7 +4220,7 @@ static const unsigned int vin5_clk_mux[] = {
|
|||
static const struct {
|
||||
struct sh_pfc_pin_group common[324];
|
||||
#if defined(CONFIG_PINCTRL_PFC_R8A77960) || defined(CONFIG_PINCTRL_PFC_R8A77961)
|
||||
struct sh_pfc_pin_group automotive[30];
|
||||
struct sh_pfc_pin_group automotive[31];
|
||||
#endif
|
||||
} pinmux_groups = {
|
||||
.common = {
|
||||
|
@ -4571,6 +4581,7 @@ static const struct {
|
|||
SH_PFC_PIN_GROUP(drif3_ctrl_b),
|
||||
SH_PFC_PIN_GROUP(drif3_data0_b),
|
||||
SH_PFC_PIN_GROUP(drif3_data1_b),
|
||||
SH_PFC_PIN_GROUP(mlb_3pin),
|
||||
}
|
||||
#endif /* CONFIG_PINCTRL_PFC_R8A77960 || CONFIG_PINCTRL_PFC_R8A77961 */
|
||||
};
|
||||
|
@ -4766,6 +4777,12 @@ static const char * const intc_ex_groups[] = {
|
|||
"intc_ex_irq5",
|
||||
};
|
||||
|
||||
#if defined(CONFIG_PINCTRL_PFC_R8A77960) || defined(CONFIG_PINCTRL_PFC_R8A77961)
|
||||
static const char * const mlb_3pin_groups[] = {
|
||||
"mlb_3pin",
|
||||
};
|
||||
#endif /* CONFIG_PINCTRL_PFC_R8A77960 || CONFIG_PINCTRL_PFC_R8A77961 */
|
||||
|
||||
static const char * const msiof0_groups[] = {
|
||||
"msiof0_clk",
|
||||
"msiof0_sync",
|
||||
|
@ -5102,7 +5119,7 @@ static const char * const vin5_groups[] = {
|
|||
static const struct {
|
||||
struct sh_pfc_function common[52];
|
||||
#if defined(CONFIG_PINCTRL_PFC_R8A77960) || defined(CONFIG_PINCTRL_PFC_R8A77961)
|
||||
struct sh_pfc_function automotive[4];
|
||||
struct sh_pfc_function automotive[5];
|
||||
#endif
|
||||
} pinmux_functions = {
|
||||
.common = {
|
||||
|
@ -5165,6 +5182,7 @@ static const struct {
|
|||
SH_PFC_FUNCTION(drif1),
|
||||
SH_PFC_FUNCTION(drif2),
|
||||
SH_PFC_FUNCTION(drif3),
|
||||
SH_PFC_FUNCTION(mlb_3pin),
|
||||
}
|
||||
#endif /* CONFIG_PINCTRL_PFC_R8A77960 || CONFIG_PINCTRL_PFC_R8A77961 */
|
||||
};
|
||||
|
|
|
@ -2609,6 +2609,16 @@ static const unsigned int intc_ex_irq5_mux[] = {
|
|||
IRQ5_MARK,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_PINCTRL_PFC_R8A77965
|
||||
/* - MLB+ ------------------------------------------------------------------- */
|
||||
static const unsigned int mlb_3pin_pins[] = {
|
||||
RCAR_GP_PIN(5, 23), RCAR_GP_PIN(5, 24), RCAR_GP_PIN(5, 25),
|
||||
};
|
||||
static const unsigned int mlb_3pin_mux[] = {
|
||||
MLB_CLK_MARK, MLB_SIG_MARK, MLB_DAT_MARK,
|
||||
};
|
||||
#endif /* CONFIG_PINCTRL_PFC_R8A77965 */
|
||||
|
||||
/* - MSIOF0 ----------------------------------------------------------------- */
|
||||
static const unsigned int msiof0_clk_pins[] = {
|
||||
/* SCK */
|
||||
|
@ -4460,7 +4470,7 @@ static const unsigned int vin5_clk_mux[] = {
|
|||
static const struct {
|
||||
struct sh_pfc_pin_group common[326];
|
||||
#ifdef CONFIG_PINCTRL_PFC_R8A77965
|
||||
struct sh_pfc_pin_group automotive[30];
|
||||
struct sh_pfc_pin_group automotive[31];
|
||||
#endif
|
||||
} pinmux_groups = {
|
||||
.common = {
|
||||
|
@ -4823,6 +4833,7 @@ static const struct {
|
|||
SH_PFC_PIN_GROUP(drif3_ctrl_b),
|
||||
SH_PFC_PIN_GROUP(drif3_data0_b),
|
||||
SH_PFC_PIN_GROUP(drif3_data1_b),
|
||||
SH_PFC_PIN_GROUP(mlb_3pin),
|
||||
}
|
||||
#endif /* CONFIG_PINCTRL_PFC_R8A77965 */
|
||||
};
|
||||
|
@ -5018,6 +5029,12 @@ static const char * const intc_ex_groups[] = {
|
|||
"intc_ex_irq5",
|
||||
};
|
||||
|
||||
#ifdef CONFIG_PINCTRL_PFC_R8A77965
|
||||
static const char * const mlb_3pin_groups[] = {
|
||||
"mlb_3pin",
|
||||
};
|
||||
#endif /* CONFIG_PINCTRL_PFC_R8A77965 */
|
||||
|
||||
static const char * const msiof0_groups[] = {
|
||||
"msiof0_clk",
|
||||
"msiof0_sync",
|
||||
|
@ -5358,7 +5375,7 @@ static const char * const vin5_groups[] = {
|
|||
static const struct {
|
||||
struct sh_pfc_function common[53];
|
||||
#ifdef CONFIG_PINCTRL_PFC_R8A77965
|
||||
struct sh_pfc_function automotive[4];
|
||||
struct sh_pfc_function automotive[5];
|
||||
#endif
|
||||
} pinmux_functions = {
|
||||
.common = {
|
||||
|
@ -5422,6 +5439,7 @@ static const struct {
|
|||
SH_PFC_FUNCTION(drif1),
|
||||
SH_PFC_FUNCTION(drif2),
|
||||
SH_PFC_FUNCTION(drif3),
|
||||
SH_PFC_FUNCTION(mlb_3pin),
|
||||
}
|
||||
#endif /* CONFIG_PINCTRL_PFC_R8A77965 */
|
||||
};
|
||||
|
|
|
@ -852,7 +852,7 @@ static const u32 rzg2l_gpio_configs[] = {
|
|||
RZG2L_GPIO_PORT_PACK(2, 0x1e, RZG2L_MPXED_PIN_FUNCS),
|
||||
RZG2L_GPIO_PORT_PACK(2, 0x1f, RZG2L_MPXED_PIN_FUNCS),
|
||||
RZG2L_GPIO_PORT_PACK(2, 0x20, RZG2L_MPXED_PIN_FUNCS),
|
||||
RZG2L_GPIO_PORT_PACK(3, 0x22, RZG2L_MPXED_PIN_FUNCS),
|
||||
RZG2L_GPIO_PORT_PACK(3, 0x21, RZG2L_MPXED_PIN_FUNCS),
|
||||
RZG2L_GPIO_PORT_PACK(2, 0x22, RZG2L_MPXED_PIN_FUNCS),
|
||||
RZG2L_GPIO_PORT_PACK(2, 0x23, RZG2L_MPXED_PIN_FUNCS),
|
||||
RZG2L_GPIO_PORT_PACK(3, 0x24, RZG2L_MPXED_ETH_PIN_FUNCS(PIN_CFG_IOLH_ETH0)),
|
||||
|
|
|
@ -538,3 +538,111 @@ const struct samsung_pinctrl_of_match_data exynos850_of_data __initconst = {
|
|||
.ctrl = exynos850_pin_ctrl,
|
||||
.num_ctrl = ARRAY_SIZE(exynos850_pin_ctrl),
|
||||
};
|
||||
|
||||
/* pin banks of exynosautov9 pin-controller 0 (ALIVE) */
|
||||
static const struct samsung_pin_bank_data exynosautov9_pin_banks0[] __initconst = {
|
||||
EXYNOS850_PIN_BANK_EINTW(8, 0x000, "gpa0", 0x00),
|
||||
EXYNOS850_PIN_BANK_EINTW(2, 0x020, "gpa1", 0x04),
|
||||
EXYNOS850_PIN_BANK_EINTN(2, 0x040, "gpq0"),
|
||||
};
|
||||
|
||||
/* pin banks of exynosautov9 pin-controller 1 (AUD) */
|
||||
static const struct samsung_pin_bank_data exynosautov9_pin_banks1[] __initconst = {
|
||||
EXYNOS850_PIN_BANK_EINTG(5, 0x000, "gpb0", 0x00),
|
||||
EXYNOS850_PIN_BANK_EINTG(8, 0x020, "gpb1", 0x04),
|
||||
EXYNOS850_PIN_BANK_EINTG(8, 0x040, "gpb2", 0x08),
|
||||
EXYNOS850_PIN_BANK_EINTG(8, 0x060, "gpb3", 0x0C),
|
||||
};
|
||||
|
||||
/* pin banks of exynosautov9 pin-controller 2 (FSYS0) */
|
||||
static const struct samsung_pin_bank_data exynosautov9_pin_banks2[] __initconst = {
|
||||
EXYNOS850_PIN_BANK_EINTG(6, 0x000, "gpf0", 0x00),
|
||||
EXYNOS850_PIN_BANK_EINTG(6, 0x020, "gpf1", 0x04),
|
||||
};
|
||||
|
||||
/* pin banks of exynosautov9 pin-controller 3 (FSYS1) */
|
||||
static const struct samsung_pin_bank_data exynosautov9_pin_banks3[] __initconst = {
|
||||
EXYNOS850_PIN_BANK_EINTG(6, 0x000, "gpf8", 0x00),
|
||||
};
|
||||
|
||||
/* pin banks of exynosautov9 pin-controller 4 (FSYS2) */
|
||||
static const struct samsung_pin_bank_data exynosautov9_pin_banks4[] __initconst = {
|
||||
EXYNOS850_PIN_BANK_EINTG(4, 0x000, "gpf2", 0x00),
|
||||
EXYNOS850_PIN_BANK_EINTG(8, 0x020, "gpf3", 0x04),
|
||||
EXYNOS850_PIN_BANK_EINTG(7, 0x040, "gpf4", 0x08),
|
||||
EXYNOS850_PIN_BANK_EINTG(8, 0x060, "gpf5", 0x0C),
|
||||
EXYNOS850_PIN_BANK_EINTG(7, 0x080, "gpf6", 0x10),
|
||||
};
|
||||
|
||||
/* pin banks of exynosautov9 pin-controller 5 (PERIC0) */
|
||||
static const struct samsung_pin_bank_data exynosautov9_pin_banks5[] __initconst = {
|
||||
EXYNOS850_PIN_BANK_EINTG(8, 0x000, "gpp0", 0x00),
|
||||
EXYNOS850_PIN_BANK_EINTG(8, 0x020, "gpp1", 0x04),
|
||||
EXYNOS850_PIN_BANK_EINTG(8, 0x040, "gpp2", 0x08),
|
||||
EXYNOS850_PIN_BANK_EINTG(5, 0x060, "gpg0", 0x0C),
|
||||
};
|
||||
|
||||
/* pin banks of exynosautov9 pin-controller 6 (PERIC1) */
|
||||
static const struct samsung_pin_bank_data exynosautov9_pin_banks6[] __initconst = {
|
||||
EXYNOS850_PIN_BANK_EINTG(8, 0x000, "gpp3", 0x00),
|
||||
EXYNOS850_PIN_BANK_EINTG(8, 0x020, "gpp4", 0x04),
|
||||
EXYNOS850_PIN_BANK_EINTG(8, 0x040, "gpp5", 0x08),
|
||||
EXYNOS850_PIN_BANK_EINTG(8, 0x060, "gpg1", 0x0C),
|
||||
EXYNOS850_PIN_BANK_EINTG(8, 0x080, "gpg2", 0x10),
|
||||
EXYNOS850_PIN_BANK_EINTG(4, 0x0A0, "gpg3", 0x14),
|
||||
};
|
||||
|
||||
static const struct samsung_pin_ctrl exynosautov9_pin_ctrl[] __initconst = {
|
||||
{
|
||||
/* pin-controller instance 0 ALIVE data */
|
||||
.pin_banks = exynosautov9_pin_banks0,
|
||||
.nr_banks = ARRAY_SIZE(exynosautov9_pin_banks0),
|
||||
.eint_wkup_init = exynos_eint_wkup_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
}, {
|
||||
/* pin-controller instance 1 AUD data */
|
||||
.pin_banks = exynosautov9_pin_banks1,
|
||||
.nr_banks = ARRAY_SIZE(exynosautov9_pin_banks1),
|
||||
}, {
|
||||
/* pin-controller instance 2 FSYS0 data */
|
||||
.pin_banks = exynosautov9_pin_banks2,
|
||||
.nr_banks = ARRAY_SIZE(exynosautov9_pin_banks2),
|
||||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
}, {
|
||||
/* pin-controller instance 3 FSYS1 data */
|
||||
.pin_banks = exynosautov9_pin_banks3,
|
||||
.nr_banks = ARRAY_SIZE(exynosautov9_pin_banks3),
|
||||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
}, {
|
||||
/* pin-controller instance 4 FSYS2 data */
|
||||
.pin_banks = exynosautov9_pin_banks4,
|
||||
.nr_banks = ARRAY_SIZE(exynosautov9_pin_banks4),
|
||||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
}, {
|
||||
/* pin-controller instance 5 PERIC0 data */
|
||||
.pin_banks = exynosautov9_pin_banks5,
|
||||
.nr_banks = ARRAY_SIZE(exynosautov9_pin_banks5),
|
||||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
}, {
|
||||
/* pin-controller instance 6 PERIC1 data */
|
||||
.pin_banks = exynosautov9_pin_banks6,
|
||||
.nr_banks = ARRAY_SIZE(exynosautov9_pin_banks6),
|
||||
.eint_gpio_init = exynos_eint_gpio_init,
|
||||
.suspend = exynos_pinctrl_suspend,
|
||||
.resume = exynos_pinctrl_resume,
|
||||
},
|
||||
};
|
||||
|
||||
const struct samsung_pinctrl_of_match_data exynosautov9_of_data __initconst = {
|
||||
.ctrl = exynosautov9_pin_ctrl,
|
||||
.num_ctrl = ARRAY_SIZE(exynosautov9_pin_ctrl),
|
||||
};
|
||||
|
|
|
@ -1266,6 +1266,8 @@ static const struct of_device_id samsung_pinctrl_dt_match[] = {
|
|||
.data = &exynos7_of_data },
|
||||
{ .compatible = "samsung,exynos850-pinctrl",
|
||||
.data = &exynos850_of_data },
|
||||
{ .compatible = "samsung,exynosautov9-pinctrl",
|
||||
.data = &exynosautov9_of_data },
|
||||
#endif
|
||||
#ifdef CONFIG_PINCTRL_S3C64XX
|
||||
{ .compatible = "samsung,s3c64xx-pinctrl",
|
||||
|
|
|
@ -340,6 +340,7 @@ extern const struct samsung_pinctrl_of_match_data exynos5420_of_data;
|
|||
extern const struct samsung_pinctrl_of_match_data exynos5433_of_data;
|
||||
extern const struct samsung_pinctrl_of_match_data exynos7_of_data;
|
||||
extern const struct samsung_pinctrl_of_match_data exynos850_of_data;
|
||||
extern const struct samsung_pinctrl_of_match_data exynosautov9_of_data;
|
||||
extern const struct samsung_pinctrl_of_match_data s3c64xx_of_data;
|
||||
extern const struct samsung_pinctrl_of_match_data s3c2412_of_data;
|
||||
extern const struct samsung_pinctrl_of_match_data s3c2416_of_data;
|
||||
|
|
|
@ -1415,17 +1415,6 @@ static int stm32_pctrl_create_pins_tab(struct stm32_pinctrl *pctl,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void stm32_pctl_get_package(struct device_node *np,
|
||||
struct stm32_pinctrl *pctl)
|
||||
{
|
||||
if (of_property_read_u32(np, "st,package", &pctl->pkg)) {
|
||||
pctl->pkg = 0;
|
||||
dev_warn(pctl->dev, "No package detected, use default one\n");
|
||||
} else {
|
||||
dev_dbg(pctl->dev, "package detected: %x\n", pctl->pkg);
|
||||
}
|
||||
}
|
||||
|
||||
int stm32_pctl_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
|
@ -1473,8 +1462,9 @@ int stm32_pctl_probe(struct platform_device *pdev)
|
|||
pctl->dev = dev;
|
||||
pctl->match_data = match->data;
|
||||
|
||||
/* get package information */
|
||||
stm32_pctl_get_package(np, pctl);
|
||||
/* get optional package information */
|
||||
if (!of_property_read_u32(np, "st,package", &pctl->pkg))
|
||||
dev_dbg(pctl->dev, "package detected: %x\n", pctl->pkg);
|
||||
|
||||
pctl->pins = devm_kcalloc(pctl->dev, pctl->match_data->npins,
|
||||
sizeof(*pctl->pins), GFP_KERNEL);
|
||||
|
|
|
@ -275,6 +275,28 @@ static int tegra_pinctrl_set_mux(struct pinctrl_dev *pctldev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct tegra_pingroup *tegra_pinctrl_get_group(struct pinctrl_dev *pctldev,
|
||||
unsigned int offset)
|
||||
{
|
||||
struct tegra_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
|
||||
unsigned int group, num_pins, j;
|
||||
const unsigned int *pins;
|
||||
int ret;
|
||||
|
||||
for (group = 0; group < pmx->soc->ngroups; ++group) {
|
||||
ret = tegra_pinctrl_get_group_pins(pctldev, group, &pins, &num_pins);
|
||||
if (ret < 0)
|
||||
continue;
|
||||
for (j = 0; j < num_pins; j++) {
|
||||
if (offset == pins[j])
|
||||
return (struct tegra_pingroup *)&pmx->soc->groups[group];
|
||||
}
|
||||
}
|
||||
|
||||
dev_err(pctldev->dev, "Pingroup not found for pin %u\n", offset);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int tegra_pinctrl_gpio_request_enable(struct pinctrl_dev *pctldev,
|
||||
struct pinctrl_gpio_range *range,
|
||||
unsigned int offset)
|
||||
|
@ -286,7 +308,10 @@ static int tegra_pinctrl_gpio_request_enable(struct pinctrl_dev *pctldev,
|
|||
if (!pmx->soc->sfsel_in_mux)
|
||||
return 0;
|
||||
|
||||
group = &pmx->soc->groups[offset];
|
||||
group = tegra_pinctrl_get_group(pctldev, offset);
|
||||
|
||||
if (!group)
|
||||
return -EINVAL;
|
||||
|
||||
if (group->mux_reg < 0 || group->sfsel_bit < 0)
|
||||
return -EINVAL;
|
||||
|
@ -309,7 +334,10 @@ static void tegra_pinctrl_gpio_disable_free(struct pinctrl_dev *pctldev,
|
|||
if (!pmx->soc->sfsel_in_mux)
|
||||
return;
|
||||
|
||||
group = &pmx->soc->groups[offset];
|
||||
group = tegra_pinctrl_get_group(pctldev, offset);
|
||||
|
||||
if (!group)
|
||||
return;
|
||||
|
||||
if (group->mux_reg < 0 || group->sfsel_bit < 0)
|
||||
return;
|
||||
|
|
|
@ -118,6 +118,7 @@ struct tegra_function {
|
|||
* @slwr_width: Slew Rising field width.
|
||||
* @slwf_bit: Slew Falling register bit.
|
||||
* @slwf_width: Slew Falling field width.
|
||||
* @lpdr_bit: Base driver enabling bit.
|
||||
* @drvtype_bit: Drive type register bit.
|
||||
* @parked_bitmask: Parked register mask. 0 if unsupported.
|
||||
*
|
||||
|
@ -161,6 +162,7 @@ struct tegra_pingroup {
|
|||
s32 drvup_bit:6;
|
||||
s32 slwr_bit:6;
|
||||
s32 slwf_bit:6;
|
||||
s32 lpdr_bit:6;
|
||||
s32 drvtype_bit:6;
|
||||
s32 drvdn_width:6;
|
||||
s32 drvup_width:6;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1276,7 +1276,7 @@ static struct tegra_function tegra210_functions[] = {
|
|||
#define PINGROUP_BIT_N(b) (-1)
|
||||
|
||||
#define PINGROUP(pg_name, f0, f1, f2, f3, r, hsm, drvtype, e_io_hv, \
|
||||
rdrv, drvdn_b, drvdn_w, drvup_b, drvup_w, slwr_b, \
|
||||
lpdr, rdrv, drvdn_b, drvdn_w, drvup_b, drvup_w, slwr_b,\
|
||||
slwr_w, slwf_b, slwf_w) \
|
||||
{ \
|
||||
.name = #pg_name, \
|
||||
|
@ -1317,6 +1317,7 @@ static struct tegra_function tegra210_functions[] = {
|
|||
.slwf_bit = slwf_b, \
|
||||
.slwf_width = slwf_w, \
|
||||
.parked_bitmask = BIT(5), \
|
||||
.lpdr_bit = PINGROUP_BIT_##lpdr(8), \
|
||||
}
|
||||
|
||||
#define DRV_PINGROUP(pg_name, r, prk_mask, drvdn_b, drvdn_w, drvup_b, \
|
||||
|
@ -1337,6 +1338,7 @@ static struct tegra_function tegra210_functions[] = {
|
|||
.drv_bank = 0, \
|
||||
.hsm_bit = -1, \
|
||||
.schmitt_bit = -1, \
|
||||
.lpdr_bit = -1, \
|
||||
.lpmd_bit = -1, \
|
||||
.drvdn_bit = drvdn_b, \
|
||||
.drvdn_width = drvdn_w, \
|
||||
|
@ -1351,169 +1353,169 @@ static struct tegra_function tegra210_functions[] = {
|
|||
}
|
||||
|
||||
static const struct tegra_pingroup tegra210_groups[] = {
|
||||
/* pg_name, f0, f1, f2, f3, r, hsm, drvtype, e_io_hv, rdrv, drvdn_b, drvdn_w, drvup_b, drvup_w, slwr_b, slwr_w, slwf_b, slwf_w */
|
||||
PINGROUP(sdmmc1_clk_pm0, SDMMC1, RSVD1, RSVD2, RSVD3, 0x3000, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc1_cmd_pm1, SDMMC1, SPI3, RSVD2, RSVD3, 0x3004, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc1_dat3_pm2, SDMMC1, SPI3, RSVD2, RSVD3, 0x3008, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc1_dat2_pm3, SDMMC1, SPI3, RSVD2, RSVD3, 0x300c, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc1_dat1_pm4, SDMMC1, SPI3, RSVD2, RSVD3, 0x3010, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc1_dat0_pm5, SDMMC1, RSVD1, RSVD2, RSVD3, 0x3014, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc3_clk_pp0, SDMMC3, RSVD1, RSVD2, RSVD3, 0x301c, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc3_cmd_pp1, SDMMC3, RSVD1, RSVD2, RSVD3, 0x3020, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc3_dat0_pp5, SDMMC3, RSVD1, RSVD2, RSVD3, 0x3024, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc3_dat1_pp4, SDMMC3, RSVD1, RSVD2, RSVD3, 0x3028, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc3_dat2_pp3, SDMMC3, RSVD1, RSVD2, RSVD3, 0x302c, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc3_dat3_pp2, SDMMC3, RSVD1, RSVD2, RSVD3, 0x3030, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pex_l0_rst_n_pa0, PE0, RSVD1, RSVD2, RSVD3, 0x3038, N, N, Y, 0xa5c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pex_l0_clkreq_n_pa1, PE0, RSVD1, RSVD2, RSVD3, 0x303c, N, N, Y, 0xa58, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pex_wake_n_pa2, PE, RSVD1, RSVD2, RSVD3, 0x3040, N, N, Y, 0xa68, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pex_l1_rst_n_pa3, PE1, RSVD1, RSVD2, RSVD3, 0x3044, N, N, Y, 0xa64, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pex_l1_clkreq_n_pa4, PE1, RSVD1, RSVD2, RSVD3, 0x3048, N, N, Y, 0xa60, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(sata_led_active_pa5, SATA, RSVD1, RSVD2, RSVD3, 0x304c, N, N, N, 0xa94, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(spi1_mosi_pc0, SPI1, RSVD1, RSVD2, RSVD3, 0x3050, Y, Y, N, 0xae0, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi1_miso_pc1, SPI1, RSVD1, RSVD2, RSVD3, 0x3054, Y, Y, N, 0xadc, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi1_sck_pc2, SPI1, RSVD1, RSVD2, RSVD3, 0x3058, Y, Y, N, 0xae4, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi1_cs0_pc3, SPI1, RSVD1, RSVD2, RSVD3, 0x305c, Y, Y, N, 0xad4, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi1_cs1_pc4, SPI1, RSVD1, RSVD2, RSVD3, 0x3060, Y, Y, N, 0xad8, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi2_mosi_pb4, SPI2, DTV, RSVD2, RSVD3, 0x3064, Y, Y, N, 0xaf4, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi2_miso_pb5, SPI2, DTV, RSVD2, RSVD3, 0x3068, Y, Y, N, 0xaf0, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi2_sck_pb6, SPI2, DTV, RSVD2, RSVD3, 0x306c, Y, Y, N, 0xaf8, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi2_cs0_pb7, SPI2, DTV, RSVD2, RSVD3, 0x3070, Y, Y, N, 0xae8, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi2_cs1_pdd0, SPI2, RSVD1, RSVD2, RSVD3, 0x3074, Y, Y, N, 0xaec, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi4_mosi_pc7, SPI4, RSVD1, RSVD2, RSVD3, 0x3078, Y, Y, N, 0xb04, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi4_miso_pd0, SPI4, RSVD1, RSVD2, RSVD3, 0x307c, Y, Y, N, 0xb00, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi4_sck_pc5, SPI4, RSVD1, RSVD2, RSVD3, 0x3080, Y, Y, N, 0xb08, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi4_cs0_pc6, SPI4, RSVD1, RSVD2, RSVD3, 0x3084, Y, Y, N, 0xafc, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(qspi_sck_pee0, QSPI, RSVD1, RSVD2, RSVD3, 0x3088, Y, Y, N, 0xa90, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(qspi_cs_n_pee1, QSPI, RSVD1, RSVD2, RSVD3, 0x308c, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(qspi_io0_pee2, QSPI, RSVD1, RSVD2, RSVD3, 0x3090, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(qspi_io1_pee3, QSPI, RSVD1, RSVD2, RSVD3, 0x3094, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(qspi_io2_pee4, QSPI, RSVD1, RSVD2, RSVD3, 0x3098, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(qspi_io3_pee5, QSPI, RSVD1, RSVD2, RSVD3, 0x309c, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(dmic1_clk_pe0, DMIC1, I2S3, RSVD2, RSVD3, 0x30a4, N, N, N, 0x984, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dmic1_dat_pe1, DMIC1, I2S3, RSVD2, RSVD3, 0x30a8, N, N, N, 0x988, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dmic2_clk_pe2, DMIC2, I2S3, RSVD2, RSVD3, 0x30ac, N, N, N, 0x98c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dmic2_dat_pe3, DMIC2, I2S3, RSVD2, RSVD3, 0x30b0, N, N, N, 0x990, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dmic3_clk_pe4, DMIC3, I2S5A, RSVD2, RSVD3, 0x30b4, N, N, N, 0x994, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dmic3_dat_pe5, DMIC3, I2S5A, RSVD2, RSVD3, 0x30b8, N, N, N, 0x998, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gen1_i2c_scl_pj1, I2C1, RSVD1, RSVD2, RSVD3, 0x30bc, N, N, Y, 0x9a8, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gen1_i2c_sda_pj0, I2C1, RSVD1, RSVD2, RSVD3, 0x30c0, N, N, Y, 0x9ac, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gen2_i2c_scl_pj2, I2C2, RSVD1, RSVD2, RSVD3, 0x30c4, N, N, Y, 0x9b0, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gen2_i2c_sda_pj3, I2C2, RSVD1, RSVD2, RSVD3, 0x30c8, N, N, Y, 0x9b4, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gen3_i2c_scl_pf0, I2C3, RSVD1, RSVD2, RSVD3, 0x30cc, N, N, Y, 0x9b8, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gen3_i2c_sda_pf1, I2C3, RSVD1, RSVD2, RSVD3, 0x30d0, N, N, Y, 0x9bc, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam_i2c_scl_ps2, I2C3, I2CVI, RSVD2, RSVD3, 0x30d4, N, N, Y, 0x934, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam_i2c_sda_ps3, I2C3, I2CVI, RSVD2, RSVD3, 0x30d8, N, N, Y, 0x938, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pwr_i2c_scl_py3, I2CPMU, RSVD1, RSVD2, RSVD3, 0x30dc, N, N, Y, 0xa6c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pwr_i2c_sda_py4, I2CPMU, RSVD1, RSVD2, RSVD3, 0x30e0, N, N, Y, 0xa70, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart1_tx_pu0, UARTA, RSVD1, RSVD2, RSVD3, 0x30e4, N, N, N, 0xb28, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart1_rx_pu1, UARTA, RSVD1, RSVD2, RSVD3, 0x30e8, N, N, N, 0xb24, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart1_rts_pu2, UARTA, RSVD1, RSVD2, RSVD3, 0x30ec, N, N, N, 0xb20, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart1_cts_pu3, UARTA, RSVD1, RSVD2, RSVD3, 0x30f0, N, N, N, 0xb1c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart2_tx_pg0, UARTB, I2S4A, SPDIF, UART, 0x30f4, N, N, N, 0xb38, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart2_rx_pg1, UARTB, I2S4A, SPDIF, UART, 0x30f8, N, N, N, 0xb34, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart2_rts_pg2, UARTB, I2S4A, RSVD2, UART, 0x30fc, N, N, N, 0xb30, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart2_cts_pg3, UARTB, I2S4A, RSVD2, UART, 0x3100, N, N, N, 0xb2c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart3_tx_pd1, UARTC, SPI4, RSVD2, RSVD3, 0x3104, N, N, N, 0xb48, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart3_rx_pd2, UARTC, SPI4, RSVD2, RSVD3, 0x3108, N, N, N, 0xb44, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart3_rts_pd3, UARTC, SPI4, RSVD2, RSVD3, 0x310c, N, N, N, 0xb40, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart3_cts_pd4, UARTC, SPI4, RSVD2, RSVD3, 0x3110, N, N, N, 0xb3c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart4_tx_pi4, UARTD, UART, RSVD2, RSVD3, 0x3114, N, N, N, 0xb58, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart4_rx_pi5, UARTD, UART, RSVD2, RSVD3, 0x3118, N, N, N, 0xb54, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart4_rts_pi6, UARTD, UART, RSVD2, RSVD3, 0x311c, N, N, N, 0xb50, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart4_cts_pi7, UARTD, UART, RSVD2, RSVD3, 0x3120, N, N, N, 0xb4c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dap1_fs_pb0, I2S1, RSVD1, RSVD2, RSVD3, 0x3124, Y, Y, N, 0x95c, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap1_din_pb1, I2S1, RSVD1, RSVD2, RSVD3, 0x3128, Y, Y, N, 0x954, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap1_dout_pb2, I2S1, RSVD1, RSVD2, RSVD3, 0x312c, Y, Y, N, 0x958, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap1_sclk_pb3, I2S1, RSVD1, RSVD2, RSVD3, 0x3130, Y, Y, N, 0x960, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap2_fs_paa0, I2S2, RSVD1, RSVD2, RSVD3, 0x3134, Y, Y, N, 0x96c, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap2_din_paa2, I2S2, RSVD1, RSVD2, RSVD3, 0x3138, Y, Y, N, 0x964, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap2_dout_paa3, I2S2, RSVD1, RSVD2, RSVD3, 0x313c, Y, Y, N, 0x968, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap2_sclk_paa1, I2S2, RSVD1, RSVD2, RSVD3, 0x3140, Y, Y, N, 0x970, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap4_fs_pj4, I2S4B, RSVD1, RSVD2, RSVD3, 0x3144, N, N, N, 0x97c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dap4_din_pj5, I2S4B, RSVD1, RSVD2, RSVD3, 0x3148, N, N, N, 0x974, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dap4_dout_pj6, I2S4B, RSVD1, RSVD2, RSVD3, 0x314c, N, N, N, 0x978, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dap4_sclk_pj7, I2S4B, RSVD1, RSVD2, RSVD3, 0x3150, N, N, N, 0x980, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam1_mclk_ps0, EXTPERIPH3, RSVD1, RSVD2, RSVD3, 0x3154, N, N, N, 0x918, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam2_mclk_ps1, EXTPERIPH3, RSVD1, RSVD2, RSVD3, 0x3158, N, N, N, 0x924, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(jtag_rtck, JTAG, RSVD1, RSVD2, RSVD3, 0x315c, N, N, N, 0xa2c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(clk_32k_in, CLK, RSVD1, RSVD2, RSVD3, 0x3160, N, N, N, 0x940, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(clk_32k_out_py5, SOC, BLINK, RSVD2, RSVD3, 0x3164, N, N, N, 0x944, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(batt_bcl, BCL, RSVD1, RSVD2, RSVD3, 0x3168, N, N, Y, 0x8f8, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(clk_req, SYS, RSVD1, RSVD2, RSVD3, 0x316c, N, N, N, 0x948, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cpu_pwr_req, CPU, RSVD1, RSVD2, RSVD3, 0x3170, N, N, N, 0x950, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pwr_int_n, PMI, RSVD1, RSVD2, RSVD3, 0x3174, N, N, N, 0xa74, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(shutdown, SHUTDOWN, RSVD1, RSVD2, RSVD3, 0x3178, N, N, N, 0xac8, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(core_pwr_req, CORE, RSVD1, RSVD2, RSVD3, 0x317c, N, N, N, 0x94c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(aud_mclk_pbb0, AUD, RSVD1, RSVD2, RSVD3, 0x3180, N, N, N, 0x8f4, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dvfs_pwm_pbb1, RSVD0, CLDVFS, SPI3, RSVD3, 0x3184, N, N, N, 0x9a4, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dvfs_clk_pbb2, RSVD0, CLDVFS, SPI3, RSVD3, 0x3188, N, N, N, 0x9a0, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gpio_x1_aud_pbb3, RSVD0, RSVD1, SPI3, RSVD3, 0x318c, N, N, N, 0xa14, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gpio_x3_aud_pbb4, RSVD0, RSVD1, SPI3, RSVD3, 0x3190, N, N, N, 0xa18, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pcc7, RSVD0, RSVD1, RSVD2, RSVD3, 0x3194, N, N, Y, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(hdmi_cec_pcc0, CEC, RSVD1, RSVD2, RSVD3, 0x3198, N, N, Y, 0xa24, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(hdmi_int_dp_hpd_pcc1, DP, RSVD1, RSVD2, RSVD3, 0x319c, N, N, Y, 0xa28, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(spdif_out_pcc2, SPDIF, RSVD1, RSVD2, RSVD3, 0x31a0, N, N, N, 0xad0, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(spdif_in_pcc3, SPDIF, RSVD1, RSVD2, RSVD3, 0x31a4, N, N, N, 0xacc, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(usb_vbus_en0_pcc4, USB, RSVD1, RSVD2, RSVD3, 0x31a8, N, N, Y, 0xb5c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(usb_vbus_en1_pcc5, USB, RSVD1, RSVD2, RSVD3, 0x31ac, N, N, Y, 0xb60, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dp_hpd0_pcc6, DP, RSVD1, RSVD2, RSVD3, 0x31b0, N, N, N, 0x99c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(wifi_en_ph0, RSVD0, RSVD1, RSVD2, RSVD3, 0x31b4, N, N, N, 0xb64, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(wifi_rst_ph1, RSVD0, RSVD1, RSVD2, RSVD3, 0x31b8, N, N, N, 0xb68, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(wifi_wake_ap_ph2, RSVD0, RSVD1, RSVD2, RSVD3, 0x31bc, N, N, N, 0xb6c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(ap_wake_bt_ph3, RSVD0, UARTB, SPDIF, RSVD3, 0x31c0, N, N, N, 0x8ec, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(bt_rst_ph4, RSVD0, UARTB, SPDIF, RSVD3, 0x31c4, N, N, N, 0x8fc, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(bt_wake_ap_ph5, RSVD0, RSVD1, RSVD2, RSVD3, 0x31c8, N, N, N, 0x900, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(ap_wake_nfc_ph7, RSVD0, RSVD1, RSVD2, RSVD3, 0x31cc, N, N, N, 0x8f0, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(nfc_en_pi0, RSVD0, RSVD1, RSVD2, RSVD3, 0x31d0, N, N, N, 0xa50, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(nfc_int_pi1, RSVD0, RSVD1, RSVD2, RSVD3, 0x31d4, N, N, N, 0xa54, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gps_en_pi2, RSVD0, RSVD1, RSVD2, RSVD3, 0x31d8, N, N, N, 0xa1c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gps_rst_pi3, RSVD0, RSVD1, RSVD2, RSVD3, 0x31dc, N, N, N, 0xa20, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam_rst_ps4, VGP1, RSVD1, RSVD2, RSVD3, 0x31e0, N, N, N, 0x93c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam_af_en_ps5, VIMCLK, VGP2, RSVD2, RSVD3, 0x31e4, N, N, N, 0x92c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam_flash_en_ps6, VIMCLK, VGP3, RSVD2, RSVD3, 0x31e8, N, N, N, 0x930, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam1_pwdn_ps7, VGP4, RSVD1, RSVD2, RSVD3, 0x31ec, N, N, N, 0x91c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam2_pwdn_pt0, VGP5, RSVD1, RSVD2, RSVD3, 0x31f0, N, N, N, 0x928, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam1_strobe_pt1, VGP6, RSVD1, RSVD2, RSVD3, 0x31f4, N, N, N, 0x920, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(lcd_te_py2, DISPLAYA, RSVD1, RSVD2, RSVD3, 0x31f8, N, N, N, 0xa44, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(lcd_bl_pwm_pv0, DISPLAYA, PWM0, SOR0, RSVD3, 0x31fc, N, N, N, 0xa34, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(lcd_bl_en_pv1, RSVD0, RSVD1, RSVD2, RSVD3, 0x3200, N, N, N, 0xa30, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(lcd_rst_pv2, RSVD0, RSVD1, RSVD2, RSVD3, 0x3204, N, N, N, 0xa40, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(lcd_gpio1_pv3, DISPLAYB, RSVD1, RSVD2, RSVD3, 0x3208, N, N, N, 0xa38, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(lcd_gpio2_pv4, DISPLAYB, PWM1, RSVD2, SOR1, 0x320c, N, N, N, 0xa3c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(ap_ready_pv5, RSVD0, RSVD1, RSVD2, RSVD3, 0x3210, N, N, N, 0x8e8, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(touch_rst_pv6, RSVD0, RSVD1, RSVD2, RSVD3, 0x3214, N, N, N, 0xb18, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(touch_clk_pv7, TOUCH, RSVD1, RSVD2, RSVD3, 0x3218, N, N, N, 0xb10, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(modem_wake_ap_px0, RSVD0, RSVD1, RSVD2, RSVD3, 0x321c, N, N, N, 0xa48, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(touch_int_px1, RSVD0, RSVD1, RSVD2, RSVD3, 0x3220, N, N, N, 0xb14, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(motion_int_px2, RSVD0, RSVD1, RSVD2, RSVD3, 0x3224, N, N, N, 0xa4c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(als_prox_int_px3, RSVD0, RSVD1, RSVD2, RSVD3, 0x3228, N, N, N, 0x8e4, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(temp_alert_px4, RSVD0, RSVD1, RSVD2, RSVD3, 0x322c, N, N, N, 0xb0c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(button_power_on_px5, RSVD0, RSVD1, RSVD2, RSVD3, 0x3230, N, N, N, 0x908, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(button_vol_up_px6, RSVD0, RSVD1, RSVD2, RSVD3, 0x3234, N, N, N, 0x914, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(button_vol_down_px7, RSVD0, RSVD1, RSVD2, RSVD3, 0x3238, N, N, N, 0x910, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(button_slide_sw_py0, RSVD0, RSVD1, RSVD2, RSVD3, 0x323c, N, N, N, 0x90c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(button_home_py1, RSVD0, RSVD1, RSVD2, RSVD3, 0x3240, N, N, N, 0x904, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pa6, SATA, RSVD1, RSVD2, RSVD3, 0x3244, N, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pe6, RSVD0, I2S5A, PWM2, RSVD3, 0x3248, N, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pe7, RSVD0, I2S5A, PWM3, RSVD3, 0x324c, N, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(ph6, RSVD0, RSVD1, RSVD2, RSVD3, 0x3250, N, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk0, IQC0, I2S5B, RSVD2, RSVD3, 0x3254, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk1, IQC0, I2S5B, RSVD2, RSVD3, 0x3258, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk2, IQC0, I2S5B, RSVD2, RSVD3, 0x325c, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk3, IQC0, I2S5B, RSVD2, RSVD3, 0x3260, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk4, IQC1, RSVD1, RSVD2, RSVD3, 0x3264, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk5, IQC1, RSVD1, RSVD2, RSVD3, 0x3268, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk6, IQC1, RSVD1, RSVD2, RSVD3, 0x326c, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk7, IQC1, RSVD1, RSVD2, RSVD3, 0x3270, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pl0, RSVD0, RSVD1, RSVD2, RSVD3, 0x3274, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pl1, SOC, RSVD1, RSVD2, RSVD3, 0x3278, Y, Y, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pz0, VIMCLK2, RSVD1, RSVD2, RSVD3, 0x327c, N, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pz1, VIMCLK2, SDMMC1, RSVD2, RSVD3, 0x3280, N, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pz2, SDMMC3, CCLA, RSVD2, RSVD3, 0x3284, N, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pz3, SDMMC3, RSVD1, RSVD2, RSVD3, 0x3288, N, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pz4, SDMMC1, RSVD1, RSVD2, RSVD3, 0x328c, N, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pz5, SOC, RSVD1, RSVD2, RSVD3, 0x3290, N, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
/* pg_name, f0, f1, f2, f3, r, hsm, drvtype, e_io_hv, lpdr, rdrv, drvdn_b, drvdn_w, drvup_b, drvup_w, slwr_b, slwr_w, slwf_b, slwf_w */
|
||||
PINGROUP(sdmmc1_clk_pm0, SDMMC1, RSVD1, RSVD2, RSVD3, 0x3000, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc1_cmd_pm1, SDMMC1, SPI3, RSVD2, RSVD3, 0x3004, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc1_dat3_pm2, SDMMC1, SPI3, RSVD2, RSVD3, 0x3008, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc1_dat2_pm3, SDMMC1, SPI3, RSVD2, RSVD3, 0x300c, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc1_dat1_pm4, SDMMC1, SPI3, RSVD2, RSVD3, 0x3010, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc1_dat0_pm5, SDMMC1, RSVD1, RSVD2, RSVD3, 0x3014, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc3_clk_pp0, SDMMC3, RSVD1, RSVD2, RSVD3, 0x301c, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc3_cmd_pp1, SDMMC3, RSVD1, RSVD2, RSVD3, 0x3020, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc3_dat0_pp5, SDMMC3, RSVD1, RSVD2, RSVD3, 0x3024, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc3_dat1_pp4, SDMMC3, RSVD1, RSVD2, RSVD3, 0x3028, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc3_dat2_pp3, SDMMC3, RSVD1, RSVD2, RSVD3, 0x302c, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(sdmmc3_dat3_pp2, SDMMC3, RSVD1, RSVD2, RSVD3, 0x3030, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pex_l0_rst_n_pa0, PE0, RSVD1, RSVD2, RSVD3, 0x3038, N, N, Y, Y, 0xa5c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pex_l0_clkreq_n_pa1, PE0, RSVD1, RSVD2, RSVD3, 0x303c, N, N, Y, Y, 0xa58, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pex_wake_n_pa2, PE, RSVD1, RSVD2, RSVD3, 0x3040, N, N, Y, Y, 0xa68, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pex_l1_rst_n_pa3, PE1, RSVD1, RSVD2, RSVD3, 0x3044, N, N, Y, Y, 0xa64, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pex_l1_clkreq_n_pa4, PE1, RSVD1, RSVD2, RSVD3, 0x3048, N, N, Y, Y, 0xa60, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(sata_led_active_pa5, SATA, RSVD1, RSVD2, RSVD3, 0x304c, N, N, N, Y, 0xa94, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(spi1_mosi_pc0, SPI1, RSVD1, RSVD2, RSVD3, 0x3050, Y, Y, N, N, 0xae0, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi1_miso_pc1, SPI1, RSVD1, RSVD2, RSVD3, 0x3054, Y, Y, N, N, 0xadc, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi1_sck_pc2, SPI1, RSVD1, RSVD2, RSVD3, 0x3058, Y, Y, N, N, 0xae4, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi1_cs0_pc3, SPI1, RSVD1, RSVD2, RSVD3, 0x305c, Y, Y, N, N, 0xad4, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi1_cs1_pc4, SPI1, RSVD1, RSVD2, RSVD3, 0x3060, Y, Y, N, N, 0xad8, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi2_mosi_pb4, SPI2, DTV, RSVD2, RSVD3, 0x3064, Y, Y, N, N, 0xaf4, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi2_miso_pb5, SPI2, DTV, RSVD2, RSVD3, 0x3068, Y, Y, N, N, 0xaf0, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi2_sck_pb6, SPI2, DTV, RSVD2, RSVD3, 0x306c, Y, Y, N, N, 0xaf8, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi2_cs0_pb7, SPI2, DTV, RSVD2, RSVD3, 0x3070, Y, Y, N, N, 0xae8, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi2_cs1_pdd0, SPI2, RSVD1, RSVD2, RSVD3, 0x3074, Y, Y, N, N, 0xaec, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi4_mosi_pc7, SPI4, RSVD1, RSVD2, RSVD3, 0x3078, Y, Y, N, N, 0xb04, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi4_miso_pd0, SPI4, RSVD1, RSVD2, RSVD3, 0x307c, Y, Y, N, N, 0xb00, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi4_sck_pc5, SPI4, RSVD1, RSVD2, RSVD3, 0x3080, Y, Y, N, N, 0xb08, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(spi4_cs0_pc6, SPI4, RSVD1, RSVD2, RSVD3, 0x3084, Y, Y, N, N, 0xafc, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(qspi_sck_pee0, QSPI, RSVD1, RSVD2, RSVD3, 0x3088, Y, Y, N, N, 0xa90, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(qspi_cs_n_pee1, QSPI, RSVD1, RSVD2, RSVD3, 0x308c, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(qspi_io0_pee2, QSPI, RSVD1, RSVD2, RSVD3, 0x3090, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(qspi_io1_pee3, QSPI, RSVD1, RSVD2, RSVD3, 0x3094, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(qspi_io2_pee4, QSPI, RSVD1, RSVD2, RSVD3, 0x3098, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(qspi_io3_pee5, QSPI, RSVD1, RSVD2, RSVD3, 0x309c, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(dmic1_clk_pe0, DMIC1, I2S3, RSVD2, RSVD3, 0x30a4, N, N, N, Y, 0x984, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dmic1_dat_pe1, DMIC1, I2S3, RSVD2, RSVD3, 0x30a8, N, N, N, Y, 0x988, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dmic2_clk_pe2, DMIC2, I2S3, RSVD2, RSVD3, 0x30ac, N, N, N, Y, 0x98c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dmic2_dat_pe3, DMIC2, I2S3, RSVD2, RSVD3, 0x30b0, N, N, N, Y, 0x990, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dmic3_clk_pe4, DMIC3, I2S5A, RSVD2, RSVD3, 0x30b4, N, N, N, Y, 0x994, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dmic3_dat_pe5, DMIC3, I2S5A, RSVD2, RSVD3, 0x30b8, N, N, N, Y, 0x998, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gen1_i2c_scl_pj1, I2C1, RSVD1, RSVD2, RSVD3, 0x30bc, N, N, Y, Y, 0x9a8, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gen1_i2c_sda_pj0, I2C1, RSVD1, RSVD2, RSVD3, 0x30c0, N, N, Y, Y, 0x9ac, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gen2_i2c_scl_pj2, I2C2, RSVD1, RSVD2, RSVD3, 0x30c4, N, N, Y, Y, 0x9b0, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gen2_i2c_sda_pj3, I2C2, RSVD1, RSVD2, RSVD3, 0x30c8, N, N, Y, Y, 0x9b4, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gen3_i2c_scl_pf0, I2C3, RSVD1, RSVD2, RSVD3, 0x30cc, N, N, Y, Y, 0x9b8, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gen3_i2c_sda_pf1, I2C3, RSVD1, RSVD2, RSVD3, 0x30d0, N, N, Y, Y, 0x9bc, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam_i2c_scl_ps2, I2C3, I2CVI, RSVD2, RSVD3, 0x30d4, N, N, Y, Y, 0x934, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam_i2c_sda_ps3, I2C3, I2CVI, RSVD2, RSVD3, 0x30d8, N, N, Y, Y, 0x938, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pwr_i2c_scl_py3, I2CPMU, RSVD1, RSVD2, RSVD3, 0x30dc, N, N, Y, Y, 0xa6c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pwr_i2c_sda_py4, I2CPMU, RSVD1, RSVD2, RSVD3, 0x30e0, N, N, Y, Y, 0xa70, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart1_tx_pu0, UARTA, RSVD1, RSVD2, RSVD3, 0x30e4, N, N, N, Y, 0xb28, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart1_rx_pu1, UARTA, RSVD1, RSVD2, RSVD3, 0x30e8, N, N, N, Y, 0xb24, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart1_rts_pu2, UARTA, RSVD1, RSVD2, RSVD3, 0x30ec, N, N, N, Y, 0xb20, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart1_cts_pu3, UARTA, RSVD1, RSVD2, RSVD3, 0x30f0, N, N, N, Y, 0xb1c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart2_tx_pg0, UARTB, I2S4A, SPDIF, UART, 0x30f4, N, N, N, Y, 0xb38, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart2_rx_pg1, UARTB, I2S4A, SPDIF, UART, 0x30f8, N, N, N, Y, 0xb34, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart2_rts_pg2, UARTB, I2S4A, RSVD2, UART, 0x30fc, N, N, N, Y, 0xb30, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart2_cts_pg3, UARTB, I2S4A, RSVD2, UART, 0x3100, N, N, N, Y, 0xb2c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart3_tx_pd1, UARTC, SPI4, RSVD2, RSVD3, 0x3104, N, N, N, Y, 0xb48, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart3_rx_pd2, UARTC, SPI4, RSVD2, RSVD3, 0x3108, N, N, N, Y, 0xb44, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart3_rts_pd3, UARTC, SPI4, RSVD2, RSVD3, 0x310c, N, N, N, Y, 0xb40, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart3_cts_pd4, UARTC, SPI4, RSVD2, RSVD3, 0x3110, N, N, N, Y, 0xb3c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart4_tx_pi4, UARTD, UART, RSVD2, RSVD3, 0x3114, N, N, N, Y, 0xb58, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart4_rx_pi5, UARTD, UART, RSVD2, RSVD3, 0x3118, N, N, N, Y, 0xb54, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart4_rts_pi6, UARTD, UART, RSVD2, RSVD3, 0x311c, N, N, N, Y, 0xb50, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(uart4_cts_pi7, UARTD, UART, RSVD2, RSVD3, 0x3120, N, N, N, Y, 0xb4c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dap1_fs_pb0, I2S1, RSVD1, RSVD2, RSVD3, 0x3124, Y, Y, N, Y, 0x95c, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap1_din_pb1, I2S1, RSVD1, RSVD2, RSVD3, 0x3128, Y, Y, N, N, 0x954, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap1_dout_pb2, I2S1, RSVD1, RSVD2, RSVD3, 0x312c, Y, Y, N, N, 0x958, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap1_sclk_pb3, I2S1, RSVD1, RSVD2, RSVD3, 0x3130, Y, Y, N, N, 0x960, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap2_fs_paa0, I2S2, RSVD1, RSVD2, RSVD3, 0x3134, Y, Y, N, N, 0x96c, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap2_din_paa2, I2S2, RSVD1, RSVD2, RSVD3, 0x3138, Y, Y, N, N, 0x964, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap2_dout_paa3, I2S2, RSVD1, RSVD2, RSVD3, 0x313c, Y, Y, N, N, 0x968, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap2_sclk_paa1, I2S2, RSVD1, RSVD2, RSVD3, 0x3140, Y, Y, N, N, 0x970, -1, -1, -1, -1, 28, 2, 30, 2),
|
||||
PINGROUP(dap4_fs_pj4, I2S4B, RSVD1, RSVD2, RSVD3, 0x3144, N, N, N, Y, 0x97c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dap4_din_pj5, I2S4B, RSVD1, RSVD2, RSVD3, 0x3148, N, N, N, Y, 0x974, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dap4_dout_pj6, I2S4B, RSVD1, RSVD2, RSVD3, 0x314c, N, N, N, Y, 0x978, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dap4_sclk_pj7, I2S4B, RSVD1, RSVD2, RSVD3, 0x3150, N, N, N, Y, 0x980, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam1_mclk_ps0, EXTPERIPH3, RSVD1, RSVD2, RSVD3, 0x3154, N, N, N, Y, 0x918, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam2_mclk_ps1, EXTPERIPH3, RSVD1, RSVD2, RSVD3, 0x3158, N, N, N, Y, 0x924, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(jtag_rtck, JTAG, RSVD1, RSVD2, RSVD3, 0x315c, N, N, N, Y, 0xa2c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(clk_32k_in, CLK, RSVD1, RSVD2, RSVD3, 0x3160, N, N, N, Y, 0x940, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(clk_32k_out_py5, SOC, BLINK, RSVD2, RSVD3, 0x3164, N, N, N, Y, 0x944, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(batt_bcl, BCL, RSVD1, RSVD2, RSVD3, 0x3168, N, N, Y, Y, 0x8f8, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(clk_req, SYS, RSVD1, RSVD2, RSVD3, 0x316c, N, N, N, Y, 0x948, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cpu_pwr_req, CPU, RSVD1, RSVD2, RSVD3, 0x3170, N, N, N, Y, 0x950, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pwr_int_n, PMI, RSVD1, RSVD2, RSVD3, 0x3174, N, N, N, Y, 0xa74, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(shutdown, SHUTDOWN, RSVD1, RSVD2, RSVD3, 0x3178, N, N, N, Y, 0xac8, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(core_pwr_req, CORE, RSVD1, RSVD2, RSVD3, 0x317c, N, N, N, Y, 0x94c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(aud_mclk_pbb0, AUD, RSVD1, RSVD2, RSVD3, 0x3180, N, N, N, Y, 0x8f4, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dvfs_pwm_pbb1, RSVD0, CLDVFS, SPI3, RSVD3, 0x3184, N, N, N, Y, 0x9a4, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dvfs_clk_pbb2, RSVD0, CLDVFS, SPI3, RSVD3, 0x3188, N, N, N, Y, 0x9a0, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gpio_x1_aud_pbb3, RSVD0, RSVD1, SPI3, RSVD3, 0x318c, N, N, N, Y, 0xa14, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gpio_x3_aud_pbb4, RSVD0, RSVD1, SPI3, RSVD3, 0x3190, N, N, N, Y, 0xa18, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pcc7, RSVD0, RSVD1, RSVD2, RSVD3, 0x3194, N, N, Y, Y, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(hdmi_cec_pcc0, CEC, RSVD1, RSVD2, RSVD3, 0x3198, N, N, Y, Y, 0xa24, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(hdmi_int_dp_hpd_pcc1, DP, RSVD1, RSVD2, RSVD3, 0x319c, N, N, Y, Y, 0xa28, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(spdif_out_pcc2, SPDIF, RSVD1, RSVD2, RSVD3, 0x31a0, N, N, N, Y, 0xad0, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(spdif_in_pcc3, SPDIF, RSVD1, RSVD2, RSVD3, 0x31a4, N, N, N, Y, 0xacc, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(usb_vbus_en0_pcc4, USB, RSVD1, RSVD2, RSVD3, 0x31a8, N, N, Y, Y, 0xb5c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(usb_vbus_en1_pcc5, USB, RSVD1, RSVD2, RSVD3, 0x31ac, N, N, Y, Y, 0xb60, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(dp_hpd0_pcc6, DP, RSVD1, RSVD2, RSVD3, 0x31b0, N, N, N, Y, 0x99c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(wifi_en_ph0, RSVD0, RSVD1, RSVD2, RSVD3, 0x31b4, N, N, N, Y, 0xb64, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(wifi_rst_ph1, RSVD0, RSVD1, RSVD2, RSVD3, 0x31b8, N, N, N, Y, 0xb68, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(wifi_wake_ap_ph2, RSVD0, RSVD1, RSVD2, RSVD3, 0x31bc, N, N, N, Y, 0xb6c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(ap_wake_bt_ph3, RSVD0, UARTB, SPDIF, RSVD3, 0x31c0, N, N, N, Y, 0x8ec, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(bt_rst_ph4, RSVD0, UARTB, SPDIF, RSVD3, 0x31c4, N, N, N, Y, 0x8fc, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(bt_wake_ap_ph5, RSVD0, RSVD1, RSVD2, RSVD3, 0x31c8, N, N, N, Y, 0x900, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(ap_wake_nfc_ph7, RSVD0, RSVD1, RSVD2, RSVD3, 0x31cc, N, N, N, Y, 0x8f0, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(nfc_en_pi0, RSVD0, RSVD1, RSVD2, RSVD3, 0x31d0, N, N, N, Y, 0xa50, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(nfc_int_pi1, RSVD0, RSVD1, RSVD2, RSVD3, 0x31d4, N, N, N, Y, 0xa54, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gps_en_pi2, RSVD0, RSVD1, RSVD2, RSVD3, 0x31d8, N, N, N, Y, 0xa1c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(gps_rst_pi3, RSVD0, RSVD1, RSVD2, RSVD3, 0x31dc, N, N, N, Y, 0xa20, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam_rst_ps4, VGP1, RSVD1, RSVD2, RSVD3, 0x31e0, N, N, N, Y, 0x93c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam_af_en_ps5, VIMCLK, VGP2, RSVD2, RSVD3, 0x31e4, N, N, N, Y, 0x92c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam_flash_en_ps6, VIMCLK, VGP3, RSVD2, RSVD3, 0x31e8, N, N, N, Y, 0x930, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam1_pwdn_ps7, VGP4, RSVD1, RSVD2, RSVD3, 0x31ec, N, N, N, Y, 0x91c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam2_pwdn_pt0, VGP5, RSVD1, RSVD2, RSVD3, 0x31f0, N, N, N, Y, 0x928, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(cam1_strobe_pt1, VGP6, RSVD1, RSVD2, RSVD3, 0x31f4, N, N, N, Y, 0x920, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(lcd_te_py2, DISPLAYA, RSVD1, RSVD2, RSVD3, 0x31f8, N, N, N, Y, 0xa44, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(lcd_bl_pwm_pv0, DISPLAYA, PWM0, SOR0, RSVD3, 0x31fc, N, N, N, Y, 0xa34, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(lcd_bl_en_pv1, RSVD0, RSVD1, RSVD2, RSVD3, 0x3200, N, N, N, Y, 0xa30, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(lcd_rst_pv2, RSVD0, RSVD1, RSVD2, RSVD3, 0x3204, N, N, N, Y, 0xa40, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(lcd_gpio1_pv3, DISPLAYB, RSVD1, RSVD2, RSVD3, 0x3208, N, N, N, Y, 0xa38, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(lcd_gpio2_pv4, DISPLAYB, PWM1, RSVD2, SOR1, 0x320c, N, N, N, Y, 0xa3c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(ap_ready_pv5, RSVD0, RSVD1, RSVD2, RSVD3, 0x3210, N, N, N, Y, 0x8e8, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(touch_rst_pv6, RSVD0, RSVD1, RSVD2, RSVD3, 0x3214, N, N, N, Y, 0xb18, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(touch_clk_pv7, TOUCH, RSVD1, RSVD2, RSVD3, 0x3218, N, N, N, Y, 0xb10, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(modem_wake_ap_px0, RSVD0, RSVD1, RSVD2, RSVD3, 0x321c, N, N, N, Y, 0xa48, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(touch_int_px1, RSVD0, RSVD1, RSVD2, RSVD3, 0x3220, N, N, N, Y, 0xb14, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(motion_int_px2, RSVD0, RSVD1, RSVD2, RSVD3, 0x3224, N, N, N, Y, 0xa4c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(als_prox_int_px3, RSVD0, RSVD1, RSVD2, RSVD3, 0x3228, N, N, N, Y, 0x8e4, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(temp_alert_px4, RSVD0, RSVD1, RSVD2, RSVD3, 0x322c, N, N, N, Y, 0xb0c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(button_power_on_px5, RSVD0, RSVD1, RSVD2, RSVD3, 0x3230, N, N, N, Y, 0x908, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(button_vol_up_px6, RSVD0, RSVD1, RSVD2, RSVD3, 0x3234, N, N, N, Y, 0x914, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(button_vol_down_px7, RSVD0, RSVD1, RSVD2, RSVD3, 0x3238, N, N, N, Y, 0x910, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(button_slide_sw_py0, RSVD0, RSVD1, RSVD2, RSVD3, 0x323c, N, N, N, Y, 0x90c, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(button_home_py1, RSVD0, RSVD1, RSVD2, RSVD3, 0x3240, N, N, N, Y, 0x904, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
PINGROUP(pa6, SATA, RSVD1, RSVD2, RSVD3, 0x3244, N, N, N, Y, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pe6, RSVD0, I2S5A, PWM2, RSVD3, 0x3248, N, N, N, Y, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pe7, RSVD0, I2S5A, PWM3, RSVD3, 0x324c, N, N, N, Y, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(ph6, RSVD0, RSVD1, RSVD2, RSVD3, 0x3250, N, N, N, Y, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk0, IQC0, I2S5B, RSVD2, RSVD3, 0x3254, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk1, IQC0, I2S5B, RSVD2, RSVD3, 0x3258, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk2, IQC0, I2S5B, RSVD2, RSVD3, 0x325c, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk3, IQC0, I2S5B, RSVD2, RSVD3, 0x3260, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk4, IQC1, RSVD1, RSVD2, RSVD3, 0x3264, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk5, IQC1, RSVD1, RSVD2, RSVD3, 0x3268, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk6, IQC1, RSVD1, RSVD2, RSVD3, 0x326c, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pk7, IQC1, RSVD1, RSVD2, RSVD3, 0x3270, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pl0, RSVD0, RSVD1, RSVD2, RSVD3, 0x3274, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pl1, SOC, RSVD1, RSVD2, RSVD3, 0x3278, Y, Y, N, N, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pz0, VIMCLK2, RSVD1, RSVD2, RSVD3, 0x327c, N, N, N, Y, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pz1, VIMCLK2, SDMMC1, RSVD2, RSVD3, 0x3280, N, N, N, Y, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pz2, SDMMC3, CCLA, RSVD2, RSVD3, 0x3284, N, N, N, Y, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pz3, SDMMC3, RSVD1, RSVD2, RSVD3, 0x3288, N, N, N, Y, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pz4, SDMMC1, RSVD1, RSVD2, RSVD3, 0x328c, N, N, N, Y, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
PINGROUP(pz5, SOC, RSVD1, RSVD2, RSVD3, 0x3290, N, N, N, Y, -1, -1, -1, -1, -1, -1, -1, -1, -1),
|
||||
|
||||
/* pg_name, r, prk_mask, drvdn_b, drvdn_w, drvup_b, drvup_w, slwr_b, slwr_w, slwf_b, slwf_w */
|
||||
DRV_PINGROUP(pa6, 0x9c0, 0x0, 12, 5, 20, 5, -1, -1, -1, -1),
|
||||
|
|
|
@ -45,4 +45,8 @@ config PINCTRL_UNIPHIER_PXS3
|
|||
bool "UniPhier PXs3 SoC pinctrl driver"
|
||||
default ARM64
|
||||
|
||||
config PINCTRL_UNIPHIER_NX1
|
||||
bool "UniPhier NX1 SoC pinctrl driver"
|
||||
default ARM64
|
||||
|
||||
endif
|
||||
|
|
|
@ -10,3 +10,4 @@ obj-$(CONFIG_PINCTRL_UNIPHIER_LD6B) += pinctrl-uniphier-ld6b.o
|
|||
obj-$(CONFIG_PINCTRL_UNIPHIER_LD11) += pinctrl-uniphier-ld11.o
|
||||
obj-$(CONFIG_PINCTRL_UNIPHIER_LD20) += pinctrl-uniphier-ld20.o
|
||||
obj-$(CONFIG_PINCTRL_UNIPHIER_PXS3) += pinctrl-uniphier-pxs3.o
|
||||
obj-$(CONFIG_PINCTRL_UNIPHIER_NX1) += pinctrl-uniphier-nx1.o
|
||||
|
|
|
@ -461,10 +461,18 @@ static const struct pinctrl_pin_desc uniphier_ld11_pins[] = {
|
|||
166, UNIPHIER_PIN_PULL_DOWN),
|
||||
};
|
||||
|
||||
static const unsigned ain1_pins[] = {151, 152, 153, 154, 155, 156, 157};
|
||||
static const int ain1_muxvals[] = {4, 4, 4, 4, 4, 4, 4};
|
||||
static const unsigned aout1_pins[] = {137, 138, 139, 140, 141, 142};
|
||||
static const int aout1_muxvals[] = {0, 0, 0, 0, 0, 0};
|
||||
static const unsigned ainiec1_pins[] = {150};
|
||||
static const int ainiec1_muxvals[] = {4};
|
||||
static const unsigned ainiec1b_pins[] = {141};
|
||||
static const int ainiec1b_muxvals[] = {4};
|
||||
static const unsigned aoutiec1_pins[] = {135, 136};
|
||||
static const int aoutiec1_muxvals[] = {0, 0};
|
||||
static const unsigned aoutiec2_pins[] = {135, 136};
|
||||
static const int aoutiec2_muxvals[] = {1, 1};
|
||||
static const unsigned int emmc_pins[] = {19, 20, 21, 22, 23, 24, 25};
|
||||
static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0};
|
||||
static const unsigned emmc_dat8_pins[] = {26, 27, 28, 29};
|
||||
|
@ -573,8 +581,12 @@ static const unsigned int gpio_range5_pins[] = {
|
|||
};
|
||||
|
||||
static const struct uniphier_pinctrl_group uniphier_ld11_groups[] = {
|
||||
UNIPHIER_PINCTRL_GROUP(ain1),
|
||||
UNIPHIER_PINCTRL_GROUP(aout1),
|
||||
UNIPHIER_PINCTRL_GROUP(ainiec1),
|
||||
UNIPHIER_PINCTRL_GROUP(ainiec1b),
|
||||
UNIPHIER_PINCTRL_GROUP(aoutiec1),
|
||||
UNIPHIER_PINCTRL_GROUP(aoutiec2),
|
||||
UNIPHIER_PINCTRL_GROUP(emmc),
|
||||
UNIPHIER_PINCTRL_GROUP(emmc_dat8),
|
||||
UNIPHIER_PINCTRL_GROUP(ether_rmii),
|
||||
|
@ -614,8 +626,11 @@ static const struct uniphier_pinctrl_group uniphier_ld11_groups[] = {
|
|||
UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range5),
|
||||
};
|
||||
|
||||
static const char * const ain1_groups[] = {"ain1"};
|
||||
static const char * const aout1_groups[] = {"aout1"};
|
||||
static const char * const ainiec1_groups[] = {"ainiec1", "ainiec1b"};
|
||||
static const char * const aoutiec1_groups[] = {"aoutiec1"};
|
||||
static const char * const aoutiec2_groups[] = {"aoutiec2"};
|
||||
static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
|
||||
static const char * const ether_rmii_groups[] = {"ether_rmii"};
|
||||
static const char * const hscin0_groups[] = {"hscin0_ci",
|
||||
|
@ -646,8 +661,11 @@ static const char * const usb1_groups[] = {"usb1"};
|
|||
static const char * const usb2_groups[] = {"usb2"};
|
||||
|
||||
static const struct uniphier_pinmux_function uniphier_ld11_functions[] = {
|
||||
UNIPHIER_PINMUX_FUNCTION(ain1),
|
||||
UNIPHIER_PINMUX_FUNCTION(aout1),
|
||||
UNIPHIER_PINMUX_FUNCTION(ainiec1),
|
||||
UNIPHIER_PINMUX_FUNCTION(aoutiec1),
|
||||
UNIPHIER_PINMUX_FUNCTION(aoutiec2),
|
||||
UNIPHIER_PINMUX_FUNCTION(emmc),
|
||||
UNIPHIER_PINMUX_FUNCTION(ether_rmii),
|
||||
UNIPHIER_PINMUX_FUNCTION(hscin0),
|
||||
|
|
|
@ -542,12 +542,26 @@ static const struct pinctrl_pin_desc uniphier_ld20_pins[] = {
|
|||
175, UNIPHIER_PIN_PULL_DOWN),
|
||||
};
|
||||
|
||||
static const unsigned ain1_pins[] = {150, 151, 152, 153, 154, 155, 156};
|
||||
static const int ain1_muxvals[] = {4, 4, 4, 4, 4, 4, 4};
|
||||
static const unsigned ain2_pins[] = {116, 117, 118, 119, 120, 121, 122};
|
||||
static const int ain2_muxvals[] = {26, 26, 26, 26, 26, 26, 26};
|
||||
static const unsigned ain3_pins[] = {116, 117, 118, 119};
|
||||
static const int ain3_muxvals[] = {27, 27, 27, 27};
|
||||
static const unsigned aout1_pins[] = {137, 138, 139, 140, 141, 142};
|
||||
static const int aout1_muxvals[] = {0, 0, 0, 0, 0, 0};
|
||||
static const unsigned aout1b_pins[] = {150, 151, 152, 153, 154, 155, 156};
|
||||
static const int aout1b_muxvals[] = {1, 1, 1, 1, 1, 1, 1};
|
||||
static const unsigned aout2_pins[] = {165, 157, 162, 158, 159, 160, 161};
|
||||
static const int aout2_muxvals[] = {2, 2, 2, 1, 1, 1, 1};
|
||||
static const unsigned aout3_pins[] = {166, 167, 168, 163};
|
||||
static const int aout3_muxvals[] = {2, 2, 2, 1};
|
||||
static const unsigned aout4_pins[] = {169, 170, 171, 164};
|
||||
static const int aout4_muxvals[] = {2, 2, 2, 1};
|
||||
static const unsigned aoutiec1_pins[] = {135, 136};
|
||||
static const int aoutiec1_muxvals[] = {0, 0};
|
||||
static const unsigned aoutiec2_pins[] = {135, 136};
|
||||
static const int aoutiec2_muxvals[] = {1, 1};
|
||||
static const unsigned int emmc_pins[] = {19, 20, 21, 22, 23, 24, 25};
|
||||
static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0};
|
||||
static const unsigned emmc_dat8_pins[] = {26, 27, 28, 29};
|
||||
|
@ -667,9 +681,16 @@ static const unsigned int gpio_range2_pins[] = {
|
|||
};
|
||||
|
||||
static const struct uniphier_pinctrl_group uniphier_ld20_groups[] = {
|
||||
UNIPHIER_PINCTRL_GROUP(ain1),
|
||||
UNIPHIER_PINCTRL_GROUP(ain2),
|
||||
UNIPHIER_PINCTRL_GROUP(ain3),
|
||||
UNIPHIER_PINCTRL_GROUP(aout1),
|
||||
UNIPHIER_PINCTRL_GROUP(aout1b),
|
||||
UNIPHIER_PINCTRL_GROUP(aout2),
|
||||
UNIPHIER_PINCTRL_GROUP(aout3),
|
||||
UNIPHIER_PINCTRL_GROUP(aout4),
|
||||
UNIPHIER_PINCTRL_GROUP(aoutiec1),
|
||||
UNIPHIER_PINCTRL_GROUP(aoutiec2),
|
||||
UNIPHIER_PINCTRL_GROUP(emmc),
|
||||
UNIPHIER_PINCTRL_GROUP(emmc_dat8),
|
||||
UNIPHIER_PINCTRL_GROUP(ether_rgmii),
|
||||
|
@ -713,8 +734,15 @@ static const struct uniphier_pinctrl_group uniphier_ld20_groups[] = {
|
|||
UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range2),
|
||||
};
|
||||
|
||||
static const char * const ain1_groups[] = {"ain1"};
|
||||
static const char * const ain2_groups[] = {"ain2"};
|
||||
static const char * const ain3_groups[] = {"ain3"};
|
||||
static const char * const aout1_groups[] = {"aout1", "aout1b"};
|
||||
static const char * const aout2_groups[] = {"aout2"};
|
||||
static const char * const aout3_groups[] = {"aout3"};
|
||||
static const char * const aout4_groups[] = {"aout4"};
|
||||
static const char * const aoutiec1_groups[] = {"aoutiec1"};
|
||||
static const char * const aoutiec2_groups[] = {"aoutiec2"};
|
||||
static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
|
||||
static const char * const ether_rgmii_groups[] = {"ether_rgmii"};
|
||||
static const char * const ether_rmii_groups[] = {"ether_rmii"};
|
||||
|
@ -752,8 +780,15 @@ static const char * const usb2_groups[] = {"usb2"};
|
|||
static const char * const usb3_groups[] = {"usb3"};
|
||||
|
||||
static const struct uniphier_pinmux_function uniphier_ld20_functions[] = {
|
||||
UNIPHIER_PINMUX_FUNCTION(ain1),
|
||||
UNIPHIER_PINMUX_FUNCTION(ain2),
|
||||
UNIPHIER_PINMUX_FUNCTION(ain3),
|
||||
UNIPHIER_PINMUX_FUNCTION(aout1),
|
||||
UNIPHIER_PINMUX_FUNCTION(aout2),
|
||||
UNIPHIER_PINMUX_FUNCTION(aout3),
|
||||
UNIPHIER_PINMUX_FUNCTION(aout4),
|
||||
UNIPHIER_PINMUX_FUNCTION(aoutiec1),
|
||||
UNIPHIER_PINMUX_FUNCTION(aoutiec2),
|
||||
UNIPHIER_PINMUX_FUNCTION(emmc),
|
||||
UNIPHIER_PINMUX_FUNCTION(ether_rgmii),
|
||||
UNIPHIER_PINMUX_FUNCTION(ether_rmii),
|
||||
|
|
|
@ -0,0 +1,489 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
//
|
||||
// Copyright (C) 2019 Socionext Inc.
|
||||
// Author: Masahiro Yamada <yamada.masahiro@socionext.com>
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include "pinctrl-uniphier.h"
|
||||
|
||||
static const struct pinctrl_pin_desc uniphier_nx1_pins[] = {
|
||||
UNIPHIER_PINCTRL_PIN(0, "LPST", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
0, UNIPHIER_PIN_DRV_3BIT,
|
||||
0, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(1, "SDCLK", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
12, UNIPHIER_PIN_DRV_2BIT,
|
||||
1, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(2, "SDCMD", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
13, UNIPHIER_PIN_DRV_2BIT,
|
||||
2, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(3, "SDDAT0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
14, UNIPHIER_PIN_DRV_2BIT,
|
||||
3, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(4, "SDDAT1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
15, UNIPHIER_PIN_DRV_2BIT,
|
||||
4, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(5, "SDDAT2", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
16, UNIPHIER_PIN_DRV_2BIT,
|
||||
5, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(6, "SDDAT3", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
17, UNIPHIER_PIN_DRV_2BIT,
|
||||
6, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(7, "SDCD", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
1, UNIPHIER_PIN_DRV_3BIT,
|
||||
7, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(8, "SDWP", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
2, UNIPHIER_PIN_DRV_3BIT,
|
||||
8, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(9, "SDVOLC", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
3, UNIPHIER_PIN_DRV_3BIT,
|
||||
9, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(10, "XERST", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
0, UNIPHIER_PIN_DRV_2BIT,
|
||||
10, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(11, "MDC", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
18, UNIPHIER_PIN_DRV_2BIT,
|
||||
11, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(12, "MDIO", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
19, UNIPHIER_PIN_DRV_2BIT,
|
||||
12, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(13, "MDIO_INTL", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
20, UNIPHIER_PIN_DRV_2BIT,
|
||||
13, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(14, "PHYRSTL", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
-1, UNIPHIER_PIN_DRV_FIXED4,
|
||||
-1, UNIPHIER_PIN_PULL_NONE),
|
||||
UNIPHIER_PINCTRL_PIN(15, "RGMII_RXCLK", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
22, UNIPHIER_PIN_DRV_2BIT,
|
||||
15, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(16, "RGMII_RXD0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
23, UNIPHIER_PIN_DRV_2BIT,
|
||||
16, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(17, "RGMII_RXD1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
24, UNIPHIER_PIN_DRV_2BIT,
|
||||
17, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(18, "RGMII_RXD2", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
25, UNIPHIER_PIN_DRV_2BIT,
|
||||
18, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(19, "RGMII_RXD3", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
26, UNIPHIER_PIN_DRV_2BIT,
|
||||
19, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(20, "RGMII_RXCTL", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
27, UNIPHIER_PIN_DRV_2BIT,
|
||||
20, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(21, "RGMII_TXCLK", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
28, UNIPHIER_PIN_DRV_2BIT,
|
||||
21, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(22, "RGMII_TXD0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
29, UNIPHIER_PIN_DRV_2BIT,
|
||||
22, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(23, "RGMII_TXD1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
30, UNIPHIER_PIN_DRV_2BIT,
|
||||
23, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(24, "RGMII_TXD2", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
31, UNIPHIER_PIN_DRV_2BIT,
|
||||
24, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(25, "RGMII_TXD3", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
32, UNIPHIER_PIN_DRV_2BIT,
|
||||
25, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(26, "RGMII_TXCTL", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
33, UNIPHIER_PIN_DRV_2BIT,
|
||||
26, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(27, "TXD0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
4, UNIPHIER_PIN_DRV_3BIT,
|
||||
27, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(28, "RXD0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
5, UNIPHIER_PIN_DRV_3BIT,
|
||||
28, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(29, "TXD1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
6, UNIPHIER_PIN_DRV_3BIT,
|
||||
29, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(30, "RXD1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
7, UNIPHIER_PIN_DRV_3BIT,
|
||||
30, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(31, "XRTS1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
8, UNIPHIER_PIN_DRV_3BIT,
|
||||
31, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(32, "XDTR1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
9, UNIPHIER_PIN_DRV_3BIT,
|
||||
32, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(33, "XCTS1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
10, UNIPHIER_PIN_DRV_3BIT,
|
||||
33, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(34, "XDSR1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
11, UNIPHIER_PIN_DRV_3BIT,
|
||||
34, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(35, "XDCD1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
12, UNIPHIER_PIN_DRV_3BIT,
|
||||
35, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(36, "TXD2", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
13, UNIPHIER_PIN_DRV_3BIT,
|
||||
36, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(37, "RXD2", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
14, UNIPHIER_PIN_DRV_3BIT,
|
||||
37, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(38, "XRTS2", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
15, UNIPHIER_PIN_DRV_3BIT,
|
||||
38, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(39, "XCTS2", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
16, UNIPHIER_PIN_DRV_3BIT,
|
||||
39, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(40, "TXD3", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
17, UNIPHIER_PIN_DRV_3BIT,
|
||||
40, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(41, "RXD3", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
18, UNIPHIER_PIN_DRV_3BIT,
|
||||
41, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(42, "SPISYNC0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
19, UNIPHIER_PIN_DRV_3BIT,
|
||||
42, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(43, "SPISCLK0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
20, UNIPHIER_PIN_DRV_3BIT,
|
||||
43, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(44, "SPITXD0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
21, UNIPHIER_PIN_DRV_3BIT,
|
||||
44, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(45, "SPIRXD0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
22, UNIPHIER_PIN_DRV_3BIT,
|
||||
45, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(46, "SPISYNC1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
23, UNIPHIER_PIN_DRV_3BIT,
|
||||
46, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(47, "SPISCLK1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
24, UNIPHIER_PIN_DRV_3BIT,
|
||||
47, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(48, "SPITXD1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
25, UNIPHIER_PIN_DRV_3BIT,
|
||||
48, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(49, "SPIRXD1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
26, UNIPHIER_PIN_DRV_3BIT,
|
||||
49, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(50, "SDA0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
-1, UNIPHIER_PIN_DRV_FIXED4,
|
||||
-1, UNIPHIER_PIN_PULL_NONE),
|
||||
UNIPHIER_PINCTRL_PIN(51, "SCL0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
-1, UNIPHIER_PIN_DRV_FIXED4,
|
||||
-1, UNIPHIER_PIN_PULL_NONE),
|
||||
UNIPHIER_PINCTRL_PIN(52, "SDA1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
-1, UNIPHIER_PIN_DRV_FIXED4,
|
||||
-1, UNIPHIER_PIN_PULL_NONE),
|
||||
UNIPHIER_PINCTRL_PIN(53, "SCL1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
-1, UNIPHIER_PIN_DRV_FIXED4,
|
||||
-1, UNIPHIER_PIN_PULL_NONE),
|
||||
UNIPHIER_PINCTRL_PIN(54, "SDA2", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
-1, UNIPHIER_PIN_DRV_FIXED4,
|
||||
-1, UNIPHIER_PIN_PULL_NONE),
|
||||
UNIPHIER_PINCTRL_PIN(55, "SCL2", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
-1, UNIPHIER_PIN_DRV_FIXED4,
|
||||
-1, UNIPHIER_PIN_PULL_NONE),
|
||||
UNIPHIER_PINCTRL_PIN(56, "SDA3", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
-1, UNIPHIER_PIN_DRV_FIXED4,
|
||||
-1, UNIPHIER_PIN_PULL_NONE),
|
||||
UNIPHIER_PINCTRL_PIN(57, "SCL3", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
-1, UNIPHIER_PIN_DRV_FIXED4,
|
||||
-1, UNIPHIER_PIN_PULL_NONE),
|
||||
UNIPHIER_PINCTRL_PIN(58, "XIRQ0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
27, UNIPHIER_PIN_DRV_3BIT,
|
||||
58, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(59, "XIRQ1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
28, UNIPHIER_PIN_DRV_3BIT,
|
||||
59, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(60, "XIRQ2", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
29, UNIPHIER_PIN_DRV_3BIT,
|
||||
60, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(61, "XIRQ3", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
30, UNIPHIER_PIN_DRV_3BIT,
|
||||
61, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(62, "XIRQ4", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
31, UNIPHIER_PIN_DRV_3BIT,
|
||||
62, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(63, "XIRQ5", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
32, UNIPHIER_PIN_DRV_3BIT,
|
||||
63, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(64, "PORT00", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
33, UNIPHIER_PIN_DRV_3BIT,
|
||||
64, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(65, "PORT01", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
34, UNIPHIER_PIN_DRV_3BIT,
|
||||
65, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(66, "PORT02", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
35, UNIPHIER_PIN_DRV_3BIT,
|
||||
66, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(67, "PORT03", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
36, UNIPHIER_PIN_DRV_3BIT,
|
||||
67, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(68, "PORT04", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
37, UNIPHIER_PIN_DRV_3BIT,
|
||||
68, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(69, "PORT05", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
38, UNIPHIER_PIN_DRV_3BIT,
|
||||
69, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(70, "PORT06", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
39, UNIPHIER_PIN_DRV_3BIT,
|
||||
70, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(71, "PORT07", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
40, UNIPHIER_PIN_DRV_3BIT,
|
||||
71, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(72, "PORT10", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
41, UNIPHIER_PIN_DRV_3BIT,
|
||||
72, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(73, "PORT11", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
42, UNIPHIER_PIN_DRV_3BIT,
|
||||
73, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(74, "PORT12", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
43, UNIPHIER_PIN_DRV_3BIT,
|
||||
74, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(75, "PORT13", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
44, UNIPHIER_PIN_DRV_3BIT,
|
||||
75, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(76, "PORT14", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
45, UNIPHIER_PIN_DRV_3BIT,
|
||||
76, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(77, "PORT15", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
46, UNIPHIER_PIN_DRV_3BIT,
|
||||
77, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(78, "USBAVBUS", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
47, UNIPHIER_PIN_DRV_3BIT,
|
||||
78, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(79, "USBAOD", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
48, UNIPHIER_PIN_DRV_3BIT,
|
||||
79, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(80, "USBBVBUS", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
49, UNIPHIER_PIN_DRV_3BIT,
|
||||
80, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(81, "USBBOD", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
50, UNIPHIER_PIN_DRV_3BIT,
|
||||
81, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(82, "HTDDCSDA0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
-1, UNIPHIER_PIN_DRV_FIXED4,
|
||||
-1, UNIPHIER_PIN_PULL_NONE),
|
||||
UNIPHIER_PINCTRL_PIN(83, "HTDDCSCL0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
-1, UNIPHIER_PIN_DRV_FIXED4,
|
||||
-1, UNIPHIER_PIN_PULL_NONE),
|
||||
UNIPHIER_PINCTRL_PIN(84, "HTHPDI0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
-1, UNIPHIER_PIN_DRV_FIXED4,
|
||||
-1, UNIPHIER_PIN_PULL_NONE),
|
||||
UNIPHIER_PINCTRL_PIN(85, "MMCCLK", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
1, UNIPHIER_PIN_DRV_2BIT,
|
||||
85, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(86, "MMCCMD", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
2, UNIPHIER_PIN_DRV_2BIT,
|
||||
86, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(87, "MMCDS", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
3, UNIPHIER_PIN_DRV_2BIT,
|
||||
87, UNIPHIER_PIN_PULL_DOWN),
|
||||
UNIPHIER_PINCTRL_PIN(88, "MMCDAT0", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
4, UNIPHIER_PIN_DRV_2BIT,
|
||||
88, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(89, "MMCDAT1", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
5, UNIPHIER_PIN_DRV_2BIT,
|
||||
89, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(90, "MMCDAT2", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
6, UNIPHIER_PIN_DRV_2BIT,
|
||||
90, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(91, "MMCDAT3", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
7, UNIPHIER_PIN_DRV_2BIT,
|
||||
91, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(92, "MMCDAT4", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
8, UNIPHIER_PIN_DRV_2BIT,
|
||||
92, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(93, "MMCDAT5", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
9, UNIPHIER_PIN_DRV_2BIT,
|
||||
93, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(94, "MMCDAT6", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
10, UNIPHIER_PIN_DRV_2BIT,
|
||||
94, UNIPHIER_PIN_PULL_UP),
|
||||
UNIPHIER_PINCTRL_PIN(95, "MMCDAT7", UNIPHIER_PIN_IECTRL_EXIST,
|
||||
11, UNIPHIER_PIN_DRV_2BIT,
|
||||
95, UNIPHIER_PIN_PULL_UP),
|
||||
};
|
||||
|
||||
static const unsigned int emmc_pins[] = {85, 86, 87, 88, 89, 90, 91};
|
||||
static const int emmc_muxvals[] = {-1, -1, -1, -1, -1, -1, -1};
|
||||
static const unsigned int emmc_dat8_pins[] = {92, 93, 94, 95};
|
||||
static const int emmc_dat8_muxvals[] = {-1, -1, -1, -1};
|
||||
static const unsigned int ether_rgmii_pins[] = {11, 12, 13, 14, 15, 16, 17, 18,
|
||||
19, 20, 21, 22, 23, 24, 25, 26};
|
||||
static const int ether_rgmii_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0};
|
||||
static const unsigned int ether_rmii_pins[] = {11, 12, 13, 14, 15, 16, 17, 18,
|
||||
20, 22, 23, 26};
|
||||
static const int ether_rmii_muxvals[] = {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1};
|
||||
static const unsigned int i2c0_pins[] = {50, 51};
|
||||
static const int i2c0_muxvals[] = {0, 0};
|
||||
static const unsigned int i2c1_pins[] = {52, 53};
|
||||
static const int i2c1_muxvals[] = {0, 0};
|
||||
static const unsigned int i2c2_pins[] = {54, 55};
|
||||
static const int i2c2_muxvals[] = {0, 0};
|
||||
static const unsigned int i2c3_pins[] = {56, 57};
|
||||
static const int i2c3_muxvals[] = {0, 0};
|
||||
static const unsigned int i2c4_pins[] = {72, 73};
|
||||
static const int i2c4_muxvals[] = {1, 1};
|
||||
static const unsigned int i2c5_pins[] = {74, 75};
|
||||
static const int i2c5_muxvals[] = {1, 1};
|
||||
static const unsigned int i2c6_pins[] = {82, 83};
|
||||
static const int i2c6_muxvals[] = {1, 1};
|
||||
static const unsigned int sd_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
static const int sd_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
static const unsigned spi0_pins[] = {42, 43, 44, 45};
|
||||
static const int spi0_muxvals[] = {0, 0, 0, 0};
|
||||
static const unsigned spi1_pins[] = {46, 47, 48, 49};
|
||||
static const int spi1_muxvals[] = {0, 0, 0, 0};
|
||||
static const unsigned int uart0_pins[] = {27, 28};
|
||||
static const int uart0_muxvals[] = {0, 0};
|
||||
static const unsigned int uart1_pins[] = {29, 30};
|
||||
static const int uart1_muxvals[] = {0, 0};
|
||||
static const unsigned int uart1_ctsrts_pins[] = {31, 33};
|
||||
static const int uart1_ctsrts_muxvals[] = {0, 0};
|
||||
static const unsigned int uart1_modem_pins[] = {32, 34, 35};
|
||||
static const int uart1_modem_muxvals[] = {0, 0, 0};
|
||||
static const unsigned int uart2_pins[] = {36, 37};
|
||||
static const int uart2_muxvals[] = {0, 0};
|
||||
static const unsigned int uart2_ctsrts_pins[] = {38, 39};
|
||||
static const int uart2_ctsrts_muxvals[] = {0, 0};
|
||||
static const unsigned int uart3_pins[] = {40, 41};
|
||||
static const int uart3_muxvals[] = {0, 0};
|
||||
static const unsigned int usb0_pins[] = {78, 79};
|
||||
static const int usb0_muxvals[] = {0, 0};
|
||||
static const unsigned int usb1_pins[] = {80, 81};
|
||||
static const int usb1_muxvals[] = {0, 0};
|
||||
static const unsigned int gpio_range0_pins[] = {
|
||||
64, 65, 66, 67, 68, 69, 70, 71, /* PORT0x */
|
||||
72, 73, 74, 75, 76, 77, 0, 1, /* PORT1x */
|
||||
2, 3, 4, 5, 6, 7, 8, 9, /* PORT2x */
|
||||
10, 78, 79, 80, 81, /* PORT30-34 */
|
||||
};
|
||||
static const unsigned int gpio_range1_pins[] = {
|
||||
11, 12, 13, /* PORT61-63 */
|
||||
};
|
||||
static const unsigned int gpio_range2_pins[] = {
|
||||
15, 16, 17, /* PORT65-67 */
|
||||
18, 19, 20, 21, 22, 23, 24, 25, /* PORT7x */
|
||||
26, 27, 28, 29, 30, 31, 32, 33, /* PORT8x */
|
||||
34, 35, 36, 37, 38, 39, 40, 41, /* PORT9x */
|
||||
42, 43, 44, 45, 46, 47, 48, 49, /* PORT10x */
|
||||
};
|
||||
static const unsigned int gpio_range3_pins[] = {
|
||||
58, 59, 60, 61, 62, 63, /* PORT12x */
|
||||
};
|
||||
static const unsigned int gpio_range4_pins[] = {
|
||||
58, 59, 60, 61, 62, 63, /* XIRQ0-5 */
|
||||
};
|
||||
|
||||
static const struct uniphier_pinctrl_group uniphier_nx1_groups[] = {
|
||||
UNIPHIER_PINCTRL_GROUP(emmc),
|
||||
UNIPHIER_PINCTRL_GROUP(emmc_dat8),
|
||||
UNIPHIER_PINCTRL_GROUP(ether_rgmii),
|
||||
UNIPHIER_PINCTRL_GROUP(ether_rmii),
|
||||
UNIPHIER_PINCTRL_GROUP(i2c0),
|
||||
UNIPHIER_PINCTRL_GROUP(i2c1),
|
||||
UNIPHIER_PINCTRL_GROUP(i2c2),
|
||||
UNIPHIER_PINCTRL_GROUP(i2c3),
|
||||
UNIPHIER_PINCTRL_GROUP(i2c4),
|
||||
UNIPHIER_PINCTRL_GROUP(i2c5),
|
||||
UNIPHIER_PINCTRL_GROUP(i2c6),
|
||||
UNIPHIER_PINCTRL_GROUP(sd),
|
||||
UNIPHIER_PINCTRL_GROUP(spi0),
|
||||
UNIPHIER_PINCTRL_GROUP(spi1),
|
||||
UNIPHIER_PINCTRL_GROUP(uart0),
|
||||
UNIPHIER_PINCTRL_GROUP(uart1),
|
||||
UNIPHIER_PINCTRL_GROUP(uart1_ctsrts),
|
||||
UNIPHIER_PINCTRL_GROUP(uart1_modem),
|
||||
UNIPHIER_PINCTRL_GROUP(uart2),
|
||||
UNIPHIER_PINCTRL_GROUP(uart2_ctsrts),
|
||||
UNIPHIER_PINCTRL_GROUP(uart3),
|
||||
UNIPHIER_PINCTRL_GROUP(usb0),
|
||||
UNIPHIER_PINCTRL_GROUP(usb1),
|
||||
UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range0),
|
||||
UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range1),
|
||||
UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range2),
|
||||
UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range3),
|
||||
UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range4),
|
||||
};
|
||||
|
||||
static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
|
||||
static const char * const ether_rgmii_groups[] = {"ether_rgmii"};
|
||||
static const char * const ether_rmii_groups[] = {"ether_rmii"};
|
||||
static const char * const i2c0_groups[] = {"i2c0"};
|
||||
static const char * const i2c1_groups[] = {"i2c1"};
|
||||
static const char * const i2c2_groups[] = {"i2c2"};
|
||||
static const char * const i2c3_groups[] = {"i2c3"};
|
||||
static const char * const i2c4_groups[] = {"i2c4"};
|
||||
static const char * const i2c5_groups[] = {"i2c5"};
|
||||
static const char * const i2c6_groups[] = {"i2c6"};
|
||||
static const char * const sd_groups[] = {"sd"};
|
||||
static const char * const spi0_groups[] = {"spi0"};
|
||||
static const char * const spi1_groups[] = {"spi1"};
|
||||
static const char * const uart0_groups[] = {"uart0"};
|
||||
static const char * const uart1_groups[] = {"uart1", "uart1_ctsrts",
|
||||
"uart1_modem"};
|
||||
static const char * const uart2_groups[] = {"uart2", "uart2_ctsrts"};
|
||||
static const char * const uart3_groups[] = {"uart3"};
|
||||
static const char * const usb0_groups[] = {"usb0"};
|
||||
static const char * const usb1_groups[] = {"usb1"};
|
||||
|
||||
static const struct uniphier_pinmux_function uniphier_nx1_functions[] = {
|
||||
UNIPHIER_PINMUX_FUNCTION(emmc),
|
||||
UNIPHIER_PINMUX_FUNCTION(ether_rgmii),
|
||||
UNIPHIER_PINMUX_FUNCTION(ether_rmii),
|
||||
UNIPHIER_PINMUX_FUNCTION(i2c0),
|
||||
UNIPHIER_PINMUX_FUNCTION(i2c1),
|
||||
UNIPHIER_PINMUX_FUNCTION(i2c2),
|
||||
UNIPHIER_PINMUX_FUNCTION(i2c3),
|
||||
UNIPHIER_PINMUX_FUNCTION(i2c4),
|
||||
UNIPHIER_PINMUX_FUNCTION(i2c5),
|
||||
UNIPHIER_PINMUX_FUNCTION(i2c6),
|
||||
UNIPHIER_PINMUX_FUNCTION(sd),
|
||||
UNIPHIER_PINMUX_FUNCTION(spi0),
|
||||
UNIPHIER_PINMUX_FUNCTION(spi1),
|
||||
UNIPHIER_PINMUX_FUNCTION(uart0),
|
||||
UNIPHIER_PINMUX_FUNCTION(uart1),
|
||||
UNIPHIER_PINMUX_FUNCTION(uart2),
|
||||
UNIPHIER_PINMUX_FUNCTION(uart3),
|
||||
UNIPHIER_PINMUX_FUNCTION(usb0),
|
||||
UNIPHIER_PINMUX_FUNCTION(usb1),
|
||||
};
|
||||
|
||||
static int uniphier_nx1_get_gpio_muxval(unsigned int pin,
|
||||
unsigned int gpio_offset)
|
||||
{
|
||||
if (gpio_offset >= 120) /* XIRQx */
|
||||
return 14;
|
||||
|
||||
return 15;
|
||||
}
|
||||
|
||||
static const struct uniphier_pinctrl_socdata uniphier_nx1_pindata = {
|
||||
.pins = uniphier_nx1_pins,
|
||||
.npins = ARRAY_SIZE(uniphier_nx1_pins),
|
||||
.groups = uniphier_nx1_groups,
|
||||
.groups_count = ARRAY_SIZE(uniphier_nx1_groups),
|
||||
.functions = uniphier_nx1_functions,
|
||||
.functions_count = ARRAY_SIZE(uniphier_nx1_functions),
|
||||
.get_gpio_muxval = uniphier_nx1_get_gpio_muxval,
|
||||
.caps = UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL,
|
||||
};
|
||||
|
||||
static int uniphier_nx1_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
return uniphier_pinctrl_probe(pdev, &uniphier_nx1_pindata);
|
||||
}
|
||||
|
||||
static const struct of_device_id uniphier_nx1_pinctrl_match[] = {
|
||||
{ .compatible = "socionext,uniphier-nx1-pinctrl" },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
static struct platform_driver uniphier_nx1_pinctrl_driver = {
|
||||
.probe = uniphier_nx1_pinctrl_probe,
|
||||
.driver = {
|
||||
.name = "uniphier-nx1-pinctrl",
|
||||
.of_match_table = uniphier_nx1_pinctrl_match,
|
||||
.pm = &uniphier_pinctrl_pm_ops,
|
||||
},
|
||||
};
|
||||
builtin_platform_driver(uniphier_nx1_pinctrl_driver);
|
|
@ -767,6 +767,22 @@ static const struct pinctrl_pin_desc uniphier_pxs3_pins[] = {
|
|||
250, UNIPHIER_PIN_PULL_DOWN),
|
||||
};
|
||||
|
||||
static const unsigned ain1_pins[] = {186, 187, 188, 189, 237, 238, 239};
|
||||
static const int ain1_muxvals[] = {0, 0, 0, 0, 1, 1, 1};
|
||||
static const unsigned ain2_pins[] = {243, 244, 245, 246, 247, 248, 249};
|
||||
static const int ain2_muxvals[] = {1, 1, 1, 1, 1, 1, 1};
|
||||
static const unsigned aout1_pins[] = {226, 227, 228, 229, 230, 231, 232};
|
||||
static const int aout1_muxvals[] = {1, 1, 1, 1, 1, 1, 1};
|
||||
static const unsigned aout2_pins[] = {192, 193, 194, 195, 196, 197, 198};
|
||||
static const int aout2_muxvals[] = {0, 0, 0, 0, 0, 0, 0};
|
||||
static const unsigned aout3_pins[] = {199, 200, 201, 202};
|
||||
static const int aout3_muxvals[] = {0, 0, 0, 0};
|
||||
static const unsigned ainiec1_pins[] = {240};
|
||||
static const int ainiec1_muxvals[] = {1};
|
||||
static const unsigned aoutiec1_pins[] = {190};
|
||||
static const int aoutiec1_muxvals[] = {0};
|
||||
static const unsigned aoutiec2_pins[] = {191};
|
||||
static const int aoutiec2_muxvals[] = {0};
|
||||
static const unsigned int emmc_pins[] = {32, 33, 34, 35, 36, 37, 38};
|
||||
static const int emmc_muxvals[] = {0, 0, 0, 0, 0, 0, 0};
|
||||
static const unsigned int emmc_dat8_pins[] = {39, 40, 41, 42};
|
||||
|
@ -871,6 +887,14 @@ static const unsigned int gpio_range2_pins[] = {
|
|||
};
|
||||
|
||||
static const struct uniphier_pinctrl_group uniphier_pxs3_groups[] = {
|
||||
UNIPHIER_PINCTRL_GROUP(ain1),
|
||||
UNIPHIER_PINCTRL_GROUP(ain2),
|
||||
UNIPHIER_PINCTRL_GROUP(aout1),
|
||||
UNIPHIER_PINCTRL_GROUP(aout2),
|
||||
UNIPHIER_PINCTRL_GROUP(aout3),
|
||||
UNIPHIER_PINCTRL_GROUP(ainiec1),
|
||||
UNIPHIER_PINCTRL_GROUP(aoutiec1),
|
||||
UNIPHIER_PINCTRL_GROUP(aoutiec2),
|
||||
UNIPHIER_PINCTRL_GROUP(emmc),
|
||||
UNIPHIER_PINCTRL_GROUP(emmc_dat8),
|
||||
UNIPHIER_PINCTRL_GROUP(ether_rgmii),
|
||||
|
@ -902,6 +926,14 @@ static const struct uniphier_pinctrl_group uniphier_pxs3_groups[] = {
|
|||
UNIPHIER_PINCTRL_GROUP_GPIO(gpio_range2),
|
||||
};
|
||||
|
||||
static const char * const ain1_groups[] = {"ain1"};
|
||||
static const char * const ain2_groups[] = {"ain2"};
|
||||
static const char * const aout1_groups[] = {"aout1"};
|
||||
static const char * const aout2_groups[] = {"aout2"};
|
||||
static const char * const aout3_groups[] = {"aout3"};
|
||||
static const char * const ainiec1_groups[] = {"ainiec1"};
|
||||
static const char * const aoutiec1_groups[] = {"aoutiec1"};
|
||||
static const char * const aoutiec2_groups[] = {"aoutiec2"};
|
||||
static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
|
||||
static const char * const ether_rgmii_groups[] = {"ether_rgmii"};
|
||||
static const char * const ether_rmii_groups[] = {"ether_rmii"};
|
||||
|
@ -928,6 +960,14 @@ static const char * const usb2_groups[] = {"usb2"};
|
|||
static const char * const usb3_groups[] = {"usb3"};
|
||||
|
||||
static const struct uniphier_pinmux_function uniphier_pxs3_functions[] = {
|
||||
UNIPHIER_PINMUX_FUNCTION(ain1),
|
||||
UNIPHIER_PINMUX_FUNCTION(ain2),
|
||||
UNIPHIER_PINMUX_FUNCTION(aout1),
|
||||
UNIPHIER_PINMUX_FUNCTION(aout2),
|
||||
UNIPHIER_PINMUX_FUNCTION(aout3),
|
||||
UNIPHIER_PINMUX_FUNCTION(ainiec1),
|
||||
UNIPHIER_PINMUX_FUNCTION(aoutiec1),
|
||||
UNIPHIER_PINMUX_FUNCTION(aoutiec2),
|
||||
UNIPHIER_PINMUX_FUNCTION(emmc),
|
||||
UNIPHIER_PINMUX_FUNCTION(ether_rgmii),
|
||||
UNIPHIER_PINMUX_FUNCTION(ether_rmii),
|
||||
|
|
|
@ -16,6 +16,15 @@
|
|||
#define MTK_PUPD_SET_R1R0_10 102
|
||||
#define MTK_PUPD_SET_R1R0_11 103
|
||||
|
||||
#define MTK_PULL_SET_RSEL_000 200
|
||||
#define MTK_PULL_SET_RSEL_001 201
|
||||
#define MTK_PULL_SET_RSEL_010 202
|
||||
#define MTK_PULL_SET_RSEL_011 203
|
||||
#define MTK_PULL_SET_RSEL_100 204
|
||||
#define MTK_PULL_SET_RSEL_101 205
|
||||
#define MTK_PULL_SET_RSEL_110 206
|
||||
#define MTK_PULL_SET_RSEL_111 207
|
||||
|
||||
#define MTK_DRIVE_2mA 2
|
||||
#define MTK_DRIVE_4mA 4
|
||||
#define MTK_DRIVE_6mA 6
|
||||
|
|
|
@ -168,11 +168,18 @@ struct gpio_irq_chip {
|
|||
|
||||
/**
|
||||
* @parent_handler_data:
|
||||
* @parent_handler_data_array:
|
||||
*
|
||||
* Data associated, and passed to, the handler for the parent
|
||||
* interrupt.
|
||||
* interrupt. Can either be a single pointer if @per_parent_data
|
||||
* is false, or an array of @num_parents pointers otherwise. If
|
||||
* @per_parent_data is true, @parent_handler_data_array cannot be
|
||||
* NULL.
|
||||
*/
|
||||
void *parent_handler_data;
|
||||
union {
|
||||
void *parent_handler_data;
|
||||
void **parent_handler_data_array;
|
||||
};
|
||||
|
||||
/**
|
||||
* @num_parents:
|
||||
|
@ -203,6 +210,14 @@ struct gpio_irq_chip {
|
|||
*/
|
||||
bool threaded;
|
||||
|
||||
/**
|
||||
* @per_parent_data:
|
||||
*
|
||||
* True if parent_handler_data_array describes a @num_parents
|
||||
* sized array to be used as parent data.
|
||||
*/
|
||||
bool per_parent_data;
|
||||
|
||||
/**
|
||||
* @init_hw: optional routine to initialize hardware before
|
||||
* an IRQ chip will be added. This is quite useful when
|
||||
|
|
Loading…
Reference in New Issue