-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dt-bindings: pinctrl: Add DT bindings for apple, pinctrl
The Apple GPIO controller is a simple combined pin and GPIO conroller present on Apple ARM SoC platforms, including various iPhone and iPad devices and the "Apple Silicon" Macs. Signed-off-by: Mark Kettenis <kettenis@openbsd.org> Link: https://lore.kernel.org/r/20210520171310.772-2-mark.kettenis@xs4all.nl Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
- Loading branch information
Mark Kettenis
authored and
Linus Walleij
committed
May 25, 2021
1 parent
f56b273
commit 7100714
Showing
3 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
106 changes: 106 additions & 0 deletions
106
Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) | ||
%YAML 1.2 | ||
--- | ||
$id: http://devicetree.org/schemas/pinctrl/apple,pinctrl.yaml# | ||
$schema: http://devicetree.org/meta-schemas/core.yaml# | ||
|
||
title: Apple GPIO controller | ||
|
||
maintainers: | ||
- Mark Kettenis <kettenis@openbsd.org> | ||
|
||
description: | | ||
The Apple GPIO controller is a simple combined pin and GPIO | ||
controller present on Apple ARM SoC platforms, including various | ||
iPhone and iPad devices and the "Apple Silicon" Macs. | ||
properties: | ||
compatible: | ||
items: | ||
- const: apple,t8103-pinctrl | ||
- const: apple,pinctrl | ||
|
||
reg: | ||
maxItems: 1 | ||
|
||
clocks: | ||
maxItems: 1 | ||
|
||
gpio-controller: true | ||
|
||
'#gpio-cells': | ||
const: 2 | ||
|
||
gpio-ranges: | ||
maxItems: 1 | ||
|
||
interrupts: | ||
description: One interrupt for each of the (up to 7) interrupt | ||
groups supported by the controller sorted by interrupt group | ||
number in ascending order. | ||
minItems: 1 | ||
maxItems: 7 | ||
|
||
interrupt-controller: true | ||
|
||
patternProperties: | ||
'-pins$': | ||
type: object | ||
$ref: pinmux-node.yaml# | ||
|
||
properties: | ||
pinmux: | ||
description: | ||
Values are constructed from pin number and alternate function | ||
configuration number using the APPLE_PINMUX() helper macro | ||
defined in include/dt-bindings/pinctrl/apple.h. | ||
|
||
required: | ||
- pinmux | ||
|
||
additionalProperties: false | ||
|
||
required: | ||
- compatible | ||
- reg | ||
- gpio-controller | ||
- '#gpio-cells' | ||
- gpio-ranges | ||
|
||
additionalProperties: false | ||
|
||
examples: | ||
- | | ||
#include <dt-bindings/interrupt-controller/apple-aic.h> | ||
#include <dt-bindings/pinctrl/apple.h> | ||
soc { | ||
#address-cells = <2>; | ||
#size-cells = <2>; | ||
pinctrl: pinctrl@23c100000 { | ||
compatible = "apple,t8103-pinctrl", "apple,pinctrl"; | ||
reg = <0x2 0x3c100000 0x0 0x100000>; | ||
clocks = <&gpio_clk>; | ||
gpio-controller; | ||
#gpio-cells = <2>; | ||
gpio-ranges = <&pinctrl 0 0 212>; | ||
interrupt-controller; | ||
interrupt-parent = <&aic>; | ||
interrupts = <AIC_IRQ 16 IRQ_TYPE_LEVEL_HIGH>, | ||
<AIC_IRQ 17 IRQ_TYPE_LEVEL_HIGH>, | ||
<AIC_IRQ 18 IRQ_TYPE_LEVEL_HIGH>, | ||
<AIC_IRQ 19 IRQ_TYPE_LEVEL_HIGH>, | ||
<AIC_IRQ 20 IRQ_TYPE_LEVEL_HIGH>, | ||
<AIC_IRQ 21 IRQ_TYPE_LEVEL_HIGH>, | ||
<AIC_IRQ 22 IRQ_TYPE_LEVEL_HIGH>; | ||
pcie_pins: pcie-pins { | ||
pinmux = <APPLE_PINMUX(150, 1)>, | ||
<APPLE_PINMUX(151, 1)>, | ||
<APPLE_PINMUX(32, 1)>; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* SPDX-License-Identifier: GPL-2.0+ OR MIT */ | ||
/* | ||
* This header provides constants for Apple pinctrl bindings. | ||
*/ | ||
|
||
#ifndef _DT_BINDINGS_PINCTRL_APPLE_H | ||
#define _DT_BINDINGS_PINCTRL_APPLE_H | ||
|
||
#define APPLE_PINMUX(pin, func) ((pin) | ((func) << 16)) | ||
#define APPLE_PIN(pinmux) ((pinmux) & 0xffff) | ||
#define APPLE_FUNC(pinmux) ((pinmux) >> 16) | ||
|
||
#endif /* _DT_BINDINGS_PINCTRL_APPLE_H */ |