Browse Source

drivers/pinctrl: ite: Don't clear FUNC3 setting unless alt_func is FUNC3

Previously, FUNC_3 related setting were cleared unconditionally,
regardless of the selected alternate function. This could
unintentionally disable FUNC_3 settings when configuring other
alternate functions.

This change ensures that FUNC_3 gcr/ext bits are only cleared
when alt_func is IT8XXX2_ALT_FUNC_3.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
pull/92460/head
Tim Lin 2 weeks ago committed by Daniel DeGrasse
parent
commit
0c627e94c8
  1. 2
      drivers/pinctrl/pinctrl_ite_it8xxx2.c

2
drivers/pinctrl/pinctrl_ite_it8xxx2.c

@ -176,6 +176,7 @@ static int pinctrl_gpio_it8xxx2_configure_pins(const pinctrl_soc_pin_t *pins) @@ -176,6 +176,7 @@ static int pinctrl_gpio_it8xxx2_configure_pins(const pinctrl_soc_pin_t *pins)
/*
* Handle alternate function.
*/
if (pins->alt_func == IT8XXX2_ALT_FUNC_3) {
if (reg_func3_gcr != NULL) {
*reg_func3_gcr &= ~gpio->func3_en_mask[pin];
}
@ -183,6 +184,7 @@ static int pinctrl_gpio_it8xxx2_configure_pins(const pinctrl_soc_pin_t *pins) @@ -183,6 +184,7 @@ static int pinctrl_gpio_it8xxx2_configure_pins(const pinctrl_soc_pin_t *pins)
if (reg_func3_ext != NULL) {
*reg_func3_ext &= ~gpio->func3_ext_mask[pin];
}
}
switch (pins->alt_func) {
case IT8XXX2_ALT_FUNC_1:

Loading…
Cancel
Save