mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-28 23:55:20 -04:00
Add a generic pinctrl binding for board-level pinmux chips that are controlled through the multiplexer subsystem. On some boards, especially development boards, external mux chips are used to switch SoC signals between different peripherals (e.g. MMC and UART). The mux select lines are often driven by a GPIO expander over I2C, as illustrated below: ┌──────┐ ┌─────┐ │ SOC │ │ │ ┌───────┐ │ │ │ │───►│ MMC │ │ │ │ MUX │ └───────┘ │ ├─────►│ │ ┌───────┐ │ │ │ │───►│ UART │ │ │ └─────┘ └───────┘ │ │ ▲ │ │ ┌────┴──────────────┐ │ I2C ├───►│ GPIO Expander │ └──────┘ └───────────────────┘ Traditionally, gpio-hog is used to configure the onboard mux at boot. However, the GPIO expander may probe later than consumer devices such as MMC. As a result, the MUX might not be configured when the peripheral driver probes, leading to initialization failures or data transfer errors. Introduce a generic pinctrl binding that models the board-level MUX as a pin control provider and builds proper device links between the MUX, its GPIO controller, and peripheral devices. This ensures correct probe ordering and reliable mux configuration. The implementation leverages the standard multiplexer subsystem, which provides broad support for onboard mux controllers and avoids the need for per-driver custom MUX handling. Allow pinctrl-* pattern as node name because this pinctrl device have not reg property. Reviewed-by: Linus Walleij <linusw@kernel.org> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
46 lines
1.6 KiB
YAML
46 lines
1.6 KiB
YAML
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
|
|
%YAML 1.2
|
|
---
|
|
$id: http://devicetree.org/schemas/pinctrl/pinctrl.yaml#
|
|
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
|
|
|
title: Pin controller device
|
|
|
|
maintainers:
|
|
- Linus Walleij <linusw@kernel.org>
|
|
- Rafał Miłecki <rafal@milecki.pl>
|
|
|
|
description: |
|
|
Pin controller devices should contain the pin configuration nodes that client
|
|
devices reference.
|
|
|
|
The contents of each of those pin configuration child nodes is defined
|
|
entirely by the binding for the individual pin controller device. There
|
|
exists no common standard for this content. The pinctrl framework only
|
|
provides generic helper bindings that the pin controller driver can use.
|
|
|
|
The pin configuration nodes need not be direct children of the pin controller
|
|
device; they may be grandchildren, for example. Whether this is legal, and
|
|
whether there is any interaction between the child and intermediate parent
|
|
nodes, is again defined entirely by the binding for the individual pin
|
|
controller device.
|
|
|
|
properties:
|
|
$nodename:
|
|
pattern: "^(pinctrl|pinmux)(@[0-9a-f]+|-[a-z0-9]+)?$"
|
|
|
|
"#pinctrl-cells":
|
|
description: >
|
|
Number of pin control cells in addition to the index within the pin
|
|
controller device instance.
|
|
|
|
pinctrl-use-default:
|
|
type: boolean
|
|
description: >
|
|
Indicates that the OS can use the boot default pin configuration. This
|
|
allows using an OS that does not have a driver for the pin controller.
|
|
This property can be set either globally for the pin controller or in
|
|
child nodes for individual pin group control.
|
|
|
|
additionalProperties: true
|