Nicholas Chin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/80452?usp=email )
Change subject: include/device/azalia_device.h: Add enum for misc field ......................................................................
include/device/azalia_device.h: Add enum for misc field
The HDA specification defines bits 11:8 of the Configuration Default register as a miscellaneous field for other jack information. Only bit 8 has a standard meaning, and indicates that the jack does not have presence detect capability. Add an enum for use in the AZALIA_PIN_DESC macro to indicate this field. Note that many vendor firmwares set bits 11:9 to non zero values despite them being reserved in the specification, and their meaning in these cases is not well known.
Currently only mb/clevo/tgl-u/variants/l140mu uses the AZALIA_PIN_DESC macro and has been updated to use the new enum. Other boards can be bulk processed to switch from bare register values to the macro and enums in a future patch.
Change-Id: I70cbfca8541828a1e0c7280887060c04e4c71721 Signed-off-by: Nicholas Chin nic.c3.14@gmail.com --- M src/include/device/azalia_device.h M src/mainboard/clevo/tgl-u/variants/l140mu/hda_verb.c 2 files changed, 18 insertions(+), 13 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/52/80452/1
diff --git a/src/include/device/azalia_device.h b/src/include/device/azalia_device.h index 1562e25..4dfe4d2 100644 --- a/src/include/device/azalia_device.h +++ b/src/include/device/azalia_device.h @@ -112,7 +112,12 @@ LOCATION_OTHER };
-#define AZALIA_PIN_DESC(conn, location2, location1, dev, type, color, no_presence_detect, \ +enum azalia_pin_misc { + JACK_PRESENCE_DETECT = 0, + NO_JACK_PRESENCE_DETECT +} + +#define AZALIA_PIN_DESC(conn, location2, location1, dev, type, color, misc, \ association, sequence) \ (((conn) << 30) | \ ((location2) << 27) | \ @@ -120,7 +125,7 @@ ((dev) << 20) | \ ((type) << 16) | \ ((color) << 12) | \ - ((no_presence_detect) << 8) | \ + ((misc) << 8) | \ ((association) << 4) | \ ((sequence) << 0))
diff --git a/src/mainboard/clevo/tgl-u/variants/l140mu/hda_verb.c b/src/mainboard/clevo/tgl-u/variants/l140mu/hda_verb.c index d8739a2..0ff24a2 100644 --- a/src/mainboard/clevo/tgl-u/variants/l140mu/hda_verb.c +++ b/src/mainboard/clevo/tgl-u/variants/l140mu/hda_verb.c @@ -18,7 +18,7 @@ MIC_IN, OTHER_DIGITAL, COLOR_UNKNOWN, - 1, /* no presence detect */ + NO_JACK_PRESENCE_DETECT, 3, 0) ),
@@ -30,7 +30,7 @@ SPEAKER, OTHER_ANALOG, COLOR_UNKNOWN, - 1, /* no presence detect */ + NO_JACK_PRESENCE_DETECT, 1, 0) ),
@@ -42,7 +42,7 @@ HP_OUT, STEREO_MONO_1_8, BLACK, - 0, /* has presence detect */ + JACK_PRESENCE_DETECT, 2, 0) ),
@@ -54,19 +54,19 @@ MIC_IN, STEREO_MONO_1_8, BLACK, /* vendor: PINK */ - 1, /* no separate presence detect */ + NO_JACK_PRESENCE_DETECT, 3, 12) ),
/* PCBEEP, vendor value: 0x41748245 */ AZALIA_PIN_CFG(0, 0x1d, AZALIA_PIN_DESC( - INTEGRATED, /* vendor: NC */ - INTERNAL, /* vendor: EXTERNAL_PRIMARY_CHASSIS */ - NA, /* vendor: REAR */ - DEVICE_OTHER, /* vendor: MODEM_HANDSET_SIDE */ - OTHER_ANALOG, /* vendor: RCA */ - COLOR_UNKNOWN, /* vendor: PURPLE */ - 1, /* no presence detect, vendor: 2 */ + INTEGRATED, /* vendor: NC */ + INTERNAL, /* vendor: EXTERNAL_PRIMARY_CHASSIS */ + NA, /* vendor: REAR */ + DEVICE_OTHER, /* vendor: MODEM_HANDSET_SIDE */ + OTHER_ANALOG, /* vendor: RCA */ + COLOR_UNKNOWN, /* vendor: PURPLE */ + NO_JACK_PRESENCE_DETECT, /* vendor: 2 */ 4, 5) ),