diff options
author | Iru Cai <mytbk920423@gmail.com> | 2019-06-29 14:06:30 +0800 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-09-06 19:35:26 +0000 |
commit | 112e9baddfd823bd5535d7772adab2db7a81eaf9 (patch) | |
tree | 2a33064b2fddb0b3dfd848be8996f211bd4f37ec /util/autoport/log_reader.go | |
parent | ab5cac2c79f2240595fb923a37a4cbdb6ed3f231 (diff) |
autoport: search for the HDA device on PCH
Haswell has its Mini-HD device and is at card0, so we need to search
for the PCH HD Audio device instead of using card0.
Change-Id: I2bc420fdbe9731ae835f63add85db79f04201da4
Signed-off-by: Iru Cai <mytbk920423@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34357
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/autoport/log_reader.go')
-rw-r--r-- | util/autoport/log_reader.go | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/util/autoport/log_reader.go b/util/autoport/log_reader.go index 0aaf6a9db3..b144804c28 100644 --- a/util/autoport/log_reader.go +++ b/util/autoport/log_reader.go @@ -251,6 +251,18 @@ func (l *LogDevReader) GetDMI() (ret DMIData) { } func (l *LogDevReader) GetAzaliaCodecs() (ret []AzaliaCodec) { + cardno := -1 + for i := 0; i < 10; i++ { + pin, err := os.Open(l.InputDirectory + "/pin_hwC" + strconv.Itoa(i) + "D0") + if err == nil { + pin.Close() + cardno = i + break + } + } + if cardno == -1 { + return + } for codecno := 0; codecno < 10; codecno++ { cur := AzaliaCodec{CodecNo: codecno, PinConfig: map[int]uint32{}} codec, err := os.Open(l.InputDirectory + "/codec#" + strconv.Itoa(codecno)) @@ -258,7 +270,8 @@ func (l *LogDevReader) GetAzaliaCodecs() (ret []AzaliaCodec) { continue } defer codec.Close() - pin, err := os.Open(l.InputDirectory + "/pin_hwC0D" + strconv.Itoa(codecno)) + pin, err := os.Open(l.InputDirectory + "/pin_hwC" + strconv.Itoa(cardno) + + "D" + strconv.Itoa(codecno)) if err != nil { continue } |