forked from Minki/linux
Pin control fixes for the v4.1 series:
- 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. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJVSzhAAAoJEEEQszewGV1zowkQAMgm637FIt5C4CvcIco83rrY iCYx1s2vGFiLPCORMgVdtDLVBB/kv2d8QKci4qQKFIMPV2hOPTO/eFlWWT8mrNQy sdjbL5aACQ7zUCBp+vwdeLfAvOIr4fxbrcSv9EnnBPE1UEYev9RSdtTHFv3V6AXR 4yBaWC084Z3vib32XPCt1zfe4umXMPjKWpZ6qJrFybh8dXKJBLUwrBmMYEHhRofz pb8hRDViCRl4hbfKc8HF9C7AFuJLNZqhMouk4NooyW6cjWgvfy7Fum1Nkxjdl5NC s9/1o+vQ9/C2eRjF2MxfxpQhTCxqojjC4e70rHoO5dt2vry1MskSF4tPLEBGFK/N v7XDTbFKIPkQB5DISw5uIs4xl6KvUZ7DTK0LQ2Og8uOonX1BBPAW60N7Z3y46nul j4I+UhpWzYwYpdHRTlAkGmKbCj+VgGpopHe3Lyf+Viv+Pm4H2s2iBmSmpMOj/HAj AweQO2FpKthjpz8MJF3FKxtGkokTF1M0TilgAWZE5QrWpNCfzt9r+/Brr2O9dhi0 XjMN3J8vZ/tpCjPT5n+w11BOgXamd53yygj5Al5AM1f6PPglS6GbxsYx3v1Y86Y4 JLIq0jp18XCumF58A+MAw5SrEC3wkKgqSk2xpIVp28EyyOHXE2ZH84cZ+Ur7Dx8L iMdlCMS8AhfZj8ae0Vfa =O9AP -----END PGP SIGNATURE----- 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)
This commit is contained in:
commit
fbb7b92f16
@ -1110,7 +1110,7 @@ void devm_pinctrl_put(struct pinctrl *p)
|
||||
EXPORT_SYMBOL_GPL(devm_pinctrl_put);
|
||||
|
||||
int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_maps,
|
||||
bool dup, bool locked)
|
||||
bool dup)
|
||||
{
|
||||
int i, ret;
|
||||
struct pinctrl_maps *maps_node;
|
||||
@ -1178,11 +1178,9 @@ int pinctrl_register_map(struct pinctrl_map const *maps, unsigned num_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);
|
||||
if (!locked)
|
||||
mutex_unlock(&pinctrl_maps_mutex);
|
||||
mutex_unlock(&pinctrl_maps_mutex);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -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,
|
||||
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)
|
||||
|
@ -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,
|
||||
bool dup, bool locked);
|
||||
bool dup);
|
||||
void pinctrl_unregister_map(struct pinctrl_map const *map);
|
||||
|
||||
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,
|
||||
dt_map->num_maps = num_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)
|
||||
|
@ -881,6 +881,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
|
||||
if (!mtk_eint_get_mask(pctl, eint_num)) {
|
||||
mtk_eint_mask(d);
|
||||
unmask = 1;
|
||||
} else {
|
||||
unmask = 0;
|
||||
}
|
||||
|
||||
clr_bit = 0xff << eint_offset;
|
||||
|
@ -364,7 +364,7 @@ static struct mvebu_mpp_mode mv88f6710_mpp_modes[] = {
|
||||
MPP_FUNCTION(0x5, "audio", "mclk"),
|
||||
MPP_FUNCTION(0x6, "uart0", "cts")),
|
||||
MPP_MODE(63,
|
||||
MPP_FUNCTION(0x0, "gpo", NULL),
|
||||
MPP_FUNCTION(0x0, "gpio", NULL),
|
||||
MPP_FUNCTION(0x1, "spi0", "sck"),
|
||||
MPP_FUNCTION(0x2, "tclk", NULL)),
|
||||
MPP_MODE(64,
|
||||
|
@ -260,6 +260,7 @@ static int pmic_gpio_set_mux(struct pinctrl_dev *pctldev, unsigned function,
|
||||
val = 1;
|
||||
}
|
||||
|
||||
val = val << PMIC_GPIO_REG_MODE_DIR_SHIFT;
|
||||
val |= pad->function << PMIC_GPIO_REG_MODE_FUNCTION_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,
|
||||
}
|
||||
}
|
||||
|
||||
val = val << PMIC_MPP_REG_MODE_DIR_SHIFT;
|
||||
val |= pad->function << PMIC_MPP_REG_MODE_FUNCTION_SHIFT;
|
||||
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,
|
||||
|
||||
if (pad->input_enabled) {
|
||||
ret = pmic_mpp_read(state, pad, PMIC_MPP_REG_RT_STS);
|
||||
if (!ret) {
|
||||
ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
|
||||
pad->out_value = ret;
|
||||
}
|
||||
if (ret < 0)
|
||||
return;
|
||||
|
||||
ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
|
||||
pad->out_value = ret;
|
||||
}
|
||||
|
||||
seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in");
|
||||
|
Loading…
Reference in New Issue
Block a user