Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Zhiyong Tao and committed by
Linus Walleij
6af8df4c 8670710f

+6 -2
+6 -2
drivers/pinctrl/mediatek/pinctrl-mtk-common.c
··· 293 293 unsigned int pin, bool enable, bool isup, unsigned int arg) 294 294 { 295 295 unsigned int bit; 296 - unsigned int reg_pullen, reg_pullsel; 296 + unsigned int reg_pullen, reg_pullsel, r1r0; 297 297 int ret; 298 298 299 299 /* Some pins' pull setting are very different, ··· 301 301 * resistor bit, so we need this special handle. 302 302 */ 303 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 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 310 if (!ret) 307 311 return 0; 308 312 }