1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/device.h>
6 #include <variant/onboard.h>
11 static void mainboard_init(struct device
*dev
)
14 #if CONFIG(BOARD_GOOGLE_NINJA) || CONFIG(BOARD_GOOGLE_SUMO)
19 static int mainboard_smbios_data(struct device
*dev
, int *handle
,
20 unsigned long *current
)
23 #ifdef BOARD_TRACKPAD_NAME
24 len
+= smbios_write_type41(
26 BOARD_TRACKPAD_NAME
, /* name */
27 BOARD_TRACKPAD_IRQ
, /* instance */
28 BOARD_TRACKPAD_I2C_BUS
, /* segment */
29 BOARD_TRACKPAD_I2C_ADDR
, /* bus */
32 SMBIOS_DEVICE_TYPE_OTHER
); /* device type */
34 #ifdef BOARD_TOUCHSCREEN_NAME
35 len
+= smbios_write_type41(
37 BOARD_TOUCHSCREEN_NAME
, /* name */
38 BOARD_TOUCHSCREEN_IRQ
, /* instance */
39 BOARD_TOUCHSCREEN_I2C_BUS
, /* segment */
40 BOARD_TOUCHSCREEN_I2C_ADDR
, /* bus */
43 SMBIOS_DEVICE_TYPE_OTHER
); /* device type */
48 // mainboard_enable is executed as first thing after
51 static void mainboard_enable(struct device
*dev
)
53 dev
->ops
->init
= mainboard_init
;
54 dev
->ops
->get_smbios_data
= mainboard_smbios_data
;
56 /* Install custom int15 handler for VGA OPROM */
57 if (CONFIG(VGA_ROM_RUN
))
58 install_baytrail_vga_int15_handler();
61 struct chip_operations mainboard_ops
= {
62 .enable_dev
= mainboard_enable
,
65 static void edp_vdden_cb(void *unused
)
67 ncore_select_func(SOC_DDI1_VDDEN_PAD
, PAD_FUNC2
);
70 BOOT_STATE_INIT_ENTRY(BS_DEV_INIT
, BS_ON_EXIT
, edp_vdden_cb
, NULL
);