Skip to content

Commit 9b82ec8

Browse files
committed
Merge branch 'ib-sophgo-pintrl' into devel
Immutable branch for the SoC tree, merge to pinctrl devel proper. Signed-off-by: Linus Walleij <[email protected]>
2 parents e880754 + e7a4141 commit 9b82ec8

File tree

16 files changed

+4066
-0
lines changed

16 files changed

+4066
-0
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pinctrl/sophgo,cv1800-pinctrl.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Sophgo CV1800 Pin Controller
8+
9+
maintainers:
10+
- Inochi Amaoto <[email protected]>
11+
12+
properties:
13+
compatible:
14+
enum:
15+
- sophgo,cv1800b-pinctrl
16+
- sophgo,cv1812h-pinctrl
17+
- sophgo,sg2000-pinctrl
18+
- sophgo,sg2002-pinctrl
19+
20+
reg:
21+
items:
22+
- description: pinctrl for system domain
23+
- description: pinctrl for rtc domain
24+
25+
reg-names:
26+
items:
27+
- const: sys
28+
- const: rtc
29+
30+
resets:
31+
maxItems: 1
32+
33+
patternProperties:
34+
'-cfg$':
35+
type: object
36+
description:
37+
A pinctrl node should contain at least one subnode representing the
38+
pinctrl groups available on the machine.
39+
40+
additionalProperties: false
41+
42+
patternProperties:
43+
'-pins$':
44+
type: object
45+
description: |
46+
Each subnode will list the pins it needs, and how they should
47+
be configured, with regard to muxer configuration, bias, input
48+
enable/disable, input schmitt trigger, slew-rate, drive strength
49+
and bus hold state. In addition, all pins in the same subnode
50+
should have the same power domain. For configuration detail,
51+
refer to https://github.com/sophgo/sophgo-doc/.
52+
53+
allOf:
54+
- $ref: pincfg-node.yaml#
55+
- $ref: pinmux-node.yaml#
56+
57+
properties:
58+
pinmux:
59+
description: |
60+
The list of GPIOs and their mux settings that properties in the
61+
node apply to. This should be set using the GPIOMUX or GPIOMUX2
62+
macro.
63+
64+
bias-pull-up:
65+
type: boolean
66+
67+
bias-pull-down:
68+
type: boolean
69+
70+
drive-strength-microamp:
71+
description: typical current when output high level.
72+
73+
input-schmitt-microvolt:
74+
description: typical threshold for schmitt trigger.
75+
76+
power-source:
77+
description: power supplies at X mV.
78+
enum: [ 1800, 3300 ]
79+
80+
slew-rate:
81+
description: slew rate for output buffer (0 is fast, 1 is slow)
82+
enum: [ 0, 1 ]
83+
84+
bias-bus-hold: true
85+
86+
required:
87+
- pinmux
88+
- power-source
89+
90+
additionalProperties: false
91+
92+
required:
93+
- compatible
94+
- reg
95+
- reg-names
96+
97+
additionalProperties: false
98+
99+
examples:
100+
- |
101+
#include <dt-bindings/pinctrl/pinctrl-cv1800b.h>
102+
103+
pinctrl@3001000 {
104+
compatible = "sophgo,cv1800b-pinctrl";
105+
reg = <0x03001000 0x1000>,
106+
<0x05027000 0x1000>;
107+
reg-names = "sys", "rtc";
108+
109+
uart0_cfg: uart0-cfg {
110+
uart0-pins {
111+
pinmux = <PINMUX(PIN_UART0_TX, 0)>,
112+
<PINMUX(PIN_UART0_RX, 0)>;
113+
bias-pull-up;
114+
drive-strength-microamp = <10800>;
115+
input-schmitt-microvolt = <0>;
116+
power-source = <3300>;
117+
slew-rate = <0>;
118+
};
119+
};
120+
};
121+
122+
...

drivers/pinctrl/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ source "drivers/pinctrl/qcom/Kconfig"
598598
source "drivers/pinctrl/realtek/Kconfig"
599599
source "drivers/pinctrl/renesas/Kconfig"
600600
source "drivers/pinctrl/samsung/Kconfig"
601+
source "drivers/pinctrl/sophgo/Kconfig"
601602
source "drivers/pinctrl/spear/Kconfig"
602603
source "drivers/pinctrl/sprd/Kconfig"
603604
source "drivers/pinctrl/starfive/Kconfig"

drivers/pinctrl/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ obj-y += qcom/
7474
obj-$(CONFIG_ARCH_REALTEK) += realtek/
7575
obj-$(CONFIG_PINCTRL_RENESAS) += renesas/
7676
obj-$(CONFIG_PINCTRL_SAMSUNG) += samsung/
77+
obj-y += sophgo/
7778
obj-$(CONFIG_PINCTRL_SPEAR) += spear/
7879
obj-y += sprd/
7980
obj-$(CONFIG_SOC_STARFIVE) += starfive/

drivers/pinctrl/sophgo/Kconfig

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
#
3+
# Sophgo SoC PINCTRL drivers
4+
#
5+
6+
config PINCTRL_SOPHGO_CV18XX
7+
bool
8+
select GENERIC_PINCTRL_GROUPS
9+
select GENERIC_PINMUX_FUNCTIONS
10+
select GENERIC_PINCONF
11+
12+
config PINCTRL_SOPHGO_CV1800B
13+
tristate "Sophgo CV1800B SoC Pinctrl driver"
14+
depends on ARCH_SOPHGO || COMPILE_TEST
15+
depends on OF
16+
select PINCTRL_SOPHGO_CV18XX
17+
help
18+
Say Y to select the pinctrl driver for CV1800B SoC.
19+
This pin controller allows selecting the mux function for
20+
each pin. This driver can also be built as a module called
21+
pinctrl-cv1800b.
22+
23+
config PINCTRL_SOPHGO_CV1812H
24+
tristate "Sophgo CV1812H SoC Pinctrl driver"
25+
depends on ARCH_SOPHGO || COMPILE_TEST
26+
depends on OF
27+
select PINCTRL_SOPHGO_CV18XX
28+
help
29+
Say Y to select the pinctrl driver for CV1812H SoC.
30+
This pin controller allows selecting the mux function for
31+
each pin. This driver can also be built as a module called
32+
pinctrl-cv1812h.
33+
34+
config PINCTRL_SOPHGO_SG2000
35+
tristate "Sophgo SG2000 SoC Pinctrl driver"
36+
depends on ARCH_SOPHGO || COMPILE_TEST
37+
depends on OF
38+
select PINCTRL_SOPHGO_CV18XX
39+
help
40+
Say Y to select the pinctrl driver for SG2000 SoC.
41+
This pin controller allows selecting the mux function for
42+
each pin. This driver can also be built as a module called
43+
pinctrl-sg2000.
44+
45+
config PINCTRL_SOPHGO_SG2002
46+
tristate "Sophgo SG2000 SoC Pinctrl driver"
47+
depends on ARCH_SOPHGO || COMPILE_TEST
48+
depends on OF
49+
select PINCTRL_SOPHGO_CV18XX
50+
help
51+
Say Y to select the pinctrl driver for SG2002 SoC.
52+
This pin controller allows selecting the mux function for
53+
each pin. This driver can also be built as a module called
54+
pinctrl-sg2002.

drivers/pinctrl/sophgo/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
obj-$(CONFIG_PINCTRL_SOPHGO_CV18XX) += pinctrl-cv18xx.o
4+
obj-$(CONFIG_PINCTRL_SOPHGO_CV1800B) += pinctrl-cv1800b.o
5+
obj-$(CONFIG_PINCTRL_SOPHGO_CV1812H) += pinctrl-cv1812h.o
6+
obj-$(CONFIG_PINCTRL_SOPHGO_SG2000) += pinctrl-sg2000.o
7+
obj-$(CONFIG_PINCTRL_SOPHGO_SG2002) += pinctrl-sg2002.o

0 commit comments

Comments
 (0)