Skip to content

Commit e9a5a9e

Browse files
committed
Lotus: use the overridable to declare the platform_reset_handler()
Signed-off-by: Josh-Tsai <josh_tsai@compal.com>
1 parent 5d992a8 commit e9a5a9e

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

include/espi.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,8 @@ int espi_signal_is_vw(int signal);
101101
void espi_wait_vw_not_dirty(enum espi_vw_signal signal,
102102
unsigned int timeout_us);
103103

104+
#ifdef CONFIG_CUSTOMIZED_DESIGN
105+
__override_proto void platform_reset_handler(int plt_rst_status);
106+
#endif
107+
104108
#endif /* __CROS_EC_ESPI_H */

include/port80.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ int port_80_last(void);
4545
* @return 0: ddr detect; 1: ddr no detect.
4646
*/
4747
int amd_ddr_initialized_check(void);
48-
49-
void edp_reset_control(int enable);
5048
#endif
5149

5250
#endif /* __CROS_EC_PORT80_H */

zephyr/program/lotus/azalea/src/power_sequence.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,6 @@ enum power_state power_handle_state(enum power_state state)
561561
return state;
562562
}
563563

564-
/* Peripheral power control */
565-
void edp_reset_control(int enable)
566-
{
567-
/* unused function */
568-
}
569-
570564
static void peripheral_power_startup(void)
571565
{
572566
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_wlan_en), 1);

zephyr/program/lotus/lotus/src/power_sequence.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,9 +554,9 @@ void panel_interrupt_handler(enum gpio_signal signal)
554554
hook_call_deferred(&panel_power_control_data, 50 * MSEC);
555555
}
556556

557-
void edp_reset_control(int enable)
557+
void platform_reset_handler(int plt_rst_status)
558558
{
559-
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_ec_edp_reset), enable);
559+
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_ec_edp_reset), plt_rst_status);
560560
}
561561

562562
static void peripheral_power_startup(void)

zephyr/shim/src/espi.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ static void espi_chipset_reset(void)
169169
DECLARE_DEFERRED(espi_chipset_reset);
170170
#endif /* CONFIG_PLATFORM_EC_CHIPSET_RESET_HOOK */
171171

172+
#ifdef CONFIG_PLATFORM_EC_CUSTOMIZED_DESIGN
173+
__overridable void platform_reset_handler(int plt_rst_status)
174+
{
175+
}
176+
#endif
177+
172178
/*
173179
* Callback for vwire received.
174180
* PLTRST (platform reset) is handled specially by
@@ -192,14 +198,14 @@ static void espi_vwire_handler(const struct device *dev,
192198
if (event.evt_details == ESPI_VWIRE_SIGNAL_PLTRST &&
193199
event.evt_data == 0) {
194200
hook_call_deferred(&espi_chipset_reset_data, MSEC);
195-
#ifdef CONFIG_CUSTOMIZED_DESIGN
196-
edp_reset_control(0);
201+
#ifdef CONFIG_PLATFORM_EC_CUSTOMIZED_DESIGN
202+
platform_reset_handler(0);
197203
#endif
198204
update_ap_boot_time(PLTRST_LOW);
199205
} else if (event.evt_details == ESPI_VWIRE_SIGNAL_PLTRST &&
200206
event.evt_data == 1) {
201-
#ifdef CONFIG_CUSTOMIZED_DESIGN
202-
edp_reset_control(1);
207+
#ifdef CONFIG_PLATFORM_EC_CUSTOMIZED_DESIGN
208+
platform_reset_handler(1);
203209
#endif
204210
update_ap_boot_time(PLTRST_HIGH);
205211
}

0 commit comments

Comments
 (0)