Attention is currently required from: Kevin Chiu. Hello Kevin Chiu,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/51708
to review the following change.
Change subject: grunt/barla: add Realtek ALC5682 codec support ......................................................................
grunt/barla: add Realtek ALC5682 codec support
ALC5682 i2c address: 0x1A
BUG=b:171755306 BRANCH=master TEST=emerge-grunt coreboot
Change-Id: I8bc571104bebe02acf86507774580effc808beb6 Signed-off-by: Kevin Chiu Kevin.Chiu@quantatw.com --- M src/mainboard/google/kahlee/variants/careena/Makefile.inc M src/mainboard/google/kahlee/variants/careena/devicetree.cb M src/mainboard/google/kahlee/variants/careena/include/variant/sku.h M src/mainboard/google/kahlee/variants/careena/variant.c 4 files changed, 75 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/51708/1
diff --git a/src/mainboard/google/kahlee/variants/careena/Makefile.inc b/src/mainboard/google/kahlee/variants/careena/Makefile.inc index e50e6b9..9bf0c93 100644 --- a/src/mainboard/google/kahlee/variants/careena/Makefile.inc +++ b/src/mainboard/google/kahlee/variants/careena/Makefile.inc @@ -4,3 +4,4 @@
bootblock-y += variant.c romstage-y += variant.c +ramstage-y += variant.c \ No newline at end of file diff --git a/src/mainboard/google/kahlee/variants/careena/devicetree.cb b/src/mainboard/google/kahlee/variants/careena/devicetree.cb index 2658a6e..7f0c87d 100644 --- a/src/mainboard/google/kahlee/variants/careena/devicetree.cb +++ b/src/mainboard/google/kahlee/variants/careena/devicetree.cb @@ -107,6 +107,21 @@ register "mclk_name" = ""oscout1"" device i2c 1a on end end + chip drivers/i2c/generic + register "hid" = ""10EC5682"" + register "name" = ""RT58"" + register "uid" = "1" + register "desc" = ""Realtek RT5682"" + register "irq_gpio" = "ACPI_GPIO_IRQ_EDGE_BOTH(GPIO_14)" + register "property_count" = "2" + register "property_list[0].type" = "ACPI_DP_TYPE_INTEGER" + register "property_list[0].name" = ""realtek,jd-src"" + register "property_list[0].integer" = "1" + register "property_list[1].type" = "ACPI_DP_TYPE_STRING" + register "property_list[1].name" = ""realtek,mclk-name"" + register "property_list[1].string" = ""oscout1"" + device i2c 1a on end + end chip drivers/generic/max98357a register "hid" = ""MX98357A"" register "sdmode_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPIO_119)" diff --git a/src/mainboard/google/kahlee/variants/careena/include/variant/sku.h b/src/mainboard/google/kahlee/variants/careena/include/variant/sku.h index 169d842..9fadfe8 100644 --- a/src/mainboard/google/kahlee/variants/careena/include/variant/sku.h +++ b/src/mainboard/google/kahlee/variants/careena/include/variant/sku.h @@ -8,4 +8,8 @@ SKU_CAREENA_KB_BACKLIGHT19 = 19, SKU_CAREENA_KB_BACKLIGHT22 = 22, SKU_CAREENA_KB_BACKLIGHT23 = 23, + SKU_BARLA_ALC5682_44 = 44, + SKU_BARLA_ALC5682_45 = 45, + SKU_BARLA_ALC5682_46 = 46, + SKU_BARLA_ALC5682_47 = 47, }; diff --git a/src/mainboard/google/kahlee/variants/careena/variant.c b/src/mainboard/google/kahlee/variants/careena/variant.c index 33ad260..cc1117c 100644 --- a/src/mainboard/google/kahlee/variants/careena/variant.c +++ b/src/mainboard/google/kahlee/variants/careena/variant.c @@ -6,6 +6,61 @@ #include <variant/sku.h> #include <gpio.h> #include <variant/gpio.h> +#include <arch/acpigen.h> +#include <console/console.h> +#include <soc/amd/stoneyridge/include/soc/pci_devs.h> +#include <drivers/i2c/hid/chip.h> + +int acpi_device_status(const struct device *dev) +{ + uint32_t sku = google_chromeec_get_sku_id(); + const struct drivers_i2c_generic_config *config = dev->chip_info; + + if (!dev->enabled) + return ACPI_STATUS_DEVICE_ALL_OFF; + if (dev->hidden) + return ACPI_STATUS_DEVICE_HIDDEN_ON; + + if (!strcmp(config->hid,"10EC5682")) { + switch (sku) { + default: + return ACPI_STATUS_DEVICE_ALL_OFF; + break; + case SKU_BARLA_ALC5682_44: + case SKU_BARLA_ALC5682_45: + case SKU_BARLA_ALC5682_46: + case SKU_BARLA_ALC5682_47: + return ACPI_STATUS_DEVICE_ALL_ON; + break; + } + } + else + return ACPI_STATUS_DEVICE_ALL_ON; +} + +int da7219_acpi_device_status(const struct device *dev); +int da7219_acpi_device_status(const struct device *dev) +{ + printk(BIOS_INFO, "da7219_acpi_device_status from variant\n"); + uint32_t sku = google_chromeec_get_sku_id(); + + if (!dev->enabled) + return ACPI_STATUS_DEVICE_ALL_OFF; + if (dev->hidden) + return ACPI_STATUS_DEVICE_HIDDEN_ON; + + switch (sku) { + default: + return ACPI_STATUS_DEVICE_ALL_ON; + break; + case SKU_BARLA_ALC5682_44: + case SKU_BARLA_ALC5682_45: + case SKU_BARLA_ALC5682_46: + case SKU_BARLA_ALC5682_47: + return ACPI_STATUS_DEVICE_ALL_OFF; + break; + } +}
static const struct soc_amd_gpio variant_gpio_wlan_rst_early_reset[] = { /* GPIO_70 - WLAN_PE_RST_L */