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

pinctrl: qcom: ipq4019: add open drain support

[ Brian: adapted from from the Chromium OS kernel used on IPQ4019-based
WiFi APs. ]

Signed-off-by: Jaiganesh Narayanan <njaigane@codeaurora.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Link: https://lore.kernel.org/r/20200703080646.23233-1-computersforpeace@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Jaiganesh Narayanan and committed by
Linus Walleij
13355ca3 13c502c8

+16
+1
drivers/pinctrl/qcom/pinctrl-ipq4019.c
··· 254 254 .mux_bit = 2, \ 255 255 .pull_bit = 0, \ 256 256 .drv_bit = 6, \ 257 + .od_bit = 12, \ 257 258 .oe_bit = 9, \ 258 259 .in_bit = 0, \ 259 260 .out_bit = 1, \
+13
drivers/pinctrl/qcom/pinctrl-msm.c
··· 233 233 *bit = g->pull_bit; 234 234 *mask = 3; 235 235 break; 236 + case PIN_CONFIG_DRIVE_OPEN_DRAIN: 237 + *bit = g->od_bit; 238 + *mask = 1; 239 + break; 236 240 case PIN_CONFIG_DRIVE_STRENGTH: 237 241 *bit = g->drv_bit; 238 242 *mask = 7; ··· 314 310 if (!arg) 315 311 return -EINVAL; 316 312 break; 313 + case PIN_CONFIG_DRIVE_OPEN_DRAIN: 314 + /* Pin is not open-drain */ 315 + if (!arg) 316 + return -EINVAL; 317 + arg = 1; 318 + break; 317 319 case PIN_CONFIG_DRIVE_STRENGTH: 318 320 arg = msm_regval_to_drive(arg); 319 321 break; ··· 391 381 arg = MSM_PULL_UP_NO_KEEPER; 392 382 else 393 383 arg = MSM_PULL_UP; 384 + break; 385 + case PIN_CONFIG_DRIVE_OPEN_DRAIN: 386 + arg = 1; 394 387 break; 395 388 case PIN_CONFIG_DRIVE_STRENGTH: 396 389 /* Check for invalid values */
+2
drivers/pinctrl/qcom/pinctrl-msm.h
··· 38 38 * @mux_bit: Offset in @ctl_reg for the pinmux function selection. 39 39 * @pull_bit: Offset in @ctl_reg for the bias configuration. 40 40 * @drv_bit: Offset in @ctl_reg for the drive strength configuration. 41 + * @od_bit: Offset in @ctl_reg for controlling open drain. 41 42 * @oe_bit: Offset in @ctl_reg for controlling output enable. 42 43 * @in_bit: Offset in @io_reg for the input bit value. 43 44 * @out_bit: Offset in @io_reg for the output bit value. ··· 76 75 unsigned pull_bit:5; 77 76 unsigned drv_bit:5; 78 77 78 + unsigned od_bit:5; 79 79 unsigned oe_bit:5; 80 80 unsigned in_bit:5; 81 81 unsigned out_bit:5;