Skip to content

Commit 8d31f80

Browse files
committed
Merge tag 'pinctrl-v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij: "These are the pin control fixes I have gathered since the return from my vacation. They boiled in -next a while so let's get them in. Apart from the documentation build it is purely driver fixes. Which is nice. The Intel fixes seem kind of important. - Fix the documentation build as the docs were moved - Correct the UART pin list on the Intel Merrifield - Fix pin assignment and number of pins on the Marvell Armada 37xx pin controller - Cover the Setzer models in the Chromebook DMI quirk in the Intel cheryview driver so they start working - Add the missing "sim" function to the sunxi driver - Fix USB pin definitions on Uniphier Pro4 - Smatch fix for invalid reference in the zx pin control driver" * tag 'pinctrl-v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: generic: update references to Documentation/pinctrl.txt pinctrl: intel: merrifield: Correct UART pin lists pinctrl: armada-37xx: Fix number of pin in south bridge pinctrl: armada-37xx: Fix the pin 23 on south bridge pinctrl: cherryview: Add Setzer models to the Chromebook DMI quirk pinctrl: sunxi: add a missing function of A10/A20 pinctrl driver pinctrl: uniphier: fix USB3 pin assignment for Pro4 pinctrl: zte: fix dereference of 'data' in zx_set_mux()
2 parents 48fb6f4 + 0cca6c8 commit 8d31f80

File tree

10 files changed

+42
-20
lines changed

10 files changed

+42
-20
lines changed

Documentation/gpio/gpio-legacy.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ pin controller?
459459

460460
This is done by registering "ranges" of pins, which are essentially
461461
cross-reference tables. These are described in
462-
Documentation/pinctrl.txt
462+
Documentation/driver-api/pinctl.rst
463463

464464
While the pin allocation is totally managed by the pinctrl subsystem,
465465
gpio (under gpiolib) is still maintained by gpio drivers. It may happen

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10383,7 +10383,7 @@ L: [email protected]
1038310383
T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git
1038410384
S: Maintained
1038510385
F: Documentation/devicetree/bindings/pinctrl/
10386-
F: Documentation/pinctrl.txt
10386+
F: Documentation/driver-api/pinctl.rst
1038710387
F: drivers/pinctrl/
1038810388
F: include/linux/pinctrl/
1038910389

drivers/pinctrl/intel/pinctrl-cherryview.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,6 +1547,13 @@ static const struct dmi_system_id chv_no_valid_mask[] = {
15471547
DMI_MATCH(DMI_PRODUCT_FAMILY, "Intel_Strago"),
15481548
},
15491549
},
1550+
{
1551+
.ident = "HP Chromebook 11 G5 (Setzer)",
1552+
.matches = {
1553+
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
1554+
DMI_MATCH(DMI_PRODUCT_NAME, "Setzer"),
1555+
},
1556+
},
15501557
{
15511558
.ident = "Acer Chromebook R11 (Cyan)",
15521559
.matches = {

drivers/pinctrl/intel/pinctrl-merrifield.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,9 @@ static const struct pinctrl_pin_desc mrfld_pins[] = {
343343

344344
static const unsigned int mrfld_sdio_pins[] = { 50, 51, 52, 53, 54, 55, 56 };
345345
static const unsigned int mrfld_spi5_pins[] = { 90, 91, 92, 93, 94, 95, 96 };
346-
static const unsigned int mrfld_uart0_pins[] = { 124, 125, 126, 127 };
347-
static const unsigned int mrfld_uart1_pins[] = { 128, 129, 130, 131 };
348-
static const unsigned int mrfld_uart2_pins[] = { 132, 133, 134, 135 };
346+
static const unsigned int mrfld_uart0_pins[] = { 115, 116, 117, 118 };
347+
static const unsigned int mrfld_uart1_pins[] = { 119, 120, 121, 122 };
348+
static const unsigned int mrfld_uart2_pins[] = { 123, 124, 125, 126 };
349349
static const unsigned int mrfld_pwm0_pins[] = { 144 };
350350
static const unsigned int mrfld_pwm1_pins[] = { 145 };
351351
static const unsigned int mrfld_pwm2_pins[] = { 132 };

drivers/pinctrl/mvebu/pinctrl-armada-37xx.c

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#define IRQ_STATUS 0x10
3838
#define IRQ_WKUP 0x18
3939

40-
#define NB_FUNCS 2
40+
#define NB_FUNCS 3
4141
#define GPIO_PER_REG 32
4242

4343
/**
@@ -126,6 +126,16 @@ struct armada_37xx_pinctrl {
126126
.funcs = {_func1, "gpio"} \
127127
}
128128

129+
#define PIN_GRP_GPIO_3(_name, _start, _nr, _mask, _v1, _v2, _v3, _f1, _f2) \
130+
{ \
131+
.name = _name, \
132+
.start_pin = _start, \
133+
.npins = _nr, \
134+
.reg_mask = _mask, \
135+
.val = {_v1, _v2, _v3}, \
136+
.funcs = {_f1, _f2, "gpio"} \
137+
}
138+
129139
#define PIN_GRP_EXTRA(_name, _start, _nr, _mask, _v1, _v2, _start2, _nr2, \
130140
_f1, _f2) \
131141
{ \
@@ -171,12 +181,13 @@ static struct armada_37xx_pin_group armada_37xx_sb_groups[] = {
171181
PIN_GRP_GPIO("usb32_drvvbus0", 0, 1, BIT(0), "drvbus"),
172182
PIN_GRP_GPIO("usb2_drvvbus1", 1, 1, BIT(1), "drvbus"),
173183
PIN_GRP_GPIO("sdio_sb", 24, 6, BIT(2), "sdio"),
174-
PIN_GRP_EXTRA("rgmii", 6, 12, BIT(3), 0, BIT(3), 23, 1, "mii", "gpio"),
184+
PIN_GRP_GPIO("rgmii", 6, 12, BIT(3), "mii"),
175185
PIN_GRP_GPIO("pcie1", 3, 2, BIT(4), "pcie"),
176186
PIN_GRP_GPIO("ptp", 20, 3, BIT(5), "ptp"),
177187
PIN_GRP("ptp_clk", 21, 1, BIT(6), "ptp", "mii"),
178188
PIN_GRP("ptp_trig", 22, 1, BIT(7), "ptp", "mii"),
179-
PIN_GRP("mii_col", 23, 1, BIT(8), "mii", "mii_err"),
189+
PIN_GRP_GPIO_3("mii_col", 23, 1, BIT(8) | BIT(14), 0, BIT(8), BIT(14),
190+
"mii", "mii_err"),
180191
};
181192

182193
const struct armada_37xx_pin_data armada_37xx_pin_nb = {
@@ -187,7 +198,7 @@ const struct armada_37xx_pin_data armada_37xx_pin_nb = {
187198
};
188199

189200
const struct armada_37xx_pin_data armada_37xx_pin_sb = {
190-
.nr_pins = 29,
201+
.nr_pins = 30,
191202
.name = "GPIO2",
192203
.groups = armada_37xx_sb_groups,
193204
.ngroups = ARRAY_SIZE(armada_37xx_sb_groups),
@@ -208,7 +219,7 @@ static int armada_37xx_get_func_reg(struct armada_37xx_pin_group *grp,
208219
{
209220
int f;
210221

211-
for (f = 0; f < NB_FUNCS; f++)
222+
for (f = 0; (f < NB_FUNCS) && grp->funcs[f]; f++)
212223
if (!strcmp(grp->funcs[f], func))
213224
return f;
214225

@@ -795,7 +806,7 @@ static int armada_37xx_fill_group(struct armada_37xx_pinctrl *info)
795806
for (j = 0; j < grp->extra_npins; j++)
796807
grp->pins[i+j] = grp->extra_pin + j;
797808

798-
for (f = 0; f < NB_FUNCS; f++) {
809+
for (f = 0; (f < NB_FUNCS) && grp->funcs[f]; f++) {
799810
int ret;
800811
/* check for unique functions and count groups */
801812
ret = armada_37xx_add_function(info->funcs, &funcsize,
@@ -847,7 +858,7 @@ static int armada_37xx_fill_func(struct armada_37xx_pinctrl *info)
847858
struct armada_37xx_pin_group *gp = &info->groups[g];
848859
int f;
849860

850-
for (f = 0; f < NB_FUNCS; f++) {
861+
for (f = 0; (f < NB_FUNCS) && gp->funcs[f]; f++) {
851862
if (strcmp(gp->funcs[f], name) == 0) {
852863
*groups = gp->name;
853864
groups++;

drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,7 @@ static const struct sunxi_desc_pin sun4i_a10_pins[] = {
918918
SUNXI_FUNCTION_VARIANT(0x3, "emac", /* ETXD1 */
919919
PINCTRL_SUN7I_A20),
920920
SUNXI_FUNCTION(0x4, "keypad"), /* IN6 */
921+
SUNXI_FUNCTION(0x5, "sim"), /* DET */
921922
SUNXI_FUNCTION_IRQ(0x6, 16), /* EINT16 */
922923
SUNXI_FUNCTION(0x7, "csi1")), /* D16 */
923924
SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 17),

drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ static const unsigned usb1_pins[] = {182, 183};
10841084
static const int usb1_muxvals[] = {0, 0};
10851085
static const unsigned usb2_pins[] = {184, 185};
10861086
static const int usb2_muxvals[] = {0, 0};
1087-
static const unsigned usb3_pins[] = {186, 187};
1087+
static const unsigned usb3_pins[] = {187, 188};
10881088
static const int usb3_muxvals[] = {0, 0};
10891089
static const unsigned port_range0_pins[] = {
10901090
300, 301, 302, 303, 304, 305, 306, 307, /* PORT0x */

drivers/pinctrl/zte/pinctrl-zx.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,8 @@ static int zx_set_mux(struct pinctrl_dev *pctldev, unsigned int func_selector,
6464
struct zx_pinctrl_soc_info *info = zpctl->info;
6565
const struct pinctrl_pin_desc *pindesc = info->pins + group_selector;
6666
struct zx_pin_data *data = pindesc->drv_data;
67-
struct zx_mux_desc *mux = data->muxes;
68-
u32 mask = (1 << data->width) - 1;
69-
u32 offset = data->offset;
70-
u32 bitpos = data->bitpos;
67+
struct zx_mux_desc *mux;
68+
u32 mask, offset, bitpos;
7169
struct function_desc *func;
7270
unsigned long flags;
7371
u32 val, mval;
@@ -76,6 +74,11 @@ static int zx_set_mux(struct pinctrl_dev *pctldev, unsigned int func_selector,
7674
if (!data)
7775
return -EINVAL;
7876

77+
mux = data->muxes;
78+
mask = (1 << data->width) - 1;
79+
offset = data->offset;
80+
bitpos = data->bitpos;
81+
7982
func = pinmux_generic_get_function(pctldev, func_selector);
8083
if (!func)
8184
return -EINVAL;

include/linux/device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ struct dev_links_info {
843843
* hibernation, system resume and during runtime PM transitions
844844
* along with subsystem-level and driver-level callbacks.
845845
* @pins: For device pin management.
846-
* See Documentation/pinctrl.txt for details.
846+
* See Documentation/driver-api/pinctl.rst for details.
847847
* @msi_list: Hosts MSI descriptors
848848
* @msi_domain: The generic MSI domain this device is using.
849849
* @numa_node: NUMA node this device is close to.

include/linux/pinctrl/pinconf-generic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181
* it.
8282
* @PIN_CONFIG_OUTPUT: this will configure the pin as an output and drive a
8383
* value on the line. Use argument 1 to indicate high level, argument 0 to
84-
* indicate low level. (Please see Documentation/pinctrl.txt, section
85-
* "GPIO mode pitfalls" for a discussion around this parameter.)
84+
* indicate low level. (Please see Documentation/driver-api/pinctl.rst,
85+
* section "GPIO mode pitfalls" for a discussion around this parameter.)
8686
* @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power
8787
* supplies, the argument to this parameter (on a custom format) tells
8888
* the driver which alternative power source to use.

0 commit comments

Comments
 (0)