Skip to content

Commit

Permalink
ITE: drivers/pinctrl: Distinguish between func3-gcr and func3-ext set…
Browse files Browse the repository at this point in the history
…tings

This PR separates the GCTRL settings from func3-gcr to func3-ext.

Signed-off-by: Tim Lin <[email protected]>
  • Loading branch information
GTLin08 authored and nashif committed Jan 26, 2024
1 parent 5808018 commit a0a599b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
8 changes: 6 additions & 2 deletions drivers/pinctrl/pinctrl_ite_it8xxx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ static int pinctrl_gpio_it8xxx2_configure_pins(const pinctrl_soc_pin_t *pins)
/*
* Handle alternate function.
*/
if (reg_func3_gcr != NULL) {
*reg_func3_gcr &= ~gpio->func3_en_mask[pin];
}
/* Ensure that func3-ext setting is in default state. */
if (reg_func3_ext != NULL) {
*reg_func3_ext &= ~gpio->func3_ext_mask[pin];
Expand All @@ -179,8 +182,9 @@ static int pinctrl_gpio_it8xxx2_configure_pins(const pinctrl_soc_pin_t *pins)
* Func3: In addition to the alternate setting above,
* Func3 also need to set the general control.
*/
*reg_func3_gcr |= gpio->func3_en_mask[pin];

if (reg_func3_gcr != NULL) {
*reg_func3_gcr |= gpio->func3_en_mask[pin];
}
/* Func3-external: Some pins require external setting. */
if (reg_func3_ext != NULL) {
*reg_func3_ext |= gpio->func3_ext_mask[pin];
Expand Down
16 changes: 8 additions & 8 deletions dts/riscv/ite/it82xx2.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -524,14 +524,14 @@
pinctrle: pinctrl@f01680 {
compatible = "ite,it8xxx2-pinctrl-func";
reg = <0x00f01680 8>; /* GPCR */
func3-gcr = <0xf02032 0xf03e16 0xf03e16 NO_FUNC
NO_FUNC 0xf03e10 NO_FUNC 0xf02032>;
func3-en-mask = <0x01 0x20 0x20 0
0 0x08 0 0x01 >;
func3-ext = <NO_FUNC 0xf02032 0xf02032 NO_FUNC
NO_FUNC NO_FUNC NO_FUNC NO_FUNC>;
func3-ext-mask = <0 0x02 0x02 0
0 0 0 0 >;
func3-gcr = <NO_FUNC 0xf03e16 0xf03e16 NO_FUNC
NO_FUNC 0xf03e10 NO_FUNC NO_FUNC >;
func3-en-mask = <0 0x20 0x20 0
0 0x08 0 0 >;
func3-ext = <0xf02032 0xf02032 0xf02032 NO_FUNC
NO_FUNC NO_FUNC NO_FUNC 0xf02032>;
func3-ext-mask = <0x01 0x02 0x02 0
0 0 0 0x01 >;
func4-gcr = <0xf03e13 NO_FUNC NO_FUNC NO_FUNC
NO_FUNC NO_FUNC NO_FUNC NO_FUNC >;
func4-en-mask = <0x01 0 0 0
Expand Down

0 comments on commit a0a599b

Please sign in to comment.