From: Drew Fustini Date: Wed, 1 Jul 2020 01:33:19 +0000 (+0200) Subject: pinctrl: single: parse #pinctrl-cells = 2 X-Git-Tag: v5.15~3141^2~62 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a133954188887a830b5ce438a287a5e4e234b1be;p=platform%2Fkernel%2Flinux-starfive.git pinctrl: single: parse #pinctrl-cells = 2 If "pinctrl-single,pins" has 3 arguments (offset, conf, mux), then pcs_parse_one_pinctrl_entry() does an OR operation on conf and mux to get the value to store in the register. Signed-off-by: Drew Fustini Acked-by: Tony Lindgren Acked-by: Haojian Zhuang Link: https://lore.kernel.org/r/20200701013320.130441-2-drew@beagleboard.org Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index a9d5119..17b32ca 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -1017,10 +1017,17 @@ static int pcs_parse_one_pinctrl_entry(struct pcs_device *pcs, break; } - /* Index plus one value cell */ offset = pinctrl_spec.args[0]; vals[found].reg = pcs->base + offset; - vals[found].val = pinctrl_spec.args[1]; + + switch (pinctrl_spec.args_count) { + case 2: + vals[found].val = pinctrl_spec.args[1]; + break; + case 3: + vals[found].val = (pinctrl_spec.args[1] | pinctrl_spec.args[2]); + break; + } dev_dbg(pcs->dev, "%pOFn index: 0x%x value: 0x%x\n", pinctrl_spec.np, offset, pinctrl_spec.args[1]);