From 2e0053b84098512c5b3c98394998e66a8f83803b Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Sat, 5 Dec 2020 19:06:55 +0100 Subject: azalia: Use `azalia_enter_reset` function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also tidy up some adjacent comments. Change-Id: I2e881900a52e42ab3f43ffe96cfbdcc63ff02e23 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/48358 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Rudolph Reviewed-by: Nico Huber Reviewed-by: Michael Niewöhner --- src/soc/intel/common/hda_verb.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/soc/intel/common') diff --git a/src/soc/intel/common/hda_verb.c b/src/soc/intel/common/hda_verb.c index 5a4b467b8a..f4ef756d5f 100644 --- a/src/soc/intel/common/hda_verb.c +++ b/src/soc/intel/common/hda_verb.c @@ -24,7 +24,7 @@ int hda_codec_detect(u8 *base) write8(base + HDA_STATESTS_REG, 0xf); /* Turn off the link and poll RESET# bit until it reads back as 0 */ - if (azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, 0) < 0) + if (azalia_enter_reset(base) < 0) goto no_codec; /* Turn on the link and poll RESET# bit until it reads back as 1 */ @@ -40,9 +40,8 @@ int hda_codec_detect(u8 *base) return reg8; no_codec: - /* Codec Not found */ - /* Put HDA back in reset (BAR + 0x8) [0] */ - azalia_set_bits(base + HDA_GCTL_REG, HDA_GCTL_CRST, 0); + /* Codec not found, put HDA back in reset */ + azalia_enter_reset(base); printk(BIOS_DEBUG, "HDA: No codec!\n"); return 0; } -- cgit v1.2.3