mb/google/skywalker: Add RT1019 support for beep sound
Derive the audio amplifier from FW_CONFIG, and set up I2C and I2S for RT1019.RT1019 and RT9123 use the same GPIOs on the Skywalker reference design, so the same function is used to improve code reusability. Also pass the corresponding GPIO to the payload. BUG=b:417083722 BRANCH=none TEST=Build pass and test with Depthcharge change: https://chromium-review.googlesource.com/c/chromiumos/platform/depthcharge/+/6437675 Check audio cmd in depthcharge with: firmware-shell: AUDIO CMD=audio 500 100 1 Change-Id: I512cd5c8635d08c6b6c54f04d11bf87c64d1b843 Signed-off-by: Rui Zhou <zhourui@huaqin.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/87887 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yidi Lin <yidilin@google.com> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
This commit is contained in:
parent
4caf5131b9
commit
69a067a9d6
3 changed files with 10 additions and 3 deletions
|
|
@ -56,6 +56,11 @@ void fill_lb_gpios(struct lb_gpios *gpios)
|
|||
{GPIO_EN_SPKR.id, ACTIVE_HIGH, -1, "rt9123_spk_en"},
|
||||
};
|
||||
lb_add_gpios(gpios, rt9123_gpios, ARRAY_SIZE(rt9123_gpios));
|
||||
} else if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_RT1019))) {
|
||||
struct lb_gpio rt1019_gpios[] = {
|
||||
{GPIO_EN_SPKR.id, ACTIVE_HIGH, -1, "rt1019_spk_en"},
|
||||
};
|
||||
lb_add_gpios(gpios, rt1019_gpios, ARRAY_SIZE(rt1019_gpios));
|
||||
} else if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_ALC5645))) {
|
||||
struct lb_gpio alc5645_gpios[] = {
|
||||
{GPIO_EN_SPKR.id, ACTIVE_HIGH, -1, "alc5645_spk_en"},
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ end
|
|||
fw_config
|
||||
field AUDIO_AMP 25 27
|
||||
option AMP_RT9123 0
|
||||
option AMP_RT1019 1
|
||||
option AMP_ALC5645 3
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#define AFE_SE_SECURE_CON1 (AUDIO_BASE + 0x5634)
|
||||
|
||||
static void configure_rt9123(void)
|
||||
static void configure_rt9123_rt1019(void)
|
||||
{
|
||||
/* SoC I2S */
|
||||
gpio_set_mode(GPIO_I2SOUT1_BCK, GPIO_FUNC(DMIC0_DAT0, I2SOUT1_BCK));
|
||||
|
|
@ -49,8 +49,9 @@ static void configure_audio(void)
|
|||
/* Switch to normal mode */
|
||||
write32p(AFE_SE_SECURE_CON1, 0x0);
|
||||
|
||||
if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_RT9123)))
|
||||
configure_rt9123();
|
||||
if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_RT9123)) ||
|
||||
fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_RT1019)))
|
||||
configure_rt9123_rt1019();
|
||||
else if (fw_config_probe(FW_CONFIG(AUDIO_AMP, AMP_ALC5645)))
|
||||
configure_alc5645();
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue