Skip to content

Commit fbb7b92

Browse files
committed
Merge tag 'pinctrl-v4.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control fixes from Linus Walleij: "Here is a smallish set of pin control fixes for the v4.1 cycle, collected the last two weeks: - fix a real nasty legacy bug that has screwed up the protection of adding pinctrl maps dynamically. Normally this didn't happen so much but Dough Anderson ran into it and fixed it, kudos! - minor driver fixes for Qualcomm spmi, mediatek and Marvell drivers" * tag 'pinctrl-v4.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: Don't just pretend to protect pinctrl_maps, do it for real pinctrl: mediatek: mtk-common: initialize unmask pinctrl: qcom-spmi-mpp: Fix input value report pinctrl: qcom-spmi: Fix pin direction configuration pinctrl: mvebu: Fix mapping of pin 63 (gpo -> gpio)
2 parents 7bbcd1b + c5272a2 commit fbb7b92

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

drivers/pinctrl/core.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ void devm_pinctrl_put(struct pinctrl *p)
11101110
EXPORT_SYMBOL_GPL(devm_pinctrl_put);
11111111

11121112
int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
1113-
bool dup, bool locked)
1113+
bool dup)
11141114
{
11151115
int i, ret;
11161116
struct pinctrl_maps *maps_node;
@@ -1178,11 +1178,9 @@ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
11781178
maps_node->maps = maps;
11791179
}
11801180

1181-
if (!locked)
1182-
mutex_lock(&pinctrl_maps_mutex);
1181+
mutex_lock(&pinctrl_maps_mutex);
11831182
list_add_tail(&maps_node->node, &pinctrl_maps);
1184-
if (!locked)
1185-
mutex_unlock(&pinctrl_maps_mutex);
1183+
mutex_unlock(&pinctrl_maps_mutex);
11861184

11871185
return 0;
11881186
}
@@ -1197,7 +1195,7 @@ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
11971195
int pinctrl_register_mappings(struct pinctrl_map const *maps,
11981196
unsigned num_maps)
11991197
{
1200-
return pinctrl_register_map(maps, num_maps, true, false);
1198+
return pinctrl_register_map(maps, num_maps, true);
12011199
}
12021200

12031201
void pinctrl_unregister_map(struct pinctrl_map const *map)

drivers/pinctrl/core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static inline struct pin_desc *pin_desc_get(struct pinctrl_dev *pctldev,
183183
}
184184

185185
int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
186-
bool dup, bool locked);
186+
bool dup);
187187
void pinctrl_unregister_map(struct pinctrl_map const *map);
188188

189189
extern int pinctrl_force_sleep(struct pinctrl_dev *pctldev);

drivers/pinctrl/devicetree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static int dt_remember_or_free_map(struct pinctrl *p, const char *statename,
9292
dt_map->num_maps = num_maps;
9393
list_add_tail(&dt_map->node, &p->dt_maps);
9494

95-
return pinctrl_register_map(map, num_maps, false, true);
95+
return pinctrl_register_map(map, num_maps, false);
9696
}
9797

9898
struct pinctrl_dev *of_pinctrl_get(struct device_node *np)

drivers/pinctrl/mediatek/pinctrl-mtk-common.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
881881
if (!mtk_eint_get_mask(pctl, eint_num)) {
882882
mtk_eint_mask(d);
883883
unmask = 1;
884+
} else {
885+
unmask = 0;
884886
}
885887

886888
clr_bit = 0xff << eint_offset;

drivers/pinctrl/mvebu/pinctrl-armada-370.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ static struct mvebu_mpp_mode mv88f6710_mpp_modes[] = {
364364
MPP_FUNCTION(0x5, "audio", "mclk"),
365365
MPP_FUNCTION(0x6, "uart0", "cts")),
366366
MPP_MODE(63,
367-
MPP_FUNCTION(0x0, "gpo", NULL),
367+
MPP_FUNCTION(0x0, "gpio", NULL),
368368
MPP_FUNCTION(0x1, "spi0", "sck"),
369369
MPP_FUNCTION(0x2, "tclk", NULL)),
370370
MPP_MODE(64,

drivers/pinctrl/qcom/pinctrl-spmi-gpio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ static int pmic_gpio_set_mux(struct pinctrl_dev *pctldev, unsigned function,
260260
val = 1;
261261
}
262262

263+
val = val << PMIC_GPIO_REG_MODE_DIR_SHIFT;
263264
val |= pad->function << PMIC_GPIO_REG_MODE_FUNCTION_SHIFT;
264265
val |= pad->out_value & PMIC_GPIO_REG_MODE_VALUE_SHIFT;
265266

drivers/pinctrl/qcom/pinctrl-spmi-mpp.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ static int pmic_mpp_set_mux(struct pinctrl_dev *pctldev, unsigned function,
370370
}
371371
}
372372

373+
val = val << PMIC_MPP_REG_MODE_DIR_SHIFT;
373374
val |= pad->function << PMIC_MPP_REG_MODE_FUNCTION_SHIFT;
374375
val |= pad->out_value & PMIC_MPP_REG_MODE_VALUE_MASK;
375376

@@ -576,10 +577,11 @@ static void pmic_mpp_config_dbg_show(struct pinctrl_dev *pctldev,
576577

577578
if (pad->input_enabled) {
578579
ret = pmic_mpp_read(state, pad, PMIC_MPP_REG_RT_STS);
579-
if (!ret) {
580-
ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
581-
pad->out_value = ret;
582-
}
580+
if (ret < 0)
581+
return;
582+
583+
ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
584+
pad->out_value = ret;
583585
}
584586

585587
seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in");

0 commit comments

Comments
 (0)