V sujith kumar Reddy has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/60072 )
Change subject: Passing EN_SPKR gpio descriptor from coreboot to kernel ......................................................................
Passing EN_SPKR gpio descriptor from coreboot to kernel
Change-Id: I784e6b58004a8a36b312b75db7739dfd6e8cd65a Signed-off-by: V sujith kumar Reddy vsujithkumar.reddy@amd.corp-partner.google.com --- M src/drivers/amd/i2s_machine_dev/chip.h M src/drivers/amd/i2s_machine_dev/i2s_machine_dev.c M src/mainboard/google/guybrush/variants/baseboard/devicetree.cb 3 files changed, 12 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/72/60072/1
diff --git a/src/drivers/amd/i2s_machine_dev/chip.h b/src/drivers/amd/i2s_machine_dev/chip.h index 0ca00a8..228e3e3 100644 --- a/src/drivers/amd/i2s_machine_dev/chip.h +++ b/src/drivers/amd/i2s_machine_dev/chip.h @@ -11,7 +11,7 @@
/* ACPI _UID */ unsigned int uid; - + struct acpi_gpio enspkr_gpio; /* * DMIC select GPIO (optional). Needs to be configured if the audio framework cannot use * all the mics and select the right channel based on the use-case. diff --git a/src/drivers/amd/i2s_machine_dev/i2s_machine_dev.c b/src/drivers/amd/i2s_machine_dev/i2s_machine_dev.c index 7bd256d..bc45290 100644 --- a/src/drivers/amd/i2s_machine_dev/i2s_machine_dev.c +++ b/src/drivers/amd/i2s_machine_dev/i2s_machine_dev.c @@ -10,7 +10,8 @@ #define AMD_I2S_ACPI_DESC "I2S machine driver"
static void i2s_machine_dev_fill_crs_dsd(const char *path, - const struct acpi_gpio *dmic_select_gpio) + const struct acpi_gpio *dmic_select_gpio, + const struct acpi_gpio *enspkr_gpio) { struct acpi_dp *dsd;
@@ -18,6 +19,7 @@ acpigen_write_name("_CRS"); acpigen_write_resourcetemplate_header(); acpi_device_write_gpio(dmic_select_gpio); + acpi_device_write_gpio(enspkr_gpio); acpigen_write_resourcetemplate_footer();
dsd = acpi_dp_new_table("_DSD"); @@ -34,19 +36,23 @@ 0, /* Index = 0 (There is a single GPIO entry in _CRS). */ 0, /* Pin = 0 (There is a single pin in the GPIO resource). */ 0); /* Active low = 0 (Kernel driver does not use active polarity). */ + if(enspkr_gpio) + acpi_dp_add_gpio(dsd, "enspkr-gpio", path, 1, 0, + enspkr_gpio->active_low); acpi_dp_write(dsd); }
static void i2s_machine_dev_fill_ssdt(const struct device *dev) { const char *scope = acpi_device_scope(dev); - const struct acpi_gpio *dmic_select_gpio; + const struct acpi_gpio *dmic_select_gpio, *enspkr_gpio; const struct drivers_amd_i2s_machine_dev_config *cfg; const char *path = acpi_device_path(dev);
cfg = config_of(dev);
dmic_select_gpio = &cfg->dmic_select_gpio; + enspkr_gpio = &cfg->enspkr_gpio;
if (scope == NULL) { printk(BIOS_ERR, "%s: ERROR: ACPI I2S scope not found\n", dev_path(dev)); @@ -66,8 +72,8 @@
acpigen_write_STA(acpi_device_status(dev));
- if (dmic_select_gpio->pin_count) - i2s_machine_dev_fill_crs_dsd(path, dmic_select_gpio); + if (dmic_select_gpio->pin_count || enspkr_gpio->pin_count) + i2s_machine_dev_fill_crs_dsd(path, dmic_select_gpio, enspkr_gpio);
acpigen_pop_len(); /* Device */ acpigen_pop_len(); /* Scope */ diff --git a/src/mainboard/google/guybrush/variants/baseboard/devicetree.cb b/src/mainboard/google/guybrush/variants/baseboard/devicetree.cb index 7fb3c7e..2b1fe3b 100644 --- a/src/mainboard/google/guybrush/variants/baseboard/devicetree.cb +++ b/src/mainboard/google/guybrush/variants/baseboard/devicetree.cb @@ -325,6 +325,7 @@ device ref acp on chip drivers/amd/i2s_machine_dev register "hid" = ""AMDI1019"" + register "enspkr_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPIO_31)" device generic 0.0 on end end end # Audio