mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:24:47 +01:00
Pin control changes for the v6.18 kernel cycle:
Core changes:
- Allow pins to be identified/marked as GPIO mode with
a special callback. The pin controller core is now
"aware" if a pin is in GPIO mode if the callback is
implemented in the driver, and can thus be marked
as "strict", i.e. disallowing simultaneous use of a
line as GPIO and another function such as I2C. This
is enabled in the Qualcomm TLMM driver and also
implemeted from day 1 in the new Broadcom STB driver.
- Rename the pin config option PIN_CONFIG_OUTPUT to
PIN_CONFIG_LEVEL to better describe what the config is
doing, as well as making it more intuitive what shall
be returned when reading this property.
New drivers:
- Qualcomm SDM660 LPASS LPI TLMM pin controller subdriver.
- Qualcomm Glymur family pin controller driver.
- Broadcom STB family pin controller driver.
- Tegra186 pin controller driver.
- AAEON UP pin controller support. This is some special
pin controller that works as an external advanced line
MUX and amplifier for signals from an Intel SoC.
A cooperative effort with the GPIO maintainer was
needed to reach a solution where we reuse code from
the GPIO aggregator/forwarder driver.
- Renesas RZ/T2H and RZ/N2H pin controller support.
- Axis ARTPEC-8 subdriver for the Samsung pin controller
driver.
Improvements:
- Output enable (OEN) support in the Renesas RZG2L driver.
- Properly support bias pull up/down in the pinctrl-single
driver.
- Move over all GPIO portions using generic MMIO GPIO to
the new generic GPIO chip management which has a nice and
separate API.
- Proper DT bindings for some older Broadcom SoCs.
- External GPIO (EGPIO) support in the Qualcomm SM8250.
Deleted code:
- Dropped the now unused Samsung S3C24xx drivers.
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmjcI6IACgkQQRCzN7AZ
XXMFYxAApJr9Rlqh3WlOzvAa2kVrGev0m3S2I0SiQUAIy2TwfMBGBRjDTOQJ+db/
ZazjsTyL+ObuCRmWJpoqlRThEB9oh5xgqN5OHCSIBQXqnjCzG9jnw+s50dGl5r77
vX5RtS5OxPgqe2ay9DY9SA8Ix0G5Yxdq9eP2MfeX45zjAfGWGq6bJT+Llkpf5y8L
a1k1EQmQbogw6DLLmpiSUA2qtFitGdB9rLkk/inYWZHq6g8qva4eoVdE+PhzG1ky
DrkXaJF3+hC/fBBGk4yrzHfnLL7pqIzyhN3on5Xy9lMfytU8bxGESZck1BxaauHZ
63w8kEfGOsOztbKQ9VLAzDg9Jd+t7fVMmQw5kXT53TEhB0hfX0SbiK2I8UAF3vkV
dCe6AWD2Zzz5XlDJpl5vOOYr9lSmuVCZuaIdvgoyLk4BJSLau+24Rme9gqfulT92
/z2mxCHO6CIzIgH4ILiyM90pIE4OCXp0II7SinZ34alO8ZoMyFHAT2Sqa736WdlQ
PVfBRBIIJF02os3bcudXpwCD7Xn0ksE5UwVgdDSIk9MKdRI5ZGdbt0y9HUrnfTDk
5hFH3rbm8Vdk65UHcgIiYTN9C9JlbPscNyQG0z4a1OUr2O4wurr0eFBn+kFpluRn
ZQBQwjxtEqedsunb5W5Ny79srN6okddpzCIUSQDL20Uw69zy9L0=
=DZy/
-----END PGP SIGNATURE-----
Merge tag 'pinctrl-v6.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control updates from Linus Walleij:
"We have GPIO awareness in the pin control core and an interesting
AAEON driver.
Core changes:
- Allow pins to be identified/marked as GPIO mode with a special
callback.
The pin controller core is now "aware" if a pin is in GPIO mode if
the callback is implemented in the driver, and can thus be marked
as "strict", i.e. disallowing simultaneous use of a line as GPIO
and another function such as I2C.
This is enabled in the Qualcomm TLMM driver and also implemeted
from day 1 in the new Broadcom STB driver
- Rename the pin config option PIN_CONFIG_OUTPUT to PIN_CONFIG_LEVEL
to better describe what the config is doing, as well as making it
more intuitive what shall be returned when reading this property
New drivers:
- Qualcomm SDM660 LPASS LPI TLMM pin controller subdriver
- Qualcomm Glymur family pin controller driver
- Broadcom STB family pin controller driver
- Tegra186 pin controller driver
- AAEON UP pin controller support.
This is some special pin controller that works as an external
advanced line MUX and amplifier for signals from an Intel SoC. A
cooperative effort with the GPIO maintainer was needed to reach a
solution where we reuse code from the GPIO aggregator/forwarder
driver
- Renesas RZ/T2H and RZ/N2H pin controller support
- Axis ARTPEC-8 subdriver for the Samsung pin controller driver
Improvements:
- Output enable (OEN) support in the Renesas RZG2L driver
- Properly support bias pull up/down in the pinctrl-single driver
- Move over all GPIO portions using generic MMIO GPIO to the new
generic GPIO chip management which has a nice and separate API
- Proper DT bindings for some older Broadcom SoCs
- External GPIO (EGPIO) support in the Qualcomm SM8250
Deleted code:
- Dropped the now unused Samsung S3C24xx drivers"
* tag 'pinctrl-v6.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (75 commits)
pinctrl: use more common syntax for compound literals
pinctrl: Simplify printks with pOF format
pinctrl: qcom: Add SDM660 LPASS LPI TLMM
dt-bindings: pinctrl: qcom: Add SDM660 LPI pinctrl
pinctrl: qcom: lpass-lpi: Add ability to use custom pin offsets
pinctrl: qcom: Add glymur pinctrl driver
dt-bindings: pinctrl: qcom: Add Glymur pinctrl
pinctrl: qcom: sm8250: Add egpio support
pinctrl: generic: rename PIN_CONFIG_OUTPUT to LEVEL
pinctrl: keembay: fix double free in keembay_build_functions()
pinctrl: spacemit: fix typo in PRI_TDI pin name
pinctrl: eswin: Fix regulator error check and Kconfig dependency
pinctrl: bcm: Add STB family pin controller driver
dt-bindings: pinctrl: Add support for Broadcom STB pin controller
pinctrl: qcom: make the pinmuxing strict
pinctrl: qcom: mark the `gpio` and `egpio` pins function as non-strict functions
pinctrl: qcom: add infrastructure for marking pin functions as GPIOs
pinctrl: allow to mark pin functions as requestable GPIOs
pinctrl: qcom: use generic pin function helpers
pinctrl: make struct pinfunction a pointer in struct function_desc
...
This commit is contained in:
commit
5fb0249319
171 changed files with 9120 additions and 767 deletions
|
|
@ -0,0 +1,137 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/brcm,bcm2712c0-pinctrl.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Broadcom STB family pin controller
|
||||
|
||||
maintainers:
|
||||
- Ivan T. Ivanov <iivanov@suse.de>
|
||||
- A. della Porta <andrea.porta@suse.com>
|
||||
|
||||
description: >
|
||||
Broadcom's STB family of memory-mapped pin controllers.
|
||||
|
||||
This includes the pin controllers inside the BCM2712 SoC which
|
||||
are instances of the STB family and has two silicon variants,
|
||||
C0 and D0, which differs slightly in terms of registers layout.
|
||||
|
||||
The -aon- (Always On) variant is the same IP block but differs
|
||||
in the number of pins that are associated and the pinmux functions
|
||||
for each of those pins.
|
||||
|
||||
allOf:
|
||||
- $ref: pinctrl.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- brcm,bcm2712c0-pinctrl
|
||||
- brcm,bcm2712c0-aon-pinctrl
|
||||
- brcm,bcm2712d0-pinctrl
|
||||
- brcm,bcm2712d0-aon-pinctrl
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
patternProperties:
|
||||
'-state$':
|
||||
oneOf:
|
||||
- $ref: '#/$defs/brcmstb-pinctrl-state'
|
||||
- patternProperties:
|
||||
'-pins$':
|
||||
$ref: '#/$defs/brcmstb-pinctrl-state'
|
||||
additionalProperties: false
|
||||
|
||||
$defs:
|
||||
brcmstb-pinctrl-state:
|
||||
allOf:
|
||||
- $ref: pincfg-node.yaml#
|
||||
- $ref: pinmux-node.yaml#
|
||||
|
||||
description: >
|
||||
Pin controller client devices use pin configuration subnodes (children
|
||||
and grandchildren) for desired pin configuration.
|
||||
|
||||
Client device subnodes use below standard properties.
|
||||
|
||||
properties:
|
||||
pins:
|
||||
description:
|
||||
List of gpio pins affected by the properties specified in this
|
||||
subnode (either this or "groups" must be specified).
|
||||
items:
|
||||
pattern: '^((aon_)?s?gpio[0-6]?[0-9])|(emmc_(clk|cmd|dat[0-7]|ds))$'
|
||||
|
||||
function:
|
||||
description:
|
||||
Specify the alternative function to be configured for the specified
|
||||
pins.
|
||||
enum: [ gpio, alt1, alt2, alt3, alt4, alt5, alt6, alt7, alt8,
|
||||
aon_cpu_standbyb, aon_fp_4sec_resetb, aon_gpclk, aon_pwm,
|
||||
arm_jtag, aud_fs_clk0, avs_pmu_bsc, bsc_m0, bsc_m1, bsc_m2,
|
||||
bsc_m3, clk_observe, ctl_hdmi_5v, enet0, enet0_mii, enet0_rgmii,
|
||||
ext_sc_clk, fl0, fl1, gpclk0, gpclk1, gpclk2, hdmi_tx0_auto_i2c,
|
||||
hdmi_tx0_bsc, hdmi_tx1_auto_i2c, hdmi_tx1_bsc, i2s_in, i2s_out,
|
||||
ir_in, mtsif, mtsif_alt, mtsif_alt1, pdm, pkt, pm_led_out, sc0,
|
||||
sd0, sd2, sd_card_a, sd_card_b, sd_card_c, sd_card_d, sd_card_e,
|
||||
sd_card_f, sd_card_g, spdif_out, spi_m, spi_s, sr_edm_sense, te0,
|
||||
te1, tsio, uart0, uart1, uart2, usb_pwr, usb_vbus, uui, vc_i2c0,
|
||||
vc_i2c3, vc_i2c4, vc_i2c5, vc_i2csl, vc_pcm, vc_pwm0, vc_pwm1,
|
||||
vc_spi0, vc_spi3, vc_spi4, vc_spi5, vc_uart0, vc_uart2, vc_uart3,
|
||||
vc_uart4 ]
|
||||
|
||||
bias-disable: true
|
||||
bias-pull-down: true
|
||||
bias-pull-up: true
|
||||
|
||||
required:
|
||||
- pins
|
||||
|
||||
if:
|
||||
properties:
|
||||
pins:
|
||||
not:
|
||||
contains:
|
||||
pattern: "^emmc_(clk|cmd|dat[0-7]|ds)$"
|
||||
then:
|
||||
required:
|
||||
- function
|
||||
else:
|
||||
properties:
|
||||
function: false
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
pinctrl@7d504100 {
|
||||
compatible = "brcm,bcm2712c0-pinctrl";
|
||||
reg = <0x7d504100 0x30>;
|
||||
|
||||
bt-shutdown-default-state {
|
||||
function = "gpio";
|
||||
pins = "gpio29";
|
||||
};
|
||||
|
||||
uarta-default-state {
|
||||
rts-tx-pins {
|
||||
function = "uart0";
|
||||
pins = "gpio24", "gpio26";
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
cts-rx-pins {
|
||||
function = "uart0";
|
||||
pins = "gpio25", "gpio27";
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
Broadcom BCM2835 GPIO (and pinmux) controller
|
||||
|
||||
The BCM2835 GPIO module is a combined GPIO controller, (GPIO) interrupt
|
||||
controller, and pinmux/control device.
|
||||
|
||||
Required properties:
|
||||
- compatible: "brcm,bcm2835-gpio"
|
||||
- compatible: should be one of:
|
||||
"brcm,bcm2835-gpio" - BCM2835 compatible pinctrl
|
||||
"brcm,bcm7211-gpio" - BCM7211 compatible pinctrl
|
||||
"brcm,bcm2711-gpio" - BCM2711 compatible pinctrl
|
||||
"brcm,bcm7211-gpio" - BCM7211 compatible pinctrl
|
||||
- reg: Should contain the physical address of the GPIO module's registers.
|
||||
- gpio-controller: Marks the device node as a GPIO controller.
|
||||
- #gpio-cells : Should be two. The first cell is the pin number and the
|
||||
second cell is used to specify optional parameters:
|
||||
- bit 0 specifies polarity (0 for normal, 1 for inverted)
|
||||
- interrupts : The interrupt outputs from the controller. One interrupt per
|
||||
individual bank followed by the "all banks" interrupt. For BCM7211, an
|
||||
additional set of per-bank interrupt line and an "all banks" wake-up
|
||||
interrupt may be specified.
|
||||
- interrupt-controller: Marks the device node as an interrupt controller.
|
||||
- #interrupt-cells : Should be 2.
|
||||
The first cell is the GPIO number.
|
||||
The second cell is used to specify flags:
|
||||
bits[3:0] trigger type and level flags:
|
||||
1 = low-to-high edge triggered.
|
||||
2 = high-to-low edge triggered.
|
||||
4 = active high level-sensitive.
|
||||
8 = active low level-sensitive.
|
||||
Valid combinations are 1, 2, 3, 4, 8.
|
||||
|
||||
Please refer to ../gpio/gpio.txt for a general description of GPIO 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".
|
||||
|
||||
Each pin configuration node lists the pin(s) to which it applies, and one or
|
||||
more of the mux function to select on those pin(s), and pull-up/down
|
||||
configuration. Each subnode only affects those parameters that are explicitly
|
||||
listed. In other words, a subnode that lists only a mux function implies no
|
||||
information about any pull configuration. Similarly, a subnode that lists only
|
||||
a pul parameter implies no information about the mux function.
|
||||
|
||||
The BCM2835 pin configuration and multiplexing supports the generic bindings.
|
||||
For details on each properties, you can refer to ./pinctrl-bindings.txt.
|
||||
|
||||
Required sub-node properties:
|
||||
- pins
|
||||
- function
|
||||
|
||||
Optional sub-node properties:
|
||||
- bias-disable
|
||||
- bias-pull-up
|
||||
- bias-pull-down
|
||||
- output-high
|
||||
- output-low
|
||||
|
||||
Legacy pin configuration and multiplexing binding:
|
||||
*** (Its use is deprecated, use generic multiplexing and configuration
|
||||
bindings instead)
|
||||
|
||||
Required subnode-properties:
|
||||
- brcm,pins: An array of cells. Each cell contains the ID of a pin. Valid IDs
|
||||
are the integer GPIO IDs; 0==GPIO0, 1==GPIO1, ... 53==GPIO53.
|
||||
|
||||
Optional subnode-properties:
|
||||
- brcm,function: Integer, containing the function to mux to the pin(s):
|
||||
0: GPIO in
|
||||
1: GPIO out
|
||||
2: alt5
|
||||
3: alt4
|
||||
4: alt0
|
||||
5: alt1
|
||||
6: alt2
|
||||
7: alt3
|
||||
- brcm,pull: Integer, representing the pull-down/up to apply to the pin(s):
|
||||
0: none
|
||||
1: down
|
||||
2: up
|
||||
|
||||
Each of brcm,function and brcm,pull may contain either a single value which
|
||||
will be applied to all pins in brcm,pins, or 1 value for each entry in
|
||||
brcm,pins.
|
||||
|
||||
Example:
|
||||
|
||||
gpio: gpio {
|
||||
compatible = "brcm,bcm2835-gpio";
|
||||
reg = <0x2200000 0xb4>;
|
||||
interrupts = <2 17>, <2 19>, <2 18>, <2 20>;
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
120
Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.yaml
Normal file
120
Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.yaml
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/brcm,bcm2835-gpio.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Broadcom BCM2835 GPIO (and pinmux) controller
|
||||
|
||||
maintainers:
|
||||
- Florian Fainelli <f.fainelli@gmail.com>
|
||||
|
||||
description: >
|
||||
The BCM2835 GPIO module is a combined GPIO controller, (GPIO) interrupt
|
||||
controller, and pinmux/control device.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- brcm,bcm2835-gpio
|
||||
- brcm,bcm2711-gpio
|
||||
- brcm,bcm7211-gpio
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
'#gpio-cells':
|
||||
const: 2
|
||||
|
||||
gpio-controller: true
|
||||
gpio-ranges: true
|
||||
gpio-line-names: true
|
||||
|
||||
interrupts:
|
||||
description: >
|
||||
Interrupt outputs: one per bank, then the combined “all banks” line.
|
||||
BCM7211 may specify up to four per-bank wake-up lines and one combined
|
||||
wake-up interrupt.
|
||||
minItems: 4
|
||||
maxItems: 10
|
||||
|
||||
'#interrupt-cells':
|
||||
const: 2
|
||||
|
||||
interrupt-controller: true
|
||||
|
||||
additionalProperties:
|
||||
oneOf:
|
||||
- type: object
|
||||
additionalProperties: false
|
||||
|
||||
patternProperties:
|
||||
'^pins?-':
|
||||
type: object
|
||||
allOf:
|
||||
- $ref: /schemas/pinctrl/pincfg-node.yaml#
|
||||
- $ref: /schemas/pinctrl/pinmux-node.yaml#
|
||||
additionalProperties: false
|
||||
|
||||
properties:
|
||||
pins: true
|
||||
function: true
|
||||
bias-disable: true
|
||||
bias-pull-up: true
|
||||
bias-pull-down: true
|
||||
output-high: true
|
||||
output-low: true
|
||||
|
||||
required:
|
||||
- pins
|
||||
- function
|
||||
|
||||
- type: object
|
||||
additionalProperties: false
|
||||
deprecated: true
|
||||
|
||||
properties:
|
||||
brcm,pins:
|
||||
description:
|
||||
GPIO pin numbers for legacy configuration.
|
||||
$ref: /schemas/types.yaml#/definitions/uint32-array
|
||||
|
||||
brcm,function:
|
||||
description:
|
||||
Legacy mux function for the pins (0=input, 1=output, 2–7=alt functions).
|
||||
$ref: /schemas/types.yaml#/definitions/uint32-array
|
||||
maximum: 7
|
||||
|
||||
brcm,pull:
|
||||
description: >
|
||||
Legacy pull setting for the pins (0=none, 1=pull-down, 2=pull-up).
|
||||
$ref: /schemas/types.yaml#/definitions/uint32-array
|
||||
maximum: 2
|
||||
|
||||
required:
|
||||
- brcm,pins
|
||||
|
||||
allOf:
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- brcm,bcm2835-gpio
|
||||
- brcm,bcm2711-gpio
|
||||
then:
|
||||
properties:
|
||||
interrupts:
|
||||
maxItems: 5
|
||||
|
||||
examples:
|
||||
- |
|
||||
gpio@2200000 {
|
||||
compatible = "brcm,bcm2835-gpio";
|
||||
reg = <0x2200000 0xb4>;
|
||||
interrupts = <2 17>, <2 19>, <2 18>, <2 20>, <2 21>;
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
#interrupt-cells = <2>;
|
||||
interrupt-controller;
|
||||
};
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
Broadcom iProc GPIO/PINCONF Controller
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible:
|
||||
"brcm,iproc-gpio" for the generic iProc based GPIO controller IP that
|
||||
supports full-featured pinctrl and GPIO functions used in various iProc
|
||||
based SoCs
|
||||
|
||||
May contain an SoC-specific compatibility string to accommodate any
|
||||
SoC-specific features
|
||||
|
||||
"brcm,cygnus-ccm-gpio", "brcm,cygnus-asiu-gpio", or
|
||||
"brcm,cygnus-crmu-gpio" for Cygnus SoCs
|
||||
|
||||
"brcm,iproc-nsp-gpio" for the iProc NSP SoC that has drive strength support
|
||||
disabled
|
||||
|
||||
"brcm,iproc-stingray-gpio" for the iProc Stingray SoC that has the general
|
||||
pinctrl support completely disabled in this IP block. In Stingray, a
|
||||
different IP block is used to handle pinctrl related functions
|
||||
|
||||
- reg:
|
||||
Define the base and range of the I/O address space that contains SoC
|
||||
GPIO/PINCONF controller registers
|
||||
|
||||
- ngpios:
|
||||
Total number of in-use slots in GPIO controller
|
||||
|
||||
- #gpio-cells:
|
||||
Must be two. The first cell is the GPIO pin number (within the
|
||||
controller's pin space) and the second cell is used for the following:
|
||||
bit[0]: polarity (0 for active high and 1 for active low)
|
||||
|
||||
- gpio-controller:
|
||||
Specifies that the node is a GPIO controller
|
||||
|
||||
Optional properties:
|
||||
|
||||
- interrupts:
|
||||
Interrupt ID
|
||||
|
||||
- interrupt-controller:
|
||||
Specifies that the node is an interrupt controller
|
||||
|
||||
- gpio-ranges:
|
||||
Specifies the mapping between gpio controller and pin-controllers pins.
|
||||
This requires 4 fields in cells defined as -
|
||||
1. Phandle of pin-controller.
|
||||
2. GPIO base pin offset.
|
||||
3 Pin-control base pin offset.
|
||||
4. number of gpio pins which are linearly mapped from pin base.
|
||||
|
||||
Supported generic PINCONF properties in child nodes:
|
||||
|
||||
- pins:
|
||||
The list of pins (within the controller's own pin space) that properties
|
||||
in the node apply to. Pin names are "gpio-<pin>"
|
||||
|
||||
- bias-disable:
|
||||
Disable pin bias
|
||||
|
||||
- bias-pull-up:
|
||||
Enable internal pull up resistor
|
||||
|
||||
- bias-pull-down:
|
||||
Enable internal pull down resistor
|
||||
|
||||
- drive-strength:
|
||||
Valid drive strength values include 2, 4, 6, 8, 10, 12, 14, 16 (mA)
|
||||
|
||||
Example:
|
||||
gpio_ccm: gpio@1800a000 {
|
||||
compatible = "brcm,cygnus-ccm-gpio";
|
||||
reg = <0x1800a000 0x50>,
|
||||
<0x0301d164 0x20>;
|
||||
ngpios = <24>;
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-controller;
|
||||
|
||||
touch_pins: touch_pins {
|
||||
pwr: pwr {
|
||||
pins = "gpio-0";
|
||||
drive-strength = <16>;
|
||||
};
|
||||
|
||||
event: event {
|
||||
pins = "gpio-1";
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
gpio_asiu: gpio@180a5000 {
|
||||
compatible = "brcm,cygnus-asiu-gpio";
|
||||
reg = <0x180a5000 0x668>;
|
||||
ngpios = <146>;
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-controller;
|
||||
gpio-ranges = <&pinctrl 0 42 1>,
|
||||
<&pinctrl 1 44 3>;
|
||||
};
|
||||
|
||||
/*
|
||||
* Touchscreen that uses the CCM GPIO 0 and 1
|
||||
*/
|
||||
tsc {
|
||||
...
|
||||
...
|
||||
gpio-pwr = <&gpio_ccm 0 0>;
|
||||
gpio-event = <&gpio_ccm 1 0>;
|
||||
};
|
||||
|
||||
/* Bluetooth that uses the ASIU GPIO 5, with polarity inverted */
|
||||
bluetooth {
|
||||
...
|
||||
...
|
||||
bcm,rfkill-bank-sel = <&gpio_asiu 5 1>
|
||||
}
|
||||
111
Documentation/devicetree/bindings/pinctrl/brcm,iproc-gpio.yaml
Normal file
111
Documentation/devicetree/bindings/pinctrl/brcm,iproc-gpio.yaml
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/brcm,iproc-gpio.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Broadcom iProc GPIO/PINCONF Controller
|
||||
|
||||
maintainers:
|
||||
- Ray Jui <rjui@broadcom.com>
|
||||
- Scott Branden <sbranden@broadcom.com>
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
oneOf:
|
||||
- enum:
|
||||
- brcm,cygnus-asiu-gpio
|
||||
- brcm,cygnus-ccm-gpio
|
||||
- brcm,cygnus-crmu-gpio
|
||||
- brcm,iproc-gpio
|
||||
- brcm,iproc-stingray-gpio
|
||||
- items:
|
||||
- enum:
|
||||
- brcm,iproc-hr2-gpio
|
||||
- brcm,iproc-nsp-gpio
|
||||
- const: brcm,iproc-gpio
|
||||
|
||||
reg:
|
||||
minItems: 1
|
||||
items:
|
||||
- description: GPIO Bank registers
|
||||
- description: IO Ctrl registers
|
||||
|
||||
"#gpio-cells":
|
||||
const: 2
|
||||
|
||||
gpio-controller: true
|
||||
|
||||
gpio-ranges: true
|
||||
|
||||
ngpios: true
|
||||
|
||||
"#interrupt-cells":
|
||||
const: 2
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
interrupt-controller: true
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- "#gpio-cells"
|
||||
- gpio-controller
|
||||
- ngpios
|
||||
|
||||
patternProperties:
|
||||
'-pins$':
|
||||
type: object
|
||||
additionalProperties:
|
||||
description: Pin configuration child nodes.
|
||||
allOf:
|
||||
- $ref: pincfg-node.yaml#
|
||||
- $ref: pinmux-node.yaml#
|
||||
additionalProperties: false
|
||||
|
||||
properties:
|
||||
pins:
|
||||
items:
|
||||
pattern: '^gpio-'
|
||||
|
||||
bias-disable: true
|
||||
bias-pull-up: true
|
||||
bias-pull-down: true
|
||||
|
||||
drive-strength:
|
||||
enum: [ 2, 4, 6, 8, 10, 12, 14, 16 ]
|
||||
|
||||
required:
|
||||
- pins
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
|
||||
gpio@1800a000 {
|
||||
compatible = "brcm,cygnus-ccm-gpio";
|
||||
reg = <0x1800a000 0x50>,
|
||||
<0x0301d164 0x20>;
|
||||
ngpios = <24>;
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
#interrupt-cells = <2>;
|
||||
interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-controller;
|
||||
|
||||
touch-pins {
|
||||
pwr {
|
||||
pins = "gpio-0";
|
||||
drive-strength = <16>;
|
||||
};
|
||||
|
||||
event {
|
||||
pins = "gpio-1";
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -48,6 +48,8 @@ properties:
|
|||
description:
|
||||
GPIO valid number range.
|
||||
|
||||
gpio-line-names: true
|
||||
|
||||
interrupt-controller: true
|
||||
|
||||
interrupts:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,285 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/nvidia,tegra186-pinmux.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: NVIDIA Tegra186 Pinmux Controller
|
||||
|
||||
maintainers:
|
||||
- Thierry Reding <thierry.reding@gmail.com>
|
||||
- Jon Hunter <jonathanh@nvidia.com>
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- nvidia,tegra186-pinmux
|
||||
- nvidia,tegra186-pinmux-aon
|
||||
|
||||
reg:
|
||||
items:
|
||||
- description: pinmux registers
|
||||
|
||||
patternProperties:
|
||||
"^pinmux(-[a-z0-9-]+)?$":
|
||||
type: object
|
||||
|
||||
# pin groups
|
||||
additionalProperties:
|
||||
$ref: nvidia,tegra-pinmux-common.yaml
|
||||
unevaluatedProperties: false
|
||||
properties:
|
||||
nvidia,function:
|
||||
enum: [ aud, can0, can1, ccla, dca, dcb, dcc, directdc, directdc1,
|
||||
displaya, displayb, dmic1, dmic2, dmic3, dmic4, dmic5, dp,
|
||||
dspk0, dspk1, dtv, eqos, extperiph1, extperiph2, extperiph3,
|
||||
extperiph4, gp, gpio, hdmi, i2c1, i2c2, i2c3, i2c5, i2c7,
|
||||
i2c8, i2c9, i2s1, i2s2, i2s3, i2s4, i2s5, i2s6, iqc0, iqc1,
|
||||
nv, pe, pe0, pe1, pe2, qspi, rsvd0, rsvd1, rsvd2, rsvd3,
|
||||
sata, sce, sdmmc1, sdmmc2, sdmmc3, sdmmc4, soc, spdif, spi1,
|
||||
spi2, spi3, spi4, touch, uarta, uartb, uartc, uartd, uarte,
|
||||
uartf, uartg, ufs0, usb, vgp1, vgp2, vgp3, vgp4, vgp5, vgp6,
|
||||
wdt ]
|
||||
|
||||
nvidia,pull: true
|
||||
nvidia,tristate: true
|
||||
nvidia,schmitt: true
|
||||
nvidia,enable-input: true
|
||||
nvidia,open-drain: true
|
||||
nvidia,lock: true
|
||||
nvidia,drive-type: true
|
||||
nvidia,io-hv: true
|
||||
|
||||
required:
|
||||
- nvidia,pins
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
allOf:
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
const: nvidia,tegra186-pinmux
|
||||
then:
|
||||
patternProperties:
|
||||
"^pinmux(-[a-z0-9-]+)?$":
|
||||
type: object
|
||||
additionalProperties:
|
||||
properties:
|
||||
nvidia,pins:
|
||||
description: An array of strings. Each string contains the name
|
||||
of a pin or group. Valid values for these names are listed
|
||||
below.
|
||||
items:
|
||||
enum: [ pex_l0_rst_n_pa0, pex_l0_clkreq_n_pa1,
|
||||
pex_wake_n_pa2, pex_l1_rst_n_pa3,
|
||||
pex_l1_clkreq_n_pa4, pex_l2_rst_n_pa5,
|
||||
pex_l2_clkreq_n_pa6, uart4_tx_pb0, uart4_rx_pb1,
|
||||
uart4_rts_pb2, uart4_cts_pb3, gpio_wan1_pb4,
|
||||
gpio_wan2_pb5, gpio_wan3_pb6, gpio_wan4_pc0,
|
||||
dap2_sclk_pc1, dap2_dout_pc2, dap2_din_pc3,
|
||||
dap2_fs_pc4, gen1_i2c_scl_pc5, gen1_i2c_sda_pc6,
|
||||
sdmmc1_clk_pd0, sdmmc1_cmd_pd1, sdmmc1_dat0_pd2,
|
||||
sdmmc1_dat1_pd3, sdmmc1_dat2_pd4, sdmmc1_dat3_pd5,
|
||||
eqos_txc_pe0, eqos_td0_pe1, eqos_td1_pe2,
|
||||
eqos_td2_pe3, eqos_td3_pe4, eqos_tx_ctl_pe5,
|
||||
eqos_rd0_pe6, eqos_rd1_pe7, eqos_rd2_pf0,
|
||||
eqos_rd3_pf1, eqos_rx_ctl_pf2, eqos_rxc_pf3,
|
||||
eqos_mdio_pf4, eqos_mdc_pf5, sdmmc3_clk_pg0,
|
||||
sdmmc3_cmd_pg1, sdmmc3_dat0_pg2, sdmmc3_dat1_pg3,
|
||||
sdmmc3_dat2_pg4, sdmmc3_dat3_pg5, gpio_wan5_ph0,
|
||||
gpio_wan6_ph1, gpio_wan7_ph2, gpio_wan8_ph3,
|
||||
bcpu_pwr_req_ph4, mcpu_pwr_req_ph5, gpu_pwr_req_ph6,
|
||||
gpio_pq0_pi0, gpio_pq1_pi1, gpio_pq2_pi2,
|
||||
gpio_pq3_pi3, gpio_pq4_pi4, gpio_pq5_pi5,
|
||||
gpio_pq6_pi6, gpio_pq7_pi7, dap1_sclk_pj0,
|
||||
dap1_dout_pj1, dap1_din_pj2, dap1_fs_pj3,
|
||||
aud_mclk_pj4, gpio_aud0_pj5, gpio_aud1_pj6,
|
||||
gpio_aud2_pj7, gpio_aud3_pk0, gen7_i2c_scl_pl0,
|
||||
gen7_i2c_sda_pl1, gen9_i2c_scl_pl2, gen9_i2c_sda_pl3,
|
||||
usb_vbus_en0_pl4, usb_vbus_en1_pl5, gp_pwm6_pl6,
|
||||
gp_pwm7_pl7, dmic1_dat_pm0, dmic1_clk_pm1,
|
||||
dmic2_dat_pm2, dmic2_clk_pm3, dmic4_dat_pm4,
|
||||
dmic4_clk_pm5, gpio_cam1_pn0, gpio_cam2_pn1,
|
||||
gpio_cam3_pn2, gpio_cam4_pn3, gpio_cam6_pn5,
|
||||
gpio_cam7_pn6, extperiph1_clk_po0,
|
||||
extperiph2_clk_po1, cam_i2c_scl_po2, cam_i2c_sda_po3,
|
||||
dp_aux_ch0_hpd_pp0, dp_aux_ch1_hpd_pp1, hdmi_cec_pp2,
|
||||
gpio_edp0_pp3, gpio_edp1_pp4, gpio_edp2_pp5,
|
||||
gpio_edp3_pp6, directdc1_clk_pq0, directdc1_in_pq1,
|
||||
directdc1_out0_pq2, directdc1_out1_pq3,
|
||||
directdc1_out2_pq4, directdc1_out3_pq5,
|
||||
qspi_sck_pr0, qspi_io0_pr1, qspi_io1_pr2,
|
||||
qspi_io2_pr3, qspi_io3_pr4, qspi_cs_n_pr5,
|
||||
uart1_tx_pt0, uart1_rx_pt1, uart1_rts_pt2,
|
||||
uart1_cts_pt3, uart2_tx_px0, uart2_rx_px1,
|
||||
uart2_rts_px2, uart2_cts_px3, uart5_tx_px4,
|
||||
uart5_rx_px5, uart5_rts_px6, uart5_cts_px7,
|
||||
gpio_mdm1_py0, gpio_mdm2_py1, gpio_mdm3_py2,
|
||||
gpio_mdm4_py3, gpio_mdm5_py4, gpio_mdm6_py5,
|
||||
gpio_mdm7_py6, ufs0_ref_clk_pbb0, ufs0_rst_pbb1,
|
||||
dap4_sclk_pcc0, dap4_dout_pcc1, dap4_din_pcc2,
|
||||
dap4_fs_pcc3, directdc_comp, sdmmc1_comp, eqos_comp,
|
||||
sdmmc3_comp, qspi_comp,
|
||||
# drive groups
|
||||
drive_gpio_aud3_pk0, drive_gpio_aud2_pj7,
|
||||
drive_gpio_aud1_pj6, drive_gpio_aud0_pj5,
|
||||
drive_aud_mclk_pj4, drive_dap1_fs_pj3,
|
||||
drive_dap1_din_pj2, drive_dap1_dout_pj1,
|
||||
drive_dap1_sclk_pj0, drive_dmic1_clk_pm1,
|
||||
drive_dmic1_dat_pm0, drive_dmic2_dat_pm2,
|
||||
drive_dmic2_clk_pm3, drive_dmic4_dat_pm4,
|
||||
drive_dmic4_clk_pm5, drive_dap4_fs_pcc3,
|
||||
drive_dap4_din_pcc2, drive_dap4_dout_pcc1,
|
||||
drive_dap4_sclk_pcc0, drive_extperiph2_clk_po1,
|
||||
drive_extperiph1_clk_po0, drive_cam_i2c_sda_po3,
|
||||
drive_cam_i2c_scl_po2, drive_gpio_cam1_pn0,
|
||||
drive_gpio_cam2_pn1, drive_gpio_cam3_pn2,
|
||||
drive_gpio_cam4_pn3, drive_gpio_cam5_pn4,
|
||||
drive_gpio_cam6_pn5, drive_gpio_cam7_pn6,
|
||||
drive_dap2_din_pc3, drive_dap2_dout_pc2,
|
||||
drive_dap2_fs_pc4, drive_dap2_sclk_pc1,
|
||||
drive_uart4_cts_pb3, drive_uart4_rts_pb2,
|
||||
drive_uart4_rx_pb1, drive_uart4_tx_pb0,
|
||||
drive_gpio_wan4_pc0, drive_gpio_wan3_pb6,
|
||||
drive_gpio_wan2_pb5, drive_gpio_wan1_pb4,
|
||||
drive_gen1_i2c_scl_pc5, drive_gen1_i2c_sda_pc6,
|
||||
drive_uart1_cts_pt3, drive_uart1_rts_pt2,
|
||||
drive_uart1_rx_pt1, drive_uart1_tx_pt0,
|
||||
drive_directdc1_out3_pq5, drive_directdc1_out2_pq4,
|
||||
drive_directdc1_out1_pq3, drive_directdc1_out0_pq2,
|
||||
drive_directdc1_in_pq1, drive_directdc1_clk_pq0,
|
||||
drive_gpio_pq0_pi0, drive_gpio_pq1_pi1,
|
||||
drive_gpio_pq2_pi2, drive_gpio_pq3_pi3,
|
||||
drive_gpio_pq4_pi4, drive_gpio_pq5_pi5,
|
||||
drive_gpio_pq6_pi6, drive_gpio_pq7_pi7,
|
||||
drive_gpio_edp2_pp5, drive_gpio_edp3_pp6,
|
||||
drive_gpio_edp0_pp3, drive_gpio_edp1_pp4,
|
||||
drive_dp_aux_ch0_hpd_pp0, drive_dp_aux_ch1_hpd_pp1,
|
||||
drive_hdmi_cec_pp2, drive_pex_l2_clkreq_n_pa6,
|
||||
drive_pex_wake_n_pa2, drive_pex_l1_clkreq_n_pa4,
|
||||
drive_pex_l1_rst_n_pa3, drive_pex_l0_clkreq_n_pa1,
|
||||
drive_pex_l0_rst_n_pa0, drive_pex_l2_rst_n_pa5,
|
||||
drive_sdmmc1_clk_pd0, drive_sdmmc1_cmd_pd1,
|
||||
drive_sdmmc1_dat3_pd5, drive_sdmmc1_dat2_pd4,
|
||||
drive_sdmmc1_dat1_pd3, drive_sdmmc1_dat0_pd2,
|
||||
drive_eqos_td3_pe4, drive_eqos_td2_pe3,
|
||||
drive_eqos_td1_pe2, drive_eqos_td0_pe1,
|
||||
drive_eqos_rd3_pf1, drive_eqos_rd2_pf0,
|
||||
drive_eqos_rd1_pe7, drive_eqos_mdio_pf4,
|
||||
drive_eqos_rd0_pe6, drive_eqos_mdc_pf5,
|
||||
drive_eqos_txc_pe0, drive_eqos_rxc_pf3,
|
||||
drive_eqos_tx_ctl_pe5, drive_eqos_rx_ctl_pf2,
|
||||
drive_sdmmc3_dat3_pg5, drive_sdmmc3_dat2_pg4,
|
||||
drive_sdmmc3_dat1_pg3, drive_sdmmc3_dat0_pg2,
|
||||
drive_sdmmc3_cmd_pg1, drive_sdmmc3_clk_pg0,
|
||||
drive_qspi_io3_pr4, drive_qspi_io2_pr3,
|
||||
drive_qspi_io1_pr2, drive_qspi_io0_pr1,
|
||||
drive_qspi_sck_pr0, drive_qspi_cs_n_pr5,
|
||||
drive_gpio_wan8_ph3, drive_gpio_wan7_ph2,
|
||||
drive_gpio_wan6_ph1, drive_gpio_wan5_ph0,
|
||||
drive_uart2_tx_px0, drive_uart2_rx_px1,
|
||||
drive_uart2_rts_px2, drive_uart2_cts_px3,
|
||||
drive_uart5_rx_px5, drive_uart5_tx_px4,
|
||||
drive_uart5_rts_px6, drive_uart5_cts_px7,
|
||||
drive_gpio_mdm1_py0, drive_gpio_mdm2_py1,
|
||||
drive_gpio_mdm3_py2, drive_gpio_mdm4_py3,
|
||||
drive_gpio_mdm5_py4, drive_gpio_mdm6_py5,
|
||||
drive_gpio_mdm7_py6, drive_bcpu_pwr_req_ph4,
|
||||
drive_mcpu_pwr_req_ph5, drive_gpu_pwr_req_ph6,
|
||||
drive_gen7_i2c_scl_pl0, drive_gen7_i2c_sda_pl1,
|
||||
drive_gen9_i2c_sda_pl3, drive_gen9_i2c_scl_pl2,
|
||||
drive_usb_vbus_en0_pl4, drive_usb_vbus_en1_pl5,
|
||||
drive_gp_pwm7_pl7, drive_gp_pwm6_pl6,
|
||||
drive_ufs0_rst_pbb1, drive_ufs0_ref_clk_pbb0,
|
||||
drive_directdc_comp, drive_sdmmc1_comp,
|
||||
drive_eqos_comp, drive_sdmmc3_comp, drive_sdmmc4_clk,
|
||||
drive_sdmmc4_cmd, drive_sdmmc4_dqs,
|
||||
drive_sdmmc4_dat7, drive_sdmmc4_dat6,
|
||||
drive_sdmmc4_dat5, drive_sdmmc4_dat4,
|
||||
drive_sdmmc4_dat3, drive_sdmmc4_dat2,
|
||||
drive_sdmmc4_dat1, drive_sdmmc4_dat0,
|
||||
drive_qspi_comp ]
|
||||
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
const: nvidia,tegra186-pinmux-aon
|
||||
then:
|
||||
patternProperties:
|
||||
"^pinmux(-[a-z0-9-]+)?$":
|
||||
type: object
|
||||
additionalProperties:
|
||||
properties:
|
||||
nvidia,pins:
|
||||
items:
|
||||
enum: [ pwr_i2c_scl_ps0, pwr_i2c_sda_ps1, batt_oc_ps2,
|
||||
safe_state_ps3, vcomp_alert_ps4, gpio_dis0_pu0,
|
||||
gpio_dis1_pu1, gpio_dis2_pu2, gpio_dis3_pu3,
|
||||
gpio_dis4_pu4, gpio_dis5_pu5, gpio_sen0_pv0,
|
||||
gpio_sen1_pv1, gpio_sen2_pv2, gpio_sen3_pv3,
|
||||
gpio_sen4_pv4, gpio_sen5_pv5, gpio_sen6_pv6,
|
||||
gpio_sen7_pv7, gen8_i2c_scl_pw0, gen8_i2c_sda_pw1,
|
||||
uart3_tx_pw2, uart3_rx_pw3, uart3_rts_pw4,
|
||||
uart3_cts_pw5, uart7_tx_pw6, uart7_rx_pw7,
|
||||
can1_dout_pz0, can1_din_pz1, can0_dout_pz2,
|
||||
can0_din_pz3, can_gpio0_paa0, can_gpio1_paa1,
|
||||
can_gpio2_paa2, can_gpio3_paa3, can_gpio4_paa4,
|
||||
can_gpio5_paa5, can_gpio6_paa6, can_gpio7_paa7,
|
||||
gpio_sen8_pee0, gpio_sen9_pee1, touch_clk_pee2,
|
||||
power_on_pff0, gpio_sw1_pff1, gpio_sw2_pff2,
|
||||
gpio_sw3_pff3, gpio_sw4_pff4, shutdown, pmu_int,
|
||||
soc_pwr_req, clk_32k_in,
|
||||
# drive groups
|
||||
drive_touch_clk_pee2, drive_uart3_cts_pw5,
|
||||
drive_uart3_rts_pw4, drive_uart3_rx_pw3,
|
||||
drive_uart3_tx_pw2, drive_gen8_i2c_sda_pw1,
|
||||
drive_gen8_i2c_scl_pw0, drive_uart7_rx_pw7,
|
||||
drive_uart7_tx_pw6, drive_gpio_sen0_pv0,
|
||||
drive_gpio_sen1_pv1, drive_gpio_sen2_pv2,
|
||||
drive_gpio_sen3_pv3, drive_gpio_sen4_pv4,
|
||||
drive_gpio_sen5_pv5, drive_gpio_sen6_pv6,
|
||||
drive_gpio_sen7_pv7, drive_gpio_sen8_pee0,
|
||||
drive_gpio_sen9_pee1, drive_can_gpio7_paa7,
|
||||
drive_can1_dout_pz0, drive_can1_din_pz1,
|
||||
drive_can0_dout_pz2, drive_can0_din_pz3,
|
||||
drive_can_gpio0_paa0, drive_can_gpio1_paa1,
|
||||
drive_can_gpio2_paa2, drive_can_gpio3_paa3,
|
||||
drive_can_gpio4_paa4, drive_can_gpio5_paa5,
|
||||
drive_can_gpio6_paa6, drive_gpio_sw1_pff1,
|
||||
drive_gpio_sw2_pff2, drive_gpio_sw3_pff3,
|
||||
drive_gpio_sw4_pff4, drive_shutdown, drive_pmu_int,
|
||||
drive_safe_state_ps3, drive_vcomp_alert_ps4,
|
||||
drive_soc_pwr_req, drive_batt_oc_ps2,
|
||||
drive_clk_32k_in, drive_power_on_pff0,
|
||||
drive_pwr_i2c_scl_ps0, drive_pwr_i2c_sda_ps1,
|
||||
drive_gpio_dis0_pu0, drive_gpio_dis1_pu1,
|
||||
drive_gpio_dis2_pu2, drive_gpio_dis3_pu3,
|
||||
drive_gpio_dis4_pu4, drive_gpio_dis5_pu5 ]
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/pinctrl/pinctrl-tegra.h>
|
||||
|
||||
pinmux@2430000 {
|
||||
compatible = "nvidia,tegra186-pinmux";
|
||||
reg = <0x2430000 0x15000>;
|
||||
|
||||
pinctrl-names = "jetson_io";
|
||||
pinctrl-0 = <&jetson_io_pinmux>;
|
||||
|
||||
jetson_io_pinmux: pinmux {
|
||||
hdr40-pin7 {
|
||||
nvidia,pins = "aud_mclk_pj4";
|
||||
nvidia,function = "aud";
|
||||
nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
|
||||
nvidia,tristate = <TEGRA_PIN_DISABLE>;
|
||||
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
|
||||
};
|
||||
};
|
||||
};
|
||||
...
|
||||
133
Documentation/devicetree/bindings/pinctrl/qcom,glymur-tlmm.yaml
Normal file
133
Documentation/devicetree/bindings/pinctrl/qcom,glymur-tlmm.yaml
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/qcom,glymur-tlmm.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Qualcomm Technologies, Inc. Glymur TLMM block
|
||||
|
||||
maintainers:
|
||||
- Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
|
||||
|
||||
description:
|
||||
Top Level Mode Multiplexer pin controller in Qualcomm Glymur SoC.
|
||||
|
||||
allOf:
|
||||
- $ref: /schemas/pinctrl/qcom,tlmm-common.yaml#
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: qcom,glymur-tlmm
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
interrupts:
|
||||
maxItems: 1
|
||||
|
||||
gpio-reserved-ranges:
|
||||
minItems: 1
|
||||
maxItems: 125
|
||||
|
||||
gpio-line-names:
|
||||
maxItems: 250
|
||||
|
||||
patternProperties:
|
||||
"-state$":
|
||||
oneOf:
|
||||
- $ref: "#/$defs/qcom-glymur-tlmm-state"
|
||||
- patternProperties:
|
||||
"-pins$":
|
||||
$ref: "#/$defs/qcom-glymur-tlmm-state"
|
||||
additionalProperties: false
|
||||
|
||||
$defs:
|
||||
qcom-glymur-tlmm-state:
|
||||
type: object
|
||||
description:
|
||||
Pinctrl node's client devices use subnodes for desired pin configuration.
|
||||
Client device subnodes use below standard properties.
|
||||
$ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state
|
||||
unevaluatedProperties: false
|
||||
|
||||
properties:
|
||||
pins:
|
||||
description:
|
||||
List of gpio pins affected by the properties specified in this
|
||||
subnode.
|
||||
items:
|
||||
oneOf:
|
||||
- pattern: "^gpio([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9])$"
|
||||
- enum: [ ufs_reset, sdc2_clk, sdc2_cmd, sdc2_data ]
|
||||
minItems: 1
|
||||
maxItems: 36
|
||||
|
||||
function:
|
||||
description:
|
||||
Specify the alternative function to be configured for the specified
|
||||
pins.
|
||||
enum: [ gpio, resout_gpio_n, aoss_cti, asc_cci, atest_char, atest_usb,
|
||||
audio_ext_mclk0, audio_ext_mclk1, audio_ref_clk, cam_asc_mclk4,
|
||||
cam_mclk, cci_async_in, cci_i2c_scl, cci_i2c_sda, cci_timer,
|
||||
cmu_rng, cri_trng, dbg_out_clk, ddr_bist_complete,
|
||||
ddr_bist_fail, ddr_bist_start, ddr_bist_stop, ddr_pxi,
|
||||
edp0_hot, edp0_lcd, edp1_lcd, egpio, eusb0_ac_en, eusb1_ac_en,
|
||||
eusb2_ac_en, eusb3_ac_en, eusb5_ac_en, eusb6_ac_en, gcc_gp1,
|
||||
gcc_gp2, gcc_gp3, host2wlan_sol, i2c0_s_scl, i2c0_s_sda,
|
||||
i2s0_data, i2s0_sck, i2s0_ws, i2s1_data, i2s1_sck, i2s1_ws,
|
||||
ibi_i3c, jitter_bist, mdp_vsync_out, mdp_vsync_e, mdp_vsync_p,
|
||||
mdp_vsync_s, pcie3a_clk, pcie3a_rst_n, pcie3b_clk,
|
||||
pcie4_clk_req_n, pcie5_clk_req_n, pcie6_clk_req_n, phase_flag,
|
||||
pll_bist_sync, pll_clk_aux, pmc_oca_n, pmc_uva_n, prng_rosc,
|
||||
qdss_cti, qdss_gpio, qspi, qup0_se0, qup0_se1, qup0_se2,
|
||||
qup0_se3_l0, qup0_se3, qup0_se4, qup0_se5, qup0_se6, qup0_se7,
|
||||
qup1_se0, qup1_se1, qup1_se2, qup1_se3, qup1_se4, qup1_se5,
|
||||
qup1_se6, qup1_se7, qup2_se0, qup2_se1, qup2_se2, qup2_se3,
|
||||
qup2_se4, qup2_se5, qup2_se6, qup2_se7, qup3_se0, qup3_se1,
|
||||
sd_write_protect, sdc4_clk, sdc4_cmd, sdc4_data, smb_acok_n,
|
||||
sys_throttle, tb_trig_sdc2, tb_trig_sdc4, tmess_prng,
|
||||
tsense_pwm, tsense_therm, usb0_dp, usb0_phy_ps, usb0_sbrx,
|
||||
usb0_sbtx, usb0_tmu, usb1_dbg, usb1_dp, usb1_phy_ps, usb1_sbrx,
|
||||
usb1_sbtx, usb1_tmu, usb2_dp, usb2_phy_ps, usb2_sbrx, usb2_sbtx,
|
||||
usb2_tmu, vsense_trigger_mirnat, wcn_sw, wcn_sw_ctrl ]
|
||||
|
||||
required:
|
||||
- pins
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
tlmm: pinctrl@f100000 {
|
||||
compatible = "qcom,glymur-tlmm";
|
||||
reg = <0x0f100000 0xf00000>;
|
||||
interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
gpio-ranges = <&tlmm 0 0 249>;
|
||||
wakeup-parent = <&pdc>;
|
||||
gpio-reserved-ranges = <4 4>, <10 2>, <33 3>, <44 4>;
|
||||
qup_uart21_default: qup-uart21-default-state {
|
||||
tx-pins {
|
||||
pins = "gpio86";
|
||||
function = "qup2_se5";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
|
||||
rx-pins {
|
||||
pins = "gpio87";
|
||||
function = "qup2_se5";
|
||||
drive-strength = <2>;
|
||||
bias-disable;
|
||||
};
|
||||
};
|
||||
};
|
||||
...
|
||||
|
|
@ -20,6 +20,16 @@ properties:
|
|||
reg:
|
||||
maxItems: 2
|
||||
|
||||
clocks:
|
||||
items:
|
||||
- description: LPASS Core voting clock
|
||||
- description: LPASS Audio voting clock
|
||||
|
||||
clock-names:
|
||||
items:
|
||||
- const: core
|
||||
- const: audio
|
||||
|
||||
patternProperties:
|
||||
"-state$":
|
||||
oneOf:
|
||||
|
|
@ -70,10 +80,16 @@ unevaluatedProperties: false
|
|||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/sound/qcom,q6afe.h>
|
||||
lpass_tlmm: pinctrl@33c0000 {
|
||||
compatible = "qcom,sc7280-lpass-lpi-pinctrl";
|
||||
reg = <0x33c0000 0x20000>,
|
||||
<0x3550000 0x10000>;
|
||||
|
||||
clocks = <&q6prmcc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
|
||||
<&q6prmcc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
|
||||
clock-names = "core", "audio";
|
||||
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
gpio-ranges = <&lpass_tlmm 0 0 15>;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,109 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/qcom,sdm660-lpass-lpi-pinctrl.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Qualcomm SDM660 SoC LPASS LPI TLMM
|
||||
|
||||
maintainers:
|
||||
- Nickolay Goppen <setotau@mainlining.org>
|
||||
|
||||
description:
|
||||
Top Level Mode Multiplexer pin controller in the Low Power Audio SubSystem
|
||||
(LPASS) Low Power Island (LPI) of Qualcomm SDM660 SoC.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
const: qcom,sdm660-lpass-lpi-pinctrl
|
||||
|
||||
reg:
|
||||
items:
|
||||
- description: LPASS LPI TLMM Control and Status registers
|
||||
|
||||
patternProperties:
|
||||
"-state$":
|
||||
oneOf:
|
||||
- $ref: "#/$defs/qcom-sdm660-lpass-state"
|
||||
- patternProperties:
|
||||
"-pins$":
|
||||
$ref: "#/$defs/qcom-sdm660-lpass-state"
|
||||
additionalProperties: false
|
||||
|
||||
$defs:
|
||||
qcom-sdm660-lpass-state:
|
||||
type: object
|
||||
description:
|
||||
Pinctrl node's client devices use subnodes for desired pin configuration.
|
||||
Client device subnodes use below standard properties.
|
||||
$ref: qcom,lpass-lpi-common.yaml#/$defs/qcom-tlmm-state
|
||||
unevaluatedProperties: false
|
||||
|
||||
properties:
|
||||
pins:
|
||||
description:
|
||||
List of gpio pins affected by the properties specified in this
|
||||
subnode.
|
||||
items:
|
||||
pattern: "^gpio([0-9]|[1-2][0-9]|3[0-1])$"
|
||||
|
||||
function:
|
||||
enum: [ gpio, comp_rx, dmic1_clk, dmic1_data, dmic2_clk, dmic2_data,
|
||||
mclk0, pdm_tx, pdm_clk, pdm_rx, pdm_sync ]
|
||||
description:
|
||||
Specify the alternative function to be configured for the specified
|
||||
pins.
|
||||
|
||||
allOf:
|
||||
- $ref: qcom,lpass-lpi-common.yaml#
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
lpi_tlmm: pinctrl@15070000 {
|
||||
compatible = "qcom,sdm660-lpass-lpi-pinctrl";
|
||||
reg = <0x15070000 0x20000>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
gpio-ranges = <&lpi_tlmm 0 0 32>;
|
||||
|
||||
cdc_pdm_default: cdc-pdm-default-state {
|
||||
clk-pins {
|
||||
pins = "gpio18";
|
||||
function = "pdm_clk";
|
||||
drive-strength = <8>;
|
||||
output-high;
|
||||
};
|
||||
|
||||
sync-pins{
|
||||
pins = "gpio19";
|
||||
function = "pdm_sync";
|
||||
drive-strength = <4>;
|
||||
output-high;
|
||||
};
|
||||
|
||||
tx-pins {
|
||||
pins = "gpio20";
|
||||
function = "pdm_tx";
|
||||
drive-strength = <8>;
|
||||
};
|
||||
|
||||
rx-pins {
|
||||
pins = "gpio21", "gpio23", "gpio25";
|
||||
function = "pdm_rx";
|
||||
drive-strength = <4>;
|
||||
output-high;
|
||||
};
|
||||
};
|
||||
|
||||
cdc_comp_default: cdc-comp-default-state {
|
||||
pins = "gpio22", "gpio24";
|
||||
function = "comp_rx";
|
||||
drive-strength = <8>;
|
||||
};
|
||||
};
|
||||
|
|
@ -72,10 +72,36 @@ $defs:
|
|||
pins:
|
||||
description:
|
||||
List of gpio pins affected by the properties specified in this
|
||||
subnode.
|
||||
subnode (either this or "groups" must be specified).
|
||||
items:
|
||||
pattern: '^gpio([0-9]|[1-4][0-9]|5[0-3])$'
|
||||
|
||||
groups:
|
||||
description:
|
||||
List of groups affected by the properties specified in this
|
||||
subnode (either this or "pins" must be specified).
|
||||
items:
|
||||
anyOf:
|
||||
- pattern: '^gpio([0-9]|[1-4][0-9]|5[0-3])$'
|
||||
- enum: [ uart0, uart0_ctrl, uart1, uart1_ctrl, uart2, uart2_ctrl,
|
||||
uart3, uart3_ctrl, uart4, uart4_ctrl, uart5_0,
|
||||
uart5_0_ctrl, uart5_1, uart5_1_ctrl, uart5_2,
|
||||
uart5_2_ctrl, uart5_3,
|
||||
sd0, sd1,
|
||||
i2s0, i2s0_dual, i2s0_quad, i2s1, i2s1_dual, i2s1_quad,
|
||||
i2s2_0, i2s2_0_dual, i2s2_1, i2s2_1_dual,
|
||||
i2c4_0, i2c4_1, i2c4_2, i2c4_3, i2c6_0, i2c6_1, i2c5_0,
|
||||
i2c5_1, i2c5_2, i2c5_3, i2c0_0, i2c0_1, i2c1_0, i2c1_1,
|
||||
i2c2_0, i2c2_1, i2c3_0, i2c3_1, i2c3_2,
|
||||
dpi_16bit, dpi_16bit_cpadhi, dpi_16bit_pad666,
|
||||
dpi_18bit, dpi_18bit_cpadhi, dpi_24bit,
|
||||
spi0, spi0_quad, spi1, spi2, spi3, spi4, spi5, spi6_0,
|
||||
spi6_1, spi7_0, spi7_1, spi8_0, spi8_1,
|
||||
aaud_0, aaud_1, aaud_2, aaud_3, aaud_4,
|
||||
vbus0_0, vbus0_1, vbus1, vbus2, vbus3,
|
||||
mic_0, mic_1, mic_2, mic_3,
|
||||
ir ]
|
||||
|
||||
function:
|
||||
enum: [ alt0, alt1, alt2, alt3, alt4, gpio, alt6, alt7, alt8, none,
|
||||
aaud, dcd0, dpi, dsi0_te_ext, dsi1_te_ext, dsr0, dtr0, gpclk0,
|
||||
|
|
@ -103,6 +129,13 @@ $defs:
|
|||
drive-strength:
|
||||
enum: [ 2, 4, 8, 12 ]
|
||||
|
||||
required:
|
||||
- function
|
||||
|
||||
oneOf:
|
||||
- required: [ groups ]
|
||||
- required: [ pins ]
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
allOf:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,172 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/pinctrl/renesas,r9a09g077-pinctrl.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Renesas RZ/T2H and RZ/N2H Pin and GPIO controller
|
||||
|
||||
maintainers:
|
||||
- Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
|
||||
|
||||
description:
|
||||
The Renesas RZ/T2H and RZ/N2H SoCs feature a combined Pin and GPIO controller.
|
||||
Pin multiplexing and GPIO configuration are performed on a per-pin basis.
|
||||
Each port supports up to 8 pins, each configurable for either GPIO (port mode)
|
||||
or alternate function mode. Each pin supports function mode values ranging from
|
||||
0x0 to 0x2A, allowing selection from up to 43 different functions.
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- renesas,r9a09g077-pinctrl # RZ/T2H
|
||||
- renesas,r9a09g087-pinctrl # RZ/N2H
|
||||
|
||||
reg:
|
||||
minItems: 1
|
||||
items:
|
||||
- description: Non-safety I/O Port base
|
||||
- description: Safety I/O Port safety region base
|
||||
- description: Safety I/O Port Non-safety region base
|
||||
|
||||
reg-names:
|
||||
minItems: 1
|
||||
items:
|
||||
- const: nsr
|
||||
- const: srs
|
||||
- const: srn
|
||||
|
||||
gpio-controller: true
|
||||
|
||||
'#gpio-cells':
|
||||
const: 2
|
||||
description:
|
||||
The first cell contains the global GPIO port index, constructed using the
|
||||
RZT2H_GPIO() helper macro from <dt-bindings/pinctrl/renesas,r9a09g077-pinctrl.h>
|
||||
(e.g. "RZT2H_GPIO(3, 0)" for P03_0). The second cell represents the consumer
|
||||
flag. Use the macros defined in include/dt-bindings/gpio/gpio.h.
|
||||
|
||||
gpio-ranges:
|
||||
maxItems: 1
|
||||
|
||||
clocks:
|
||||
maxItems: 1
|
||||
|
||||
power-domains:
|
||||
maxItems: 1
|
||||
|
||||
definitions:
|
||||
renesas-rzt2h-n2h-pins-node:
|
||||
type: object
|
||||
allOf:
|
||||
- $ref: pincfg-node.yaml#
|
||||
- $ref: pinmux-node.yaml#
|
||||
properties:
|
||||
pinmux:
|
||||
description:
|
||||
Values are constructed from I/O port number, pin number, and
|
||||
alternate function configuration number using the RZT2H_PORT_PINMUX()
|
||||
helper macro from <dt-bindings/pinctrl/renesas,r9a09g077-pinctrl.h>.
|
||||
pins: true
|
||||
phandle: true
|
||||
input: true
|
||||
input-enable: true
|
||||
output-enable: true
|
||||
oneOf:
|
||||
- required: [pinmux]
|
||||
- required: [pins]
|
||||
additionalProperties: false
|
||||
|
||||
patternProperties:
|
||||
# Grouping nodes: allow multiple "-pins" subnodes within a "-group"
|
||||
'.*-group$':
|
||||
type: object
|
||||
description:
|
||||
Pin controller client devices can organize pin configuration entries into
|
||||
grouping nodes ending in "-group". These group nodes may contain multiple
|
||||
child nodes each ending in "-pins" to configure distinct sets of pins.
|
||||
additionalProperties: false
|
||||
patternProperties:
|
||||
'-pins$':
|
||||
$ref: '#/definitions/renesas-rzt2h-n2h-pins-node'
|
||||
|
||||
# Standalone "-pins" nodes under client devices or groups
|
||||
'-pins$':
|
||||
$ref: '#/definitions/renesas-rzt2h-n2h-pins-node'
|
||||
|
||||
'-hog$':
|
||||
type: object
|
||||
description: GPIO hog node
|
||||
properties:
|
||||
gpio-hog: true
|
||||
gpios: true
|
||||
input: true
|
||||
output-high: true
|
||||
output-low: true
|
||||
line-name: true
|
||||
required:
|
||||
- gpio-hog
|
||||
- gpios
|
||||
additionalProperties: false
|
||||
|
||||
allOf:
|
||||
- $ref: pinctrl.yaml#
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- reg-names
|
||||
- gpio-controller
|
||||
- '#gpio-cells'
|
||||
- gpio-ranges
|
||||
- clocks
|
||||
- power-domains
|
||||
|
||||
unevaluatedProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
#include <dt-bindings/clock/renesas,r9a09g077-cpg-mssr.h>
|
||||
#include <dt-bindings/pinctrl/renesas,r9a09g077-pinctrl.h>
|
||||
|
||||
pinctrl@802c0000 {
|
||||
compatible = "renesas,r9a09g077-pinctrl";
|
||||
reg = <0x802c0000 0x2000>,
|
||||
<0x812c0000 0x2000>,
|
||||
<0x802b0000 0x2000>;
|
||||
reg-names = "nsr", "srs", "srn";
|
||||
clocks = <&cpg CPG_CORE R9A09G077_CLK_PCLKM>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
gpio-ranges = <&pinctrl 0 0 288>;
|
||||
power-domains = <&cpg>;
|
||||
|
||||
serial0-pins {
|
||||
pinmux = <RZT2H_PORT_PINMUX(38, 0, 1)>, /* Tx */
|
||||
<RZT2H_PORT_PINMUX(38, 1, 1)>; /* Rx */
|
||||
};
|
||||
|
||||
sd1-pwr-en-hog {
|
||||
gpio-hog;
|
||||
gpios = <RZT2H_GPIO(39, 2) 0>;
|
||||
output-high;
|
||||
line-name = "sd1_pwr_en";
|
||||
};
|
||||
|
||||
i2c0-pins {
|
||||
pins = "RIIC0_SDA", "RIIC0_SCL";
|
||||
input-enable;
|
||||
};
|
||||
|
||||
sd0-sd-group {
|
||||
ctrl-pins {
|
||||
pinmux = <RZT2H_PORT_PINMUX(12, 0, 0x29)>, /* SD0_CLK */
|
||||
<RZT2H_PORT_PINMUX(12, 1, 0x29)>; /* SD0_CMD */
|
||||
};
|
||||
|
||||
data-pins {
|
||||
pinmux = <RZT2H_PORT_PINMUX(12, 0, 0x29)>, /* SD0_CLK */
|
||||
<RZT2H_PORT_PINMUX(12, 1, 0x29)>; /* SD0_CMD */
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -30,8 +30,6 @@ properties:
|
|||
compatible:
|
||||
oneOf:
|
||||
- enum:
|
||||
- samsung,s3c2410-wakeup-eint
|
||||
- samsung,s3c2412-wakeup-eint
|
||||
- samsung,s3c64xx-wakeup-eint
|
||||
- samsung,s5pv210-wakeup-eint
|
||||
- samsung,exynos4210-wakeup-eint
|
||||
|
|
@ -59,27 +57,12 @@ properties:
|
|||
description:
|
||||
Interrupt used by multiplexed external wake-up interrupts.
|
||||
minItems: 1
|
||||
maxItems: 6
|
||||
maxItems: 4
|
||||
|
||||
required:
|
||||
- compatible
|
||||
|
||||
allOf:
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
contains:
|
||||
enum:
|
||||
- samsung,s3c2410-wakeup-eint
|
||||
- samsung,s3c2412-wakeup-eint
|
||||
then:
|
||||
properties:
|
||||
interrupts:
|
||||
minItems: 6
|
||||
maxItems: 6
|
||||
required:
|
||||
- interrupts
|
||||
|
||||
- if:
|
||||
properties:
|
||||
compatible:
|
||||
|
|
|
|||
|
|
@ -35,11 +35,8 @@ properties:
|
|||
|
||||
compatible:
|
||||
enum:
|
||||
- axis,artpec8-pinctrl
|
||||
- google,gs101-pinctrl
|
||||
- samsung,s3c2412-pinctrl
|
||||
- samsung,s3c2416-pinctrl
|
||||
- samsung,s3c2440-pinctrl
|
||||
- samsung,s3c2450-pinctrl
|
||||
- samsung,s3c64xx-pinctrl
|
||||
- samsung,s5pv210-pinctrl
|
||||
- samsung,exynos2200-pinctrl
|
||||
|
|
|
|||
|
|
@ -863,7 +863,7 @@ has to be handled by the ``<linux/gpio/consumer.h>`` interface. Instead view thi
|
|||
a certain pin config setting. Look in e.g. ``<linux/pinctrl/pinconf-generic.h>``
|
||||
and you find this in the documentation:
|
||||
|
||||
PIN_CONFIG_OUTPUT:
|
||||
PIN_CONFIG_LEVEL:
|
||||
this will configure the pin in output, use argument
|
||||
1 to indicate high level, argument 0 to indicate low level.
|
||||
|
||||
|
|
@ -897,7 +897,7 @@ And your machine configuration may look like this:
|
|||
};
|
||||
|
||||
static unsigned long uart_sleep_mode[] = {
|
||||
PIN_CONF_PACKED(PIN_CONFIG_OUTPUT, 0),
|
||||
PIN_CONF_PACKED(PIN_CONFIG_LEVEL, 0),
|
||||
};
|
||||
|
||||
static struct pinctrl_map pinmap[] __initdata = {
|
||||
|
|
|
|||
|
|
@ -1117,6 +1117,27 @@ void *devm_kmemdup(struct device *dev, const void *src, size_t len, gfp_t gfp)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(devm_kmemdup);
|
||||
|
||||
/**
|
||||
* devm_kmemdup_const - conditionally duplicate and manage a region of memory
|
||||
*
|
||||
* @dev: Device this memory belongs to
|
||||
* @src: memory region to duplicate
|
||||
* @len: memory region length,
|
||||
* @gfp: GFP mask to use
|
||||
*
|
||||
* Return: source address if it is in .rodata or the return value of kmemdup()
|
||||
* to which the function falls back otherwise.
|
||||
*/
|
||||
const void *
|
||||
devm_kmemdup_const(struct device *dev, const void *src, size_t len, gfp_t gfp)
|
||||
{
|
||||
if (is_kernel_rodata((unsigned long)src))
|
||||
return src;
|
||||
|
||||
return devm_kmemdup(dev, src, len, gfp);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(devm_kmemdup_const);
|
||||
|
||||
struct pages_devres {
|
||||
unsigned long addr;
|
||||
unsigned int order;
|
||||
|
|
|
|||
|
|
@ -769,7 +769,7 @@ static int rockchip_gpio_probe(struct platform_device *pdev)
|
|||
list_del(&cfg->head);
|
||||
|
||||
switch (cfg->param) {
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
ret = rockchip_gpio_direction_output(&bank->gpio_chip, cfg->pin, cfg->arg);
|
||||
if (ret)
|
||||
dev_warn(dev, "setting output pin %u to %u failed\n", cfg->pin,
|
||||
|
|
|
|||
|
|
@ -211,6 +211,8 @@ config PINCTRL_EIC7700
|
|||
depends on ARCH_ESWIN || COMPILE_TEST
|
||||
select PINMUX
|
||||
select GENERIC_PINCONF
|
||||
select REGULATOR
|
||||
select REGULATOR_FIXED_VOLTAGE
|
||||
help
|
||||
This driver support for the pin controller in ESWIN's EIC7700 SoC,
|
||||
which supports pin multiplexing, pin configuration,and rgmii voltage
|
||||
|
|
@ -562,7 +564,7 @@ config PINCTRL_STMFX
|
|||
interrupt-controller.
|
||||
|
||||
config PINCTRL_SX150X
|
||||
bool "Semtech SX150x I2C GPIO expander pinctrl driver"
|
||||
tristate "Semtech SX150x I2C GPIO expander pinctrl driver"
|
||||
depends on I2C=y
|
||||
select PINMUX
|
||||
select PINCONF
|
||||
|
|
@ -612,6 +614,25 @@ config PINCTRL_TH1520
|
|||
This driver is needed for RISC-V development boards like
|
||||
the BeagleV Ahead and the LicheePi 4A.
|
||||
|
||||
config PINCTRL_UPBOARD
|
||||
tristate "AAeon UP board FPGA pin controller"
|
||||
depends on MFD_UPBOARD_FPGA
|
||||
select PINMUX
|
||||
select GENERIC_PINCTRL_GROUPS
|
||||
select GENERIC_PINMUX_FUNCTIONS
|
||||
select GPIOLIB
|
||||
select GPIO_AGGREGATOR
|
||||
help
|
||||
Pin controller for the FPGA GPIO lines on UP boards. Due to the
|
||||
hardware layout, the driver controls the FPGA pins in tandem with
|
||||
their corresponding Intel SoC GPIOs.
|
||||
|
||||
Currently supported:
|
||||
- UP Squared
|
||||
|
||||
To compile this driver as a module, choose M here: the module
|
||||
will be called pinctrl-upboard.
|
||||
|
||||
config PINCTRL_ZYNQ
|
||||
bool "Pinctrl driver for Xilinx Zynq"
|
||||
depends on ARCH_ZYNQ || COMPILE_TEST
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ obj-$(CONFIG_PINCTRL_SX150X) += pinctrl-sx150x.o
|
|||
obj-$(CONFIG_PINCTRL_TB10X) += pinctrl-tb10x.o
|
||||
obj-$(CONFIG_PINCTRL_TPS6594) += pinctrl-tps6594.o
|
||||
obj-$(CONFIG_PINCTRL_TH1520) += pinctrl-th1520.o
|
||||
obj-$(CONFIG_PINCTRL_UPBOARD) += pinctrl-upboard.o
|
||||
obj-$(CONFIG_PINCTRL_ZYNQMP) += pinctrl-zynqmp.o
|
||||
obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o
|
||||
|
||||
|
|
|
|||
|
|
@ -106,6 +106,18 @@ config PINCTRL_BCM63268
|
|||
help
|
||||
Say Y here to enable the Broadcom BCM63268 GPIO driver.
|
||||
|
||||
config PINCTRL_BRCMSTB
|
||||
tristate "Broadcom STB product line pin controller driver"
|
||||
depends on OF && (ARCH_BCM2835 || ARCH_BRCMSTB || COMPILE_TEST)
|
||||
select PINMUX
|
||||
select PINCONF
|
||||
select GENERIC_PINCONF
|
||||
help
|
||||
Enable pin muxing and configuration functionality
|
||||
for Broadcom STB product line chipsets.
|
||||
|
||||
source "drivers/pinctrl/bcm/Kconfig.stb"
|
||||
|
||||
config PINCTRL_IPROC_GPIO
|
||||
bool "Broadcom iProc GPIO (with PINCONF) driver"
|
||||
depends on OF_GPIO && (ARCH_BCM_IPROC || COMPILE_TEST)
|
||||
|
|
|
|||
10
drivers/pinctrl/bcm/Kconfig.stb
Normal file
10
drivers/pinctrl/bcm/Kconfig.stb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
if PINCTRL_BRCMSTB
|
||||
|
||||
config PINCTRL_BCM2712
|
||||
tristate "BCM2712 SoC pin controller driver"
|
||||
help
|
||||
Driver for BCM2712 integrated pin controller,
|
||||
commonly found on Raspberry Pi 5.
|
||||
|
||||
endif
|
||||
|
|
@ -11,6 +11,8 @@ obj-$(CONFIG_PINCTRL_BCM6358) += pinctrl-bcm6358.o
|
|||
obj-$(CONFIG_PINCTRL_BCM6362) += pinctrl-bcm6362.o
|
||||
obj-$(CONFIG_PINCTRL_BCM6368) += pinctrl-bcm6368.o
|
||||
obj-$(CONFIG_PINCTRL_BCM63268) += pinctrl-bcm63268.o
|
||||
obj-$(CONFIG_PINCTRL_BRCMSTB) += pinctrl-brcmstb.o
|
||||
obj-$(CONFIG_PINCTRL_BCM2712) += pinctrl-brcmstb-bcm2712.o
|
||||
obj-$(CONFIG_PINCTRL_IPROC_GPIO) += pinctrl-iproc-gpio.o
|
||||
obj-$(CONFIG_PINCTRL_CYGNUS_MUX) += pinctrl-cygnus-mux.o
|
||||
obj-$(CONFIG_PINCTRL_NS) += pinctrl-ns.o
|
||||
|
|
|
|||
|
|
@ -1023,7 +1023,7 @@ static int bcm2835_pinconf_get(struct pinctrl_dev *pctldev,
|
|||
/* No way to read back bias config in HW */
|
||||
|
||||
switch (param) {
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
if (fsel != BCM2835_FSEL_GPIO_OUT)
|
||||
return -EINVAL;
|
||||
|
||||
|
|
@ -1091,7 +1091,7 @@ static int bcm2835_pinconf_set(struct pinctrl_dev *pctldev,
|
|||
break;
|
||||
|
||||
/* Set output-high or output-low */
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
bcm2835_gpio_set_bit(pc, arg ? GPSET0 : GPCLR0, pin);
|
||||
break;
|
||||
|
||||
|
|
@ -1202,7 +1202,7 @@ static int bcm2711_pinconf_set(struct pinctrl_dev *pctldev,
|
|||
break;
|
||||
|
||||
/* Set output-high or output-low */
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
bcm2835_gpio_set_bit(pc, arg ? GPSET0 : GPCLR0, pin);
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -343,10 +343,8 @@ static int bcm6358_pinctrl_probe(struct platform_device *pdev)
|
|||
pc = platform_get_drvdata(pdev);
|
||||
|
||||
priv->overlays = devm_regmap_field_alloc(dev, pc->regs, overlays);
|
||||
if (IS_ERR(priv->overlays))
|
||||
return PTR_ERR(priv->overlays);
|
||||
|
||||
return 0;
|
||||
return PTR_ERR_OR_ZERO(priv->overlays);
|
||||
}
|
||||
|
||||
static const struct of_device_id bcm6358_pinctrl_match[] = {
|
||||
|
|
|
|||
747
drivers/pinctrl/bcm/pinctrl-brcmstb-bcm2712.c
Normal file
747
drivers/pinctrl/bcm/pinctrl-brcmstb-bcm2712.c
Normal file
|
|
@ -0,0 +1,747 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Driver for Broadcom brcmstb GPIO units (pinctrl only)
|
||||
*
|
||||
* Copyright (C) 2024-2025 Ivan T. Ivanov, Andrea della Porta
|
||||
* Copyright (C) 2021-3 Raspberry Pi Ltd.
|
||||
* Copyright (C) 2012 Chris Boot, Simon Arlott, Stephen Warren
|
||||
*
|
||||
* Based heavily on the BCM2835 GPIO & pinctrl driver, which was inspired by:
|
||||
* pinctrl-nomadik.c, please see original file for copyright information
|
||||
* pinctrl-tegra.c, please see original file for copyright information
|
||||
*/
|
||||
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
#include <linux/of.h>
|
||||
#include "pinctrl-brcmstb.h"
|
||||
|
||||
#define BRCMSTB_FSEL_COUNT 8
|
||||
#define BRCMSTB_FSEL_MASK 0xf
|
||||
|
||||
#define BRCMSTB_PIN(i, f1, f2, f3, f4, f5, f6, f7, f8) \
|
||||
[i] = { \
|
||||
.funcs = (u8[]) { \
|
||||
func_##f1, \
|
||||
func_##f2, \
|
||||
func_##f3, \
|
||||
func_##f4, \
|
||||
func_##f5, \
|
||||
func_##f6, \
|
||||
func_##f7, \
|
||||
func_##f8, \
|
||||
}, \
|
||||
.n_funcs = BRCMSTB_FSEL_COUNT, \
|
||||
.func_mask = BRCMSTB_FSEL_MASK, \
|
||||
}
|
||||
|
||||
enum bcm2712_funcs {
|
||||
func_gpio,
|
||||
func_alt1,
|
||||
func_alt2,
|
||||
func_alt3,
|
||||
func_alt4,
|
||||
func_alt5,
|
||||
func_alt6,
|
||||
func_alt7,
|
||||
func_alt8,
|
||||
func_aon_cpu_standbyb,
|
||||
func_aon_fp_4sec_resetb,
|
||||
func_aon_gpclk,
|
||||
func_aon_pwm,
|
||||
func_arm_jtag,
|
||||
func_aud_fs_clk0,
|
||||
func_avs_pmu_bsc,
|
||||
func_bsc_m0,
|
||||
func_bsc_m1,
|
||||
func_bsc_m2,
|
||||
func_bsc_m3,
|
||||
func_clk_observe,
|
||||
func_ctl_hdmi_5v,
|
||||
func_enet0,
|
||||
func_enet0_mii,
|
||||
func_enet0_rgmii,
|
||||
func_ext_sc_clk,
|
||||
func_fl0,
|
||||
func_fl1,
|
||||
func_gpclk0,
|
||||
func_gpclk1,
|
||||
func_gpclk2,
|
||||
func_hdmi_tx0_auto_i2c,
|
||||
func_hdmi_tx0_bsc,
|
||||
func_hdmi_tx1_auto_i2c,
|
||||
func_hdmi_tx1_bsc,
|
||||
func_i2s_in,
|
||||
func_i2s_out,
|
||||
func_ir_in,
|
||||
func_mtsif,
|
||||
func_mtsif_alt,
|
||||
func_mtsif_alt1,
|
||||
func_pdm,
|
||||
func_pkt,
|
||||
func_pm_led_out,
|
||||
func_sc0,
|
||||
func_sd0,
|
||||
func_sd2,
|
||||
func_sd_card_a,
|
||||
func_sd_card_b,
|
||||
func_sd_card_c,
|
||||
func_sd_card_d,
|
||||
func_sd_card_e,
|
||||
func_sd_card_f,
|
||||
func_sd_card_g,
|
||||
func_spdif_out,
|
||||
func_spi_m,
|
||||
func_spi_s,
|
||||
func_sr_edm_sense,
|
||||
func_te0,
|
||||
func_te1,
|
||||
func_tsio,
|
||||
func_uart0,
|
||||
func_uart1,
|
||||
func_uart2,
|
||||
func_usb_pwr,
|
||||
func_usb_vbus,
|
||||
func_uui,
|
||||
func_vc_i2c0,
|
||||
func_vc_i2c3,
|
||||
func_vc_i2c4,
|
||||
func_vc_i2c5,
|
||||
func_vc_i2csl,
|
||||
func_vc_pcm,
|
||||
func_vc_pwm0,
|
||||
func_vc_pwm1,
|
||||
func_vc_spi0,
|
||||
func_vc_spi3,
|
||||
func_vc_spi4,
|
||||
func_vc_spi5,
|
||||
func_vc_uart0,
|
||||
func_vc_uart2,
|
||||
func_vc_uart3,
|
||||
func_vc_uart4,
|
||||
func__,
|
||||
func_count = func__
|
||||
};
|
||||
|
||||
static const struct pin_regs bcm2712_c0_gpio_pin_regs[] = {
|
||||
GPIO_REGS(0, 0, 0, 7, 7),
|
||||
GPIO_REGS(1, 0, 1, 7, 8),
|
||||
GPIO_REGS(2, 0, 2, 7, 9),
|
||||
GPIO_REGS(3, 0, 3, 7, 10),
|
||||
GPIO_REGS(4, 0, 4, 7, 11),
|
||||
GPIO_REGS(5, 0, 5, 7, 12),
|
||||
GPIO_REGS(6, 0, 6, 7, 13),
|
||||
GPIO_REGS(7, 0, 7, 7, 14),
|
||||
GPIO_REGS(8, 1, 0, 8, 0),
|
||||
GPIO_REGS(9, 1, 1, 8, 1),
|
||||
GPIO_REGS(10, 1, 2, 8, 2),
|
||||
GPIO_REGS(11, 1, 3, 8, 3),
|
||||
GPIO_REGS(12, 1, 4, 8, 4),
|
||||
GPIO_REGS(13, 1, 5, 8, 5),
|
||||
GPIO_REGS(14, 1, 6, 8, 6),
|
||||
GPIO_REGS(15, 1, 7, 8, 7),
|
||||
GPIO_REGS(16, 2, 0, 8, 8),
|
||||
GPIO_REGS(17, 2, 1, 8, 9),
|
||||
GPIO_REGS(18, 2, 2, 8, 10),
|
||||
GPIO_REGS(19, 2, 3, 8, 11),
|
||||
GPIO_REGS(20, 2, 4, 8, 12),
|
||||
GPIO_REGS(21, 2, 5, 8, 13),
|
||||
GPIO_REGS(22, 2, 6, 8, 14),
|
||||
GPIO_REGS(23, 2, 7, 9, 0),
|
||||
GPIO_REGS(24, 3, 0, 9, 1),
|
||||
GPIO_REGS(25, 3, 1, 9, 2),
|
||||
GPIO_REGS(26, 3, 2, 9, 3),
|
||||
GPIO_REGS(27, 3, 3, 9, 4),
|
||||
GPIO_REGS(28, 3, 4, 9, 5),
|
||||
GPIO_REGS(29, 3, 5, 9, 6),
|
||||
GPIO_REGS(30, 3, 6, 9, 7),
|
||||
GPIO_REGS(31, 3, 7, 9, 8),
|
||||
GPIO_REGS(32, 4, 0, 9, 9),
|
||||
GPIO_REGS(33, 4, 1, 9, 10),
|
||||
GPIO_REGS(34, 4, 2, 9, 11),
|
||||
GPIO_REGS(35, 4, 3, 9, 12),
|
||||
GPIO_REGS(36, 4, 4, 9, 13),
|
||||
GPIO_REGS(37, 4, 5, 9, 14),
|
||||
GPIO_REGS(38, 4, 6, 10, 0),
|
||||
GPIO_REGS(39, 4, 7, 10, 1),
|
||||
GPIO_REGS(40, 5, 0, 10, 2),
|
||||
GPIO_REGS(41, 5, 1, 10, 3),
|
||||
GPIO_REGS(42, 5, 2, 10, 4),
|
||||
GPIO_REGS(43, 5, 3, 10, 5),
|
||||
GPIO_REGS(44, 5, 4, 10, 6),
|
||||
GPIO_REGS(45, 5, 5, 10, 7),
|
||||
GPIO_REGS(46, 5, 6, 10, 8),
|
||||
GPIO_REGS(47, 5, 7, 10, 9),
|
||||
GPIO_REGS(48, 6, 0, 10, 10),
|
||||
GPIO_REGS(49, 6, 1, 10, 11),
|
||||
GPIO_REGS(50, 6, 2, 10, 12),
|
||||
GPIO_REGS(51, 6, 3, 10, 13),
|
||||
GPIO_REGS(52, 6, 4, 10, 14),
|
||||
GPIO_REGS(53, 6, 5, 11, 0),
|
||||
EMMC_REGS(54, 11, 1), /* EMMC_CMD */
|
||||
EMMC_REGS(55, 11, 2), /* EMMC_DS */
|
||||
EMMC_REGS(56, 11, 3), /* EMMC_CLK */
|
||||
EMMC_REGS(57, 11, 4), /* EMMC_DAT0 */
|
||||
EMMC_REGS(58, 11, 5), /* EMMC_DAT1 */
|
||||
EMMC_REGS(59, 11, 6), /* EMMC_DAT2 */
|
||||
EMMC_REGS(60, 11, 7), /* EMMC_DAT3 */
|
||||
EMMC_REGS(61, 11, 8), /* EMMC_DAT4 */
|
||||
EMMC_REGS(62, 11, 9), /* EMMC_DAT5 */
|
||||
EMMC_REGS(63, 11, 10), /* EMMC_DAT6 */
|
||||
EMMC_REGS(64, 11, 11), /* EMMC_DAT7 */
|
||||
};
|
||||
|
||||
static struct pin_regs bcm2712_c0_aon_gpio_pin_regs[] = {
|
||||
AON_GPIO_REGS(0, 3, 0, 6, 10),
|
||||
AON_GPIO_REGS(1, 3, 1, 6, 11),
|
||||
AON_GPIO_REGS(2, 3, 2, 6, 12),
|
||||
AON_GPIO_REGS(3, 3, 3, 6, 13),
|
||||
AON_GPIO_REGS(4, 3, 4, 6, 14),
|
||||
AON_GPIO_REGS(5, 3, 5, 7, 0),
|
||||
AON_GPIO_REGS(6, 3, 6, 7, 1),
|
||||
AON_GPIO_REGS(7, 3, 7, 7, 2),
|
||||
AON_GPIO_REGS(8, 4, 0, 7, 3),
|
||||
AON_GPIO_REGS(9, 4, 1, 7, 4),
|
||||
AON_GPIO_REGS(10, 4, 2, 7, 5),
|
||||
AON_GPIO_REGS(11, 4, 3, 7, 6),
|
||||
AON_GPIO_REGS(12, 4, 4, 7, 7),
|
||||
AON_GPIO_REGS(13, 4, 5, 7, 8),
|
||||
AON_GPIO_REGS(14, 4, 6, 7, 9),
|
||||
AON_GPIO_REGS(15, 4, 7, 7, 10),
|
||||
AON_GPIO_REGS(16, 5, 0, 7, 11),
|
||||
AON_SGPIO_REGS(0, 0, 0),
|
||||
AON_SGPIO_REGS(1, 0, 1),
|
||||
AON_SGPIO_REGS(2, 0, 2),
|
||||
AON_SGPIO_REGS(3, 0, 3),
|
||||
AON_SGPIO_REGS(4, 1, 0),
|
||||
AON_SGPIO_REGS(5, 2, 0),
|
||||
};
|
||||
|
||||
static const struct pinctrl_pin_desc bcm2712_c0_gpio_pins[] = {
|
||||
GPIO_PIN(0),
|
||||
GPIO_PIN(1),
|
||||
GPIO_PIN(2),
|
||||
GPIO_PIN(3),
|
||||
GPIO_PIN(4),
|
||||
GPIO_PIN(5),
|
||||
GPIO_PIN(6),
|
||||
GPIO_PIN(7),
|
||||
GPIO_PIN(8),
|
||||
GPIO_PIN(9),
|
||||
GPIO_PIN(10),
|
||||
GPIO_PIN(11),
|
||||
GPIO_PIN(12),
|
||||
GPIO_PIN(13),
|
||||
GPIO_PIN(14),
|
||||
GPIO_PIN(15),
|
||||
GPIO_PIN(16),
|
||||
GPIO_PIN(17),
|
||||
GPIO_PIN(18),
|
||||
GPIO_PIN(19),
|
||||
GPIO_PIN(20),
|
||||
GPIO_PIN(21),
|
||||
GPIO_PIN(22),
|
||||
GPIO_PIN(23),
|
||||
GPIO_PIN(24),
|
||||
GPIO_PIN(25),
|
||||
GPIO_PIN(26),
|
||||
GPIO_PIN(27),
|
||||
GPIO_PIN(28),
|
||||
GPIO_PIN(29),
|
||||
GPIO_PIN(30),
|
||||
GPIO_PIN(31),
|
||||
GPIO_PIN(32),
|
||||
GPIO_PIN(33),
|
||||
GPIO_PIN(34),
|
||||
GPIO_PIN(35),
|
||||
GPIO_PIN(36),
|
||||
GPIO_PIN(37),
|
||||
GPIO_PIN(38),
|
||||
GPIO_PIN(39),
|
||||
GPIO_PIN(40),
|
||||
GPIO_PIN(41),
|
||||
GPIO_PIN(42),
|
||||
GPIO_PIN(43),
|
||||
GPIO_PIN(44),
|
||||
GPIO_PIN(45),
|
||||
GPIO_PIN(46),
|
||||
GPIO_PIN(47),
|
||||
GPIO_PIN(48),
|
||||
GPIO_PIN(49),
|
||||
GPIO_PIN(50),
|
||||
GPIO_PIN(51),
|
||||
GPIO_PIN(52),
|
||||
GPIO_PIN(53),
|
||||
PINCTRL_PIN(54, "emmc_cmd"),
|
||||
PINCTRL_PIN(55, "emmc_ds"),
|
||||
PINCTRL_PIN(56, "emmc_clk"),
|
||||
PINCTRL_PIN(57, "emmc_dat0"),
|
||||
PINCTRL_PIN(58, "emmc_dat1"),
|
||||
PINCTRL_PIN(59, "emmc_dat2"),
|
||||
PINCTRL_PIN(60, "emmc_dat3"),
|
||||
PINCTRL_PIN(61, "emmc_dat4"),
|
||||
PINCTRL_PIN(62, "emmc_dat5"),
|
||||
PINCTRL_PIN(63, "emmc_dat6"),
|
||||
PINCTRL_PIN(64, "emmc_dat7"),
|
||||
};
|
||||
|
||||
static struct pinctrl_pin_desc bcm2712_c0_aon_gpio_pins[] = {
|
||||
AON_GPIO_PIN(0), AON_GPIO_PIN(1), AON_GPIO_PIN(2), AON_GPIO_PIN(3),
|
||||
AON_GPIO_PIN(4), AON_GPIO_PIN(5), AON_GPIO_PIN(6), AON_GPIO_PIN(7),
|
||||
AON_GPIO_PIN(8), AON_GPIO_PIN(9), AON_GPIO_PIN(10), AON_GPIO_PIN(11),
|
||||
AON_GPIO_PIN(12), AON_GPIO_PIN(13), AON_GPIO_PIN(14), AON_GPIO_PIN(15),
|
||||
AON_GPIO_PIN(16), AON_SGPIO_PIN(0), AON_SGPIO_PIN(1), AON_SGPIO_PIN(2),
|
||||
AON_SGPIO_PIN(3), AON_SGPIO_PIN(4), AON_SGPIO_PIN(5),
|
||||
};
|
||||
|
||||
static const struct pin_regs bcm2712_d0_gpio_pin_regs[] = {
|
||||
GPIO_REGS(1, 0, 0, 4, 5),
|
||||
GPIO_REGS(2, 0, 1, 4, 6),
|
||||
GPIO_REGS(3, 0, 2, 4, 7),
|
||||
GPIO_REGS(4, 0, 3, 4, 8),
|
||||
GPIO_REGS(10, 0, 4, 4, 9),
|
||||
GPIO_REGS(11, 0, 5, 4, 10),
|
||||
GPIO_REGS(12, 0, 6, 4, 11),
|
||||
GPIO_REGS(13, 0, 7, 4, 12),
|
||||
GPIO_REGS(14, 1, 0, 4, 13),
|
||||
GPIO_REGS(15, 1, 1, 4, 14),
|
||||
GPIO_REGS(18, 1, 2, 5, 0),
|
||||
GPIO_REGS(19, 1, 3, 5, 1),
|
||||
GPIO_REGS(20, 1, 4, 5, 2),
|
||||
GPIO_REGS(21, 1, 5, 5, 3),
|
||||
GPIO_REGS(22, 1, 6, 5, 4),
|
||||
GPIO_REGS(23, 1, 7, 5, 5),
|
||||
GPIO_REGS(24, 2, 0, 5, 6),
|
||||
GPIO_REGS(25, 2, 1, 5, 7),
|
||||
GPIO_REGS(26, 2, 2, 5, 8),
|
||||
GPIO_REGS(27, 2, 3, 5, 9),
|
||||
GPIO_REGS(28, 2, 4, 5, 10),
|
||||
GPIO_REGS(29, 2, 5, 5, 11),
|
||||
GPIO_REGS(30, 2, 6, 5, 12),
|
||||
GPIO_REGS(31, 2, 7, 5, 13),
|
||||
GPIO_REGS(32, 3, 0, 5, 14),
|
||||
GPIO_REGS(33, 3, 1, 6, 0),
|
||||
GPIO_REGS(34, 3, 2, 6, 1),
|
||||
GPIO_REGS(35, 3, 3, 6, 2),
|
||||
EMMC_REGS(36, 6, 3), /* EMMC_CMD */
|
||||
EMMC_REGS(37, 6, 4), /* EMMC_DS */
|
||||
EMMC_REGS(38, 6, 5), /* EMMC_CLK */
|
||||
EMMC_REGS(39, 6, 6), /* EMMC_DAT0 */
|
||||
EMMC_REGS(40, 6, 7), /* EMMC_DAT1 */
|
||||
EMMC_REGS(41, 6, 8), /* EMMC_DAT2 */
|
||||
EMMC_REGS(42, 6, 9), /* EMMC_DAT3 */
|
||||
EMMC_REGS(43, 6, 10), /* EMMC_DAT4 */
|
||||
EMMC_REGS(44, 6, 11), /* EMMC_DAT5 */
|
||||
EMMC_REGS(45, 6, 12), /* EMMC_DAT6 */
|
||||
EMMC_REGS(46, 6, 13), /* EMMC_DAT7 */
|
||||
};
|
||||
|
||||
static struct pin_regs bcm2712_d0_aon_gpio_pin_regs[] = {
|
||||
AON_GPIO_REGS(0, 3, 0, 5, 9),
|
||||
AON_GPIO_REGS(1, 3, 1, 5, 10),
|
||||
AON_GPIO_REGS(2, 3, 2, 5, 11),
|
||||
AON_GPIO_REGS(3, 3, 3, 5, 12),
|
||||
AON_GPIO_REGS(4, 3, 4, 5, 13),
|
||||
AON_GPIO_REGS(5, 3, 5, 5, 14),
|
||||
AON_GPIO_REGS(6, 3, 6, 6, 0),
|
||||
AON_GPIO_REGS(8, 3, 7, 6, 1),
|
||||
AON_GPIO_REGS(9, 4, 0, 6, 2),
|
||||
AON_GPIO_REGS(12, 4, 1, 6, 3),
|
||||
AON_GPIO_REGS(13, 4, 2, 6, 4),
|
||||
AON_GPIO_REGS(14, 4, 3, 6, 5),
|
||||
AON_SGPIO_REGS(0, 0, 0),
|
||||
AON_SGPIO_REGS(1, 0, 1),
|
||||
AON_SGPIO_REGS(2, 0, 2),
|
||||
AON_SGPIO_REGS(3, 0, 3),
|
||||
AON_SGPIO_REGS(4, 1, 0),
|
||||
AON_SGPIO_REGS(5, 2, 0),
|
||||
};
|
||||
|
||||
static const struct pinctrl_pin_desc bcm2712_d0_gpio_pins[] = {
|
||||
GPIO_PIN(1),
|
||||
GPIO_PIN(2),
|
||||
GPIO_PIN(3),
|
||||
GPIO_PIN(4),
|
||||
GPIO_PIN(10),
|
||||
GPIO_PIN(11),
|
||||
GPIO_PIN(12),
|
||||
GPIO_PIN(13),
|
||||
GPIO_PIN(14),
|
||||
GPIO_PIN(15),
|
||||
GPIO_PIN(18),
|
||||
GPIO_PIN(19),
|
||||
GPIO_PIN(20),
|
||||
GPIO_PIN(21),
|
||||
GPIO_PIN(22),
|
||||
GPIO_PIN(23),
|
||||
GPIO_PIN(24),
|
||||
GPIO_PIN(25),
|
||||
GPIO_PIN(26),
|
||||
GPIO_PIN(27),
|
||||
GPIO_PIN(28),
|
||||
GPIO_PIN(29),
|
||||
GPIO_PIN(30),
|
||||
GPIO_PIN(31),
|
||||
GPIO_PIN(32),
|
||||
GPIO_PIN(33),
|
||||
GPIO_PIN(34),
|
||||
GPIO_PIN(35),
|
||||
PINCTRL_PIN(36, "emmc_cmd"),
|
||||
PINCTRL_PIN(37, "emmc_ds"),
|
||||
PINCTRL_PIN(38, "emmc_clk"),
|
||||
PINCTRL_PIN(39, "emmc_dat0"),
|
||||
PINCTRL_PIN(40, "emmc_dat1"),
|
||||
PINCTRL_PIN(41, "emmc_dat2"),
|
||||
PINCTRL_PIN(42, "emmc_dat3"),
|
||||
PINCTRL_PIN(43, "emmc_dat4"),
|
||||
PINCTRL_PIN(44, "emmc_dat5"),
|
||||
PINCTRL_PIN(45, "emmc_dat6"),
|
||||
PINCTRL_PIN(46, "emmc_dat7"),
|
||||
};
|
||||
|
||||
static struct pinctrl_pin_desc bcm2712_d0_aon_gpio_pins[] = {
|
||||
AON_GPIO_PIN(0), AON_GPIO_PIN(1), AON_GPIO_PIN(2), AON_GPIO_PIN(3),
|
||||
AON_GPIO_PIN(4), AON_GPIO_PIN(5), AON_GPIO_PIN(6), AON_GPIO_PIN(8),
|
||||
AON_GPIO_PIN(9), AON_GPIO_PIN(12), AON_GPIO_PIN(13), AON_GPIO_PIN(14),
|
||||
AON_SGPIO_PIN(0), AON_SGPIO_PIN(1), AON_SGPIO_PIN(2),
|
||||
AON_SGPIO_PIN(3), AON_SGPIO_PIN(4), AON_SGPIO_PIN(5),
|
||||
};
|
||||
|
||||
static const char * const bcm2712_func_names[] = {
|
||||
BRCMSTB_FUNC(gpio),
|
||||
BRCMSTB_FUNC(alt1),
|
||||
BRCMSTB_FUNC(alt2),
|
||||
BRCMSTB_FUNC(alt3),
|
||||
BRCMSTB_FUNC(alt4),
|
||||
BRCMSTB_FUNC(alt5),
|
||||
BRCMSTB_FUNC(alt6),
|
||||
BRCMSTB_FUNC(alt7),
|
||||
BRCMSTB_FUNC(alt8),
|
||||
BRCMSTB_FUNC(aon_cpu_standbyb),
|
||||
BRCMSTB_FUNC(aon_fp_4sec_resetb),
|
||||
BRCMSTB_FUNC(aon_gpclk),
|
||||
BRCMSTB_FUNC(aon_pwm),
|
||||
BRCMSTB_FUNC(arm_jtag),
|
||||
BRCMSTB_FUNC(aud_fs_clk0),
|
||||
BRCMSTB_FUNC(avs_pmu_bsc),
|
||||
BRCMSTB_FUNC(bsc_m0),
|
||||
BRCMSTB_FUNC(bsc_m1),
|
||||
BRCMSTB_FUNC(bsc_m2),
|
||||
BRCMSTB_FUNC(bsc_m3),
|
||||
BRCMSTB_FUNC(clk_observe),
|
||||
BRCMSTB_FUNC(ctl_hdmi_5v),
|
||||
BRCMSTB_FUNC(enet0),
|
||||
BRCMSTB_FUNC(enet0_mii),
|
||||
BRCMSTB_FUNC(enet0_rgmii),
|
||||
BRCMSTB_FUNC(ext_sc_clk),
|
||||
BRCMSTB_FUNC(fl0),
|
||||
BRCMSTB_FUNC(fl1),
|
||||
BRCMSTB_FUNC(gpclk0),
|
||||
BRCMSTB_FUNC(gpclk1),
|
||||
BRCMSTB_FUNC(gpclk2),
|
||||
BRCMSTB_FUNC(hdmi_tx0_auto_i2c),
|
||||
BRCMSTB_FUNC(hdmi_tx0_bsc),
|
||||
BRCMSTB_FUNC(hdmi_tx1_auto_i2c),
|
||||
BRCMSTB_FUNC(hdmi_tx1_bsc),
|
||||
BRCMSTB_FUNC(i2s_in),
|
||||
BRCMSTB_FUNC(i2s_out),
|
||||
BRCMSTB_FUNC(ir_in),
|
||||
BRCMSTB_FUNC(mtsif),
|
||||
BRCMSTB_FUNC(mtsif_alt),
|
||||
BRCMSTB_FUNC(mtsif_alt1),
|
||||
BRCMSTB_FUNC(pdm),
|
||||
BRCMSTB_FUNC(pkt),
|
||||
BRCMSTB_FUNC(pm_led_out),
|
||||
BRCMSTB_FUNC(sc0),
|
||||
BRCMSTB_FUNC(sd0),
|
||||
BRCMSTB_FUNC(sd2),
|
||||
BRCMSTB_FUNC(sd_card_a),
|
||||
BRCMSTB_FUNC(sd_card_b),
|
||||
BRCMSTB_FUNC(sd_card_c),
|
||||
BRCMSTB_FUNC(sd_card_d),
|
||||
BRCMSTB_FUNC(sd_card_e),
|
||||
BRCMSTB_FUNC(sd_card_f),
|
||||
BRCMSTB_FUNC(sd_card_g),
|
||||
BRCMSTB_FUNC(spdif_out),
|
||||
BRCMSTB_FUNC(spi_m),
|
||||
BRCMSTB_FUNC(spi_s),
|
||||
BRCMSTB_FUNC(sr_edm_sense),
|
||||
BRCMSTB_FUNC(te0),
|
||||
BRCMSTB_FUNC(te1),
|
||||
BRCMSTB_FUNC(tsio),
|
||||
BRCMSTB_FUNC(uart0),
|
||||
BRCMSTB_FUNC(uart1),
|
||||
BRCMSTB_FUNC(uart2),
|
||||
BRCMSTB_FUNC(usb_pwr),
|
||||
BRCMSTB_FUNC(usb_vbus),
|
||||
BRCMSTB_FUNC(uui),
|
||||
BRCMSTB_FUNC(vc_i2c0),
|
||||
BRCMSTB_FUNC(vc_i2c3),
|
||||
BRCMSTB_FUNC(vc_i2c4),
|
||||
BRCMSTB_FUNC(vc_i2c5),
|
||||
BRCMSTB_FUNC(vc_i2csl),
|
||||
BRCMSTB_FUNC(vc_pcm),
|
||||
BRCMSTB_FUNC(vc_pwm0),
|
||||
BRCMSTB_FUNC(vc_pwm1),
|
||||
BRCMSTB_FUNC(vc_spi0),
|
||||
BRCMSTB_FUNC(vc_spi3),
|
||||
BRCMSTB_FUNC(vc_spi4),
|
||||
BRCMSTB_FUNC(vc_spi5),
|
||||
BRCMSTB_FUNC(vc_uart0),
|
||||
BRCMSTB_FUNC(vc_uart2),
|
||||
BRCMSTB_FUNC(vc_uart3),
|
||||
BRCMSTB_FUNC(vc_uart4),
|
||||
};
|
||||
|
||||
static const struct brcmstb_pin_funcs bcm2712_c0_aon_gpio_pin_funcs[] = {
|
||||
BRCMSTB_PIN(0, ir_in, vc_spi0, vc_uart3, vc_i2c3, te0, vc_i2c0, _, _),
|
||||
BRCMSTB_PIN(1, vc_pwm0, vc_spi0, vc_uart3, vc_i2c3, te1, aon_pwm, vc_i2c0, vc_pwm1),
|
||||
BRCMSTB_PIN(2, vc_pwm0, vc_spi0, vc_uart3, ctl_hdmi_5v, fl0, aon_pwm, ir_in, vc_pwm1),
|
||||
BRCMSTB_PIN(3, ir_in, vc_spi0, vc_uart3, aon_fp_4sec_resetb, fl1, sd_card_g, aon_gpclk, _),
|
||||
BRCMSTB_PIN(4, gpclk0, vc_spi0, vc_i2csl, aon_gpclk, pm_led_out, aon_pwm, sd_card_g, vc_pwm0),
|
||||
BRCMSTB_PIN(5, gpclk1, ir_in, vc_i2csl, clk_observe, aon_pwm, sd_card_g, vc_pwm0, _),
|
||||
BRCMSTB_PIN(6, uart1, vc_uart4, gpclk2, ctl_hdmi_5v, vc_uart0, vc_spi3, _, _),
|
||||
BRCMSTB_PIN(7, uart1, vc_uart4, gpclk0, aon_pwm, vc_uart0, vc_spi3, _, _),
|
||||
BRCMSTB_PIN(8, uart1, vc_uart4, vc_i2csl, ctl_hdmi_5v, vc_uart0, vc_spi3, _, _),
|
||||
BRCMSTB_PIN(9, uart1, vc_uart4, vc_i2csl, aon_pwm, vc_uart0, vc_spi3, _, _),
|
||||
BRCMSTB_PIN(10, tsio, ctl_hdmi_5v, sc0, spdif_out, vc_spi5, usb_pwr, aon_gpclk, sd_card_f),
|
||||
BRCMSTB_PIN(11, tsio, uart0, sc0, aud_fs_clk0, vc_spi5, usb_vbus, vc_uart2, sd_card_f),
|
||||
BRCMSTB_PIN(12, tsio, uart0, vc_uart0, tsio, vc_spi5, usb_pwr, vc_uart2, sd_card_f),
|
||||
BRCMSTB_PIN(13, bsc_m1, uart0, vc_uart0, uui, vc_spi5, arm_jtag, vc_uart2, vc_i2c3),
|
||||
BRCMSTB_PIN(14, bsc_m1, uart0, vc_uart0, uui, vc_spi5, arm_jtag, vc_uart2, vc_i2c3),
|
||||
BRCMSTB_PIN(15, ir_in, aon_fp_4sec_resetb, vc_uart0, pm_led_out, ctl_hdmi_5v, aon_pwm, aon_gpclk, _),
|
||||
BRCMSTB_PIN(16, aon_cpu_standbyb, gpclk0, pm_led_out, ctl_hdmi_5v, vc_pwm0, usb_pwr, aud_fs_clk0, _),
|
||||
};
|
||||
|
||||
static const struct brcmstb_pin_funcs bcm2712_c0_gpio_pin_funcs[] = {
|
||||
BRCMSTB_PIN(0, bsc_m3, vc_i2c0, gpclk0, enet0, vc_pwm1, vc_spi0, ir_in, _),
|
||||
BRCMSTB_PIN(1, bsc_m3, vc_i2c0, gpclk1, enet0, vc_pwm1, sr_edm_sense, vc_spi0, vc_uart3),
|
||||
BRCMSTB_PIN(2, pdm, i2s_in, gpclk2, vc_spi4, pkt, vc_spi0, vc_uart3, _),
|
||||
BRCMSTB_PIN(3, pdm, i2s_in, vc_spi4, pkt, vc_spi0, vc_uart3, _, _),
|
||||
BRCMSTB_PIN(4, pdm, i2s_in, arm_jtag, vc_spi4, pkt, vc_spi0, vc_uart3, _),
|
||||
BRCMSTB_PIN(5, pdm, vc_i2c3, arm_jtag, sd_card_e, vc_spi4, pkt, vc_pcm, vc_i2c5),
|
||||
BRCMSTB_PIN(6, pdm, vc_i2c3, arm_jtag, sd_card_e, vc_spi4, pkt, vc_pcm, vc_i2c5),
|
||||
BRCMSTB_PIN(7, i2s_out, spdif_out, arm_jtag, sd_card_e, vc_i2c3, enet0_rgmii, vc_pcm, vc_spi4),
|
||||
BRCMSTB_PIN(8, i2s_out, aud_fs_clk0, arm_jtag, sd_card_e, vc_i2c3, enet0_mii, vc_pcm, vc_spi4),
|
||||
BRCMSTB_PIN(9, i2s_out, aud_fs_clk0, arm_jtag, sd_card_e, enet0_mii, sd_card_c, vc_spi4, _),
|
||||
BRCMSTB_PIN(10, bsc_m3, mtsif_alt1, i2s_in, i2s_out, vc_spi5, enet0_mii, sd_card_c, vc_spi4),
|
||||
BRCMSTB_PIN(11, bsc_m3, mtsif_alt1, i2s_in, i2s_out, vc_spi5, enet0_mii, sd_card_c, vc_spi4),
|
||||
BRCMSTB_PIN(12, spi_s, mtsif_alt1, i2s_in, i2s_out, vc_spi5, vc_i2csl, sd0, sd_card_d),
|
||||
BRCMSTB_PIN(13, spi_s, mtsif_alt1, i2s_out, usb_vbus, vc_spi5, vc_i2csl, sd0, sd_card_d),
|
||||
BRCMSTB_PIN(14, spi_s, vc_i2csl, enet0_rgmii, arm_jtag, vc_spi5, vc_pwm0, vc_i2c4, sd_card_d),
|
||||
BRCMSTB_PIN(15, spi_s, vc_i2csl, vc_spi3, arm_jtag, vc_pwm0, vc_i2c4, gpclk0, _),
|
||||
BRCMSTB_PIN(16, sd_card_b, i2s_out, vc_spi3, i2s_in, sd0, enet0_rgmii, gpclk1, _),
|
||||
BRCMSTB_PIN(17, sd_card_b, i2s_out, vc_spi3, i2s_in, ext_sc_clk, sd0, enet0_rgmii, gpclk2),
|
||||
BRCMSTB_PIN(18, sd_card_b, i2s_out, vc_spi3, i2s_in, sd0, enet0_rgmii, vc_pwm1, _),
|
||||
BRCMSTB_PIN(19, sd_card_b, usb_pwr, vc_spi3, pkt, spdif_out, sd0, ir_in, vc_pwm1),
|
||||
BRCMSTB_PIN(20, sd_card_b, uui, vc_uart0, arm_jtag, uart2, usb_pwr, vc_pcm, vc_uart4),
|
||||
BRCMSTB_PIN(21, usb_pwr, uui, vc_uart0, arm_jtag, uart2, sd_card_b, vc_pcm, vc_uart4),
|
||||
BRCMSTB_PIN(22, usb_pwr, enet0, vc_uart0, mtsif, uart2, usb_vbus, vc_pcm, vc_i2c5),
|
||||
BRCMSTB_PIN(23, usb_vbus, enet0, vc_uart0, mtsif, uart2, i2s_out, vc_pcm, vc_i2c5),
|
||||
BRCMSTB_PIN(24, mtsif, pkt, uart0, enet0_rgmii, enet0_rgmii, vc_i2c4, vc_uart3, _),
|
||||
BRCMSTB_PIN(25, mtsif, pkt, sc0, uart0, enet0_rgmii, enet0_rgmii, vc_i2c4, vc_uart3),
|
||||
BRCMSTB_PIN(26, mtsif, pkt, sc0, uart0, enet0_rgmii, vc_uart4, vc_spi5, _),
|
||||
BRCMSTB_PIN(27, mtsif, pkt, sc0, uart0, enet0_rgmii, vc_uart4, vc_spi5, _),
|
||||
BRCMSTB_PIN(28, mtsif, pkt, sc0, enet0_rgmii, vc_uart4, vc_spi5, _, _),
|
||||
BRCMSTB_PIN(29, mtsif, pkt, sc0, enet0_rgmii, vc_uart4, vc_spi5, _, _),
|
||||
BRCMSTB_PIN(30, mtsif, pkt, sc0, sd2, enet0_rgmii, gpclk0, vc_pwm0, _),
|
||||
BRCMSTB_PIN(31, mtsif, pkt, sc0, sd2, enet0_rgmii, vc_spi3, vc_pwm0, _),
|
||||
BRCMSTB_PIN(32, mtsif, pkt, sc0, sd2, enet0_rgmii, vc_spi3, vc_uart3, _),
|
||||
BRCMSTB_PIN(33, mtsif, pkt, sd2, enet0_rgmii, vc_spi3, vc_uart3, _, _),
|
||||
BRCMSTB_PIN(34, mtsif, pkt, ext_sc_clk, sd2, enet0_rgmii, vc_spi3, vc_i2c5, _),
|
||||
BRCMSTB_PIN(35, mtsif, pkt, sd2, enet0_rgmii, vc_spi3, vc_i2c5, _, _),
|
||||
BRCMSTB_PIN(36, sd0, mtsif, sc0, i2s_in, vc_uart3, vc_uart2, _, _),
|
||||
BRCMSTB_PIN(37, sd0, mtsif, sc0, vc_spi0, i2s_in, vc_uart3, vc_uart2, _),
|
||||
BRCMSTB_PIN(38, sd0, mtsif_alt, sc0, vc_spi0, i2s_in, vc_uart3, vc_uart2, _),
|
||||
BRCMSTB_PIN(39, sd0, mtsif_alt, sc0, vc_spi0, vc_uart3, vc_uart2, _, _),
|
||||
BRCMSTB_PIN(40, sd0, mtsif_alt, sc0, vc_spi0, bsc_m3, _, _, _),
|
||||
BRCMSTB_PIN(41, sd0, mtsif_alt, sc0, vc_spi0, bsc_m3, _, _, _),
|
||||
BRCMSTB_PIN(42, vc_spi0, mtsif_alt, vc_i2c0, sd_card_a, mtsif_alt1, arm_jtag, pdm, spi_m),
|
||||
BRCMSTB_PIN(43, vc_spi0, mtsif_alt, vc_i2c0, sd_card_a, mtsif_alt1, arm_jtag, pdm, spi_m),
|
||||
BRCMSTB_PIN(44, vc_spi0, mtsif_alt, enet0, sd_card_a, mtsif_alt1, arm_jtag, pdm, spi_m),
|
||||
BRCMSTB_PIN(45, vc_spi0, mtsif_alt, enet0, sd_card_a, mtsif_alt1, arm_jtag, pdm, spi_m),
|
||||
BRCMSTB_PIN(46, vc_spi0, mtsif_alt, sd_card_a, mtsif_alt1, arm_jtag, pdm, spi_m, _),
|
||||
BRCMSTB_PIN(47, enet0, mtsif_alt, i2s_out, mtsif_alt1, arm_jtag, _, _, _),
|
||||
BRCMSTB_PIN(48, sc0, usb_pwr, spdif_out, mtsif, _, _, _, _),
|
||||
BRCMSTB_PIN(49, sc0, usb_pwr, aud_fs_clk0, mtsif, _, _, _, _),
|
||||
BRCMSTB_PIN(50, sc0, usb_vbus, sc0, _, _, _, _, _),
|
||||
BRCMSTB_PIN(51, sc0, enet0, sc0, sr_edm_sense, _, _, _, _),
|
||||
BRCMSTB_PIN(52, sc0, enet0, vc_pwm1, _, _, _, _, _),
|
||||
BRCMSTB_PIN(53, sc0, enet0_rgmii, ext_sc_clk, _, _, _, _, _),
|
||||
};
|
||||
|
||||
static const struct brcmstb_pin_funcs bcm2712_d0_aon_gpio_pin_funcs[] = {
|
||||
BRCMSTB_PIN(0, ir_in, vc_spi0, vc_uart0, vc_i2c3, uart0, vc_i2c0, _, _),
|
||||
BRCMSTB_PIN(1, vc_pwm0, vc_spi0, vc_uart0, vc_i2c3, uart0, aon_pwm, vc_i2c0, vc_pwm1),
|
||||
BRCMSTB_PIN(2, vc_pwm0, vc_spi0, vc_uart0, ctl_hdmi_5v, uart0, aon_pwm, ir_in, vc_pwm1),
|
||||
BRCMSTB_PIN(3, ir_in, vc_spi0, vc_uart0, uart0, sd_card_g, aon_gpclk, _, _),
|
||||
BRCMSTB_PIN(4, gpclk0, vc_spi0, pm_led_out, aon_pwm, sd_card_g, vc_pwm0, _, _),
|
||||
BRCMSTB_PIN(5, gpclk1, ir_in, aon_pwm, sd_card_g, vc_pwm0, _, _, _),
|
||||
BRCMSTB_PIN(6, uart1, vc_uart2, ctl_hdmi_5v, gpclk2, vc_spi3, _, _, _),
|
||||
BRCMSTB_PIN(7, _, _, _, _, _, _, _, _), /* non-existent on D0 silicon */
|
||||
BRCMSTB_PIN(8, uart1, vc_uart2, ctl_hdmi_5v, vc_spi0, vc_spi3, _, _, _),
|
||||
BRCMSTB_PIN(9, uart1, vc_uart2, vc_uart0, aon_pwm, vc_spi0, vc_uart2, vc_spi3, _),
|
||||
BRCMSTB_PIN(10, _, _, _, _, _, _, _, _), /* non-existent on D0 silicon */
|
||||
BRCMSTB_PIN(11, _, _, _, _, _, _, _, _), /* non-existent on D0 silicon */
|
||||
BRCMSTB_PIN(12, uart1, vc_uart2, vc_uart0, vc_spi0, usb_pwr, vc_uart2, vc_spi3, _),
|
||||
BRCMSTB_PIN(13, bsc_m1, vc_uart0, uui, vc_spi0, arm_jtag, vc_uart2, vc_i2c3, _),
|
||||
BRCMSTB_PIN(14, bsc_m1, aon_gpclk, vc_uart0, uui, vc_spi0, arm_jtag, vc_uart2, vc_i2c3),
|
||||
};
|
||||
|
||||
static const struct brcmstb_pin_funcs bcm2712_d0_gpio_pin_funcs[] = {
|
||||
BRCMSTB_PIN(1, vc_i2c0, usb_pwr, gpclk0, sd_card_e, vc_spi3, sr_edm_sense, vc_spi0, vc_uart0),
|
||||
BRCMSTB_PIN(2, vc_i2c0, usb_pwr, gpclk1, sd_card_e, vc_spi3, clk_observe, vc_spi0, vc_uart0),
|
||||
BRCMSTB_PIN(3, vc_i2c3, usb_vbus, gpclk2, sd_card_e, vc_spi3, vc_spi0, vc_uart0, _),
|
||||
BRCMSTB_PIN(4, vc_i2c3, vc_pwm1, vc_spi3, sd_card_e, vc_spi3, vc_spi0, vc_uart0, _),
|
||||
BRCMSTB_PIN(10, bsc_m3, vc_pwm1, vc_spi3, sd_card_e, vc_spi3, gpclk0, _, _),
|
||||
BRCMSTB_PIN(11, bsc_m3, vc_spi3, clk_observe, sd_card_c, gpclk1, _, _, _),
|
||||
BRCMSTB_PIN(12, spi_s, vc_spi3, sd_card_c, sd_card_d, _, _, _, _),
|
||||
BRCMSTB_PIN(13, spi_s, vc_spi3, sd_card_c, sd_card_d, _, _, _, _),
|
||||
BRCMSTB_PIN(14, spi_s, uui, arm_jtag, vc_pwm0, vc_i2c0, sd_card_d, _, _),
|
||||
BRCMSTB_PIN(15, spi_s, uui, arm_jtag, vc_pwm0, vc_i2c0, gpclk0, _, _),
|
||||
BRCMSTB_PIN(18, sd_card_f, vc_pwm1, _, _, _, _, _, _),
|
||||
BRCMSTB_PIN(19, sd_card_f, usb_pwr, vc_pwm1, _, _, _, _, _),
|
||||
BRCMSTB_PIN(20, vc_i2c3, uui, vc_uart0, arm_jtag, vc_uart2, _, _, _),
|
||||
BRCMSTB_PIN(21, vc_i2c3, uui, vc_uart0, arm_jtag, vc_uart2, _, _, _),
|
||||
BRCMSTB_PIN(22, sd_card_f, vc_uart0, vc_i2c3, _, _, _, _, _),
|
||||
BRCMSTB_PIN(23, vc_uart0, vc_i2c3, _, _, _, _, _, _),
|
||||
BRCMSTB_PIN(24, sd_card_b, vc_spi0, arm_jtag, uart0, usb_pwr, vc_uart2, vc_uart0, _),
|
||||
BRCMSTB_PIN(25, sd_card_b, vc_spi0, arm_jtag, uart0, usb_pwr, vc_uart2, vc_uart0, _),
|
||||
BRCMSTB_PIN(26, sd_card_b, vc_spi0, arm_jtag, uart0, usb_vbus, vc_uart2, vc_spi0, _),
|
||||
BRCMSTB_PIN(27, sd_card_b, vc_spi0, arm_jtag, uart0, vc_uart2, vc_spi0, _, _),
|
||||
BRCMSTB_PIN(28, sd_card_b, vc_spi0, arm_jtag, vc_i2c0, vc_spi0, _, _, _),
|
||||
BRCMSTB_PIN(29, arm_jtag, vc_i2c0, vc_spi0, _, _, _, _, _),
|
||||
BRCMSTB_PIN(30, sd2, gpclk0, vc_pwm0, _, _, _, _, _),
|
||||
BRCMSTB_PIN(31, sd2, vc_spi3, vc_pwm0, _, _, _, _, _),
|
||||
BRCMSTB_PIN(32, sd2, vc_spi3, vc_uart3, _, _, _, _, _),
|
||||
BRCMSTB_PIN(33, sd2, vc_spi3, vc_uart3, _, _, _, _, _),
|
||||
BRCMSTB_PIN(34, sd2, vc_spi3, vc_i2c5, _, _, _, _, _),
|
||||
BRCMSTB_PIN(35, sd2, vc_spi3, vc_i2c5, _, _, _, _, _),
|
||||
};
|
||||
|
||||
static const struct pinctrl_desc bcm2712_c0_pinctrl_desc = {
|
||||
.name = "pinctrl-bcm2712",
|
||||
.pins = bcm2712_c0_gpio_pins,
|
||||
.npins = ARRAY_SIZE(bcm2712_c0_gpio_pins),
|
||||
};
|
||||
|
||||
static const struct pinctrl_desc bcm2712_c0_aon_pinctrl_desc = {
|
||||
.name = "aon-pinctrl-bcm2712",
|
||||
.pins = bcm2712_c0_aon_gpio_pins,
|
||||
.npins = ARRAY_SIZE(bcm2712_c0_aon_gpio_pins),
|
||||
};
|
||||
|
||||
static const struct pinctrl_desc bcm2712_d0_pinctrl_desc = {
|
||||
.name = "pinctrl-bcm2712",
|
||||
.pins = bcm2712_d0_gpio_pins,
|
||||
.npins = ARRAY_SIZE(bcm2712_d0_gpio_pins),
|
||||
};
|
||||
|
||||
static const struct pinctrl_desc bcm2712_d0_aon_pinctrl_desc = {
|
||||
.name = "aon-pinctrl-bcm2712",
|
||||
.pins = bcm2712_d0_aon_gpio_pins,
|
||||
.npins = ARRAY_SIZE(bcm2712_d0_aon_gpio_pins),
|
||||
};
|
||||
|
||||
static const struct pinctrl_gpio_range bcm2712_c0_pinctrl_gpio_range = {
|
||||
.name = "pinctrl-bcm2712",
|
||||
.npins = ARRAY_SIZE(bcm2712_c0_gpio_pins),
|
||||
};
|
||||
|
||||
static const struct pinctrl_gpio_range bcm2712_c0_aon_pinctrl_gpio_range = {
|
||||
.name = "aon-pinctrl-bcm2712",
|
||||
.npins = ARRAY_SIZE(bcm2712_c0_aon_gpio_pins),
|
||||
};
|
||||
|
||||
static const struct pinctrl_gpio_range bcm2712_d0_pinctrl_gpio_range = {
|
||||
.name = "pinctrl-bcm2712",
|
||||
.npins = ARRAY_SIZE(bcm2712_d0_gpio_pins),
|
||||
};
|
||||
|
||||
static const struct pinctrl_gpio_range bcm2712_d0_aon_pinctrl_gpio_range = {
|
||||
.name = "aon-pinctrl-bcm2712",
|
||||
.npins = ARRAY_SIZE(bcm2712_d0_aon_gpio_pins),
|
||||
};
|
||||
|
||||
static const struct brcmstb_pdata bcm2712_c0_pdata = {
|
||||
.pctl_desc = &bcm2712_c0_pinctrl_desc,
|
||||
.gpio_range = &bcm2712_c0_pinctrl_gpio_range,
|
||||
.pin_regs = bcm2712_c0_gpio_pin_regs,
|
||||
.pin_funcs = bcm2712_c0_gpio_pin_funcs,
|
||||
.func_count = func_count,
|
||||
.func_gpio = func_gpio,
|
||||
.func_names = bcm2712_func_names,
|
||||
};
|
||||
|
||||
static const struct brcmstb_pdata bcm2712_c0_aon_pdata = {
|
||||
.pctl_desc = &bcm2712_c0_aon_pinctrl_desc,
|
||||
.gpio_range = &bcm2712_c0_aon_pinctrl_gpio_range,
|
||||
.pin_regs = bcm2712_c0_aon_gpio_pin_regs,
|
||||
.pin_funcs = bcm2712_c0_aon_gpio_pin_funcs,
|
||||
.func_count = func_count,
|
||||
.func_gpio = func_gpio,
|
||||
.func_names = bcm2712_func_names,
|
||||
};
|
||||
|
||||
static const struct brcmstb_pdata bcm2712_d0_pdata = {
|
||||
.pctl_desc = &bcm2712_d0_pinctrl_desc,
|
||||
.gpio_range = &bcm2712_d0_pinctrl_gpio_range,
|
||||
.pin_regs = bcm2712_d0_gpio_pin_regs,
|
||||
.pin_funcs = bcm2712_d0_gpio_pin_funcs,
|
||||
.func_count = func_count,
|
||||
.func_gpio = func_gpio,
|
||||
.func_names = bcm2712_func_names,
|
||||
};
|
||||
|
||||
static const struct brcmstb_pdata bcm2712_d0_aon_pdata = {
|
||||
.pctl_desc = &bcm2712_d0_aon_pinctrl_desc,
|
||||
.gpio_range = &bcm2712_d0_aon_pinctrl_gpio_range,
|
||||
.pin_regs = bcm2712_d0_aon_gpio_pin_regs,
|
||||
.pin_funcs = bcm2712_d0_aon_gpio_pin_funcs,
|
||||
.func_count = func_count,
|
||||
.func_gpio = func_gpio,
|
||||
.func_names = bcm2712_func_names,
|
||||
};
|
||||
|
||||
static int bcm2712_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
return brcmstb_pinctrl_probe(pdev);
|
||||
}
|
||||
|
||||
static const struct of_device_id bcm2712_pinctrl_match[] = {
|
||||
{
|
||||
.compatible = "brcm,bcm2712c0-pinctrl",
|
||||
.data = &bcm2712_c0_pdata
|
||||
},
|
||||
{
|
||||
.compatible = "brcm,bcm2712c0-aon-pinctrl",
|
||||
.data = &bcm2712_c0_aon_pdata
|
||||
},
|
||||
|
||||
{
|
||||
.compatible = "brcm,bcm2712d0-pinctrl",
|
||||
.data = &bcm2712_d0_pdata
|
||||
},
|
||||
{
|
||||
.compatible = "brcm,bcm2712d0-aon-pinctrl",
|
||||
.data = &bcm2712_d0_aon_pdata
|
||||
},
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, bcm2712_pinctrl_match);
|
||||
|
||||
static struct platform_driver bcm2712_pinctrl_driver = {
|
||||
.probe = bcm2712_pinctrl_probe,
|
||||
.driver = {
|
||||
.name = "pinctrl-bcm2712",
|
||||
.of_match_table = bcm2712_pinctrl_match,
|
||||
.suppress_bind_attrs = true,
|
||||
},
|
||||
};
|
||||
module_platform_driver(bcm2712_pinctrl_driver);
|
||||
|
||||
MODULE_AUTHOR("Phil Elwell");
|
||||
MODULE_AUTHOR("Jonathan Bell");
|
||||
MODULE_AUTHOR("Ivan T. Ivanov");
|
||||
MODULE_AUTHOR("Andrea della Porta");
|
||||
MODULE_DESCRIPTION("Broadcom BCM2712 pinctrl driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
442
drivers/pinctrl/bcm/pinctrl-brcmstb.c
Normal file
442
drivers/pinctrl/bcm/pinctrl-brcmstb.c
Normal file
|
|
@ -0,0 +1,442 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Driver for Broadcom brcmstb GPIO units (pinctrl only)
|
||||
*
|
||||
* Copyright (C) 2024-2025 Ivan T. Ivanov, Andrea della Porta
|
||||
* Copyright (C) 2021-3 Raspberry Pi Ltd.
|
||||
* Copyright (C) 2012 Chris Boot, Simon Arlott, Stephen Warren
|
||||
*
|
||||
* Based heavily on the BCM2835 GPIO & pinctrl driver, which was inspired by:
|
||||
* pinctrl-nomadik.c, please see original file for copyright information
|
||||
* pinctrl-tegra.c, please see original file for copyright information
|
||||
*/
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/pinctrl/pinconf.h>
|
||||
#include <linux/pinctrl/pinctrl.h>
|
||||
#include <linux/pinctrl/pinmux.h>
|
||||
#include <linux/pinctrl/pinconf-generic.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/cleanup.h>
|
||||
|
||||
#include "pinctrl-brcmstb.h"
|
||||
|
||||
#define BRCMSTB_PULL_NONE 0
|
||||
#define BRCMSTB_PULL_DOWN 1
|
||||
#define BRCMSTB_PULL_UP 2
|
||||
#define BRCMSTB_PULL_MASK 0x3
|
||||
|
||||
#define BIT_TO_REG(b) (((b) >> 5) << 2)
|
||||
#define BIT_TO_SHIFT(b) ((b) & 0x1f)
|
||||
|
||||
struct brcmstb_pinctrl {
|
||||
struct device *dev;
|
||||
void __iomem *base;
|
||||
struct pinctrl_dev *pctl_dev;
|
||||
struct pinctrl_desc pctl_desc;
|
||||
const struct pin_regs *pin_regs;
|
||||
const struct brcmstb_pin_funcs *pin_funcs;
|
||||
const char * const *func_names;
|
||||
unsigned int func_count;
|
||||
unsigned int func_gpio;
|
||||
const char *const *gpio_groups;
|
||||
struct pinctrl_gpio_range gpio_range;
|
||||
/* Protect FSEL registers */
|
||||
spinlock_t fsel_lock;
|
||||
};
|
||||
|
||||
static unsigned int brcmstb_pinctrl_fsel_get(struct brcmstb_pinctrl *pc,
|
||||
unsigned int pin)
|
||||
{
|
||||
u32 bit = pc->pin_regs[pin].mux_bit;
|
||||
unsigned int func;
|
||||
int fsel;
|
||||
u32 val;
|
||||
|
||||
if (!bit)
|
||||
return pc->func_gpio;
|
||||
|
||||
bit &= ~MUX_BIT_VALID;
|
||||
|
||||
val = readl(pc->base + BIT_TO_REG(bit));
|
||||
fsel = (val >> BIT_TO_SHIFT(bit)) & pc->pin_funcs[pin].func_mask;
|
||||
func = pc->pin_funcs[pin].funcs[fsel];
|
||||
|
||||
if (func >= pc->func_count)
|
||||
func = fsel;
|
||||
|
||||
dev_dbg(pc->dev, "get %04x: %08x (%u => %s)\n",
|
||||
BIT_TO_REG(bit), val, pin,
|
||||
pc->func_names[func]);
|
||||
|
||||
return func;
|
||||
}
|
||||
|
||||
static int brcmstb_pinctrl_fsel_set(struct brcmstb_pinctrl *pc,
|
||||
unsigned int pin, unsigned int func)
|
||||
{
|
||||
u32 bit = pc->pin_regs[pin].mux_bit, val, fsel_mask;
|
||||
const u8 *pin_funcs;
|
||||
int fsel;
|
||||
int cur;
|
||||
int i;
|
||||
|
||||
if (!bit || func >= pc->func_count)
|
||||
return -EINVAL;
|
||||
|
||||
bit &= ~MUX_BIT_VALID;
|
||||
|
||||
fsel = pc->pin_funcs[pin].n_funcs + 1;
|
||||
fsel_mask = pc->pin_funcs[pin].func_mask;
|
||||
|
||||
if (func >= fsel) {
|
||||
/* Convert to an fsel number */
|
||||
pin_funcs = pc->pin_funcs[pin].funcs;
|
||||
for (i = 1; i < fsel; i++) {
|
||||
if (pin_funcs[i - 1] == func) {
|
||||
fsel = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fsel = func;
|
||||
}
|
||||
|
||||
if (fsel >= pc->pin_funcs[pin].n_funcs + 1)
|
||||
return -EINVAL;
|
||||
|
||||
guard(spinlock_irqsave)(&pc->fsel_lock);
|
||||
|
||||
val = readl(pc->base + BIT_TO_REG(bit));
|
||||
cur = (val >> BIT_TO_SHIFT(bit)) & fsel_mask;
|
||||
|
||||
dev_dbg(pc->dev, "read %04x: %08x (%u => %s)\n",
|
||||
BIT_TO_REG(bit), val, pin,
|
||||
pc->func_names[cur]);
|
||||
|
||||
if (cur != fsel) {
|
||||
val &= ~(fsel_mask << BIT_TO_SHIFT(bit));
|
||||
val |= fsel << BIT_TO_SHIFT(bit);
|
||||
|
||||
dev_dbg(pc->dev, "write %04x: %08x (%u <= %s)\n",
|
||||
BIT_TO_REG(bit), val, pin,
|
||||
pc->func_names[fsel]);
|
||||
writel(val, pc->base + BIT_TO_REG(bit));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int brcmstb_pctl_get_groups_count(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
struct brcmstb_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
return pc->pctl_desc.npins;
|
||||
}
|
||||
|
||||
static const char *brcmstb_pctl_get_group_name(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector)
|
||||
{
|
||||
struct brcmstb_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
return pc->gpio_groups[selector];
|
||||
}
|
||||
|
||||
static int brcmstb_pctl_get_group_pins(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector,
|
||||
const unsigned int **pins,
|
||||
unsigned int *num_pins)
|
||||
{
|
||||
struct brcmstb_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
*pins = &pc->pctl_desc.pins[selector].number;
|
||||
*num_pins = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void brcmstb_pctl_pin_dbg_show(struct pinctrl_dev *pctldev,
|
||||
struct seq_file *s, unsigned int offset)
|
||||
{
|
||||
struct brcmstb_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
|
||||
unsigned int fsel = brcmstb_pinctrl_fsel_get(pc, offset);
|
||||
const char *fname = pc->func_names[fsel];
|
||||
|
||||
seq_printf(s, "function %s", fname);
|
||||
}
|
||||
|
||||
static void brcmstb_pctl_dt_free_map(struct pinctrl_dev *pctldev,
|
||||
struct pinctrl_map *maps,
|
||||
unsigned int num_maps)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_maps; i++)
|
||||
if (maps[i].type == PIN_MAP_TYPE_CONFIGS_PIN)
|
||||
kfree(maps[i].data.configs.configs);
|
||||
|
||||
kfree(maps);
|
||||
}
|
||||
|
||||
static const struct pinctrl_ops brcmstb_pctl_ops = {
|
||||
.get_groups_count = brcmstb_pctl_get_groups_count,
|
||||
.get_group_name = brcmstb_pctl_get_group_name,
|
||||
.get_group_pins = brcmstb_pctl_get_group_pins,
|
||||
.pin_dbg_show = brcmstb_pctl_pin_dbg_show,
|
||||
.dt_node_to_map = pinconf_generic_dt_node_to_map_all,
|
||||
.dt_free_map = brcmstb_pctl_dt_free_map,
|
||||
};
|
||||
|
||||
static int brcmstb_pmx_free(struct pinctrl_dev *pctldev, unsigned int offset)
|
||||
{
|
||||
struct brcmstb_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
/* disable by setting to GPIO */
|
||||
return brcmstb_pinctrl_fsel_set(pc, offset, pc->func_gpio);
|
||||
}
|
||||
|
||||
static int brcmstb_pmx_get_functions_count(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
struct brcmstb_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
return pc->func_count;
|
||||
}
|
||||
|
||||
static const char *brcmstb_pmx_get_function_name(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector)
|
||||
{
|
||||
struct brcmstb_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
return (selector < pc->func_count) ? pc->func_names[selector] : NULL;
|
||||
}
|
||||
|
||||
static int brcmstb_pmx_get_function_groups(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector,
|
||||
const char *const **groups,
|
||||
unsigned *const num_groups)
|
||||
{
|
||||
struct brcmstb_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
*groups = pc->gpio_groups;
|
||||
*num_groups = pc->pctl_desc.npins;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int brcmstb_pmx_set(struct pinctrl_dev *pctldev,
|
||||
unsigned int func_selector,
|
||||
unsigned int group_selector)
|
||||
{
|
||||
struct brcmstb_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct pinctrl_desc *pctldesc = &pc->pctl_desc;
|
||||
const struct pinctrl_pin_desc *pindesc;
|
||||
|
||||
if (group_selector >= pctldesc->npins)
|
||||
return -EINVAL;
|
||||
|
||||
pindesc = &pctldesc->pins[group_selector];
|
||||
return brcmstb_pinctrl_fsel_set(pc, pindesc->number, func_selector);
|
||||
}
|
||||
|
||||
static int brcmstb_pmx_gpio_request_enable(struct pinctrl_dev *pctldev,
|
||||
struct pinctrl_gpio_range *range,
|
||||
unsigned int pin)
|
||||
{
|
||||
struct brcmstb_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
return brcmstb_pinctrl_fsel_set(pc, pin, pc->func_gpio);
|
||||
}
|
||||
|
||||
static void brcmstb_pmx_gpio_disable_free(struct pinctrl_dev *pctldev,
|
||||
struct pinctrl_gpio_range *range,
|
||||
unsigned int offset)
|
||||
{
|
||||
struct brcmstb_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
/* disable by setting to GPIO */
|
||||
(void)brcmstb_pinctrl_fsel_set(pc, offset, pc->func_gpio);
|
||||
}
|
||||
|
||||
static bool brcmstb_pmx_function_is_gpio(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector)
|
||||
{
|
||||
struct brcmstb_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
return pc->func_gpio == selector;
|
||||
}
|
||||
|
||||
static const struct pinmux_ops brcmstb_pmx_ops = {
|
||||
.free = brcmstb_pmx_free,
|
||||
.get_functions_count = brcmstb_pmx_get_functions_count,
|
||||
.get_function_name = brcmstb_pmx_get_function_name,
|
||||
.get_function_groups = brcmstb_pmx_get_function_groups,
|
||||
.set_mux = brcmstb_pmx_set,
|
||||
.gpio_request_enable = brcmstb_pmx_gpio_request_enable,
|
||||
.gpio_disable_free = brcmstb_pmx_gpio_disable_free,
|
||||
.function_is_gpio = brcmstb_pmx_function_is_gpio,
|
||||
.strict = true,
|
||||
};
|
||||
|
||||
static unsigned int brcmstb_pull_config_get(struct brcmstb_pinctrl *pc,
|
||||
unsigned int pin)
|
||||
{
|
||||
u32 bit = pc->pin_regs[pin].pad_bit, val;
|
||||
|
||||
if (bit == PAD_BIT_INVALID)
|
||||
return BRCMSTB_PULL_NONE;
|
||||
|
||||
val = readl(pc->base + BIT_TO_REG(bit));
|
||||
return (val >> BIT_TO_SHIFT(bit)) & BRCMSTB_PULL_MASK;
|
||||
}
|
||||
|
||||
static int brcmstb_pull_config_set(struct brcmstb_pinctrl *pc,
|
||||
unsigned int pin, unsigned int arg)
|
||||
{
|
||||
u32 bit = pc->pin_regs[pin].pad_bit, val;
|
||||
|
||||
if (bit == PAD_BIT_INVALID) {
|
||||
dev_warn(pc->dev, "Can't set pulls for %s\n",
|
||||
pc->gpio_groups[pin]);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
guard(spinlock_irqsave)(&pc->fsel_lock);
|
||||
|
||||
val = readl(pc->base + BIT_TO_REG(bit));
|
||||
val &= ~(BRCMSTB_PULL_MASK << BIT_TO_SHIFT(bit));
|
||||
val |= (arg << BIT_TO_SHIFT(bit));
|
||||
writel(val, pc->base + BIT_TO_REG(bit));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int brcmstb_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
|
||||
unsigned long *config)
|
||||
{
|
||||
struct brcmstb_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
|
||||
enum pin_config_param param = pinconf_to_config_param(*config);
|
||||
u32 arg;
|
||||
|
||||
switch (param) {
|
||||
case PIN_CONFIG_BIAS_DISABLE:
|
||||
arg = (brcmstb_pull_config_get(pc, pin) == BRCMSTB_PULL_NONE);
|
||||
break;
|
||||
case PIN_CONFIG_BIAS_PULL_DOWN:
|
||||
arg = (brcmstb_pull_config_get(pc, pin) == BRCMSTB_PULL_DOWN);
|
||||
break;
|
||||
case PIN_CONFIG_BIAS_PULL_UP:
|
||||
arg = (brcmstb_pull_config_get(pc, pin) == BRCMSTB_PULL_UP);
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
*config = pinconf_to_config_packed(param, arg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int brcmstb_pinconf_set(struct pinctrl_dev *pctldev,
|
||||
unsigned int pin, unsigned long *configs,
|
||||
unsigned int num_configs)
|
||||
{
|
||||
struct brcmstb_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
|
||||
int ret = 0;
|
||||
u32 param;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_configs; i++) {
|
||||
param = pinconf_to_config_param(configs[i]);
|
||||
|
||||
switch (param) {
|
||||
case PIN_CONFIG_BIAS_DISABLE:
|
||||
ret = brcmstb_pull_config_set(pc, pin, BRCMSTB_PULL_NONE);
|
||||
break;
|
||||
case PIN_CONFIG_BIAS_PULL_DOWN:
|
||||
ret = brcmstb_pull_config_set(pc, pin, BRCMSTB_PULL_DOWN);
|
||||
break;
|
||||
case PIN_CONFIG_BIAS_PULL_UP:
|
||||
ret = brcmstb_pull_config_set(pc, pin, BRCMSTB_PULL_UP);
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct pinconf_ops brcmstb_pinconf_ops = {
|
||||
.is_generic = true,
|
||||
.pin_config_get = brcmstb_pinconf_get,
|
||||
.pin_config_set = brcmstb_pinconf_set,
|
||||
};
|
||||
|
||||
int brcmstb_pinctrl_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct device_node *np = dev->of_node;
|
||||
const struct brcmstb_pdata *pdata;
|
||||
struct brcmstb_pinctrl *pc;
|
||||
const char **names;
|
||||
int num_pins, i;
|
||||
|
||||
pdata = of_device_get_match_data(dev);
|
||||
|
||||
pc = devm_kzalloc(dev, sizeof(*pc), GFP_KERNEL);
|
||||
if (!pc)
|
||||
return -ENOMEM;
|
||||
|
||||
platform_set_drvdata(pdev, pc);
|
||||
pc->dev = dev;
|
||||
spin_lock_init(&pc->fsel_lock);
|
||||
|
||||
pc->base = devm_of_iomap(dev, np, 0, NULL);
|
||||
if (IS_ERR(pc->base))
|
||||
return dev_err_probe(&pdev->dev, PTR_ERR(pc->base),
|
||||
"Could not get IO memory\n");
|
||||
|
||||
pc->pctl_desc = *pdata->pctl_desc;
|
||||
pc->pctl_desc.pctlops = &brcmstb_pctl_ops;
|
||||
pc->pctl_desc.pmxops = &brcmstb_pmx_ops;
|
||||
pc->pctl_desc.confops = &brcmstb_pinconf_ops;
|
||||
pc->pctl_desc.owner = THIS_MODULE;
|
||||
num_pins = pc->pctl_desc.npins;
|
||||
names = devm_kmalloc_array(dev, num_pins, sizeof(const char *),
|
||||
GFP_KERNEL);
|
||||
if (!names)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < num_pins; i++)
|
||||
names[i] = pc->pctl_desc.pins[i].name;
|
||||
|
||||
pc->gpio_groups = names;
|
||||
pc->pin_regs = pdata->pin_regs;
|
||||
pc->pin_funcs = pdata->pin_funcs;
|
||||
pc->func_count = pdata->func_count;
|
||||
pc->func_names = pdata->func_names;
|
||||
|
||||
pc->pctl_dev = devm_pinctrl_register(dev, &pc->pctl_desc, pc);
|
||||
if (IS_ERR(pc->pctl_dev))
|
||||
return dev_err_probe(&pdev->dev, PTR_ERR(pc->pctl_dev),
|
||||
"Failed to register pinctrl device\n");
|
||||
|
||||
pc->gpio_range = *pdata->gpio_range;
|
||||
pinctrl_add_gpio_range(pc->pctl_dev, &pc->gpio_range);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(brcmstb_pinctrl_probe);
|
||||
|
||||
MODULE_AUTHOR("Phil Elwell");
|
||||
MODULE_AUTHOR("Jonathan Bell");
|
||||
MODULE_AUTHOR("Ivan T. Ivanov");
|
||||
MODULE_AUTHOR("Andrea della Porta");
|
||||
MODULE_DESCRIPTION("Broadcom brcmstb pinctrl driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
93
drivers/pinctrl/bcm/pinctrl-brcmstb.h
Normal file
93
drivers/pinctrl/bcm/pinctrl-brcmstb.h
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Header for Broadcom brcmstb GPIO based drivers
|
||||
*
|
||||
* Copyright (C) 2024-2025 Ivan T. Ivanov, Andrea della Porta
|
||||
* Copyright (C) 2021-3 Raspberry Pi Ltd.
|
||||
* Copyright (C) 2012 Chris Boot, Simon Arlott, Stephen Warren
|
||||
*
|
||||
* Based heavily on the BCM2835 GPIO & pinctrl driver, which was inspired by:
|
||||
* pinctrl-nomadik.c, please see original file for copyright information
|
||||
* pinctrl-tegra.c, please see original file for copyright information
|
||||
*/
|
||||
|
||||
#ifndef __PINCTRL_BRCMSTB_H__
|
||||
#define __PINCTRL_BRCMSTB_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#define BRCMSTB_FUNC(f) \
|
||||
[func_##f] = #f
|
||||
|
||||
#define MUX_BIT_VALID 0x8000
|
||||
#define PAD_BIT_INVALID 0xffff
|
||||
|
||||
#define MUX_BIT(muxreg, muxshift) \
|
||||
(MUX_BIT_VALID + ((muxreg) << 5) + ((muxshift) << 2))
|
||||
#define PAD_BIT(padreg, padshift) \
|
||||
(((padreg) << 5) + ((padshift) << 1))
|
||||
|
||||
#define GPIO_REGS(n, muxreg, muxshift, padreg, padshift) \
|
||||
[n] = { MUX_BIT(muxreg, muxshift), PAD_BIT(padreg, padshift) }
|
||||
|
||||
#define EMMC_REGS(n, padreg, padshift) \
|
||||
[n] = { 0, PAD_BIT(padreg, padshift) }
|
||||
|
||||
#define AON_GPIO_REGS(n, muxreg, muxshift, padreg, padshift) \
|
||||
GPIO_REGS(n, muxreg, muxshift, padreg, padshift)
|
||||
|
||||
#define AON_SGPIO_REGS(n, muxreg, muxshift) \
|
||||
[(n) + 32] = { MUX_BIT(muxreg, muxshift), PAD_BIT_INVALID }
|
||||
|
||||
#define GPIO_PIN(n) PINCTRL_PIN(n, "gpio" #n)
|
||||
/**
|
||||
* AON pins are in the Always-On power domain. SGPIOs are also 'Safe'
|
||||
* being 5V tolerant (necessary for the HDMI I2C pins), and can be driven
|
||||
* while the power is off.
|
||||
*/
|
||||
#define AON_GPIO_PIN(n) PINCTRL_PIN(n, "aon_gpio" #n)
|
||||
#define AON_SGPIO_PIN(n) PINCTRL_PIN((n) + 32, "aon_sgpio" #n)
|
||||
|
||||
struct pin_regs {
|
||||
u16 mux_bit;
|
||||
u16 pad_bit;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct brcmstb_pin_funcs - pins provide their primary/alternate
|
||||
* functions in this struct
|
||||
* @func_mask: mask representing valid bits of the function selector
|
||||
* in the registers
|
||||
* @funcs: array of function identifiers
|
||||
* @n_funcs: number of identifiers of the @funcs array above
|
||||
*/
|
||||
struct brcmstb_pin_funcs {
|
||||
const u32 func_mask;
|
||||
const u8 *funcs;
|
||||
const unsigned int n_funcs;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct brcmstb_pdata - specific data for a pinctrl chip implementation
|
||||
* @pctl_desc: pin controller descriptor for this implementation
|
||||
* @gpio_range: range of GPIOs served by this controller
|
||||
* @pin_regs: array of register descriptors for each pin
|
||||
* @pin_funcs: array of all possible assignable function for each pin
|
||||
* @func_count: total number of functions
|
||||
* @func_gpio: which function number is GPIO (usually 0)
|
||||
* @func_names: an array listing all function names
|
||||
*/
|
||||
struct brcmstb_pdata {
|
||||
const struct pinctrl_desc *pctl_desc;
|
||||
const struct pinctrl_gpio_range *gpio_range;
|
||||
const struct pin_regs *pin_regs;
|
||||
const struct brcmstb_pin_funcs *pin_funcs;
|
||||
const unsigned int func_count;
|
||||
const unsigned int func_gpio;
|
||||
const char * const *func_names;
|
||||
};
|
||||
|
||||
int brcmstb_pinctrl_probe(struct platform_device *pdev);
|
||||
|
||||
#endif
|
||||
|
|
@ -804,7 +804,7 @@ static int madera_pin_conf_get(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
if (conf[0] & MADERA_GP1_IP_CFG_MASK)
|
||||
result = 1;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
if ((conf[1] & MADERA_GP1_DIR_MASK) &&
|
||||
(conf[0] & MADERA_GP1_LVL_MASK))
|
||||
result = 1;
|
||||
|
|
@ -902,7 +902,7 @@ static int madera_pin_conf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
mask[1] |= MADERA_GP1_DIR_MASK;
|
||||
conf[1] |= MADERA_GP1_DIR;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
val = pinconf_to_config_argument(*configs);
|
||||
mask[0] |= MADERA_GP1_LVL_MASK;
|
||||
if (val)
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, unsigned selector,
|
|||
{
|
||||
struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
const struct imx_pinctrl_soc_info *info = ipctl->info;
|
||||
struct function_desc *func;
|
||||
const struct function_desc *func;
|
||||
struct group_desc *grp;
|
||||
struct imx_pin *pin;
|
||||
unsigned int npins;
|
||||
|
|
@ -266,7 +266,7 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, unsigned selector,
|
|||
npins = grp->grp.npins;
|
||||
|
||||
dev_dbg(ipctl->dev, "enable function %s group %s\n",
|
||||
func->func.name, grp->grp.name);
|
||||
func->func->name, grp->grp.name);
|
||||
|
||||
for (i = 0; i < npins; i++) {
|
||||
/*
|
||||
|
|
@ -580,33 +580,38 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
|
|||
u32 index)
|
||||
{
|
||||
struct pinctrl_dev *pctl = ipctl->pctl;
|
||||
struct function_desc *func;
|
||||
struct pinfunction *func;
|
||||
struct group_desc *grp;
|
||||
const char **group_names;
|
||||
int ret;
|
||||
u32 i;
|
||||
|
||||
dev_dbg(pctl->dev, "parse function(%d): %pOFn\n", index, np);
|
||||
|
||||
func = pinmux_generic_get_function(pctl, index);
|
||||
func = devm_kzalloc(ipctl->dev, sizeof(*func), GFP_KERNEL);
|
||||
if (!func)
|
||||
return -EINVAL;
|
||||
return -ENOMEM;
|
||||
|
||||
/* Initialise function */
|
||||
func->func.name = np->name;
|
||||
func->func.ngroups = of_get_child_count(np);
|
||||
if (func->func.ngroups == 0) {
|
||||
func->name = np->name;
|
||||
func->ngroups = of_get_child_count(np);
|
||||
if (func->ngroups == 0) {
|
||||
dev_info(ipctl->dev, "no groups defined in %pOF\n", np);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
group_names = devm_kcalloc(ipctl->dev, func->func.ngroups,
|
||||
sizeof(*func->func.groups), GFP_KERNEL);
|
||||
group_names = devm_kcalloc(ipctl->dev, func->ngroups,
|
||||
sizeof(*func->groups), GFP_KERNEL);
|
||||
if (!group_names)
|
||||
return -ENOMEM;
|
||||
i = 0;
|
||||
for_each_child_of_node_scoped(np, child)
|
||||
group_names[i++] = child->name;
|
||||
func->func.groups = group_names;
|
||||
func->groups = group_names;
|
||||
|
||||
ret = pinmux_generic_add_pinfunction(pctl, func, NULL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
i = 0;
|
||||
for_each_child_of_node_scoped(np, child) {
|
||||
|
|
@ -615,6 +620,10 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
|
|||
return -ENOMEM;
|
||||
|
||||
mutex_lock(&ipctl->mutex);
|
||||
/*
|
||||
* FIXME: This should use pinctrl_generic_add_group() and not
|
||||
* access the private radix tree directly.
|
||||
*/
|
||||
radix_tree_insert(&pctl->pin_group_tree,
|
||||
ipctl->group_index++, grp);
|
||||
mutex_unlock(&ipctl->mutex);
|
||||
|
|
@ -669,20 +678,6 @@ static int imx_pinctrl_probe_dt(struct platform_device *pdev,
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < nfuncs; i++) {
|
||||
struct function_desc *function;
|
||||
|
||||
function = devm_kzalloc(&pdev->dev, sizeof(*function),
|
||||
GFP_KERNEL);
|
||||
if (!function)
|
||||
return -ENOMEM;
|
||||
|
||||
mutex_lock(&ipctl->mutex);
|
||||
radix_tree_insert(&pctl->pin_function_tree, i, function);
|
||||
mutex_unlock(&ipctl->mutex);
|
||||
}
|
||||
pctl->num_functions = nfuncs;
|
||||
|
||||
ipctl->group_index = 0;
|
||||
if (flat_funcs) {
|
||||
pctl->num_groups = of_get_child_count(np);
|
||||
|
|
|
|||
|
|
@ -35,13 +35,8 @@
|
|||
|
||||
#define PINCTRL_FUNC_DESC(id) \
|
||||
{ \
|
||||
.desc = { \
|
||||
.func = { \
|
||||
.name = #id, \
|
||||
.groups = id##_groups, \
|
||||
.ngroups = ARRAY_SIZE(id##_groups), \
|
||||
} \
|
||||
}, \
|
||||
.desc = PINCTRL_PINFUNCTION(#id, id##_groups, \
|
||||
ARRAY_SIZE(id##_groups)), \
|
||||
.groups = id##_func_group, \
|
||||
.group_size = ARRAY_SIZE(id##_func_group), \
|
||||
}
|
||||
|
|
@ -337,7 +332,7 @@ struct airoha_pinctrl_func_group {
|
|||
};
|
||||
|
||||
struct airoha_pinctrl_func {
|
||||
const struct function_desc desc;
|
||||
const struct pinfunction desc;
|
||||
const struct airoha_pinctrl_func_group *groups;
|
||||
u8 group_size;
|
||||
};
|
||||
|
|
@ -2451,7 +2446,7 @@ static int airoha_pinmux_set_mux(struct pinctrl_dev *pctrl_dev,
|
|||
{
|
||||
struct airoha_pinctrl *pinctrl = pinctrl_dev_get_drvdata(pctrl_dev);
|
||||
const struct airoha_pinctrl_func *func;
|
||||
struct function_desc *desc;
|
||||
const struct function_desc *desc;
|
||||
struct group_desc *grp;
|
||||
int i;
|
||||
|
||||
|
|
@ -2464,7 +2459,7 @@ static int airoha_pinmux_set_mux(struct pinctrl_dev *pctrl_dev,
|
|||
return -EINVAL;
|
||||
|
||||
dev_dbg(pctrl_dev->dev, "enable function %s group %s\n",
|
||||
desc->func.name, grp->grp.name);
|
||||
desc->func->name, grp->grp.name);
|
||||
|
||||
func = desc->data;
|
||||
for (i = 0; i < func->group_size; i++) {
|
||||
|
|
@ -2773,7 +2768,7 @@ static int airoha_pinconf_set(struct pinctrl_dev *pctrl_dev,
|
|||
break;
|
||||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
case PIN_CONFIG_OUTPUT: {
|
||||
case PIN_CONFIG_LEVEL: {
|
||||
bool input = param == PIN_CONFIG_INPUT_ENABLE;
|
||||
int err;
|
||||
|
||||
|
|
@ -2782,7 +2777,7 @@ static int airoha_pinconf_set(struct pinctrl_dev *pctrl_dev,
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
if (param == PIN_CONFIG_OUTPUT) {
|
||||
if (param == PIN_CONFIG_LEVEL) {
|
||||
err = airoha_pinconf_set_pin_value(pctrl_dev,
|
||||
pin, !!arg);
|
||||
if (err)
|
||||
|
|
@ -2911,11 +2906,11 @@ static int airoha_pinctrl_probe(struct platform_device *pdev)
|
|||
|
||||
func = &airoha_pinctrl_funcs[i];
|
||||
err = pinmux_generic_add_pinfunction(pinctrl->ctrl,
|
||||
&func->desc.func,
|
||||
&func->desc,
|
||||
(void *)func);
|
||||
if (err < 0) {
|
||||
dev_err(dev, "Failed to register function %s\n",
|
||||
func->desc.func.name);
|
||||
func->desc.name);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ static int mtk_pinmux_set_mux(struct pinctrl_dev *pctldev,
|
|||
unsigned int selector, unsigned int group)
|
||||
{
|
||||
struct mtk_pinctrl *hw = pinctrl_dev_get_drvdata(pctldev);
|
||||
struct function_desc *func;
|
||||
const struct function_desc *func;
|
||||
struct group_desc *grp;
|
||||
int i, err;
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ static int mtk_pinmux_set_mux(struct pinctrl_dev *pctldev,
|
|||
return -EINVAL;
|
||||
|
||||
dev_dbg(pctldev->dev, "enable function %s group %s\n",
|
||||
func->func.name, grp->grp.name);
|
||||
func->func->name, grp->grp.name);
|
||||
|
||||
for (i = 0; i < grp->grp.npins; i++) {
|
||||
const struct mtk_pin_desc *desc;
|
||||
|
|
@ -332,7 +332,7 @@ static int mtk_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
goto err;
|
||||
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
|
||||
MTK_OUTPUT);
|
||||
if (err)
|
||||
|
|
@ -622,11 +622,9 @@ static int mtk_build_functions(struct mtk_pinctrl *hw)
|
|||
int i, err;
|
||||
|
||||
for (i = 0; i < hw->soc->nfuncs ; i++) {
|
||||
const struct function_desc *function = hw->soc->funcs + i;
|
||||
const struct pinfunction *func = &function->func;
|
||||
const struct pinfunction *func = hw->soc->funcs + i;
|
||||
|
||||
err = pinmux_generic_add_pinfunction(hw->pctrl, func,
|
||||
function->data);
|
||||
err = pinmux_generic_add_pinfunction(hw->pctrl, func, NULL);
|
||||
if (err < 0) {
|
||||
dev_err(hw->dev, "Failed to register function %s\n",
|
||||
func->name);
|
||||
|
|
|
|||
|
|
@ -43,11 +43,8 @@
|
|||
.data = id##_funcs, \
|
||||
}
|
||||
|
||||
#define PINCTRL_PIN_FUNCTION(_name_, id) \
|
||||
{ \
|
||||
.func = PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_groups)), \
|
||||
.data = NULL, \
|
||||
}
|
||||
#define PINCTRL_PIN_FUNCTION(_name_, id) \
|
||||
PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_groups))
|
||||
|
||||
int mtk_moore_pinctrl_probe(struct platform_device *pdev,
|
||||
const struct mtk_pin_soc *soc);
|
||||
|
|
|
|||
|
|
@ -822,7 +822,7 @@ static const char *mt7622_uart_groups[] = { "uart0_0_tx_rx",
|
|||
"uart4_2_rts_cts",};
|
||||
static const char *mt7622_wdt_groups[] = { "watchdog", };
|
||||
|
||||
static const struct function_desc mt7622_functions[] = {
|
||||
static const struct pinfunction mt7622_functions[] = {
|
||||
PINCTRL_PIN_FUNCTION("antsel", mt7622_antsel),
|
||||
PINCTRL_PIN_FUNCTION("emmc", mt7622_emmc),
|
||||
PINCTRL_PIN_FUNCTION("eth", mt7622_ethernet),
|
||||
|
|
|
|||
|
|
@ -1340,7 +1340,7 @@ static const char *mt7623_uart_groups[] = { "uart0_0_txd_rxd",
|
|||
"uart3_rts_cts", };
|
||||
static const char *mt7623_wdt_groups[] = { "watchdog_0", "watchdog_1", };
|
||||
|
||||
static const struct function_desc mt7623_functions[] = {
|
||||
static const struct pinfunction mt7623_functions[] = {
|
||||
PINCTRL_PIN_FUNCTION("audck", mt7623_aud_clk),
|
||||
PINCTRL_PIN_FUNCTION("disp", mt7623_disp_pwm),
|
||||
PINCTRL_PIN_FUNCTION("eth", mt7623_ethernet),
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ static const char *mt7629_wdt_groups[] = { "watchdog", };
|
|||
static const char *mt7629_wifi_groups[] = { "wf0_5g", "wf0_2g", };
|
||||
static const char *mt7629_flash_groups[] = { "snfi", "spi_nor" };
|
||||
|
||||
static const struct function_desc mt7629_functions[] = {
|
||||
static const struct pinfunction mt7629_functions[] = {
|
||||
PINCTRL_PIN_FUNCTION("eth", mt7629_ethernet),
|
||||
PINCTRL_PIN_FUNCTION("i2c", mt7629_i2c),
|
||||
PINCTRL_PIN_FUNCTION("led", mt7629_led),
|
||||
|
|
|
|||
|
|
@ -977,7 +977,7 @@ static const char *mt7981_ethernet_groups[] = { "smi_mdc_mdio", "gbe_ext_mdc_mdi
|
|||
"wf0_mode1", "wf0_mode3", "mt7531_int", };
|
||||
static const char *mt7981_ant_groups[] = { "ant_sel", };
|
||||
|
||||
static const struct function_desc mt7981_functions[] = {
|
||||
static const struct pinfunction mt7981_functions[] = {
|
||||
PINCTRL_PIN_FUNCTION("wa_aice", mt7981_wa_aice),
|
||||
PINCTRL_PIN_FUNCTION("dfd", mt7981_dfd),
|
||||
PINCTRL_PIN_FUNCTION("jtag", mt7981_jtag),
|
||||
|
|
|
|||
|
|
@ -878,7 +878,7 @@ static const char *mt7986_uart_groups[] = {
|
|||
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[] = {
|
||||
static const struct pinfunction mt7986_functions[] = {
|
||||
PINCTRL_PIN_FUNCTION("audio", mt7986_audio),
|
||||
PINCTRL_PIN_FUNCTION("emmc", mt7986_emmc),
|
||||
PINCTRL_PIN_FUNCTION("eth", mt7986_ethernet),
|
||||
|
|
|
|||
|
|
@ -1464,33 +1464,23 @@ static const char * const mt7988_usb_groups[] = {
|
|||
"drv_vbus_p1",
|
||||
};
|
||||
|
||||
static const struct function_desc mt7988_functions[] = {
|
||||
{ { "audio", mt7988_audio_groups, ARRAY_SIZE(mt7988_audio_groups) },
|
||||
NULL },
|
||||
{ { "jtag", mt7988_jtag_groups, ARRAY_SIZE(mt7988_jtag_groups) },
|
||||
NULL },
|
||||
{ { "int_usxgmii", mt7988_int_usxgmii_groups,
|
||||
ARRAY_SIZE(mt7988_int_usxgmii_groups) },
|
||||
NULL },
|
||||
{ { "pwm", mt7988_pwm_groups, ARRAY_SIZE(mt7988_pwm_groups) }, NULL },
|
||||
{ { "dfd", mt7988_dfd_groups, ARRAY_SIZE(mt7988_dfd_groups) }, NULL },
|
||||
{ { "i2c", mt7988_i2c_groups, ARRAY_SIZE(mt7988_i2c_groups) }, NULL },
|
||||
{ { "eth", mt7988_ethernet_groups, ARRAY_SIZE(mt7988_ethernet_groups) },
|
||||
NULL },
|
||||
{ { "pcie", mt7988_pcie_groups, ARRAY_SIZE(mt7988_pcie_groups) },
|
||||
NULL },
|
||||
{ { "pmic", mt7988_pmic_groups, ARRAY_SIZE(mt7988_pmic_groups) },
|
||||
NULL },
|
||||
{ { "watchdog", mt7988_wdt_groups, ARRAY_SIZE(mt7988_wdt_groups) },
|
||||
NULL },
|
||||
{ { "spi", mt7988_spi_groups, ARRAY_SIZE(mt7988_spi_groups) }, NULL },
|
||||
{ { "flash", mt7988_flash_groups, ARRAY_SIZE(mt7988_flash_groups) },
|
||||
NULL },
|
||||
{ { "uart", mt7988_uart_groups, ARRAY_SIZE(mt7988_uart_groups) },
|
||||
NULL },
|
||||
{ { "udi", mt7988_udi_groups, ARRAY_SIZE(mt7988_udi_groups) }, NULL },
|
||||
{ { "usb", mt7988_usb_groups, ARRAY_SIZE(mt7988_usb_groups) }, NULL },
|
||||
{ { "led", mt7988_led_groups, ARRAY_SIZE(mt7988_led_groups) }, NULL },
|
||||
static const struct pinfunction mt7988_functions[] = {
|
||||
PINCTRL_PIN_FUNCTION("audio", mt7988_audio),
|
||||
PINCTRL_PIN_FUNCTION("jtag", mt7988_jtag),
|
||||
PINCTRL_PIN_FUNCTION("int_usxgmii", mt7988_int_usxgmii),
|
||||
PINCTRL_PIN_FUNCTION("pwm", mt7988_pwm),
|
||||
PINCTRL_PIN_FUNCTION("dfd", mt7988_dfd),
|
||||
PINCTRL_PIN_FUNCTION("i2c", mt7988_i2c),
|
||||
PINCTRL_PIN_FUNCTION("eth", mt7988_ethernet),
|
||||
PINCTRL_PIN_FUNCTION("pcie", mt7988_pcie),
|
||||
PINCTRL_PIN_FUNCTION("pmic", mt7988_pmic),
|
||||
PINCTRL_PIN_FUNCTION("watchdog", mt7988_wdt),
|
||||
PINCTRL_PIN_FUNCTION("spi", mt7988_spi),
|
||||
PINCTRL_PIN_FUNCTION("flash", mt7988_flash),
|
||||
PINCTRL_PIN_FUNCTION("uart", mt7988_uart),
|
||||
PINCTRL_PIN_FUNCTION("udi", mt7988_udi),
|
||||
PINCTRL_PIN_FUNCTION("usb", mt7988_usb),
|
||||
PINCTRL_PIN_FUNCTION("led", mt7988_led),
|
||||
};
|
||||
|
||||
static const struct mtk_eint_hw mt7988_eint_hw = {
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ struct mtk_pin_soc {
|
|||
unsigned int npins;
|
||||
const struct group_desc *grps;
|
||||
unsigned int ngrps;
|
||||
const struct function_desc *funcs;
|
||||
const struct pinfunction *funcs;
|
||||
unsigned int nfuncs;
|
||||
const struct mtk_eint_regs *eint_regs;
|
||||
const struct mtk_eint_hw *eint_hw;
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ static int mtk_pconf_parse_conf(struct pinctrl_dev *pctldev,
|
|||
mtk_pmx_gpio_set_direction(pctldev, NULL, pin, true);
|
||||
ret = mtk_pconf_set_ies_smt(pctl, pin, arg, param);
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
mtk_gpio_set(pctl->chip, pin, arg);
|
||||
ret = mtk_pmx_gpio_set_direction(pctldev, NULL, pin, false);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ static int mtk_pinconf_get(struct pinctrl_dev *pctldev,
|
|||
if (!ret)
|
||||
err = -EINVAL;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DIR, &ret);
|
||||
if (err)
|
||||
break;
|
||||
|
|
@ -292,7 +292,7 @@ static int mtk_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
/* regard all non-zero value as enable */
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SR, !!arg);
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DO,
|
||||
arg);
|
||||
if (err)
|
||||
|
|
|
|||
|
|
@ -422,7 +422,7 @@ static int aml_pinconf_get(struct pinctrl_dev *pcdev, unsigned int pin,
|
|||
return -EINVAL;
|
||||
arg = 1;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
ret = aml_pinconf_get_output(info, pin);
|
||||
if (ret <= 0)
|
||||
return -EINVAL;
|
||||
|
|
@ -568,7 +568,7 @@ static int aml_pinconf_set(struct pinctrl_dev *pcdev, unsigned int pin,
|
|||
switch (param) {
|
||||
case PIN_CONFIG_DRIVE_STRENGTH_UA:
|
||||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
arg = pinconf_to_config_argument(configs[i]);
|
||||
break;
|
||||
|
||||
|
|
@ -592,7 +592,7 @@ static int aml_pinconf_set(struct pinctrl_dev *pcdev, unsigned int pin,
|
|||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
ret = aml_pinconf_set_output(info, pin, arg);
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
ret = aml_pinconf_set_output_drive(info, pin, arg);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -442,6 +442,8 @@ static const unsigned int tdm_c_dout1_z_pins[] = { GPIOZ_3 };
|
|||
static const unsigned int tdm_c_dout2_z_pins[] = { GPIOZ_4 };
|
||||
static const unsigned int tdm_c_dout3_z_pins[] = { GPIOZ_5 };
|
||||
|
||||
static const unsigned int pcie_clkreqn_pins[] = { GPIOC_7 };
|
||||
|
||||
static const struct meson_pmx_group meson_g12a_periphs_groups[] = {
|
||||
GPIO_GROUP(GPIOZ_0),
|
||||
GPIO_GROUP(GPIOZ_1),
|
||||
|
|
@ -721,6 +723,7 @@ static const struct meson_pmx_group meson_g12a_periphs_groups[] = {
|
|||
GROUP(pdm_din2_c, 4),
|
||||
GROUP(pdm_din3_c, 4),
|
||||
GROUP(pdm_dclk_c, 4),
|
||||
GROUP(pcie_clkreqn, 1),
|
||||
|
||||
/* bank GPIOH */
|
||||
GROUP(spi1_mosi, 3),
|
||||
|
|
@ -1183,6 +1186,10 @@ static const char * const tdm_c_groups[] = {
|
|||
"tdm_c_dout2_z", "tdm_c_dout3_z",
|
||||
};
|
||||
|
||||
static const char * const pcie_clkreqn_groups[] = {
|
||||
"pcie_clkreqn"
|
||||
};
|
||||
|
||||
static const char * const gpio_aobus_groups[] = {
|
||||
"GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4",
|
||||
"GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9",
|
||||
|
|
@ -1309,6 +1316,7 @@ static const struct meson_pmx_func meson_g12a_periphs_functions[] = {
|
|||
FUNCTION(tdm_a),
|
||||
FUNCTION(tdm_b),
|
||||
FUNCTION(tdm_c),
|
||||
FUNCTION(pcie_clkreqn),
|
||||
};
|
||||
|
||||
static const struct meson_pmx_func meson_g12a_aobus_functions[] = {
|
||||
|
|
|
|||
|
|
@ -187,6 +187,9 @@ static const unsigned int i2c_sda_c_pins[] = { GPIODV_28 };
|
|||
static const unsigned int i2c_sck_c_dv19_pins[] = { GPIODV_19 };
|
||||
static const unsigned int i2c_sda_c_dv18_pins[] = { GPIODV_18 };
|
||||
|
||||
static const unsigned int i2c_sck_d_pins[] = { GPIOX_11 };
|
||||
static const unsigned int i2c_sda_d_pins[] = { GPIOX_10 };
|
||||
|
||||
static const unsigned int eth_mdio_pins[] = { GPIOZ_0 };
|
||||
static const unsigned int eth_mdc_pins[] = { GPIOZ_1 };
|
||||
static const unsigned int eth_clk_rx_clk_pins[] = { GPIOZ_2 };
|
||||
|
|
@ -411,6 +414,8 @@ static const struct meson_pmx_group meson_gxl_periphs_groups[] = {
|
|||
GPIO_GROUP(GPIO_TEST_N),
|
||||
|
||||
/* Bank X */
|
||||
GROUP(i2c_sda_d, 5, 5),
|
||||
GROUP(i2c_sck_d, 5, 4),
|
||||
GROUP(sdio_d0, 5, 31),
|
||||
GROUP(sdio_d1, 5, 30),
|
||||
GROUP(sdio_d2, 5, 29),
|
||||
|
|
@ -651,6 +656,10 @@ static const char * const i2c_c_groups[] = {
|
|||
"i2c_sck_c", "i2c_sda_c", "i2c_sda_c_dv18", "i2c_sck_c_dv19",
|
||||
};
|
||||
|
||||
static const char * const i2c_d_groups[] = {
|
||||
"i2c_sck_d", "i2c_sda_d",
|
||||
};
|
||||
|
||||
static const char * const eth_groups[] = {
|
||||
"eth_mdio", "eth_mdc", "eth_clk_rx_clk", "eth_rx_dv",
|
||||
"eth_rxd0", "eth_rxd1", "eth_rxd2", "eth_rxd3",
|
||||
|
|
@ -777,6 +786,7 @@ static const struct meson_pmx_func meson_gxl_periphs_functions[] = {
|
|||
FUNCTION(i2c_a),
|
||||
FUNCTION(i2c_b),
|
||||
FUNCTION(i2c_c),
|
||||
FUNCTION(i2c_d),
|
||||
FUNCTION(eth),
|
||||
FUNCTION(pwm_a),
|
||||
FUNCTION(pwm_b),
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ static int meson_pinconf_set(struct pinctrl_dev *pcdev, unsigned int pin,
|
|||
switch (param) {
|
||||
case PIN_CONFIG_DRIVE_STRENGTH_UA:
|
||||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
arg = pinconf_to_config_argument(configs[i]);
|
||||
break;
|
||||
|
||||
|
|
@ -384,7 +384,7 @@ static int meson_pinconf_set(struct pinctrl_dev *pcdev, unsigned int pin,
|
|||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
ret = meson_pinconf_set_output(pc, pin, arg);
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
ret = meson_pinconf_set_output_drive(pc, pin, arg);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -502,7 +502,7 @@ static int meson_pinconf_get(struct pinctrl_dev *pcdev, unsigned int pin,
|
|||
return -EINVAL;
|
||||
arg = 1;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
ret = meson_pinconf_get_output(pc, pin);
|
||||
if (ret <= 0)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -420,7 +420,8 @@ static int armada_37xx_gpio_direction_output(struct gpio_chip *chip,
|
|||
struct armada_37xx_pinctrl *info = gpiochip_get_data(chip);
|
||||
unsigned int en_offset = offset;
|
||||
unsigned int reg = OUTPUT_VAL;
|
||||
unsigned int mask, val, ret;
|
||||
unsigned int mask, val;
|
||||
int ret;
|
||||
|
||||
armada_37xx_update_reg(®, &offset);
|
||||
mask = BIT(offset);
|
||||
|
|
@ -634,8 +635,9 @@ static int armada_37xx_edge_both_irq_swap_pol(struct armada_37xx_pinctrl *info,
|
|||
{
|
||||
u32 reg_idx = pin_idx / GPIO_PER_REG;
|
||||
u32 bit_num = pin_idx % GPIO_PER_REG;
|
||||
u32 p, l, ret;
|
||||
unsigned long flags;
|
||||
u32 p, l;
|
||||
int ret;
|
||||
|
||||
regmap_read(info->regmap, INPUT_VAL + 4*reg_idx, &l);
|
||||
|
||||
|
|
|
|||
|
|
@ -860,8 +860,8 @@ static int abx500_pin_config_set(struct pinctrl_dev *pctldev,
|
|||
|
||||
dev_dbg(chip->parent, "pin %d [%#lx]: %s %s\n",
|
||||
pin, configs[i],
|
||||
(param == PIN_CONFIG_OUTPUT) ? "output " : "input",
|
||||
(param == PIN_CONFIG_OUTPUT) ?
|
||||
(param == PIN_CONFIG_LEVEL) ? "output " : "input",
|
||||
(param == PIN_CONFIG_LEVEL) ?
|
||||
str_high_low(argument) :
|
||||
(argument ? "pull up" : "pull down"));
|
||||
|
||||
|
|
@ -907,7 +907,7 @@ static int abx500_pin_config_set(struct pinctrl_dev *pctldev,
|
|||
ret = abx500_gpio_direction_input(chip, offset);
|
||||
break;
|
||||
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
ret = abx500_gpio_direction_output(chip, offset,
|
||||
argument);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1038,7 +1038,8 @@ static int ma35_pinctrl_parse_functions(struct fwnode_handle *fwnode, struct ma3
|
|||
struct group_desc *grp;
|
||||
static u32 grp_index;
|
||||
const char **groups;
|
||||
u32 ret, i = 0;
|
||||
u32 i = 0;
|
||||
int ret;
|
||||
|
||||
dev_dbg(npctl->dev, "parse function(%d): %s\n", index, np->name);
|
||||
|
||||
|
|
|
|||
|
|
@ -1700,13 +1700,13 @@ static int npcm7xx_config_get(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
else if (param == PIN_CONFIG_BIAS_PULL_DOWN)
|
||||
rc = (!pu && pd);
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
ie = ioread32(bank->base + NPCM7XX_GP_N_IEM) & pinmask;
|
||||
oe = ioread32(bank->base + NPCM7XX_GP_N_OE) & pinmask;
|
||||
if (param == PIN_CONFIG_INPUT_ENABLE)
|
||||
rc = (ie && !oe);
|
||||
else if (param == PIN_CONFIG_OUTPUT)
|
||||
else if (param == PIN_CONFIG_LEVEL)
|
||||
rc = (!ie && oe);
|
||||
break;
|
||||
case PIN_CONFIG_DRIVE_PUSH_PULL:
|
||||
|
|
@ -1765,7 +1765,7 @@ static int npcm7xx_config_set_one(struct npcm7xx_pinctrl *npcm,
|
|||
iowrite32(gpio, bank->base + NPCM7XX_GP_N_OEC);
|
||||
bank->direction_input(&bank->chip.gc, pin % bank->chip.gc.ngpio);
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
bank->direction_output(&bank->chip.gc, pin % bank->chip.gc.ngpio, arg);
|
||||
iowrite32(gpio, bank->base + NPCM7XX_GP_N_OES);
|
||||
break;
|
||||
|
|
@ -1836,7 +1836,7 @@ static int npcm7xx_gpio_of(struct npcm7xx_pinctrl *pctrl)
|
|||
if (!pctrl->gpio_bank[id].base)
|
||||
return -EINVAL;
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = pctrl->gpio_bank[id].base + NPCM7XX_GP_N_DIN,
|
||||
|
|
|
|||
|
|
@ -2187,13 +2187,13 @@ static int npcm8xx_config_get(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
else if (param == PIN_CONFIG_BIAS_PULL_DOWN)
|
||||
rc = !pu && pd;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
ie = ioread32(bank->base + NPCM8XX_GP_N_IEM) & pinmask;
|
||||
oe = ioread32(bank->base + NPCM8XX_GP_N_OE) & pinmask;
|
||||
if (param == PIN_CONFIG_INPUT_ENABLE)
|
||||
rc = (ie && !oe);
|
||||
else if (param == PIN_CONFIG_OUTPUT)
|
||||
else if (param == PIN_CONFIG_LEVEL)
|
||||
rc = (!ie && oe);
|
||||
break;
|
||||
case PIN_CONFIG_DRIVE_PUSH_PULL:
|
||||
|
|
@ -2251,7 +2251,7 @@ static int npcm8xx_config_set_one(struct npcm8xx_pinctrl *npcm,
|
|||
iowrite32(gpio, bank->base + NPCM8XX_GP_N_OEC);
|
||||
bank->direction_input(&bank->chip.gc, pin % bank->chip.gc.ngpio);
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
bank->direction_output(&bank->chip.gc, pin % bank->chip.gc.ngpio, arg);
|
||||
iowrite32(gpio, bank->base + NPCM8XX_GP_N_OES);
|
||||
break;
|
||||
|
|
@ -2329,7 +2329,7 @@ static int npcm8xx_gpio_fw(struct npcm8xx_pinctrl *pctrl)
|
|||
if (!pctrl->gpio_bank[id].base)
|
||||
return dev_err_probe(dev, -ENXIO, "fwnode_iomap id %d failed\n", id);
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = pctrl->gpio_bank[id].base + NPCM8XX_GP_N_DIN,
|
||||
|
|
|
|||
|
|
@ -1064,7 +1064,7 @@ static int wpcm450_gpio_register(struct platform_device *pdev,
|
|||
flags = GPIO_GENERIC_NO_OUTPUT;
|
||||
}
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = dat,
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ static const struct pin_config_item conf_items[] = {
|
|||
PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT_ENABLE, "input schmitt enabled", NULL, false),
|
||||
PCONFDUMP(PIN_CONFIG_MODE_LOW_POWER, "pin low power", "mode", true),
|
||||
PCONFDUMP(PIN_CONFIG_OUTPUT_ENABLE, "output enabled", NULL, false),
|
||||
PCONFDUMP(PIN_CONFIG_OUTPUT, "pin output", "level", true),
|
||||
PCONFDUMP(PIN_CONFIG_LEVEL, "pin output", "level", true),
|
||||
PCONFDUMP(PIN_CONFIG_OUTPUT_IMPEDANCE_OHMS, "output impedance", "ohms", true),
|
||||
PCONFDUMP(PIN_CONFIG_POWER_SOURCE, "pin power source", "selector", true),
|
||||
PCONFDUMP(PIN_CONFIG_SLEEP_HARDWARE_STATE, "sleep hardware state", NULL, false),
|
||||
|
|
@ -183,9 +183,9 @@ static const struct pinconf_generic_params dt_params[] = {
|
|||
{ "low-power-enable", PIN_CONFIG_MODE_LOW_POWER, 1 },
|
||||
{ "output-disable", PIN_CONFIG_OUTPUT_ENABLE, 0 },
|
||||
{ "output-enable", PIN_CONFIG_OUTPUT_ENABLE, 1 },
|
||||
{ "output-high", PIN_CONFIG_OUTPUT, 1, },
|
||||
{ "output-high", PIN_CONFIG_LEVEL, 1, },
|
||||
{ "output-impedance-ohms", PIN_CONFIG_OUTPUT_IMPEDANCE_OHMS, 0 },
|
||||
{ "output-low", PIN_CONFIG_OUTPUT, 0, },
|
||||
{ "output-low", PIN_CONFIG_LEVEL, 0, },
|
||||
{ "power-source", PIN_CONFIG_POWER_SOURCE, 0 },
|
||||
{ "sleep-hardware-state", PIN_CONFIG_SLEEP_HARDWARE_STATE, 0 },
|
||||
{ "slew-rate", PIN_CONFIG_SLEW_RATE, 0 },
|
||||
|
|
|
|||
|
|
@ -383,14 +383,15 @@ static void amd_gpio_irq_enable(struct irq_data *d)
|
|||
unsigned long flags;
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
|
||||
irq_hw_number_t hwirq = irqd_to_hwirq(d);
|
||||
|
||||
gpiochip_enable_irq(gc, d->hwirq);
|
||||
gpiochip_enable_irq(gc, hwirq);
|
||||
|
||||
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
|
||||
pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
|
||||
pin_reg = readl(gpio_dev->base + hwirq * 4);
|
||||
pin_reg |= BIT(INTERRUPT_ENABLE_OFF);
|
||||
pin_reg |= BIT(INTERRUPT_MASK_OFF);
|
||||
writel(pin_reg, gpio_dev->base + (d->hwirq)*4);
|
||||
writel(pin_reg, gpio_dev->base + hwirq * 4);
|
||||
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
|
||||
}
|
||||
|
||||
|
|
@ -400,15 +401,16 @@ static void amd_gpio_irq_disable(struct irq_data *d)
|
|||
unsigned long flags;
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
|
||||
irq_hw_number_t hwirq = irqd_to_hwirq(d);
|
||||
|
||||
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
|
||||
pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
|
||||
pin_reg = readl(gpio_dev->base + hwirq * 4);
|
||||
pin_reg &= ~BIT(INTERRUPT_ENABLE_OFF);
|
||||
pin_reg &= ~BIT(INTERRUPT_MASK_OFF);
|
||||
writel(pin_reg, gpio_dev->base + (d->hwirq)*4);
|
||||
writel(pin_reg, gpio_dev->base + hwirq * 4);
|
||||
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
|
||||
|
||||
gpiochip_disable_irq(gc, d->hwirq);
|
||||
gpiochip_disable_irq(gc, hwirq);
|
||||
}
|
||||
|
||||
static void amd_gpio_irq_mask(struct irq_data *d)
|
||||
|
|
@ -417,11 +419,12 @@ static void amd_gpio_irq_mask(struct irq_data *d)
|
|||
unsigned long flags;
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
|
||||
irq_hw_number_t hwirq = irqd_to_hwirq(d);
|
||||
|
||||
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
|
||||
pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
|
||||
pin_reg = readl(gpio_dev->base + hwirq * 4);
|
||||
pin_reg &= ~BIT(INTERRUPT_MASK_OFF);
|
||||
writel(pin_reg, gpio_dev->base + (d->hwirq)*4);
|
||||
writel(pin_reg, gpio_dev->base + hwirq * 4);
|
||||
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
|
||||
}
|
||||
|
||||
|
|
@ -431,11 +434,12 @@ static void amd_gpio_irq_unmask(struct irq_data *d)
|
|||
unsigned long flags;
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
|
||||
irq_hw_number_t hwirq = irqd_to_hwirq(d);
|
||||
|
||||
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
|
||||
pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
|
||||
pin_reg = readl(gpio_dev->base + hwirq * 4);
|
||||
pin_reg |= BIT(INTERRUPT_MASK_OFF);
|
||||
writel(pin_reg, gpio_dev->base + (d->hwirq)*4);
|
||||
writel(pin_reg, gpio_dev->base + hwirq * 4);
|
||||
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
|
||||
}
|
||||
|
||||
|
|
@ -446,17 +450,21 @@ static int amd_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
|
|||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
|
||||
u32 wake_mask = BIT(WAKE_CNTRL_OFF_S0I3) | BIT(WAKE_CNTRL_OFF_S3);
|
||||
irq_hw_number_t hwirq = irqd_to_hwirq(d);
|
||||
int err;
|
||||
|
||||
pm_pr_dbg("Setting wake for GPIO %lu to %s\n",
|
||||
hwirq, str_enable_disable(on));
|
||||
|
||||
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
|
||||
pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
|
||||
pin_reg = readl(gpio_dev->base + hwirq * 4);
|
||||
|
||||
if (on)
|
||||
pin_reg |= wake_mask;
|
||||
else
|
||||
pin_reg &= ~wake_mask;
|
||||
|
||||
writel(pin_reg, gpio_dev->base + (d->hwirq)*4);
|
||||
writel(pin_reg, gpio_dev->base + hwirq * 4);
|
||||
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
|
||||
|
||||
if (on)
|
||||
|
|
@ -492,9 +500,10 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
|
|||
unsigned long flags;
|
||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||
struct amd_gpio *gpio_dev = gpiochip_get_data(gc);
|
||||
irq_hw_number_t hwirq = irqd_to_hwirq(d);
|
||||
|
||||
raw_spin_lock_irqsave(&gpio_dev->lock, flags);
|
||||
pin_reg = readl(gpio_dev->base + (d->hwirq)*4);
|
||||
pin_reg = readl(gpio_dev->base + hwirq * 4);
|
||||
|
||||
switch (type & IRQ_TYPE_SENSE_MASK) {
|
||||
case IRQ_TYPE_EDGE_RISING:
|
||||
|
|
@ -560,10 +569,10 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
|
|||
pin_reg_irq_en = pin_reg;
|
||||
pin_reg_irq_en |= mask;
|
||||
pin_reg_irq_en &= ~BIT(INTERRUPT_MASK_OFF);
|
||||
writel(pin_reg_irq_en, gpio_dev->base + (d->hwirq)*4);
|
||||
while ((readl(gpio_dev->base + (d->hwirq)*4) & mask) != mask)
|
||||
writel(pin_reg_irq_en, gpio_dev->base + hwirq * 4);
|
||||
while ((readl(gpio_dev->base + hwirq * 4) & mask) != mask)
|
||||
continue;
|
||||
writel(pin_reg, gpio_dev->base + (d->hwirq)*4);
|
||||
writel(pin_reg, gpio_dev->base + hwirq * 4);
|
||||
raw_spin_unlock_irqrestore(&gpio_dev->lock, flags);
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -862,7 +862,7 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev,
|
|||
conf |= ATMEL_PIO_IFSCEN_MASK;
|
||||
}
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
conf |= ATMEL_PIO_DIR_MASK;
|
||||
bank = ATMEL_PIO_BANK(pin_id);
|
||||
pin = ATMEL_PIO_LINE(pin_id);
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ static int aw9523_pcfg_param_to_reg(enum pin_config_param pcp, int pin, u8 *r)
|
|||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
reg = AW9523_REG_CONF_STATE(pin);
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
reg = AW9523_REG_OUT_STATE(pin);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -249,7 +249,7 @@ static int aw9523_pconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
switch (param) {
|
||||
case PIN_CONFIG_BIAS_PULL_UP:
|
||||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
val &= BIT(regbit);
|
||||
break;
|
||||
case PIN_CONFIG_BIAS_PULL_DOWN:
|
||||
|
|
@ -301,7 +301,7 @@ static int aw9523_pconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
goto end;
|
||||
|
||||
switch (param) {
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
/* First, enable pin output */
|
||||
rc = regmap_update_bits(awi->regmap,
|
||||
AW9523_REG_CONF_STATE(pin),
|
||||
|
|
|
|||
|
|
@ -808,7 +808,7 @@ static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip,
|
|||
case PIN_CONFIG_MODE_PWM:
|
||||
reg = CY8C95X0_SELPWM;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
reg = CY8C95X0_OUTPUT;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
|
|
|
|||
|
|
@ -634,7 +634,7 @@ static int eic7700_pinctrl_probe(struct platform_device *pdev)
|
|||
return PTR_ERR(pc->base);
|
||||
|
||||
regulator = devm_regulator_get(dev, "vrgmii");
|
||||
if (IS_ERR_OR_NULL(regulator)) {
|
||||
if (IS_ERR(regulator)) {
|
||||
return dev_err_probe(dev, PTR_ERR(regulator),
|
||||
"failed to get vrgmii regulator\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ static int gpiolib_reg(struct eqbr_pinctrl_drv_data *drvdata)
|
|||
}
|
||||
raw_spin_lock_init(&gctrl->lock);
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = gctrl->bank->nr_pins / 8,
|
||||
.dat = gctrl->membase + GPIO_IN,
|
||||
|
|
@ -325,7 +325,7 @@ static int eqbr_pinmux_set_mux(struct pinctrl_dev *pctldev,
|
|||
unsigned int selector, unsigned int group)
|
||||
{
|
||||
struct eqbr_pinctrl_drv_data *pctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
struct function_desc *func;
|
||||
const struct function_desc *func;
|
||||
struct group_desc *grp;
|
||||
unsigned int *pinmux;
|
||||
int i;
|
||||
|
|
@ -445,7 +445,7 @@ static int eqbr_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
}
|
||||
raw_spin_unlock_irqrestore(&pctl->lock, flags);
|
||||
*config = pinconf_to_config_packed(param, val);
|
||||
;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -96,11 +96,8 @@
|
|||
.data = (void *)func, \
|
||||
}
|
||||
|
||||
#define INGENIC_PIN_FUNCTION(_name_, id) \
|
||||
{ \
|
||||
.func = PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_groups)), \
|
||||
.data = NULL, \
|
||||
}
|
||||
#define INGENIC_PIN_FUNCTION(_name_, id) \
|
||||
PINCTRL_PINFUNCTION(_name_, id##_groups, ARRAY_SIZE(id##_groups))
|
||||
|
||||
enum jz_version {
|
||||
ID_JZ4730,
|
||||
|
|
@ -128,7 +125,7 @@ struct ingenic_chip_info {
|
|||
const struct group_desc *groups;
|
||||
unsigned int num_groups;
|
||||
|
||||
const struct function_desc *functions;
|
||||
const struct pinfunction *functions;
|
||||
unsigned int num_functions;
|
||||
|
||||
const u32 *pull_ups, *pull_downs;
|
||||
|
|
@ -263,7 +260,7 @@ static const char *jz4730_pwm1_groups[] = { "pwm1", };
|
|||
static const char *jz4730_mii_groups[] = { "mii", };
|
||||
static const char *jz4730_i2s_groups[] = { "i2s-data", "i2s-master", "i2s-slave", };
|
||||
|
||||
static const struct function_desc jz4730_functions[] = {
|
||||
static const struct pinfunction jz4730_functions[] = {
|
||||
INGENIC_PIN_FUNCTION("mmc", jz4730_mmc),
|
||||
INGENIC_PIN_FUNCTION("uart0", jz4730_uart0),
|
||||
INGENIC_PIN_FUNCTION("uart1", jz4730_uart1),
|
||||
|
|
@ -370,7 +367,7 @@ static const char *jz4740_pwm5_groups[] = { "pwm5", };
|
|||
static const char *jz4740_pwm6_groups[] = { "pwm6", };
|
||||
static const char *jz4740_pwm7_groups[] = { "pwm7", };
|
||||
|
||||
static const struct function_desc jz4740_functions[] = {
|
||||
static const struct pinfunction jz4740_functions[] = {
|
||||
INGENIC_PIN_FUNCTION("mmc", jz4740_mmc),
|
||||
INGENIC_PIN_FUNCTION("uart0", jz4740_uart0),
|
||||
INGENIC_PIN_FUNCTION("uart1", jz4740_uart1),
|
||||
|
|
@ -474,7 +471,7 @@ static const char *jz4725b_pwm3_groups[] = { "pwm3", };
|
|||
static const char *jz4725b_pwm4_groups[] = { "pwm4", };
|
||||
static const char *jz4725b_pwm5_groups[] = { "pwm5", };
|
||||
|
||||
static const struct function_desc jz4725b_functions[] = {
|
||||
static const struct pinfunction jz4725b_functions[] = {
|
||||
INGENIC_PIN_FUNCTION("mmc0", jz4725b_mmc0),
|
||||
INGENIC_PIN_FUNCTION("mmc1", jz4725b_mmc1),
|
||||
INGENIC_PIN_FUNCTION("uart", jz4725b_uart),
|
||||
|
|
@ -606,7 +603,7 @@ static const char *jz4750_pwm3_groups[] = { "pwm3", };
|
|||
static const char *jz4750_pwm4_groups[] = { "pwm4", };
|
||||
static const char *jz4750_pwm5_groups[] = { "pwm5", };
|
||||
|
||||
static const struct function_desc jz4750_functions[] = {
|
||||
static const struct pinfunction jz4750_functions[] = {
|
||||
INGENIC_PIN_FUNCTION("uart0", jz4750_uart0),
|
||||
INGENIC_PIN_FUNCTION("uart1", jz4750_uart1),
|
||||
INGENIC_PIN_FUNCTION("uart2", jz4750_uart2),
|
||||
|
|
@ -771,7 +768,7 @@ static const char *jz4755_pwm3_groups[] = { "pwm3", };
|
|||
static const char *jz4755_pwm4_groups[] = { "pwm4", };
|
||||
static const char *jz4755_pwm5_groups[] = { "pwm5", };
|
||||
|
||||
static const struct function_desc jz4755_functions[] = {
|
||||
static const struct pinfunction jz4755_functions[] = {
|
||||
INGENIC_PIN_FUNCTION("uart0", jz4755_uart0),
|
||||
INGENIC_PIN_FUNCTION("uart1", jz4755_uart1),
|
||||
INGENIC_PIN_FUNCTION("uart2", jz4755_uart2),
|
||||
|
|
@ -1106,7 +1103,7 @@ static const char *jz4760_pwm6_groups[] = { "pwm6", };
|
|||
static const char *jz4760_pwm7_groups[] = { "pwm7", };
|
||||
static const char *jz4760_otg_groups[] = { "otg-vbus", };
|
||||
|
||||
static const struct function_desc jz4760_functions[] = {
|
||||
static const struct pinfunction jz4760_functions[] = {
|
||||
INGENIC_PIN_FUNCTION("uart0", jz4760_uart0),
|
||||
INGENIC_PIN_FUNCTION("uart1", jz4760_uart1),
|
||||
INGENIC_PIN_FUNCTION("uart2", jz4760_uart2),
|
||||
|
|
@ -1444,7 +1441,7 @@ static const char *jz4770_pwm6_groups[] = { "pwm6", };
|
|||
static const char *jz4770_pwm7_groups[] = { "pwm7", };
|
||||
static const char *jz4770_mac_groups[] = { "mac-rmii", "mac-mii", };
|
||||
|
||||
static const struct function_desc jz4770_functions[] = {
|
||||
static const struct pinfunction jz4770_functions[] = {
|
||||
INGENIC_PIN_FUNCTION("uart0", jz4770_uart0),
|
||||
INGENIC_PIN_FUNCTION("uart1", jz4770_uart1),
|
||||
INGENIC_PIN_FUNCTION("uart2", jz4770_uart2),
|
||||
|
|
@ -1723,7 +1720,7 @@ static const char *jz4775_mac_groups[] = {
|
|||
};
|
||||
static const char *jz4775_otg_groups[] = { "otg-vbus", };
|
||||
|
||||
static const struct function_desc jz4775_functions[] = {
|
||||
static const struct pinfunction jz4775_functions[] = {
|
||||
INGENIC_PIN_FUNCTION("uart0", jz4775_uart0),
|
||||
INGENIC_PIN_FUNCTION("uart1", jz4775_uart1),
|
||||
INGENIC_PIN_FUNCTION("uart2", jz4775_uart2),
|
||||
|
|
@ -1976,7 +1973,7 @@ static const char *jz4780_dmic_groups[] = { "dmic", };
|
|||
static const char *jz4780_cim_groups[] = { "cim-data", };
|
||||
static const char *jz4780_hdmi_ddc_groups[] = { "hdmi-ddc", };
|
||||
|
||||
static const struct function_desc jz4780_functions[] = {
|
||||
static const struct pinfunction jz4780_functions[] = {
|
||||
INGENIC_PIN_FUNCTION("uart0", jz4770_uart0),
|
||||
INGENIC_PIN_FUNCTION("uart1", jz4770_uart1),
|
||||
INGENIC_PIN_FUNCTION("uart2", jz4780_uart2),
|
||||
|
|
@ -2211,7 +2208,7 @@ static const char *x1000_pwm3_groups[] = { "pwm3", };
|
|||
static const char *x1000_pwm4_groups[] = { "pwm4", };
|
||||
static const char *x1000_mac_groups[] = { "mac", };
|
||||
|
||||
static const struct function_desc x1000_functions[] = {
|
||||
static const struct pinfunction x1000_functions[] = {
|
||||
INGENIC_PIN_FUNCTION("uart0", x1000_uart0),
|
||||
INGENIC_PIN_FUNCTION("uart1", x1000_uart1),
|
||||
INGENIC_PIN_FUNCTION("uart2", x1000_uart2),
|
||||
|
|
@ -2341,7 +2338,7 @@ static const char *x1500_pwm2_groups[] = { "pwm2", };
|
|||
static const char *x1500_pwm3_groups[] = { "pwm3", };
|
||||
static const char *x1500_pwm4_groups[] = { "pwm4", };
|
||||
|
||||
static const struct function_desc x1500_functions[] = {
|
||||
static const struct pinfunction x1500_functions[] = {
|
||||
INGENIC_PIN_FUNCTION("uart0", x1500_uart0),
|
||||
INGENIC_PIN_FUNCTION("uart1", x1500_uart1),
|
||||
INGENIC_PIN_FUNCTION("uart2", x1500_uart2),
|
||||
|
|
@ -2562,7 +2559,7 @@ static const char * const x1600_pwm7_groups[] = { "pwm7-b10", "pwm7-b21", };
|
|||
|
||||
static const char * const x1600_mac_groups[] = { "mac", };
|
||||
|
||||
static const struct function_desc x1600_functions[] = {
|
||||
static const struct pinfunction x1600_functions[] = {
|
||||
INGENIC_PIN_FUNCTION("uart0", x1600_uart0),
|
||||
INGENIC_PIN_FUNCTION("uart1", x1600_uart1),
|
||||
INGENIC_PIN_FUNCTION("uart2", x1600_uart2),
|
||||
|
|
@ -2779,7 +2776,7 @@ static const char *x1830_pwm6_groups[] = { "pwm6-c-17", "pwm6-c-27", };
|
|||
static const char *x1830_pwm7_groups[] = { "pwm7-c-18", "pwm7-c-28", };
|
||||
static const char *x1830_mac_groups[] = { "mac", };
|
||||
|
||||
static const struct function_desc x1830_functions[] = {
|
||||
static const struct pinfunction x1830_functions[] = {
|
||||
INGENIC_PIN_FUNCTION("uart0", x1830_uart0),
|
||||
INGENIC_PIN_FUNCTION("uart1", x1830_uart1),
|
||||
INGENIC_PIN_FUNCTION("sfc", x1830_sfc),
|
||||
|
|
@ -3225,7 +3222,7 @@ static const char *x2000_mac0_groups[] = { "mac0-rmii", "mac0-rgmii", };
|
|||
static const char *x2000_mac1_groups[] = { "mac1-rmii", "mac1-rgmii", };
|
||||
static const char *x2000_otg_groups[] = { "otg-vbus", };
|
||||
|
||||
static const struct function_desc x2000_functions[] = {
|
||||
static const struct pinfunction x2000_functions[] = {
|
||||
INGENIC_PIN_FUNCTION("uart0", x2000_uart0),
|
||||
INGENIC_PIN_FUNCTION("uart1", x2000_uart1),
|
||||
INGENIC_PIN_FUNCTION("uart2", x2000_uart2),
|
||||
|
|
@ -3449,7 +3446,7 @@ static const struct group_desc x2100_groups[] = {
|
|||
|
||||
static const char *x2100_mac_groups[] = { "mac", };
|
||||
|
||||
static const struct function_desc x2100_functions[] = {
|
||||
static const struct pinfunction x2100_functions[] = {
|
||||
INGENIC_PIN_FUNCTION("uart0", x2000_uart0),
|
||||
INGENIC_PIN_FUNCTION("uart1", x2000_uart1),
|
||||
INGENIC_PIN_FUNCTION("uart2", x2000_uart2),
|
||||
|
|
@ -4003,7 +4000,7 @@ static int ingenic_pinmux_set_mux(struct pinctrl_dev *pctldev,
|
|||
unsigned int selector, unsigned int group)
|
||||
{
|
||||
struct ingenic_pinctrl *jzpc = pinctrl_dev_get_drvdata(pctldev);
|
||||
struct function_desc *func;
|
||||
const struct function_desc *func;
|
||||
struct group_desc *grp;
|
||||
unsigned int i;
|
||||
uintptr_t mode;
|
||||
|
|
@ -4018,7 +4015,7 @@ static int ingenic_pinmux_set_mux(struct pinctrl_dev *pctldev,
|
|||
return -EINVAL;
|
||||
|
||||
dev_dbg(pctldev->dev, "enable function %s group %s\n",
|
||||
func->func.name, grp->grp.name);
|
||||
func->func->name, grp->grp.name);
|
||||
|
||||
mode = (uintptr_t)grp->data;
|
||||
if (mode <= 3) {
|
||||
|
|
@ -4267,7 +4264,7 @@ static int ingenic_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
case PIN_CONFIG_BIAS_PULL_UP:
|
||||
case PIN_CONFIG_BIAS_PULL_DOWN:
|
||||
case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
case PIN_CONFIG_SLEW_RATE:
|
||||
continue;
|
||||
default:
|
||||
|
|
@ -4308,7 +4305,7 @@ static int ingenic_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
ingenic_set_schmitt_trigger(jzpc, pin, arg);
|
||||
break;
|
||||
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
ret = pinctrl_gpio_direction_output(jzpc->gc,
|
||||
pin - jzpc->gc->base);
|
||||
if (ret)
|
||||
|
|
@ -4571,11 +4568,9 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
for (i = 0; i < chip_info->num_functions; i++) {
|
||||
const struct function_desc *function = &chip_info->functions[i];
|
||||
const struct pinfunction *func = &function->func;
|
||||
const struct pinfunction *func = &chip_info->functions[i];
|
||||
|
||||
err = pinmux_generic_add_pinfunction(jzpc->pctl, func,
|
||||
function->data);
|
||||
err = pinmux_generic_add_pinfunction(jzpc->pctl, func, NULL);
|
||||
if (err < 0) {
|
||||
dev_err(dev, "Failed to register function %s\n", func->name);
|
||||
return err;
|
||||
|
|
|
|||
|
|
@ -551,7 +551,7 @@ static int k210_pinconf_set_param(struct pinctrl_dev *pctldev,
|
|||
else
|
||||
val &= ~K210_PC_ST;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
k210_pinmux_set_pin_function(pctldev, pin, K210_PCF_CONSTANT);
|
||||
val = readl(&pdata->fpioa->pins[pin]);
|
||||
val |= K210_PC_MODE_OUT;
|
||||
|
|
|
|||
|
|
@ -135,6 +135,11 @@ struct keembay_pin_soc {
|
|||
const struct pinctrl_pin_desc *pins;
|
||||
};
|
||||
|
||||
struct keembay_pinfunction {
|
||||
struct pinfunction func;
|
||||
u8 mux_mode;
|
||||
};
|
||||
|
||||
static const struct pinctrl_pin_desc keembay_pins[] = {
|
||||
KEEMBAY_PIN_DESC(0, "GPIO0",
|
||||
KEEMBAY_MUX(0x0, "I2S0_M0"),
|
||||
|
|
@ -930,7 +935,7 @@ static int keembay_set_mux(struct pinctrl_dev *pctldev, unsigned int fun_sel,
|
|||
unsigned int grp_sel)
|
||||
{
|
||||
struct keembay_pinctrl *kpc = pinctrl_dev_get_drvdata(pctldev);
|
||||
struct function_desc *func;
|
||||
const struct function_desc *func;
|
||||
struct group_desc *grp;
|
||||
unsigned int val;
|
||||
u8 pin_mode;
|
||||
|
|
@ -1556,13 +1561,13 @@ static int keembay_pinctrl_reg(struct keembay_pinctrl *kpc, struct device *dev)
|
|||
}
|
||||
|
||||
static int keembay_add_functions(struct keembay_pinctrl *kpc,
|
||||
struct function_desc *functions)
|
||||
struct keembay_pinfunction *functions)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
/* Assign the groups for each function */
|
||||
for (i = 0; i < kpc->nfuncs; i++) {
|
||||
struct function_desc *func = &functions[i];
|
||||
struct keembay_pinfunction *func = &functions[i];
|
||||
const char **group_names;
|
||||
unsigned int grp_idx = 0;
|
||||
int j;
|
||||
|
|
@ -1588,14 +1593,14 @@ static int keembay_add_functions(struct keembay_pinctrl *kpc,
|
|||
/* Add all functions */
|
||||
for (i = 0; i < kpc->nfuncs; i++)
|
||||
pinmux_generic_add_pinfunction(kpc->pctrl, &functions[i].func,
|
||||
functions[i].data);
|
||||
&functions[i].mux_mode);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int keembay_build_functions(struct keembay_pinctrl *kpc)
|
||||
{
|
||||
struct function_desc *keembay_funcs, *new_funcs;
|
||||
struct keembay_pinfunction *keembay_funcs, *new_funcs;
|
||||
int i;
|
||||
|
||||
/*
|
||||
|
|
@ -1603,7 +1608,8 @@ static int keembay_build_functions(struct keembay_pinctrl *kpc)
|
|||
* being part of 8 (hw maximum) globally unique muxes.
|
||||
*/
|
||||
kpc->nfuncs = 0;
|
||||
keembay_funcs = kcalloc(kpc->npins * 8, sizeof(*keembay_funcs), GFP_KERNEL);
|
||||
keembay_funcs = devm_kcalloc(kpc->dev, kpc->npins * 8,
|
||||
sizeof(*keembay_funcs), GFP_KERNEL);
|
||||
if (!keembay_funcs)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -1613,7 +1619,7 @@ static int keembay_build_functions(struct keembay_pinctrl *kpc)
|
|||
struct keembay_mux_desc *mux;
|
||||
|
||||
for (mux = pdesc->drv_data; mux->name; mux++) {
|
||||
struct function_desc *fdesc;
|
||||
struct keembay_pinfunction *fdesc;
|
||||
|
||||
/* Check if we already have function for this mux */
|
||||
for (fdesc = keembay_funcs; fdesc->func.name; fdesc++) {
|
||||
|
|
@ -1627,18 +1633,18 @@ static int keembay_build_functions(struct keembay_pinctrl *kpc)
|
|||
if (!fdesc->func.name) {
|
||||
fdesc->func.name = mux->name;
|
||||
fdesc->func.ngroups = 1;
|
||||
fdesc->data = &mux->mode;
|
||||
fdesc->mux_mode = mux->mode;
|
||||
kpc->nfuncs++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Reallocate memory based on actual number of functions */
|
||||
new_funcs = krealloc(keembay_funcs, kpc->nfuncs * sizeof(*new_funcs), GFP_KERNEL);
|
||||
if (!new_funcs) {
|
||||
kfree(keembay_funcs);
|
||||
new_funcs = devm_krealloc_array(kpc->dev, keembay_funcs,
|
||||
kpc->nfuncs, sizeof(*new_funcs),
|
||||
GFP_KERNEL);
|
||||
if (!new_funcs)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
return keembay_add_functions(kpc, new_funcs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -371,7 +371,7 @@ static int sgpio_pinconf_get(struct pinctrl_dev *pctldev,
|
|||
val = !bank->is_input;
|
||||
break;
|
||||
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
if (bank->is_input)
|
||||
return -EINVAL;
|
||||
val = sgpio_output_get(priv, &addr);
|
||||
|
|
@ -402,7 +402,7 @@ static int sgpio_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
arg = pinconf_to_config_argument(configs[cfg]);
|
||||
|
||||
switch (param) {
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
if (bank->is_input)
|
||||
return -EINVAL;
|
||||
err = sgpio_output_set(priv, &addr, arg);
|
||||
|
|
@ -824,7 +824,7 @@ static int microchip_sgpio_register_bank(struct device *dev,
|
|||
pctl_desc->confops = &sgpio_confops;
|
||||
pctl_desc->owner = THIS_MODULE;
|
||||
|
||||
pins = devm_kzalloc(dev, sizeof(*pins)*ngpios, GFP_KERNEL);
|
||||
pins = devm_kcalloc(dev, ngpios, sizeof(*pins), GFP_KERNEL);
|
||||
if (!pins)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -1656,7 +1656,7 @@ static int ocelot_pinconf_get(struct pinctrl_dev *pctldev,
|
|||
return err;
|
||||
break;
|
||||
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
err = regmap_read(info->map, REG(OCELOT_GPIO_OUT, info, pin),
|
||||
&val);
|
||||
if (err)
|
||||
|
|
@ -1735,7 +1735,7 @@ static int ocelot_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
|
||||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
p = pin % 32;
|
||||
if (arg)
|
||||
regmap_write(info->map,
|
||||
|
|
|
|||
|
|
@ -1905,7 +1905,7 @@ static int pic32_pinconf_get(struct pinctrl_dev *pctldev, unsigned pin,
|
|||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
arg = !!(readl(bank->reg_base + TRIS_REG) & mask);
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
arg = !(readl(bank->reg_base + TRIS_REG) & mask);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -1960,7 +1960,7 @@ static int pic32_pinconf_set(struct pinctrl_dev *pctldev, unsigned pin,
|
|||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
pic32_gpio_direction_input(&bank->gpio_chip, offset);
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
pic32_gpio_direction_output(&bank->gpio_chip,
|
||||
offset, arg);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -541,7 +541,7 @@ static int rk805_pinconf_get(struct pinctrl_dev *pctldev,
|
|||
u32 arg = 0;
|
||||
|
||||
switch (param) {
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
arg = rk805_gpio_get(&pci->gpio_chip, pin);
|
||||
break;
|
||||
|
|
@ -568,7 +568,7 @@ static int rk805_pinconf_set(struct pinctrl_dev *pctldev,
|
|||
arg = pinconf_to_config_argument(configs[i]);
|
||||
|
||||
switch (param) {
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
rk805_gpio_set(&pci->gpio_chip, pin, arg);
|
||||
rk805_pmx_gpio_set_direction(pctldev, NULL, pin, false);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -3272,7 +3272,7 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
param = pinconf_to_config_param(configs[i]);
|
||||
arg = pinconf_to_config_argument(configs[i]);
|
||||
|
||||
if (param == PIN_CONFIG_OUTPUT || param == PIN_CONFIG_INPUT_ENABLE) {
|
||||
if (param == PIN_CONFIG_LEVEL || param == PIN_CONFIG_INPUT_ENABLE) {
|
||||
/*
|
||||
* Check for gpio driver not being probed yet.
|
||||
* The lock makes sure that either gpio-probe has completed
|
||||
|
|
@ -3313,7 +3313,7 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
if (rc)
|
||||
return rc;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
rc = rockchip_set_mux(bank, pin - bank->pin_base,
|
||||
RK_FUNC_GPIO);
|
||||
if (rc != RK_FUNC_GPIO)
|
||||
|
|
@ -3392,7 +3392,7 @@ static int rockchip_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
|
||||
arg = 1;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
rc = rockchip_get_mux(bank, pin - bank->pin_base);
|
||||
if (rc != RK_FUNC_GPIO)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -1440,7 +1440,7 @@ static int rp1_pinconf_set(struct pinctrl_dev *pctldev, unsigned int offset,
|
|||
rp1_output_enable(pin, arg);
|
||||
break;
|
||||
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
rp1_set_value(pin, arg);
|
||||
rp1_set_dir(pin, RP1_DIR_OUTPUT);
|
||||
rp1_set_fsel(pin, RP1_FSEL_GPIO);
|
||||
|
|
@ -1623,12 +1623,94 @@ MODULE_DEVICE_TABLE(of, rp1_pinctrl_match);
|
|||
|
||||
static struct rp1_pinctrl rp1_pinctrl_data = {};
|
||||
|
||||
static const struct regmap_config rp1_pinctrl_regmap_cfg = {
|
||||
static const struct regmap_range rp1_gpio_reg_ranges[] = {
|
||||
/* BANK 0 */
|
||||
regmap_reg_range(0x2004, 0x20dc),
|
||||
regmap_reg_range(0x3004, 0x30dc),
|
||||
regmap_reg_range(0x0004, 0x00dc),
|
||||
regmap_reg_range(0x0124, 0x0124),
|
||||
regmap_reg_range(0x211c, 0x211c),
|
||||
regmap_reg_range(0x311c, 0x311c),
|
||||
/* BANK 1 */
|
||||
regmap_reg_range(0x6004, 0x602c),
|
||||
regmap_reg_range(0x7004, 0x702c),
|
||||
regmap_reg_range(0x4004, 0x402c),
|
||||
regmap_reg_range(0x4124, 0x4124),
|
||||
regmap_reg_range(0x611c, 0x611c),
|
||||
regmap_reg_range(0x711c, 0x711c),
|
||||
/* BANK 2 */
|
||||
regmap_reg_range(0xa004, 0xa09c),
|
||||
regmap_reg_range(0xb004, 0xb09c),
|
||||
regmap_reg_range(0x8004, 0x809c),
|
||||
regmap_reg_range(0x8124, 0x8124),
|
||||
regmap_reg_range(0xa11c, 0xa11c),
|
||||
regmap_reg_range(0xb11c, 0xb11c),
|
||||
};
|
||||
|
||||
static const struct regmap_range rp1_rio_reg_ranges[] = {
|
||||
/* BANK 0 */
|
||||
regmap_reg_range(0x2000, 0x2004),
|
||||
regmap_reg_range(0x3000, 0x3004),
|
||||
regmap_reg_range(0x0004, 0x0008),
|
||||
/* BANK 1 */
|
||||
regmap_reg_range(0x6000, 0x6004),
|
||||
regmap_reg_range(0x7000, 0x7004),
|
||||
regmap_reg_range(0x4004, 0x4008),
|
||||
/* BANK 2 */
|
||||
regmap_reg_range(0xa000, 0xa004),
|
||||
regmap_reg_range(0xb000, 0xb004),
|
||||
regmap_reg_range(0x8004, 0x8008),
|
||||
};
|
||||
|
||||
static const struct regmap_range rp1_pads_reg_ranges[] = {
|
||||
/* BANK 0 */
|
||||
regmap_reg_range(0x0004, 0x0070),
|
||||
/* BANK 1 */
|
||||
regmap_reg_range(0x4004, 0x4018),
|
||||
/* BANK 2 */
|
||||
regmap_reg_range(0x8004, 0x8050),
|
||||
};
|
||||
|
||||
static const struct regmap_access_table rp1_gpio_reg_table = {
|
||||
.yes_ranges = rp1_gpio_reg_ranges,
|
||||
.n_yes_ranges = ARRAY_SIZE(rp1_gpio_reg_ranges),
|
||||
};
|
||||
|
||||
static const struct regmap_access_table rp1_rio_reg_table = {
|
||||
.yes_ranges = rp1_rio_reg_ranges,
|
||||
.n_yes_ranges = ARRAY_SIZE(rp1_rio_reg_ranges),
|
||||
};
|
||||
|
||||
static const struct regmap_access_table rp1_pads_reg_table = {
|
||||
.yes_ranges = rp1_pads_reg_ranges,
|
||||
.n_yes_ranges = ARRAY_SIZE(rp1_pads_reg_ranges),
|
||||
};
|
||||
|
||||
static const struct regmap_config rp1_pinctrl_gpio_regmap_cfg = {
|
||||
.reg_bits = 32,
|
||||
.val_bits = 32,
|
||||
.reg_stride = 4,
|
||||
.fast_io = true,
|
||||
.name = "rp1-pinctrl",
|
||||
.rd_table = &rp1_gpio_reg_table,
|
||||
.name = "rp1-gpio",
|
||||
.max_register = 0xb11c,
|
||||
};
|
||||
|
||||
static const struct regmap_config rp1_pinctrl_rio_regmap_cfg = {
|
||||
.reg_bits = 32,
|
||||
.val_bits = 32,
|
||||
.reg_stride = 4,
|
||||
.rd_table = &rp1_rio_reg_table,
|
||||
.name = "rp1-rio",
|
||||
.max_register = 0xb004,
|
||||
};
|
||||
|
||||
static const struct regmap_config rp1_pinctrl_pads_regmap_cfg = {
|
||||
.reg_bits = 32,
|
||||
.val_bits = 32,
|
||||
.reg_stride = 4,
|
||||
.rd_table = &rp1_pads_reg_table,
|
||||
.name = "rp1-pads",
|
||||
.max_register = 0x8050,
|
||||
};
|
||||
|
||||
static int rp1_gen_regfield(struct device *dev,
|
||||
|
|
@ -1685,17 +1767,17 @@ static int rp1_pinctrl_probe(struct platform_device *pdev)
|
|||
return dev_err_probe(dev, PTR_ERR(pc->pads_base), "could not get PADS IO memory\n");
|
||||
|
||||
gpio_regmap = devm_regmap_init_mmio(dev, pc->gpio_base,
|
||||
&rp1_pinctrl_regmap_cfg);
|
||||
&rp1_pinctrl_gpio_regmap_cfg);
|
||||
if (IS_ERR(gpio_regmap))
|
||||
return dev_err_probe(dev, PTR_ERR(gpio_regmap), "could not init GPIO regmap\n");
|
||||
|
||||
rio_regmap = devm_regmap_init_mmio(dev, pc->rio_base,
|
||||
&rp1_pinctrl_regmap_cfg);
|
||||
&rp1_pinctrl_rio_regmap_cfg);
|
||||
if (IS_ERR(rio_regmap))
|
||||
return dev_err_probe(dev, PTR_ERR(rio_regmap), "could not init RIO regmap\n");
|
||||
|
||||
pads_regmap = devm_regmap_init_mmio(dev, pc->pads_base,
|
||||
&rp1_pinctrl_regmap_cfg);
|
||||
&rp1_pinctrl_pads_regmap_cfg);
|
||||
if (IS_ERR(pads_regmap))
|
||||
return dev_err_probe(dev, PTR_ERR(pads_regmap), "could not init PADS regmap\n");
|
||||
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ static int pinctrl_scmi_map_pinconf_type(enum pin_config_param param,
|
|||
case PIN_CONFIG_MODE_LOW_POWER:
|
||||
*type = SCMI_PIN_LOW_POWER_MODE;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
*type = SCMI_PIN_OUTPUT_VALUE;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ static int pcs_get_function(struct pinctrl_dev *pctldev, unsigned pin,
|
|||
struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev);
|
||||
struct pin_desc *pdesc = pin_desc_get(pctldev, pin);
|
||||
const struct pinctrl_setting_mux *setting;
|
||||
struct function_desc *function;
|
||||
const struct function_desc *function;
|
||||
unsigned fselector;
|
||||
|
||||
/* If pin is not described in DTS & enabled, mux_setting is NULL. */
|
||||
|
|
@ -360,7 +360,7 @@ static int pcs_set_mux(struct pinctrl_dev *pctldev, unsigned fselector,
|
|||
unsigned group)
|
||||
{
|
||||
struct pcs_device *pcs;
|
||||
struct function_desc *function;
|
||||
const struct function_desc *function;
|
||||
struct pcs_function *func;
|
||||
int i;
|
||||
|
||||
|
|
@ -589,8 +589,10 @@ static int pcs_pinconf_set(struct pinctrl_dev *pctldev,
|
|||
/* 4 parameters */
|
||||
case PIN_CONFIG_BIAS_PULL_DOWN:
|
||||
case PIN_CONFIG_BIAS_PULL_UP:
|
||||
if (arg)
|
||||
if (arg) {
|
||||
pcs_pinconf_clear_bias(pctldev, pin);
|
||||
data = pcs->read(pcs->base + offset);
|
||||
}
|
||||
fallthrough;
|
||||
case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
|
||||
data &= ~func->conf[i].mask;
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ static int stmfx_pinconf_get(struct pinctrl_dev *pctldev,
|
|||
if ((!dir && !type) || (dir && type))
|
||||
arg = 1;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
if (dir)
|
||||
return -EINVAL;
|
||||
|
||||
|
|
@ -334,7 +334,7 @@ static int stmfx_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
if (ret)
|
||||
return ret;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
ret = stmfx_gpio_direction_output(&pctl->gpio_chip,
|
||||
pin, arg);
|
||||
if (ret)
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ static int sx150x_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
if (sx150x_pin_is_oscio(pctl, pin)) {
|
||||
switch (param) {
|
||||
case PIN_CONFIG_DRIVE_PUSH_PULL:
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
ret = regmap_read(pctl->regmap,
|
||||
pctl->data->pri.x789.reg_clock,
|
||||
&data);
|
||||
|
|
@ -705,7 +705,7 @@ static int sx150x_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
}
|
||||
break;
|
||||
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
ret = sx150x_gpio_get_direction(&pctl->gpio, pin);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
|
@ -744,7 +744,7 @@ static int sx150x_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
arg = pinconf_to_config_argument(configs[i]);
|
||||
|
||||
if (sx150x_pin_is_oscio(pctl, pin)) {
|
||||
if (param == PIN_CONFIG_OUTPUT) {
|
||||
if (param == PIN_CONFIG_LEVEL) {
|
||||
ret = sx150x_gpio_direction_output(&pctl->gpio,
|
||||
pin, arg);
|
||||
if (ret < 0)
|
||||
|
|
@ -816,7 +816,7 @@ static int sx150x_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
|
||||
break;
|
||||
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
ret = sx150x_gpio_direction_output(&pctl->gpio,
|
||||
pin, arg);
|
||||
if (ret < 0)
|
||||
|
|
@ -863,6 +863,7 @@ static const struct of_device_id sx150x_of_match[] = {
|
|||
{ .compatible = "semtech,sx1509q", .data = &sx1509q_device_data },
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, sx150x_of_match);
|
||||
|
||||
static int sx150x_reset(struct sx150x_pinctrl *pctl)
|
||||
{
|
||||
|
|
@ -1266,3 +1267,6 @@ static int __init sx150x_init(void)
|
|||
return i2c_add_driver(&sx150x_driver);
|
||||
}
|
||||
subsys_initcall(sx150x_init);
|
||||
|
||||
MODULE_DESCRIPTION("Semtech SX150x I2C GPIO expander pinctrl driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
|
|
|||
1070
drivers/pinctrl/pinctrl-upboard.c
Normal file
1070
drivers/pinctrl/pinctrl-upboard.c
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -919,7 +919,7 @@ static int versal_pinctrl_prepare_pin_desc(struct device *dev,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
pins = devm_kzalloc(dev, sizeof(*pins) * *npins, GFP_KERNEL);
|
||||
pins = devm_kcalloc(dev, *npins, sizeof(*pins), GFP_KERNEL);
|
||||
if (!pins)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -89,13 +89,20 @@ bool pinmux_can_be_used_for_gpio(struct pinctrl_dev *pctldev, unsigned int pin)
|
|||
{
|
||||
struct pin_desc *desc = pin_desc_get(pctldev, pin);
|
||||
const struct pinmux_ops *ops = pctldev->desc->pmxops;
|
||||
const struct pinctrl_setting_mux *mux_setting;
|
||||
bool func_is_gpio = false;
|
||||
|
||||
/* Can't inspect pin, assume it can be used */
|
||||
if (!desc || !ops)
|
||||
return true;
|
||||
|
||||
mux_setting = desc->mux_setting;
|
||||
|
||||
guard(mutex)(&desc->mux_lock);
|
||||
if (ops->strict && desc->mux_usecount)
|
||||
if (mux_setting && ops->function_is_gpio)
|
||||
func_is_gpio = ops->function_is_gpio(pctldev, mux_setting->func);
|
||||
|
||||
if (ops->strict && desc->mux_usecount && !func_is_gpio)
|
||||
return false;
|
||||
|
||||
return !(ops->strict && !!desc->gpio_owner);
|
||||
|
|
@ -116,7 +123,9 @@ static int pin_request(struct pinctrl_dev *pctldev,
|
|||
{
|
||||
struct pin_desc *desc;
|
||||
const struct pinmux_ops *ops = pctldev->desc->pmxops;
|
||||
const struct pinctrl_setting_mux *mux_setting;
|
||||
int status = -EINVAL;
|
||||
bool gpio_ok = false;
|
||||
|
||||
desc = pin_desc_get(pctldev, pin);
|
||||
if (desc == NULL) {
|
||||
|
|
@ -126,11 +135,21 @@ static int pin_request(struct pinctrl_dev *pctldev,
|
|||
goto out;
|
||||
}
|
||||
|
||||
mux_setting = desc->mux_setting;
|
||||
|
||||
dev_dbg(pctldev->dev, "request pin %d (%s) for %s\n",
|
||||
pin, desc->name, owner);
|
||||
|
||||
scoped_guard(mutex, &desc->mux_lock) {
|
||||
if ((!gpio_range || ops->strict) &&
|
||||
if (mux_setting) {
|
||||
if (ops->function_is_gpio)
|
||||
gpio_ok = ops->function_is_gpio(pctldev,
|
||||
mux_setting->func);
|
||||
} else {
|
||||
gpio_ok = true;
|
||||
}
|
||||
|
||||
if ((!gpio_range || ops->strict) && !gpio_ok &&
|
||||
desc->mux_usecount && strcmp(desc->mux_owner, owner)) {
|
||||
dev_err(pctldev->dev,
|
||||
"pin %s already requested by %s; cannot claim for %s\n",
|
||||
|
|
@ -138,7 +157,7 @@ static int pin_request(struct pinctrl_dev *pctldev,
|
|||
goto out;
|
||||
}
|
||||
|
||||
if ((gpio_range || ops->strict) && desc->gpio_owner) {
|
||||
if ((gpio_range || ops->strict) && !gpio_ok && desc->gpio_owner) {
|
||||
dev_err(pctldev->dev,
|
||||
"pin %s already requested by %s; cannot claim for %s\n",
|
||||
desc->name, desc->gpio_owner, owner);
|
||||
|
|
@ -337,7 +356,7 @@ static int pinmux_func_name_to_selector(struct pinctrl_dev *pctldev,
|
|||
while (selector < nfuncs) {
|
||||
const char *fname = ops->get_function_name(pctldev, selector);
|
||||
|
||||
if (!strcmp(function, fname))
|
||||
if (fname && !strcmp(function, fname))
|
||||
return selector;
|
||||
|
||||
selector++;
|
||||
|
|
@ -810,7 +829,7 @@ pinmux_generic_get_function_name(struct pinctrl_dev *pctldev,
|
|||
if (!function)
|
||||
return NULL;
|
||||
|
||||
return function->func.name;
|
||||
return function->func->name;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinmux_generic_get_function_name);
|
||||
|
||||
|
|
@ -835,8 +854,8 @@ int pinmux_generic_get_function_groups(struct pinctrl_dev *pctldev,
|
|||
__func__, selector);
|
||||
return -EINVAL;
|
||||
}
|
||||
*groups = function->func.groups;
|
||||
*ngroups = function->func.ngroups;
|
||||
*groups = function->func->groups;
|
||||
*ngroups = function->func->ngroups;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -847,8 +866,8 @@ EXPORT_SYMBOL_GPL(pinmux_generic_get_function_groups);
|
|||
* @pctldev: pin controller device
|
||||
* @selector: function number
|
||||
*/
|
||||
struct function_desc *pinmux_generic_get_function(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector)
|
||||
const struct function_desc *
|
||||
pinmux_generic_get_function(struct pinctrl_dev *pctldev, unsigned int selector)
|
||||
{
|
||||
struct function_desc *function;
|
||||
|
||||
|
|
@ -861,6 +880,27 @@ struct function_desc *pinmux_generic_get_function(struct pinctrl_dev *pctldev,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(pinmux_generic_get_function);
|
||||
|
||||
/**
|
||||
* pinmux_generic_function_is_gpio() - returns true if given function is a GPIO
|
||||
* @pctldev: pin controller device
|
||||
* @selector: function number
|
||||
*
|
||||
* Returns:
|
||||
* True if given function is a GPIO, false otherwise.
|
||||
*/
|
||||
bool pinmux_generic_function_is_gpio(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector)
|
||||
{
|
||||
struct function_desc *function;
|
||||
|
||||
function = radix_tree_lookup(&pctldev->pin_function_tree, selector);
|
||||
if (!function)
|
||||
return false;
|
||||
|
||||
return function->func->flags & PINFUNCTION_FLAG_GPIO;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinmux_generic_function_is_gpio);
|
||||
|
||||
/**
|
||||
* pinmux_generic_add_function() - adds a function group
|
||||
* @pctldev: pin controller device
|
||||
|
|
@ -903,7 +943,17 @@ int pinmux_generic_add_pinfunction(struct pinctrl_dev *pctldev,
|
|||
if (!function)
|
||||
return -ENOMEM;
|
||||
|
||||
function->func = *func;
|
||||
/*
|
||||
* FIXME: It's generally a bad idea to use devres in subsystem core
|
||||
* code - managed interfaces are aimed at drivers - but pinctrl already
|
||||
* uses it all over the place so it's a larger piece of technical debt
|
||||
* to fix.
|
||||
*/
|
||||
function->func = devm_kmemdup_const(pctldev->dev, func,
|
||||
sizeof(*func), GFP_KERNEL);
|
||||
if (!function->func)
|
||||
return -ENOMEM;
|
||||
|
||||
function->data = data;
|
||||
|
||||
error = radix_tree_insert(&pctldev->pin_function_tree, selector, function);
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ static inline void pinmux_init_device_debugfs(struct dentry *devroot,
|
|||
* @data: pin controller driver specific data
|
||||
*/
|
||||
struct function_desc {
|
||||
struct pinfunction func;
|
||||
const struct pinfunction *func;
|
||||
void *data;
|
||||
};
|
||||
|
||||
|
|
@ -152,8 +152,8 @@ int pinmux_generic_get_function_groups(struct pinctrl_dev *pctldev,
|
|||
const char * const **groups,
|
||||
unsigned int * const ngroups);
|
||||
|
||||
struct function_desc *pinmux_generic_get_function(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector);
|
||||
const struct function_desc *
|
||||
pinmux_generic_get_function(struct pinctrl_dev *pctldev, unsigned int selector);
|
||||
|
||||
int pinmux_generic_add_function(struct pinctrl_dev *pctldev,
|
||||
const char *name,
|
||||
|
|
@ -169,6 +169,9 @@ int pinmux_generic_remove_function(struct pinctrl_dev *pctldev,
|
|||
|
||||
void pinmux_generic_free_functions(struct pinctrl_dev *pctldev);
|
||||
|
||||
bool pinmux_generic_function_is_gpio(struct pinctrl_dev *pctldev,
|
||||
unsigned int selector);
|
||||
|
||||
#else
|
||||
|
||||
static inline void pinmux_generic_free_functions(struct pinctrl_dev *pctldev)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ config PINCTRL_MSM
|
|||
depends on OF
|
||||
select QCOM_SCM
|
||||
select PINMUX
|
||||
select GENERIC_PINMUX_FUNCTIONS
|
||||
select PINCONF
|
||||
select GENERIC_PINCONF
|
||||
select GPIOLIB_IRQCHIP
|
||||
|
|
@ -68,6 +69,16 @@ config PINCTRL_SC7280_LPASS_LPI
|
|||
Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI
|
||||
(Low Power Island) found on the Qualcomm Technologies Inc SC7280 platform.
|
||||
|
||||
config PINCTRL_SDM660_LPASS_LPI
|
||||
tristate "Qualcomm Technologies Inc SDM660 LPASS LPI pin controller driver"
|
||||
depends on GPIOLIB
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
depends on PINCTRL_LPASS_LPI
|
||||
help
|
||||
This is the pinctrl, pinmux, pinconf and gpiolib driver for the
|
||||
Qualcomm Technologies Inc LPASS (Low Power Audio SubSystem) LPI
|
||||
(Low Power Island) found on the Qualcomm Technologies Inc SDM660 platform.
|
||||
|
||||
config PINCTRL_SM4250_LPASS_LPI
|
||||
tristate "Qualcomm Technologies Inc SM4250 LPASS LPI pin controller driver"
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
|
|
|
|||
|
|
@ -15,6 +15,16 @@ config PINCTRL_APQ8084
|
|||
This is the pinctrl, pinmux, pinconf and gpiolib driver for the
|
||||
Qualcomm TLMM block found in the Qualcomm APQ8084 platform.
|
||||
|
||||
config PINCTRL_GLYMUR
|
||||
tristate "Qualcomm Technologies Inc Glymur pin controller driver"
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
help
|
||||
This is the pinctrl, pinmux, pinconf and gpiolib driver for the
|
||||
Qualcomm Technologies Inc Top Level Mode Multiplexer block (TLMM)
|
||||
block found on the Qualcomm Technologies Inc Glymur platform.
|
||||
Say Y here to compile statically, or M here to compile it as a module.
|
||||
If unsure, say N.
|
||||
|
||||
config PINCTRL_IPQ4019
|
||||
tristate "Qualcomm IPQ4019 pin controller driver"
|
||||
depends on ARM || COMPILE_TEST
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
obj-$(CONFIG_PINCTRL_MSM) += pinctrl-msm.o
|
||||
obj-$(CONFIG_PINCTRL_APQ8064) += pinctrl-apq8064.o
|
||||
obj-$(CONFIG_PINCTRL_APQ8084) += pinctrl-apq8084.o
|
||||
obj-$(CONFIG_PINCTRL_GLYMUR) += pinctrl-glymur.o
|
||||
obj-$(CONFIG_PINCTRL_IPQ4019) += pinctrl-ipq4019.o
|
||||
obj-$(CONFIG_PINCTRL_IPQ5018) += pinctrl-ipq5018.o
|
||||
obj-$(CONFIG_PINCTRL_IPQ8064) += pinctrl-ipq8064.o
|
||||
|
|
@ -44,6 +45,7 @@ obj-$(CONFIG_PINCTRL_SC7280_LPASS_LPI) += pinctrl-sc7280-lpass-lpi.o
|
|||
obj-$(CONFIG_PINCTRL_SC8180X) += pinctrl-sc8180x.o
|
||||
obj-$(CONFIG_PINCTRL_SC8280XP) += pinctrl-sc8280xp.o
|
||||
obj-$(CONFIG_PINCTRL_SDM660) += pinctrl-sdm660.o
|
||||
obj-$(CONFIG_PINCTRL_SDM660_LPASS_LPI) += pinctrl-sdm660-lpass-lpi.o
|
||||
obj-$(CONFIG_PINCTRL_SDM670) += pinctrl-sdm670.o
|
||||
obj-$(CONFIG_PINCTRL_SDM845) += pinctrl-sdm845.o
|
||||
obj-$(CONFIG_PINCTRL_SDX55) += pinctrl-sdx55.o
|
||||
|
|
|
|||
1777
drivers/pinctrl/qcom/pinctrl-glymur.c
Normal file
1777
drivers/pinctrl/qcom/pinctrl-glymur.c
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -630,7 +630,7 @@ static const struct pinfunction ipq5018_functions[] = {
|
|||
MSM_PIN_FUNCTION(eud_gpio),
|
||||
MSM_PIN_FUNCTION(gcc_plltest),
|
||||
MSM_PIN_FUNCTION(gcc_tlmm),
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(led0),
|
||||
MSM_PIN_FUNCTION(led2),
|
||||
MSM_PIN_FUNCTION(mac0),
|
||||
|
|
|
|||
|
|
@ -692,7 +692,7 @@ static const struct pinfunction ipq5332_functions[] = {
|
|||
MSM_PIN_FUNCTION(dbg_out),
|
||||
MSM_PIN_FUNCTION(gcc_plltest),
|
||||
MSM_PIN_FUNCTION(gcc_tlmm),
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(lock_det),
|
||||
MSM_PIN_FUNCTION(mac0),
|
||||
MSM_PIN_FUNCTION(mac1),
|
||||
|
|
|
|||
|
|
@ -641,7 +641,7 @@ static const struct pinfunction ipq5424_functions[] = {
|
|||
MSM_PIN_FUNCTION(dbg_out),
|
||||
MSM_PIN_FUNCTION(gcc_plltest),
|
||||
MSM_PIN_FUNCTION(gcc_tlmm),
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(i2c0_scl),
|
||||
MSM_PIN_FUNCTION(i2c0_sda),
|
||||
MSM_PIN_FUNCTION(i2c1_scl),
|
||||
|
|
|
|||
|
|
@ -891,7 +891,7 @@ static const struct pinfunction ipq6018_functions[] = {
|
|||
MSM_PIN_FUNCTION(dbg_out),
|
||||
MSM_PIN_FUNCTION(gcc_plltest),
|
||||
MSM_PIN_FUNCTION(gcc_tlmm),
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(lpass_aud),
|
||||
MSM_PIN_FUNCTION(lpass_aud0),
|
||||
MSM_PIN_FUNCTION(lpass_aud1),
|
||||
|
|
|
|||
|
|
@ -838,7 +838,7 @@ static const struct pinfunction ipq8074_functions[] = {
|
|||
MSM_PIN_FUNCTION(dbg_out),
|
||||
MSM_PIN_FUNCTION(gcc_plltest),
|
||||
MSM_PIN_FUNCTION(gcc_tlmm),
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(ldo_en),
|
||||
MSM_PIN_FUNCTION(ldo_update),
|
||||
MSM_PIN_FUNCTION(led0),
|
||||
|
|
|
|||
|
|
@ -651,7 +651,7 @@ static const struct pinfunction ipq9574_functions[] = {
|
|||
MSM_PIN_FUNCTION(dwc_ddrphy),
|
||||
MSM_PIN_FUNCTION(gcc_plltest),
|
||||
MSM_PIN_FUNCTION(gcc_tlmm),
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(mac),
|
||||
MSM_PIN_FUNCTION(mdc),
|
||||
MSM_PIN_FUNCTION(mdio),
|
||||
|
|
|
|||
|
|
@ -41,13 +41,27 @@ struct lpi_pinctrl {
|
|||
static int lpi_gpio_read(struct lpi_pinctrl *state, unsigned int pin,
|
||||
unsigned int addr)
|
||||
{
|
||||
return ioread32(state->tlmm_base + LPI_TLMM_REG_OFFSET * pin + addr);
|
||||
u32 pin_offset;
|
||||
|
||||
if (state->data->flags & LPI_FLAG_USE_PREDEFINED_PIN_OFFSET)
|
||||
pin_offset = state->data->groups[pin].pin_offset;
|
||||
else
|
||||
pin_offset = LPI_TLMM_REG_OFFSET * pin;
|
||||
|
||||
return ioread32(state->tlmm_base + pin_offset + addr);
|
||||
}
|
||||
|
||||
static int lpi_gpio_write(struct lpi_pinctrl *state, unsigned int pin,
|
||||
unsigned int addr, unsigned int val)
|
||||
{
|
||||
iowrite32(val, state->tlmm_base + LPI_TLMM_REG_OFFSET * pin + addr);
|
||||
u32 pin_offset;
|
||||
|
||||
if (state->data->flags & LPI_FLAG_USE_PREDEFINED_PIN_OFFSET)
|
||||
pin_offset = state->data->groups[pin].pin_offset;
|
||||
else
|
||||
pin_offset = LPI_TLMM_REG_OFFSET * pin;
|
||||
|
||||
iowrite32(val, state->tlmm_base + pin_offset + addr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -174,7 +188,7 @@ static int lpi_config_get(struct pinctrl_dev *pctldev,
|
|||
arg = 1;
|
||||
break;
|
||||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
if (is_out)
|
||||
arg = 1;
|
||||
break;
|
||||
|
|
@ -252,7 +266,7 @@ static int lpi_config_set(struct pinctrl_dev *pctldev, unsigned int group,
|
|||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
output_enabled = false;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
output_enabled = true;
|
||||
value = arg;
|
||||
break;
|
||||
|
|
@ -314,7 +328,7 @@ static int lpi_gpio_direction_output(struct gpio_chip *chip,
|
|||
struct lpi_pinctrl *state = gpiochip_get_data(chip);
|
||||
unsigned long config;
|
||||
|
||||
config = pinconf_to_config_packed(PIN_CONFIG_OUTPUT, val);
|
||||
config = pinconf_to_config_packed(PIN_CONFIG_LEVEL, val);
|
||||
|
||||
return lpi_config_set(state->ctrl, pin, &config, 1);
|
||||
}
|
||||
|
|
@ -332,7 +346,7 @@ static int lpi_gpio_set(struct gpio_chip *chip, unsigned int pin, int value)
|
|||
struct lpi_pinctrl *state = gpiochip_get_data(chip);
|
||||
unsigned long config;
|
||||
|
||||
config = pinconf_to_config_packed(PIN_CONFIG_OUTPUT, value);
|
||||
config = pinconf_to_config_packed(PIN_CONFIG_LEVEL, value);
|
||||
|
||||
return lpi_config_set(state->ctrl, pin, &config, 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,22 @@ struct pinctrl_pin_desc;
|
|||
LPI_MUX_##f4, \
|
||||
}, \
|
||||
.nfuncs = 5, \
|
||||
.pin_offset = 0, \
|
||||
}
|
||||
|
||||
#define LPI_PINGROUP_OFFSET(id, soff, f1, f2, f3, f4, poff) \
|
||||
{ \
|
||||
.pin = id, \
|
||||
.slew_offset = soff, \
|
||||
.funcs = (int[]){ \
|
||||
LPI_MUX_gpio, \
|
||||
LPI_MUX_##f1, \
|
||||
LPI_MUX_##f2, \
|
||||
LPI_MUX_##f3, \
|
||||
LPI_MUX_##f4, \
|
||||
}, \
|
||||
.nfuncs = 5, \
|
||||
.pin_offset = poff, \
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -62,6 +78,7 @@ struct pinctrl_pin_desc;
|
|||
* pin configuration.
|
||||
*/
|
||||
#define LPI_FLAG_SLEW_RATE_SAME_REG BIT(0)
|
||||
#define LPI_FLAG_USE_PREDEFINED_PIN_OFFSET BIT(1)
|
||||
|
||||
struct lpi_pingroup {
|
||||
unsigned int pin;
|
||||
|
|
@ -69,6 +86,7 @@ struct lpi_pingroup {
|
|||
int slew_offset;
|
||||
unsigned int *funcs;
|
||||
unsigned int nfuncs;
|
||||
unsigned int pin_offset;
|
||||
};
|
||||
|
||||
struct lpi_function {
|
||||
|
|
|
|||
|
|
@ -861,7 +861,7 @@ static const struct pinfunction mdm9607_functions[] = {
|
|||
MSM_PIN_FUNCTION(gcc_plltest),
|
||||
MSM_PIN_FUNCTION(gcc_tlmm),
|
||||
MSM_PIN_FUNCTION(gmac_mdio),
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(gsm0_tx),
|
||||
MSM_PIN_FUNCTION(lcd_rst),
|
||||
MSM_PIN_FUNCTION(ldo_en),
|
||||
|
|
|
|||
|
|
@ -313,7 +313,7 @@ static const char * const cdc_mclk_groups[] = {
|
|||
};
|
||||
|
||||
static const struct pinfunction mdm9615_functions[] = {
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(gsbi2_i2c),
|
||||
MSM_PIN_FUNCTION(gsbi3),
|
||||
MSM_PIN_FUNCTION(gsbi4),
|
||||
|
|
|
|||
|
|
@ -974,7 +974,7 @@ static const char *const wcn_sw_ctrl_groups[] = {
|
|||
};
|
||||
|
||||
static const struct pinfunction milos_functions[] = {
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(aoss_cti),
|
||||
MSM_PIN_FUNCTION(atest_char),
|
||||
MSM_PIN_FUNCTION(atest_usb),
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "../core.h"
|
||||
#include "../pinconf.h"
|
||||
#include "../pinctrl-utils.h"
|
||||
#include "../pinmux.h"
|
||||
|
||||
#include "pinctrl-msm.h"
|
||||
|
||||
|
|
@ -150,33 +151,6 @@ static int msm_pinmux_request(struct pinctrl_dev *pctldev, unsigned offset)
|
|||
return gpiochip_line_is_valid(chip, offset) ? 0 : -EINVAL;
|
||||
}
|
||||
|
||||
static int msm_get_functions_count(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
struct msm_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
return pctrl->soc->nfunctions;
|
||||
}
|
||||
|
||||
static const char *msm_get_function_name(struct pinctrl_dev *pctldev,
|
||||
unsigned function)
|
||||
{
|
||||
struct msm_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
return pctrl->soc->functions[function].name;
|
||||
}
|
||||
|
||||
static int msm_get_function_groups(struct pinctrl_dev *pctldev,
|
||||
unsigned function,
|
||||
const char * const **groups,
|
||||
unsigned * const num_groups)
|
||||
{
|
||||
struct msm_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
|
||||
|
||||
*groups = pctrl->soc->functions[function].groups;
|
||||
*num_groups = pctrl->soc->functions[function].ngroups;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int msm_pinmux_set_mux(struct pinctrl_dev *pctldev,
|
||||
unsigned function,
|
||||
unsigned group)
|
||||
|
|
@ -288,11 +262,13 @@ static int msm_pinmux_request_gpio(struct pinctrl_dev *pctldev,
|
|||
|
||||
static const struct pinmux_ops msm_pinmux_ops = {
|
||||
.request = msm_pinmux_request,
|
||||
.get_functions_count = msm_get_functions_count,
|
||||
.get_function_name = msm_get_function_name,
|
||||
.get_function_groups = msm_get_function_groups,
|
||||
.get_functions_count = pinmux_generic_get_function_count,
|
||||
.get_function_name = pinmux_generic_get_function_name,
|
||||
.get_function_groups = pinmux_generic_get_function_groups,
|
||||
.function_is_gpio = pinmux_generic_function_is_gpio,
|
||||
.gpio_request_enable = msm_pinmux_request_gpio,
|
||||
.set_mux = msm_pinmux_set_mux,
|
||||
.strict = true,
|
||||
};
|
||||
|
||||
static int msm_config_reg(struct msm_pinctrl *pctrl,
|
||||
|
|
@ -319,7 +295,7 @@ static int msm_config_reg(struct msm_pinctrl *pctrl,
|
|||
*bit = g->drv_bit;
|
||||
*mask = 7;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
case PIN_CONFIG_OUTPUT_ENABLE:
|
||||
*bit = g->oe_bit;
|
||||
|
|
@ -409,7 +385,7 @@ static int msm_config_group_get(struct pinctrl_dev *pctldev,
|
|||
case PIN_CONFIG_DRIVE_STRENGTH:
|
||||
arg = msm_regval_to_drive(arg);
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
/* Pin is not output */
|
||||
if (!arg)
|
||||
return -EINVAL;
|
||||
|
|
@ -488,7 +464,7 @@ static int msm_config_group_set(struct pinctrl_dev *pctldev,
|
|||
else
|
||||
arg = (arg / 2) - 1;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
case PIN_CONFIG_LEVEL:
|
||||
/* set output value */
|
||||
raw_spin_lock_irqsave(&pctrl->lock, flags);
|
||||
val = msm_readl_io(pctrl, g);
|
||||
|
|
@ -1552,6 +1528,7 @@ EXPORT_SYMBOL(msm_pinctrl_dev_pm_ops);
|
|||
int msm_pinctrl_probe(struct platform_device *pdev,
|
||||
const struct msm_pinctrl_soc_data *soc_data)
|
||||
{
|
||||
const struct pinfunction *func;
|
||||
struct msm_pinctrl *pctrl;
|
||||
struct resource *res;
|
||||
int ret;
|
||||
|
|
@ -1606,6 +1583,14 @@ int msm_pinctrl_probe(struct platform_device *pdev,
|
|||
return PTR_ERR(pctrl->pctrl);
|
||||
}
|
||||
|
||||
for (i = 0; i < soc_data->nfunctions; i++) {
|
||||
func = &soc_data->functions[i];
|
||||
|
||||
ret = pinmux_generic_add_pinfunction(pctrl->pctrl, func, NULL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = msm_gpio_init(pctrl);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@ struct pinctrl_pin_desc;
|
|||
fname##_groups, \
|
||||
ARRAY_SIZE(fname##_groups))
|
||||
|
||||
#define MSM_GPIO_PIN_FUNCTION(fname) \
|
||||
[msm_mux_##fname] = PINCTRL_GPIO_PINFUNCTION(#fname, \
|
||||
fname##_groups, \
|
||||
ARRAY_SIZE(fname##_groups))
|
||||
|
||||
#define QCA_PIN_FUNCTION(fname) \
|
||||
[qca_mux_##fname] = PINCTRL_PINFUNCTION(#fname, \
|
||||
fname##_groups, \
|
||||
|
|
|
|||
|
|
@ -483,7 +483,7 @@ static const struct pinfunction msm8226_functions[] = {
|
|||
MSM_PIN_FUNCTION(cci_i2c0),
|
||||
MSM_PIN_FUNCTION(gp0_clk),
|
||||
MSM_PIN_FUNCTION(gp1_clk),
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(sdc3),
|
||||
MSM_PIN_FUNCTION(wlan),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -714,7 +714,7 @@ static const char * const ebi2_groups[] = {
|
|||
};
|
||||
|
||||
static const struct pinfunction msm8660_functions[] = {
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(cam_mclk),
|
||||
MSM_PIN_FUNCTION(dsub),
|
||||
MSM_PIN_FUNCTION(ext_gps),
|
||||
|
|
|
|||
|
|
@ -696,7 +696,7 @@ static const struct pinfunction msm8909_functions[] = {
|
|||
MSM_PIN_FUNCTION(gcc_gp3_clk_a),
|
||||
MSM_PIN_FUNCTION(gcc_gp3_clk_b),
|
||||
MSM_PIN_FUNCTION(gcc_plltest),
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(gsm0_tx),
|
||||
MSM_PIN_FUNCTION(ldo_en),
|
||||
MSM_PIN_FUNCTION(ldo_update),
|
||||
|
|
|
|||
|
|
@ -743,7 +743,7 @@ static const struct pinfunction msm8916_functions[] = {
|
|||
MSM_PIN_FUNCTION(gcc_gp2_clk_b),
|
||||
MSM_PIN_FUNCTION(gcc_gp3_clk_a),
|
||||
MSM_PIN_FUNCTION(gcc_gp3_clk_b),
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(gsm0_tx0),
|
||||
MSM_PIN_FUNCTION(gsm0_tx1),
|
||||
MSM_PIN_FUNCTION(gsm1_tx0),
|
||||
|
|
|
|||
|
|
@ -1302,7 +1302,7 @@ static const struct pinfunction msm8917_functions[] = {
|
|||
MSM_PIN_FUNCTION(gcc_gp3_clk_b),
|
||||
MSM_PIN_FUNCTION(gcc_plltest),
|
||||
MSM_PIN_FUNCTION(gcc_tlmm),
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(gsm0_tx),
|
||||
MSM_PIN_FUNCTION(key_focus),
|
||||
MSM_PIN_FUNCTION(key_snapshot),
|
||||
|
|
|
|||
|
|
@ -1533,7 +1533,7 @@ static const struct pinfunction msm8953_functions[] = {
|
|||
MSM_PIN_FUNCTION(gcc_gp3_clk_b),
|
||||
MSM_PIN_FUNCTION(gcc_plltest),
|
||||
MSM_PIN_FUNCTION(gcc_tlmm),
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(gsm0_tx),
|
||||
MSM_PIN_FUNCTION(gsm1_tx),
|
||||
MSM_PIN_FUNCTION(gyro_int),
|
||||
|
|
|
|||
|
|
@ -974,7 +974,7 @@ static const struct pinfunction msm8960_functions[] = {
|
|||
MSM_PIN_FUNCTION(gp_pdm_1b),
|
||||
MSM_PIN_FUNCTION(gp_pdm_2a),
|
||||
MSM_PIN_FUNCTION(gp_pdm_2b),
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(gsbi1),
|
||||
MSM_PIN_FUNCTION(gsbi1_spi_cs1_n),
|
||||
MSM_PIN_FUNCTION(gsbi1_spi_cs2a_n),
|
||||
|
|
|
|||
|
|
@ -812,7 +812,7 @@ static const char * const ss_switch_groups[] = {
|
|||
};
|
||||
|
||||
static const struct pinfunction msm8976_functions[] = {
|
||||
MSM_PIN_FUNCTION(gpio),
|
||||
MSM_GPIO_PIN_FUNCTION(gpio),
|
||||
MSM_PIN_FUNCTION(blsp_spi1),
|
||||
MSM_PIN_FUNCTION(smb_int),
|
||||
MSM_PIN_FUNCTION(blsp_i2c1),
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue