aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhiyong Tao <zhiyong.tao@mediatek.com>2018-03-21 22:58:42 -0400
committerLinus Walleij <linus.walleij@linaro.org>2018-03-26 04:56:54 -0400
commit6af8df4c670a19158182e9f55fc0decb1cf8baa6 (patch)
tree172139ead53e614196eb30e46f5c3cc0c91c6afb
parent8670710ff8feda2183474f5e0e9cbb4071761e47 (diff)
pintcrl: mtk: support bias-disable of generic and special pins simultaneously
For generic pins, parameter "arg" is 0 or 1. For special pins, bias-disable is set by R0R1, so we need transmited "00" to set bias-disable When we set "bias-disable" as high-z property, the parameter should be "MTK_PUPD_SET_R1R0_00". Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com> Reviewed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mtk-common.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index e1615614a184..c3975a04d1cd 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -293,7 +293,7 @@ static int mtk_pconf_set_pull_select(struct mtk_pinctrl *pctl,
293 unsigned int pin, bool enable, bool isup, unsigned int arg) 293 unsigned int pin, bool enable, bool isup, unsigned int arg)
294{ 294{
295 unsigned int bit; 295 unsigned int bit;
296 unsigned int reg_pullen, reg_pullsel; 296 unsigned int reg_pullen, reg_pullsel, r1r0;
297 int ret; 297 int ret;
298 298
299 /* Some pins' pull setting are very different, 299 /* Some pins' pull setting are very different,
@@ -301,8 +301,12 @@ static int mtk_pconf_set_pull_select(struct mtk_pinctrl *pctl,
301 * resistor bit, so we need this special handle. 301 * resistor bit, so we need this special handle.
302 */ 302 */
303 if (pctl->devdata->spec_pull_set) { 303 if (pctl->devdata->spec_pull_set) {
304 /* For special pins, bias-disable is set by R1R0,
305 * the parameter should be "MTK_PUPD_SET_R1R0_00".
306 */
307 r1r0 = enable ? arg : MTK_PUPD_SET_R1R0_00;
304 ret = pctl->devdata->spec_pull_set(mtk_get_regmap(pctl, pin), 308 ret = pctl->devdata->spec_pull_set(mtk_get_regmap(pctl, pin),
305 pin, pctl->devdata->port_align, isup, arg); 309 pin, pctl->devdata->port_align, isup, r1r0);
306 if (!ret) 310 if (!ret)
307 return 0; 311 return 0;
308 } 312 }