Skip to content

Commit b09cd03

Browse files
Dino-Licarlescufi
authored andcommitted
soc: it8xxx2: Disable EGAD pin output of external gpio control
Setting IT8XXX2_EGPIO_EEPODD bit will disable EGAD pin output driving to avoid leakage when GPIO E1/E2 on it82002 are set to alternate function. Signed-off-by: Tim Lin <[email protected]> Signed-off-by: Dino Li <[email protected]>
1 parent 7127130 commit b09cd03

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

soc/riscv/ite_ec/common/chip_chipregs.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@
4545
#define IT8XXX2_GCTRL_BASE 0x00F02000
4646
#define IT8XXX2_GCTRL_EIDSR ECREG(IT8XXX2_GCTRL_BASE + 0x31)
4747

48+
/* --- External GPIO Control (EGPIO) --- */
49+
#define IT8XXX2_EGPIO_BASE 0x00F02100
50+
#define IT8XXX2_EGPIO_EGCR ECREG(IT8XXX2_EGPIO_BASE + 0x04)
51+
52+
/* EGPIO register fields */
53+
/*
54+
* 0x04: External GPIO Control
55+
* BIT(4): EXGPIO EGAD Pin Output Driving Disable
56+
*/
57+
#define IT8XXX2_EGPIO_EEPODD BIT(4)
58+
4859
/**
4960
*
5061
* (11xxh) Interrupt controller (INTC)

soc/riscv/ite_ec/it8xxx2/soc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,11 @@ static int ite_it8xxx2_init(void)
287287
IT8XXX2_SMB_SFFCTL &= ~IT8XXX2_SMB_HSAPE;
288288
#elif CONFIG_SOC_IT8XXX2_REG_SET_V2
289289
IT8XXX2_SMB_SCLKTS_BRGS &= ~IT8XXX2_SMB_PREDEN;
290+
/*
291+
* Setting this bit will disable EGAD pin output driving to avoid
292+
* leakage when GPIO E1/E2 on it82002 are set to alternate function.
293+
*/
294+
IT8XXX2_EGPIO_EGCR |= IT8XXX2_EGPIO_EEPODD;
290295
#endif
291296

292297
#if DT_NODE_HAS_STATUS(DT_NODELABEL(uart1), okay)

0 commit comments

Comments
 (0)