diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c index c29364c9ef..aa1877eac6 100644 --- a/src/ec/lenovo/h8/h8.c +++ b/src/ec/lenovo/h8/h8.c @@ -221,6 +221,8 @@ struct device_operations h8_dev_ops = { .init = h8_init, }; +void __weak h8_mb_init(void){ /* NOOP */ } + static void h8_enable(struct device *dev) { struct ec_lenovo_h8_config *conf = dev->chip_info; @@ -340,6 +342,7 @@ static void h8_enable(struct device *dev) h8_charge_priority(val); h8_set_audio_mute(0); + h8_mb_init(); } struct chip_operations ec_lenovo_h8_ops = { diff --git a/src/ec/lenovo/h8/h8.h b/src/ec/lenovo/h8/h8.h index 6c2f86ab51..c5092c3a29 100644 --- a/src/ec/lenovo/h8/h8.h +++ b/src/ec/lenovo/h8/h8.h @@ -35,6 +35,11 @@ bool h8_wwan_nv_enable(void); bool h8_has_wwan(const struct device *dev); void h8_ssdt_generator(const struct device *dev); +/* + * boards needing specific h8-related inits could override it + */ +void h8_mb_init(void); + /* EC registers */ #define H8_CONFIG0 0x00 diff --git a/src/mainboard/lenovo/t410/dock.c b/src/mainboard/lenovo/t410/dock.c index 122376ac05..37a2908c1d 100644 --- a/src/mainboard/lenovo/t410/dock.c +++ b/src/mainboard/lenovo/t410/dock.c @@ -7,13 +7,14 @@ #include #include -void init_dock(void) +void h8_mb_init(void) { if (dock_present()) { printk(BIOS_DEBUG, "dock is connected\n"); dock_connect(); - } else + } else { printk(BIOS_DEBUG, "dock is not connected\n"); + } } void dock_connect(void) diff --git a/src/mainboard/lenovo/t410/mainboard.c b/src/mainboard/lenovo/t410/mainboard.c index c359173a4a..7953b2e575 100644 --- a/src/mainboard/lenovo/t410/mainboard.c +++ b/src/mainboard/lenovo/t410/mainboard.c @@ -10,7 +10,6 @@ static void mainboard_enable(struct device *dev) install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_LFP, 2); - init_dock(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/lenovo/x201/dock.c b/src/mainboard/lenovo/x201/dock.c index 258d8f8eaa..7354eeeb41 100644 --- a/src/mainboard/lenovo/x201/dock.c +++ b/src/mainboard/lenovo/x201/dock.c @@ -7,13 +7,14 @@ #include #include -void init_dock(void) +void h8_mb_init(void) { if (dock_present()) { printk(BIOS_DEBUG, "dock is connected\n"); dock_connect(); - } else + } else { printk(BIOS_DEBUG, "dock is not connected\n"); + } } void dock_connect(void) diff --git a/src/mainboard/lenovo/x201/mainboard.c b/src/mainboard/lenovo/x201/mainboard.c index c35536df2d..beb99385f5 100644 --- a/src/mainboard/lenovo/x201/mainboard.c +++ b/src/mainboard/lenovo/x201/mainboard.c @@ -25,8 +25,6 @@ static void mainboard_enable(struct device *dev) install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_LFP, 2); - - init_dock(); } struct chip_operations mainboard_ops = {