File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 15
15
#include <zephyr/logging/log.h>
16
16
17
17
LOG_MODULE_REGISTER (clock_control_it51xxx , LOG_LEVEL_ERR );
18
+ #include "soc_espi.h"
18
19
19
20
BUILD_ASSERT (DT_NUM_INST_STATUS_OKAY (DT_DRV_COMPAT ) == 1 ,
20
21
"only one ite,it51xxx-ecpm compatible node can be supported" );
@@ -171,11 +172,21 @@ static int clock_control_it51xxx_init(const struct device *dev)
171
172
ite_intc_save_and_disable_interrupts ();
172
173
}
173
174
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
174
182
if (reg_val != data -> pll_configuration [config -> pll_freq ]) {
175
183
/* configure PLL clock */
176
184
chip_configure_pll (dev , data -> pll_configuration [config -> pll_freq ]);
177
185
}
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
179
190
if (IS_ENABLED (CONFIG_ITE_IT51XXX_INTC )) {
180
191
ite_intc_restore_interrupts ();
181
192
}
You can’t perform that action at this time.
0 commit comments