diff options
author | Trevor Wu <trevor.wu@mediatek.com> | 2023-02-23 22:18:39 +0800 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2023-03-05 15:49:06 +0000 |
commit | eeb5491b125e79a2700b444e1506b86373803e27 (patch) | |
tree | 5678fe1b8579688f57ac2bb56a265b1f8f028fb0 /src/mainboard/google/geralt/chromeos.c | |
parent | abe3c16df2e110d4934ffdb2671243fc9e34c210 (diff) |
mb/google/geralt: Add NAU8318 support for Geralt
Add a config "USE_NAU8318" to enable NAU8318 support.
NAU8318 is another speaker used in Geralt. NAU8318 supports beep
function via GPIO control. So we configure the GPIO pins and pass them
to the payload.
BUG=b:250459803
BRANCH=none
TEST=Verify beep function through CLI in depthcharge successfully.
Change-Id: I21009a20809f398de4628ff0c11bcbd0e7591443
Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73413
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/mainboard/google/geralt/chromeos.c')
-rw-r--r-- | src/mainboard/google/geralt/chromeos.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mainboard/google/geralt/chromeos.c b/src/mainboard/google/geralt/chromeos.c index 10fc9d314f..ab9f1d665e 100644 --- a/src/mainboard/google/geralt/chromeos.c +++ b/src/mainboard/google/geralt/chromeos.c @@ -20,6 +20,7 @@ void setup_chromeos_gpios(void) gpio_output(GPIO_EN_SPKR, 0); gpio_output(GPIO_RST_SPKR_L, 0); gpio_output(GPIO_XHCI_INIT_DONE, 0); + gpio_output(GPIO_BEEP_ON_OD, 0); } void fill_lb_gpios(struct lb_gpios *gpios) @@ -27,7 +28,6 @@ void fill_lb_gpios(struct lb_gpios *gpios) struct lb_gpio chromeos_gpios[] = { {GPIO_EC_AP_INT_ODL.id, ACTIVE_LOW, -1, "EC interrupt"}, {GPIO_GSC_AP_INT_ODL.id, ACTIVE_HIGH, -1, "TPM interrupt"}, - {GPIO_EN_SPKR.id, ACTIVE_HIGH, -1, "speaker enable"}, {GPIO_XHCI_INIT_DONE.id, ACTIVE_HIGH, -1, "XHCI init done"}, }; lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios)); @@ -46,6 +46,12 @@ void fill_lb_gpios(struct lb_gpios *gpios) {GPIO_RST_SPKR_L.id, ACTIVE_LOW, -1, "speaker reset"}, }; lb_add_gpios(gpios, max98390_gpios, ARRAY_SIZE(max98390_gpios)); + } else if (CONFIG(USE_NAU8318)) { + struct lb_gpio nau8318_gpios[] = { + {GPIO_EN_SPKR.id, ACTIVE_HIGH, -1, "speaker enable"}, + {GPIO_BEEP_ON_OD.id, ACTIVE_HIGH, -1, "beep enable"}, + }; + lb_add_gpios(gpios, nau8318_gpios, ARRAY_SIZE(nau8318_gpios)); } } |