1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <console/console.h>
5 #include <device/device.h>
11 #define SUBSYSTEM_ID 0x1AE0006B
13 static const char *oem_id_maxim
= "GOOGLE";
14 static const char *oem_table_id_maxim
= "EVEMAX";
16 static void mainboard_init(struct device
*dev
)
21 static unsigned long mainboard_write_acpi_tables(
22 const struct device
*device
, unsigned long current
, acpi_rsdp_t
*rsdp
)
34 nhlt
->subsystem_id
= SUBSYSTEM_ID
;
36 /* 4 Channel DMIC array */
37 if (nhlt_soc_add_rt5514(nhlt
, AUDIO_LINK_SSP0
, 4, 1))
38 printk(BIOS_ERR
, "Couldn't add rt5514.\n");
40 /* RT5663 Headset codec */
41 if (nhlt_soc_add_rt5663(nhlt
, AUDIO_LINK_SSP1
))
42 printk(BIOS_ERR
, "Couldn't add headset codec.\n");
44 /* MAXIM98927 Smart Amps for left and right channel */
45 /* Render time_slot is 0 and feedback time_slot is 2 */
46 if (nhlt_soc_add_max98927(nhlt
, AUDIO_LINK_SSP0
, 0, 2))
47 printk(BIOS_ERR
, "Couldn't add max98927\n");
49 end_addr
= nhlt_soc_serialize_oem_overrides(nhlt
, start_addr
,
50 oem_id_maxim
, oem_table_id_maxim
, 0);
52 if (end_addr
!= start_addr
)
53 acpi_add_table(rsdp
, (void *)start_addr
);
58 static void mainboard_enable(struct device
*dev
)
60 dev
->ops
->init
= mainboard_init
;
61 dev
->ops
->write_acpi_tables
= mainboard_write_acpi_tables
;
64 static void mainboard_chip_init(void *chip_info
)
66 gpio_configure_pads(gpio_table
, ARRAY_SIZE(gpio_table
));
69 struct chip_operations mainboard_ops
= {
70 .init
= mainboard_chip_init
,
71 .enable_dev
= mainboard_enable
,