Index: hda/hda_codec.cpp ================================================================== --- hda/hda_codec.cpp +++ hda/hda_codec.cpp @@ -840,11 +840,33 @@ } verbs[0] = MAKE_VERB(audioGroup->codec->addr, nodeID, VID_GET_CONFIGURATION_DEFAULT, 0); if (hda_send_verbs(audioGroup->codec, verbs, resp, 1) == B_OK) { + /*****************/ + TRACE( "Pinconfig T- for %ld is 0x%8.8lx ====\n", nodeID, resp[0] ); + switch( nodeID ) + { + case 0x19: // widget 25 + resp[0] = 0x042140ff; + //xxxx the sequence number is still "15", before and after + // the patch ? + // ask korli what the sequence is supposed to be/do.. + break; + + case 0x1a: + resp[0] = 0x21a190f0; + break; + + case 0x1c: + resp[0] = 0x212140ff; + break; + } + TRACE( "Pinconfig T+ for %ld is 0x%8.8lx\n", nodeID, resp[0] ); + widget.d.pin.config = resp[0]; + const char* location = get_widget_location(CONF_DEFAULT_LOCATION(resp[0])); TRACE("\t%s, %s%s%s, %s, %s, Association:%ld\n", kPortConnector[CONF_DEFAULT_CONNECTIVITY(resp[0])], location ? location : "", @@ -875,10 +897,47 @@ dump_widget_inputs(widget); } hda_widget_get_associations(audioGroup); +#if 1 + //+ if T410 thinkpad, then do this: + if( widget.node_id == 31 ) + { + /* The linux driver does both "set-control" and "select-mux": + // Port G: internal speakers + {0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, + {0x1f, AC_VERB_SET_CONNECT_SEL, 0x00}, // DAC1 + The haiku driver is missing that second part! So let's try below: + + Also tried: widget 16: send verb offset "0" (instead of huge decibel offset "74", aka 0x4a) + + ....And what about this:?? + //EAPD: + {0x1d, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, // default on + */ + + uint32 mux = 0; + uint32 verb = MAKE_VERB( + audioGroup->codec->addr, + widget.node_id, + VID_SET_CONNECTION_SELECT, + mux + ); + if (hda_send_verbs(audioGroup->codec, &verb, NULL, 1) != B_OK) { + dprintf("** send-verb failure: hda: Setting output selector %" B_PRId32 " failed on " + "widget %" B_PRIu32 "!\n", + mux, + widget.node_id + ); + } + TRACE("-- T410 patch: widget %" B_PRId32 " will feed from selector: %" B_PRIu32 "\n", + widget.node_id, + mux + ); + } +#endif // init the codecs switch (codec_id) { case 0x10ec0888: { hda_verb_write(codec, 0x20, VID_SET_COEFFICIENT_INDEX, 0x0); uint32 tmp; @@ -886,12 +945,23 @@ hda_verb_write(codec, 0x20, VID_SET_COEFFICIENT_INDEX, 0x7); hda_verb_write(codec, 0x20, VID_SET_PROCESSING_COEFFICIENT, (tmp & 0xf0) == 0x20 ? 0x830 : 0x3030); break; } + default: { + /* + ----> "case 0x17aa215e:"... + */ + } + break; } - + TRACE("\n==== subsys: 0x%x\n", codec->controller->pci_info.u.h0.subsystem_id); + TRACE("\n==== subsys vendor: 0x%x\n", codec->controller->pci_info.u.h0.subsystem_vendor_id); + //yields this: + //KERN: ==== subsys: 0x215e + //KERN: ==== subsys vendor: 0x17aa + return B_OK; } /*! Find output path for widget */ @@ -1351,10 +1421,16 @@ corb_t verb = MAKE_VERB(audioGroup->codec->addr, widget.node_id, VID_SET_PIN_WIDGET_CONTROL, ctrl); hda_send_verbs(audioGroup->codec, &verb, NULL, 1); +#if 1 + //+ if T410 thinkpad, then do this: + if( widget.node_id == 31 ) + .. + moved up to where advised, as per ticket #14581 +#endif if (PIN_CAP_IS_EAPD_CAP(widget.d.pin.capabilities)) { uint32 result; verb = MAKE_VERB(audioGroup->codec->addr, widget.node_id, VID_GET_EAPDBTL_EN, 0); if (hda_send_verbs(audioGroup->codec, &verb, Index: hda/hda_codec_defs.h ================================================================== --- hda/hda_codec_defs.h +++ hda/hda_codec_defs.h @@ -49,10 +49,14 @@ /* Verb Helper Macro */ #define MAKE_VERB(cad, nid, vid, payload) \ (((cad) << 28) | ((nid) << 20) | (vid) | (payload)) + +// [x] [xx] [xxx] [xx] +// (as hex digit slots) + /* Verb IDs */ #define VID_GET_PARAMETER 0xf0000 #define VID_GET_CONNECTION_SELECT 0xf0100 #define VID_SET_CONNECTION_SELECT 0x70100 Index: hda/hda_multi_audio.cpp ================================================================== --- hda/hda_multi_audio.cpp +++ hda/hda_multi_audio.cpp @@ -18,11 +18,11 @@ #ifdef TRACE # undef TRACE #endif -//#define TRACE_MULTI_AUDIO +#define TRACE_MULTI_AUDIO #ifdef TRACE_MULTI_AUDIO # define TRACE(a...) dprintf("hda: " a) #else # define TRACE(a...) ; #endif @@ -761,10 +761,33 @@ static status_t set_mix(hda_audio_group* audioGroup, multi_mix_value_info * mmvi) { + /* + Add support for X220: xxx + Add support for T410: + 8086/3b56 (17aa/215e) + Codec 0 Vendor: 14f1 Product: 5069 + ++ or we could add a haiku "quirk" for hda_codec_get_quirks() ? + */ + /* + ======= ROADMAP (on my own): ======= + [x] apply the 3 "patch pin config" lines + [x] test on COLD boot + [.] apply the "thinkpad acpi" line + => I need to find the "tpacpi_led_set" symbol.. it's not in the hda/ folder :-( + [.] look into "Sequence 0xf", seems this critical part of the patch did not make the intended difference ; FWIW, hda_auto_parser.c has this little nugget: " The real HPs should have the sequence 0x0f " ANd this one: "sort by sequence" + [ ] could be *another* problem in the hda driver, that just happens to be exposed on the T410 ..etc ? + ======= ROADMAP (tickets): ======= + - ask tidux for "tracing-enabled dmesg" ? (as per bookmarks on R61) + */