Commit fbb7b92f authored by Linus Torvalds's avatar Linus Torvalds

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)
parents 7bbcd1b8 c5272a28
...@@ -1110,7 +1110,7 @@ void devm_pinctrl_put(struct pinctrl *p) ...@@ -1110,7 +1110,7 @@ void devm_pinctrl_put(struct pinctrl *p)
EXPORT_SYMBOL_GPL(devm_pinctrl_put); EXPORT_SYMBOL_GPL(devm_pinctrl_put);
int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps, int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
bool dup, bool locked) bool dup)
{ {
int i, ret; int i, ret;
struct pinctrl_maps *maps_node; struct pinctrl_maps *maps_node;
...@@ -1178,11 +1178,9 @@ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps, ...@@ -1178,11 +1178,9 @@ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
maps_node->maps = maps; maps_node->maps = maps;
} }
if (!locked) mutex_lock(&pinctrl_maps_mutex);
mutex_lock(&pinctrl_maps_mutex);
list_add_tail(&maps_node->node, &pinctrl_maps); list_add_tail(&maps_node->node, &pinctrl_maps);
if (!locked) mutex_unlock(&pinctrl_maps_mutex);
mutex_unlock(&pinctrl_maps_mutex);
return 0; return 0;
} }
...@@ -1197,7 +1195,7 @@ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps, ...@@ -1197,7 +1195,7 @@ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
int pinctrl_register_mappings(struct pinctrl_map const *maps, int pinctrl_register_mappings(struct pinctrl_map const *maps,
unsigned num_maps) unsigned num_maps)
{ {
return pinctrl_register_map(maps, num_maps, true, false); return pinctrl_register_map(maps, num_maps, true);
} }
void pinctrl_unregister_map(struct pinctrl_map const *map) void pinctrl_unregister_map(struct pinctrl_map const *map)
......
...@@ -183,7 +183,7 @@ static inline struct pin_desc *pin_desc_get(struct pinctrl_dev *pctldev, ...@@ -183,7 +183,7 @@ static inline struct pin_desc *pin_desc_get(struct pinctrl_dev *pctldev,
} }
int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps, int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
bool dup, bool locked); bool dup);
void pinctrl_unregister_map(struct pinctrl_map const *map); void pinctrl_unregister_map(struct pinctrl_map const *map);
extern int pinctrl_force_sleep(struct pinctrl_dev *pctldev); extern int pinctrl_force_sleep(struct pinctrl_dev *pctldev);
......
...@@ -92,7 +92,7 @@ static int dt_remember_or_free_map(struct pinctrl *p, const char *statename, ...@@ -92,7 +92,7 @@ static int dt_remember_or_free_map(struct pinctrl *p, const char *statename,
dt_map->num_maps = num_maps; dt_map->num_maps = num_maps;
list_add_tail(&dt_map->node, &p->dt_maps); list_add_tail(&dt_map->node, &p->dt_maps);
return pinctrl_register_map(map, num_maps, false, true); return pinctrl_register_map(map, num_maps, false);
} }
struct pinctrl_dev *of_pinctrl_get(struct device_node *np) struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
......
...@@ -881,6 +881,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset, ...@@ -881,6 +881,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
if (!mtk_eint_get_mask(pctl, eint_num)) { if (!mtk_eint_get_mask(pctl, eint_num)) {
mtk_eint_mask(d); mtk_eint_mask(d);
unmask = 1; unmask = 1;
} else {
unmask = 0;
} }
clr_bit = 0xff << eint_offset; clr_bit = 0xff << eint_offset;
......
...@@ -364,7 +364,7 @@ static struct mvebu_mpp_mode mv88f6710_mpp_modes[] = { ...@@ -364,7 +364,7 @@ static struct mvebu_mpp_mode mv88f6710_mpp_modes[] = {
MPP_FUNCTION(0x5, "audio", "mclk"), MPP_FUNCTION(0x5, "audio", "mclk"),
MPP_FUNCTION(0x6, "uart0", "cts")), MPP_FUNCTION(0x6, "uart0", "cts")),
MPP_MODE(63, MPP_MODE(63,
MPP_FUNCTION(0x0, "gpo", NULL), MPP_FUNCTION(0x0, "gpio", NULL),
MPP_FUNCTION(0x1, "spi0", "sck"), MPP_FUNCTION(0x1, "spi0", "sck"),
MPP_FUNCTION(0x2, "tclk", NULL)), MPP_FUNCTION(0x2, "tclk", NULL)),
MPP_MODE(64, MPP_MODE(64,
......
...@@ -260,6 +260,7 @@ static int pmic_gpio_set_mux(struct pinctrl_dev *pctldev, unsigned function, ...@@ -260,6 +260,7 @@ static int pmic_gpio_set_mux(struct pinctrl_dev *pctldev, unsigned function,
val = 1; val = 1;
} }
val = val << PMIC_GPIO_REG_MODE_DIR_SHIFT;
val |= pad->function << PMIC_GPIO_REG_MODE_FUNCTION_SHIFT; val |= pad->function << PMIC_GPIO_REG_MODE_FUNCTION_SHIFT;
val |= pad->out_value & PMIC_GPIO_REG_MODE_VALUE_SHIFT; val |= pad->out_value & PMIC_GPIO_REG_MODE_VALUE_SHIFT;
......
...@@ -370,6 +370,7 @@ static int pmic_mpp_set_mux(struct pinctrl_dev *pctldev, unsigned function, ...@@ -370,6 +370,7 @@ static int pmic_mpp_set_mux(struct pinctrl_dev *pctldev, unsigned function,
} }
} }
val = val << PMIC_MPP_REG_MODE_DIR_SHIFT;
val |= pad->function << PMIC_MPP_REG_MODE_FUNCTION_SHIFT; val |= pad->function << PMIC_MPP_REG_MODE_FUNCTION_SHIFT;
val |= pad->out_value & PMIC_MPP_REG_MODE_VALUE_MASK; val |= pad->out_value & PMIC_MPP_REG_MODE_VALUE_MASK;
...@@ -576,10 +577,11 @@ static void pmic_mpp_config_dbg_show(struct pinctrl_dev *pctldev, ...@@ -576,10 +577,11 @@ static void pmic_mpp_config_dbg_show(struct pinctrl_dev *pctldev,
if (pad->input_enabled) { if (pad->input_enabled) {
ret = pmic_mpp_read(state, pad, PMIC_MPP_REG_RT_STS); ret = pmic_mpp_read(state, pad, PMIC_MPP_REG_RT_STS);
if (!ret) { if (ret < 0)
ret &= PMIC_MPP_REG_RT_STS_VAL_MASK; return;
pad->out_value = ret;
} ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
pad->out_value = ret;
} }
seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in"); seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment