Skip to content

Commit 5d992a8

Browse files
committed
lotus:modified the panel sequence
Follow the apu_enbkl signal to control the sm_panel_bken_ec signal Follow the platform reset signal to control the edp reset signal Signed-off-by: Josh-Tsai <josh_tsai@compal.com>
1 parent f930cf9 commit 5d992a8

File tree

6 files changed

+43
-5
lines changed

6 files changed

+43
-5
lines changed

include/port80.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ 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);
4850
#endif
4951

5052
#endif /* __CROS_EC_PORT80_H */

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "keyboard_protocol.h"
1919
#include "lpc.h"
2020
#include "power.h"
21+
#include "port80.h"
2122
#include "power_sequence.h"
2223
#include "task.h"
2324
#include "util.h"
@@ -561,6 +562,11 @@ enum power_state power_handle_state(enum power_state state)
561562
}
562563

563564
/* Peripheral power control */
565+
void edp_reset_control(int enable)
566+
{
567+
/* unused function */
568+
}
569+
564570
static void peripheral_power_startup(void)
565571
{
566572
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_wlan_en), 1);

zephyr/program/lotus/lotus/gpio.dtsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@
236236
gpio_f_beam_open_l: f_beam_open_l {
237237
gpios = <&gpiof 0 GPIO_INPUT>;
238238
};
239-
enbkl_apu {
239+
gpio_enblk_apu: enbkl_apu {
240240
gpios = <&gpioe 0 GPIO_INPUT>; /* monitor APU EDP BKL */
241241
};
242242
dgpu_pwr_en {

zephyr/program/lotus/lotus/interrupts.dtsi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,10 @@
7777
flags = <GPIO_INT_EDGE_RISING>;
7878
handler = "dp_hot_plug_interrupt";
7979
};
80+
int_enblk_apu_interrupt: enable_apu_interrupt {
81+
irq-pin = <&gpio_enblk_apu>;
82+
flags = <GPIO_INT_EDGE_BOTH>;
83+
handler = "panel_interrupt_handler";
84+
};
8085
};
8186
};

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

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
#include "lpc.h"
1919
#include "power.h"
2020
#include "power_sequence.h"
21+
#include "port80.h"
2122
#include "task.h"
23+
#include "timer.h"
2224
#include "util.h"
2325
#include "gpu.h"
2426

@@ -535,7 +537,28 @@ enum power_state power_handle_state(enum power_state state)
535537
return state;
536538
}
537539

540+
static void panel_power_control(void)
541+
{
542+
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_sm_panel_bken_ec), 1);
543+
}
544+
DECLARE_DEFERRED(panel_power_control);
545+
538546
/* Peripheral power control */
547+
void panel_interrupt_handler(enum gpio_signal signal)
548+
{
549+
int panel_status = gpio_pin_get_dt(GPIO_DT_FROM_NODELABEL(gpio_enblk_apu));
550+
551+
if (panel_status == 0)
552+
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_sm_panel_bken_ec), 0);
553+
else
554+
hook_call_deferred(&panel_power_control_data, 50 * MSEC);
555+
}
556+
557+
void edp_reset_control(int enable)
558+
{
559+
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_ec_edp_reset), enable);
560+
}
561+
539562
static void peripheral_power_startup(void)
540563
{
541564
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_wlan_en), 1);
@@ -548,10 +571,8 @@ DECLARE_HOOK(HOOK_CHIPSET_STARTUP, peripheral_power_startup, HOOK_PRIO_DEFAULT);
548571
static void peripheral_power_resume(void)
549572
{
550573
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_ec_mute_l), 1);
551-
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_ec_edp_reset), 1);
552574
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_en_invpwr), 1);
553575
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_sleep_l), 1);
554-
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_sm_panel_bken_ec), 1);
555576
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_ssd2_pwr_en), 1);
556577
}
557578
DECLARE_HOOK(HOOK_CHIPSET_RESUME, peripheral_power_resume, HOOK_PRIO_DEFAULT);
@@ -569,10 +590,8 @@ DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, peripheral_power_shutdown, HOOK_PRIO_DEFAULT
569590
static void peripheral_power_suspend(void)
570591
{
571592
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_ec_mute_l), 0);
572-
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_ec_edp_reset), 0);
573593
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_en_invpwr), 0);
574594
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_sleep_l), 0);
575-
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_sm_panel_bken_ec), 0);
576595
gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_ssd2_pwr_en), 0);
577596
}
578597
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, peripheral_power_suspend, HOOK_PRIO_DEFAULT);

zephyr/shim/src/espi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,15 @@ static void espi_vwire_handler(const struct device *dev,
192192
if (event.evt_details == ESPI_VWIRE_SIGNAL_PLTRST &&
193193
event.evt_data == 0) {
194194
hook_call_deferred(&espi_chipset_reset_data, MSEC);
195+
#ifdef CONFIG_CUSTOMIZED_DESIGN
196+
edp_reset_control(0);
197+
#endif
195198
update_ap_boot_time(PLTRST_LOW);
196199
} else if (event.evt_details == ESPI_VWIRE_SIGNAL_PLTRST &&
197200
event.evt_data == 1) {
201+
#ifdef CONFIG_CUSTOMIZED_DESIGN
202+
edp_reset_control(1);
203+
#endif
198204
update_ap_boot_time(PLTRST_HIGH);
199205
}
200206
#endif

0 commit comments

Comments
 (0)