Skip to content

Commit 8a3a11f

Browse files
committed
Merge tag 'pinctrl-for-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pinctrl changes from Linus Walleij: "These are the main pinctrl changes for the v3.9 merge window. The most interesting change by far is how the device core grabs pinctrl default handles avoiding the need to stick boilerplate into driver consumers. - Grabbing of default pinctrl handles from the device core. These are the hunks hitting drivers/base. All is ACKed by Greg, after a long discussion about different alternatives. - Some stuff also touches the MFD and ARM SoC trees, this has been coordinated and ACKed. - New drivers for: - The Tegra 114 sub-SoC - Allwinner sunxi - New ABx500 driver and sub-SoC drivers for AB8500, AB8505, AB9540 and AB8540. - Make it possible for hogged pins to enter a sleep mode, and make it possible for drivers to control that mode. - Various clean-up, extensions and device tree support to various pin controllers." * tag 'pinctrl-for-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (68 commits) pinctrl: tegra: add clfvs function to Tegra114 support pinctrl: generic: rename input schmitt disable pinctrl/pinconfig: add debug interface pinctrl: samsung: remove duplicated line ARM: ux500: use real AB8500 IRQ numbers instead of virtual ones ARM: ux500: remove irq_base property from platform_data pinctrl/abx500: use direct IRQ defines pinctrl/abx500: replace IRQ offsets with table read-in values pinctrl/abx500: move IRQ handling to ab8500-core pinctrl: exynos5440: remove erroneous __init pinctrl/abx500: adjust offset for get_mode() pinctrl/abx500: add Device Tree support pinctrl/abx500: align GPIO cluster boundaries pinctrl/abx500: prevent error path from corrupting returning error pinctrl: sunxi: add of_xlate function pinctrl/lantiq: fix pin number in ltq_pmx_gpio_request_enable pinctrl/lantiq: add functionality to falcon_pinconf_dbg_show pinctrl/lantiq: fix pinconfig parameters pinctrl/lantiq: one of the boot leds was defined incorrectly pinctrl/lantiq: only probe available pad controllers ...
2 parents 8909ff6 + ade158e commit 8a3a11f

54 files changed

Lines changed: 9415 additions & 742 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
* Allwinner A1X Pin Controller
2+
3+
The pins controlled by sunXi pin controller are organized in banks,
4+
each bank has 32 pins. Each pin has 7 multiplexing functions, with
5+
the first two functions being GPIO in and out. The configuration on
6+
the pins includes drive strength and pull-up.
7+
8+
Required properties:
9+
- compatible: "allwinner,<soc>-pinctrl". Supported SoCs for now are:
10+
sun5i-a13.
11+
- reg: Should contain the register physical address and length for the
12+
pin controller.
13+
14+
Please refer to pinctrl-bindings.txt in this directory for details of the
15+
common pinctrl bindings used by client devices.
16+
17+
A pinctrl node should contain at least one subnodes representing the
18+
pinctrl groups available on the machine. Each subnode will list the
19+
pins it needs, and how they should be configured, with regard to muxer
20+
configuration, drive strength and pullups. If one of these options is
21+
not set, its actual value will be unspecified.
22+
23+
Required subnode-properties:
24+
25+
- allwinner,pins: List of strings containing the pin name.
26+
- allwinner,function: Function to mux the pins listed above to.
27+
28+
Optional subnode-properties:
29+
- allwinner,drive: Integer. Represents the current sent to the pin
30+
0: 10 mA
31+
1: 20 mA
32+
2: 30 mA
33+
3: 40 mA
34+
- allwinner,pull: Integer.
35+
0: No resistor
36+
1: Pull-up resistor
37+
2: Pull-down resistor
38+
39+
Examples:
40+
41+
pinctrl@01c20800 {
42+
compatible = "allwinner,sun5i-a13-pinctrl";
43+
reg = <0x01c20800 0x400>;
44+
#address-cells = <1>;
45+
#size-cells = <0>;
46+
47+
uart1_pins_a: uart1@0 {
48+
allwinner,pins = "PE10", "PE11";
49+
allwinner,function = "uart1";
50+
allwinner,drive = <0>;
51+
allwinner,pull = <0>;
52+
};
53+
54+
uart1_pins_b: uart1@1 {
55+
allwinner,pins = "PG3", "PG4";
56+
allwinner,function = "uart1";
57+
allwinner,drive = <0>;
58+
allwinner,pull = <0>;
59+
};
60+
};
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
NVIDIA Tegra114 pinmux controller
2+
3+
The Tegra114 pinctrl binding is very similar to the Tegra20 and Tegra30
4+
pinctrl binding, as described in nvidia,tegra20-pinmux.txt and
5+
nvidia,tegra30-pinmux.txt. In fact, this document assumes that binding as
6+
a baseline, and only documents the differences between the two bindings.
7+
8+
Required properties:
9+
- compatible: "nvidia,tegra114-pinmux"
10+
- reg: Should contain the register physical address and length for each of
11+
the pad control and mux registers. The first bank of address must be the
12+
driver strength pad control register address and second bank address must
13+
be pinmux register address.
14+
15+
Tegra114 adds the following optional properties for pin configuration subnodes:
16+
- nvidia,enable-input: Integer. Enable the pin's input path. 0: no, 1: yes.
17+
- nvidia,open-drain: Integer. Enable open drain mode. 0: no, 1: yes.
18+
- nvidia,lock: Integer. Lock the pin configuration against further changes
19+
until reset. 0: no, 1: yes.
20+
- nvidia,io-reset: Integer. Reset the IO path. 0: no, 1: yes.
21+
- nvidia,rcv-sel: Integer. Select VIL/VIH receivers. 0: normal, 1: high.
22+
- nvidia,drive-type: Integer. Valid range 0...3.
23+
24+
As with Tegra20 and Terga30, see the Tegra TRM for complete details regarding
25+
which groups support which functionality.
26+
27+
Valid values for pin and group names are:
28+
29+
per-pin mux groups:
30+
31+
These all support nvidia,function, nvidia,tristate, nvidia,pull,
32+
nvidia,enable-input, nvidia,lock. Some support nvidia,open-drain,
33+
nvidia,io-reset and nvidia,rcv-sel.
34+
35+
ulpi_data0_po1, ulpi_data1_po2, ulpi_data2_po3, ulpi_data3_po4,
36+
ulpi_data4_po5, ulpi_data5_po6, ulpi_data6_po7, ulpi_data7_po0,
37+
ulpi_clk_py0, ulpi_dir_py1, ulpi_nxt_py2, ulpi_stp_py3, dap3_fs_pp0,
38+
dap3_din_pp1, dap3_dout_pp2, dap3_sclk_pp3, pv0, pv1, sdmmc1_clk_pz0,
39+
sdmmc1_cmd_pz1, sdmmc1_dat3_py4, sdmmc1_dat2_py5, sdmmc1_dat1_py6,
40+
sdmmc1_dat0_py7, clk2_out_pw5, clk2_req_pcc5, hdmi_int_pn7, ddc_scl_pv4,
41+
ddc_sda_pv5, uart2_rxd_pc3, uart2_txd_pc2, uart2_rts_n_pj6,
42+
uart2_cts_n_pj5, uart3_txd_pw6, uart3_rxd_pw7, uart3_cts_n_pa1,
43+
uart3_rts_n_pc0, pu0, pu1, pu2, pu3, pu4, pu5, pu6, gen1_i2c_sda_pc5,
44+
gen1_i2c_scl_pc4, dap4_fs_pp4, dap4_din_pp5, dap4_dout_pp6, dap4_sclk_pp7,
45+
clk3_out_pee0, clk3_req_pee1, gmi_wp_n_pc7, gmi_iordy_pi5, gmi_wait_pi7,
46+
gmi_adv_n_pk0, gmi_clk_pk1, gmi_cs0_n_pj0, gmi_cs1_n_pj2, gmi_cs2_n_pk3,
47+
gmi_cs3_n_pk4, gmi_cs4_n_pk2, gmi_cs6_n_pi3, gmi_cs7_n_pi6, gmi_ad0_pg0,
48+
gmi_ad1_pg1, gmi_ad2_pg2, gmi_ad3_pg3, gmi_ad4_pg4, gmi_ad5_pg5,
49+
gmi_ad6_pg6, gmi_ad7_pg7, gmi_ad8_ph0, gmi_ad9_ph1, gmi_ad10_ph2,
50+
gmi_ad11_ph3, gmi_ad12_ph4, gmi_ad13_ph5, gmi_ad14_ph6, gmi_ad15_ph7,
51+
gmi_a16_pj7, gmi_a17_pb0, gmi_a18_pb1, gmi_a19_pk7, gmi_wr_n_pi0,
52+
gmi_oe_n_pi1, gmi_dqs_p_pj3, gmi_rst_n_pi4, gen2_i2c_scl_pt5,
53+
gen2_i2c_sda_pt6, sdmmc4_clk_pcc4, sdmmc4_cmd_pt7, sdmmc4_dat0_paa0,
54+
sdmmc4_dat1_paa1, sdmmc4_dat2_paa2, sdmmc4_dat3_paa3, sdmmc4_dat4_paa4,
55+
sdmmc4_dat5_paa5, sdmmc4_dat6_paa6, sdmmc4_dat7_paa7, cam_mclk_pcc0,
56+
pcc1, pbb0, cam_i2c_scl_pbb1, cam_i2c_sda_pbb2, pbb3, pbb4, pbb5, pbb6,
57+
pbb7, pcc2, pwr_i2c_scl_pz6, pwr_i2c_sda_pz7, kb_row0_pr0, kb_row1_pr1,
58+
kb_row2_pr2, kb_row3_pr3, kb_row4_pr4, kb_row5_pr5, kb_row6_pr6,
59+
kb_row7_pr7, kb_row8_ps0, kb_row9_ps1, kb_row10_ps2, kb_col0_pq0,
60+
kb_col1_pq1, kb_col2_pq2, kb_col3_pq3, kb_col4_pq4, kb_col5_pq5,
61+
kb_col6_pq6, kb_col7_pq7, clk_32k_out_pa0, sys_clk_req_pz5, core_pwr_req,
62+
cpu_pwr_req, pwr_int_n, owr, dap1_fs_pn0, dap1_din_pn1, dap1_dout_pn2,
63+
dap1_sclk_pn3, clk1_req_pee2, clk1_out_pw4, spdif_in_pk6, spdif_out_pk5,
64+
dap2_fs_pa2, dap2_din_pa4, dap2_dout_pa5, dap2_sclk_pa3, dvfs_pwm_px0,
65+
gpio_x1_aud_px1, gpio_x3_aud_px3, dvfs_clk_px2, gpio_x4_aud_px4,
66+
gpio_x5_aud_px5, gpio_x6_aud_px6, gpio_x7_aud_px7, sdmmc3_clk_pa6,
67+
sdmmc3_cmd_pa7, sdmmc3_dat0_pb7, sdmmc3_dat1_pb6, sdmmc3_dat2_pb5,
68+
sdmmc3_dat3_pb4, hdmi_cec_pee3, sdmmc1_wp_n_pv3, sdmmc3_cd_n_pv2,
69+
gpio_w2_aud_pw2, gpio_w3_aud_pw3, usb_vbus_en0_pn4, usb_vbus_en1_pn5,
70+
sdmmc3_clk_lb_in_pee5, sdmmc3_clk_lb_out_pee4, reset_out_n.
71+
72+
drive groups:
73+
74+
These all support nvidia,pull-down-strength, nvidia,pull-up-strength,
75+
nvidia,slew-rate-rising, nvidia,slew-rate-falling. Most but not all
76+
support nvidia,high-speed-mode, nvidia,schmitt, nvidia,low-power-mode
77+
and nvidia,drive-type.
78+
79+
ao1, ao2, at1, at2, at3, at4, at5, cdev1, cdev2, dap1, dap2, dap3, dap4,
80+
dbg, sdio3, spi, uaa, uab, uart2, uart3, sdio1, ddc, gma, gme, gmf, gmg,
81+
gmh, owr, uda.
82+
83+
Example:
84+
85+
pinmux: pinmux {
86+
compatible = "nvidia,tegra114-pinmux";
87+
reg = <0x70000868 0x148 /* Pad control registers */
88+
0x70003000 0x40c>; /* PinMux registers */
89+
};
90+
91+
Example board file extract:
92+
93+
pinctrl {
94+
sdmmc4_default: pinmux {
95+
sdmmc4_clk_pcc4 {
96+
nvidia,pins = "sdmmc4_clk_pcc4",
97+
nvidia,function = "sdmmc4";
98+
nvidia,pull = <0>;
99+
nvidia,tristate = <0>;
100+
};
101+
sdmmc4_dat0_paa0 {
102+
nvidia,pins = "sdmmc4_dat0_paa0",
103+
"sdmmc4_dat1_paa1",
104+
"sdmmc4_dat2_paa2",
105+
"sdmmc4_dat3_paa3",
106+
"sdmmc4_dat4_paa4",
107+
"sdmmc4_dat5_paa5",
108+
"sdmmc4_dat6_paa6",
109+
"sdmmc4_dat7_paa7";
110+
nvidia,function = "sdmmc4";
111+
nvidia,pull = <2>;
112+
nvidia,tristate = <0>;
113+
};
114+
};
115+
};
116+
117+
sdhci@78000400 {
118+
pinctrl-names = "default";
119+
pinctrl-0 = <&sdmmc4_default>;
120+
};
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
ST Ericsson Nomadik pinmux controller
2+
3+
Required properties:
4+
- compatible: "stericsson,nmk-pinctrl", "stericsson,nmk-pinctrl-db8540",
5+
"stericsson,nmk-pinctrl-stn8815"
6+
- reg: Should contain the register physical address and length of the PRCMU.
7+
8+
Please refer to pinctrl-bindings.txt in this directory for details of the
9+
common pinctrl bindings used by client devices, including the meaning of the
10+
phrase "pin configuration node".
11+
12+
ST Ericsson's pin configuration nodes act as a container for an arbitrary number of
13+
subnodes. Each of these subnodes represents some desired configuration for a
14+
pin, a group, or a list of pins or groups. This configuration can include the
15+
mux function to select on those pin(s)/group(s), and various pin configuration
16+
parameters, such as input, output, pull up, pull down...
17+
18+
The name of each subnode is not important; all subnodes should be enumerated
19+
and processed purely based on their content.
20+
21+
Required subnode-properties:
22+
- ste,pins : An array of strings. Each string contains the name of a pin or
23+
group.
24+
25+
Optional subnode-properties:
26+
- ste,function: A string containing the name of the function to mux to the
27+
pin or group.
28+
29+
- ste,config: Handle of pin configuration node (e.g. ste,config = <&slpm_in_wkup_pdis>)
30+
31+
- ste,input : <0/1/2>
32+
0: input with no pull
33+
1: input with pull up,
34+
2: input with pull down,
35+
36+
- ste,output: <0/1/2>
37+
0: output low,
38+
1: output high,
39+
2: output (value is not specified).
40+
41+
- ste,sleep: <0/1>
42+
0: sleep mode disable,
43+
1: sleep mode enable.
44+
45+
- ste,sleep-input: <0/1/2/3>
46+
0: sleep input with no pull,
47+
1: sleep input with pull up,
48+
2: sleep input with pull down.
49+
3: sleep input and keep last input configuration (no pull, pull up or pull down).
50+
51+
- ste,sleep-output: <0/1/2>
52+
0: sleep output low,
53+
1: sleep output high,
54+
2: sleep output (value is not specified).
55+
56+
- ste,sleep-gpio: <0/1>
57+
0: disable sleep gpio mode,
58+
1: enable sleep gpio mode.
59+
60+
- ste,sleep-wakeup: <0/1>
61+
0: wake-up detection enabled,
62+
1: wake-up detection disabled.
63+
64+
- ste,sleep-pull-disable: <0/1>
65+
0: GPIO pull-up or pull-down resistor is enabled, when pin is an input,
66+
1: GPIO pull-up and pull-down resistor are disabled.
67+
68+
Example board file extract:
69+
70+
pinctrl@80157000 {
71+
compatible = "stericsson,nmk-pinctrl";
72+
reg = <0x80157000 0x2000>;
73+
74+
pinctrl-names = "default";
75+
76+
slpm_in_wkup_pdis: slpm_in_wkup_pdis {
77+
ste,sleep = <1>;
78+
ste,sleep-input = <3>;
79+
ste,sleep-wakeup = <1>;
80+
ste,sleep-pull-disable = <0>;
81+
};
82+
83+
slpm_out_hi_wkup_pdis: slpm_out_hi_wkup_pdis {
84+
ste,sleep = <1>;
85+
ste,sleep-output = <1>;
86+
ste,sleep-wakeup = <1>;
87+
ste,sleep-pull-disable = <0>;
88+
};
89+
90+
slpm_out_wkup_pdis: slpm_out_wkup_pdis {
91+
ste,sleep = <1>;
92+
ste,sleep-output = <2>;
93+
ste,sleep-wakeup = <1>;
94+
ste,sleep-pull-disable = <0>;
95+
};
96+
97+
uart0 {
98+
uart0_default_mux: uart0_mux {
99+
u0_default_mux {
100+
ste,function = "u0";
101+
ste,pins = "u0_a_1";
102+
};
103+
};
104+
uart0_default_mode: uart0_default {
105+
uart0_default_cfg1 {
106+
ste,pins = "GPIO0", "GPIO2";
107+
ste,input = <1>;
108+
};
109+
110+
uart0_default_cfg2 {
111+
ste,pins = "GPIO1", "GPIO3";
112+
ste,output = <1>;
113+
};
114+
};
115+
uart0_sleep_mode: uart0_sleep {
116+
uart0_sleep_cfg1 {
117+
ste,pins = "GPIO0", "GPIO2";
118+
ste,config = <&slpm_in_wkup_pdis>;
119+
};
120+
uart0_sleep_cfg2 {
121+
ste,pins = "GPIO1";
122+
ste,config = <&slpm_out_hi_wkup_pdis>;
123+
};
124+
uart0_sleep_cfg3 {
125+
ste,pins = "GPIO3";
126+
ste,config = <&slpm_out_wkup_pdis>;
127+
};
128+
};
129+
};
130+
};
131+
132+
uart@80120000 {
133+
compatible = "arm,pl011", "arm,primecell";
134+
reg = <0x80120000 0x1000>;
135+
interrupts = <0 11 0x4>;
136+
137+
pinctrl-names = "default","sleep";
138+
pinctrl-0 = <&uart0_default_mux>, <&uart0_default_mode>;
139+
pinctrl-1 = <&uart0_sleep_mode>;
140+
};

‎Documentation/devicetree/bindings/vendor-prefixes.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ simtek
5050
sirf SiRF Technology, Inc.
5151
snps Synopsys, Inc.
5252
st STMicroelectronics
53+
ste ST-Ericsson
5354
stericsson ST-Ericsson
5455
ti Texas Instruments
5556
via VIA Technologies, Inc.

‎Documentation/pinctrl.txt‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,18 @@ pinmux core.
972972
Pin control requests from drivers
973973
=================================
974974

975+
When a device driver is about to probe the device core will automatically
976+
attempt to issue pinctrl_get_select_default() on these devices.
977+
This way driver writers do not need to add any of the boilerplate code
978+
of the type found below. However when doing fine-grained state selection
979+
and not using the "default" state, you may have to do some device driver
980+
handling of the pinctrl handles and states.
981+
982+
So if you just want to put the pins for a certain device into the default
983+
state and be done with it, there is nothing you need to do besides
984+
providing the proper mapping table. The device core will take care of
985+
the rest.
986+
975987
Generally it is discouraged to let individual drivers get and enable pin
976988
control. So if possible, handle the pin control in platform code or some other
977989
place where you have access to all the affected struct device * pointers. In
@@ -1097,9 +1109,9 @@ situations that can be electrically unpleasant, you will certainly want to
10971109
mux in and bias pins in a certain way before the GPIO subsystems starts to
10981110
deal with them.
10991111

1100-
The above can be hidden: using pinctrl hogs, the pin control driver may be
1101-
setting up the config and muxing for the pins when it is probing,
1102-
nevertheless orthogonal to the GPIO subsystem.
1112+
The above can be hidden: using the device core, the pinctrl core may be
1113+
setting up the config and muxing for the pins right before the device is
1114+
probing, nevertheless orthogonal to the GPIO subsystem.
11031115

11041116
But there are also situations where it makes sense for the GPIO subsystem
11051117
to communicate directly with with the pinctrl subsystem, using the latter

‎arch/arm/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,7 @@ config ARCH_NR_GPIO
16361636
default 355 if ARCH_U8500
16371637
default 264 if MACH_H4700
16381638
default 512 if SOC_OMAP5
1639-
default 288 if ARCH_VT8500
1639+
default 288 if ARCH_VT8500 || ARCH_SUNXI
16401640
default 0
16411641
help
16421642
Maximum number of GPIOs in the system.

‎arch/arm/boot/dts/dbx5x0.dtsi‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,9 @@
170170
gpio-bank = <8>;
171171
};
172172

173-
pinctrl@80157000 {
174-
// This is actually the PRCMU base address
175-
reg = <0x80157000 0x2000>;
176-
compatible = "stericsson,nmk_pinctrl";
173+
pinctrl {
174+
compatible = "stericsson,nmk-pinctrl";
175+
prcm = <&prcmu>;
177176
};
178177

179178
usb@a03e0000 {
@@ -190,9 +189,10 @@
190189
interrupts = <0 25 0x4>;
191190
};
192191

193-
prcmu@80157000 {
192+
prcmu: prcmu@80157000 {
194193
compatible = "stericsson,db8500-prcmu";
195194
reg = <0x80157000 0x1000>;
195+
reg-names = "prcmu";
196196
interrupts = <0 47 0x4>;
197197
#address-cells = <1>;
198198
#size-cells = <1>;

0 commit comments

Comments
 (0)