Skip to content

Commit 706b7e9

Browse files
GTLin08kartben
authored andcommitted
drivers/clock: it51xxx: Disable eSPI pad before changing PLL sequence
We have to disable eSPI pad before changing PLL sequence or sequence will fail if CS# pin is low. Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
1 parent a8e467c commit 706b7e9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

drivers/clock_control/clock_control_it51xxx.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <zephyr/logging/log.h>
1616

1717
LOG_MODULE_REGISTER(clock_control_it51xxx, LOG_LEVEL_ERR);
18+
#include "soc_espi.h"
1819

1920
BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT) == 1,
2021
"only one ite,it51xxx-ecpm compatible node can be supported");
@@ -171,11 +172,21 @@ static int clock_control_it51xxx_init(const struct device *dev)
171172
ite_intc_save_and_disable_interrupts();
172173
}
173174

175+
#ifdef CONFIG_ESPI
176+
/*
177+
* We have to disable eSPI pad before changing PLL sequence
178+
* or sequence will fail if CS# pin is low.
179+
*/
180+
espi_ite_ec_enable_pad_ctrl(ESPI_ITE_SOC_DEV, false);
181+
#endif
174182
if (reg_val != data->pll_configuration[config->pll_freq]) {
175183
/* configure PLL clock */
176184
chip_configure_pll(dev, data->pll_configuration[config->pll_freq]);
177185
}
178-
186+
#ifdef CONFIG_ESPI
187+
/* Enable eSPI pad after changing PLL sequence */
188+
espi_ite_ec_enable_pad_ctrl(ESPI_ITE_SOC_DEV, true);
189+
#endif
179190
if (IS_ENABLED(CONFIG_ITE_IT51XXX_INTC)) {
180191
ite_intc_restore_interrupts();
181192
}

0 commit comments

Comments
 (0)