From owner-svn-src-all@FreeBSD.ORG Sun Jul 27 08:37:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1BF8151; Sun, 27 Jul 2014 08:37:13 +0000 (UTC) Received: from mail-qg0-x230.google.com (mail-qg0-x230.google.com [IPv6:2607:f8b0:400d:c04::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DBC723B3; Sun, 27 Jul 2014 08:37:13 +0000 (UTC) Received: by mail-qg0-f48.google.com with SMTP id i50so6939550qgf.7 for ; Sun, 27 Jul 2014 01:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=JOsg6iHy1fORv+vnJsPREIQqZ2SunBA814qblErDKXA=; b=KPMctn9v7T7znJJY/lS6LMxto1YJSkCapEGnkPS7iy5Tax2bajLbnHrBu3xnRIsPJd 8sezymIbYJ0cfYGd5/ZOXgWSHGMyOkkwNJwjs3dbjhDoFmwlDKCAOKhsV2V3PGY32ePs dXc/Grq3uD9Rm/sMsJTtEdZ89D5M+yiqT+72FkpkVASHzS57dWw/BlrZKEFiiocCV3hZ yUMdl5SnbhB7wAG4lsus4IGudVjpteqHrDeZ3aTFmMVAbeEPyR0O8ayIxIgWZtw0Bbuj l+CHUchwiJCAtDZx0iSxjI0D1MF6pZpdxMqiYLgv6WfXo6EuXv8YEJUQI7PReDEZtnKF V1vA== MIME-Version: 1.0 X-Received: by 10.224.97.65 with SMTP id k1mr45937607qan.28.1406450232270; Sun, 27 Jul 2014 01:37:12 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Sun, 27 Jul 2014 01:37:12 -0700 (PDT) In-Reply-To: <53D4B853.8040305@FreeBSD.org> References: <201407131031.s6DAVTja093433@svn.freebsd.org> <53C335EF.2090606@FreeBSD.org> <53D4B853.8040305@FreeBSD.org> Date: Sun, 27 Jul 2014 01:37:12 -0700 X-Google-Sender-Auth: mh9B-mhADRINgO_ULeLLjT52hSQ Message-ID: Subject: Re: svn commit: r268584 - head/sys/dev/sound/pci/hda From: Adrian Chadd To: Alexander Motin Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Mark Johnston , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jul 2014 08:37:13 -0000 On 27 July 2014 01:29, Alexander Motin wrote: > On 27.07.2014 11:20, Adrian Chadd wrote: >> ok, so how do I figure out what the right patch should be? >> >> pcm0: at nid 22 and 24 on hdaa0 >> pcm1: at nid 26 and 29 on hdaa0 >> >> .. and >> >> hdac0@pci0:0:27:0: class=0x040300 card=0x20f217aa chip=0x293e8086 >> rev=0x03 hdr=0x00 > > Technically there is not all of required info shown above, but assuming > some likeness I would try this (just replace ZZZ with your model name): > > Index: hdaa_patches.c > =================================================================== > --- hdaa_patches.c (revision 269151) > +++ hdaa_patches.c (working copy) > @@ -340,7 +340,8 @@ hdac_pin_patch(struct hdaa_widget *w) > } > } > } else if (id == HDA_CODEC_CX20561 && > - subid == LENOVO_B450_SUBVENDOR) { > + (subid == LENOVO_B450_SUBVENDOR || > + subid == LENOVO_ZZZ_SUBVENDOR)) { > switch (nid) { > case 22: > patch = "as=1 seq=15"; > Index: hdac.h > =================================================================== > --- hdac.h (revision 269151) > +++ hdac.h (working copy) > @@ -236,6 +236,7 @@ > #define LENOVO_X1CRBN_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f9) > #define LENOVO_X220_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21da) > #define LENOVO_X300_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac) > +#define LENOVO_ZZZ_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20f2) > #define LENOVO_T420_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce) > #define LENOVO_T430_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f3) > #define LENOVO_T430S_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21fb) So I have: adrian@lucy-11i386:~/work/freebsd/head/src/sys/dev/sound/pci/hda % svn diff . Index: hdaa_patches.c =================================================================== --- hdaa_patches.c (revision 268931) +++ hdaa_patches.c (working copy) @@ -154,6 +154,8 @@ id = hdaa_codec_id(w->devinfo); subid = hdaa_card_id(w->devinfo); + printf("%s: id=0x%08x; subid=0x%08x; nid=%d\n", __func__, id, subid, nid); + /* XXX: Old patches require complete review. * Now they may create more problem then solve due to * incorrect associations. @@ -340,9 +342,10 @@ } } } else if (id == HDA_CODEC_CX20561 && - subid == LENOVO_B450_SUBVENDOR) { + (subid == LENOVO_T400_SUBVENDOR || + subid == LENOVO_B450_SUBVENDOR)) { switch (nid) { - case 22: + case 22: /* headphones */ patch = "as=1 seq=15"; break; } Index: hdac.h =================================================================== --- hdac.h (revision 268931) +++ hdac.h (working copy) @@ -236,6 +236,7 @@ #define LENOVO_X1CRBN_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f9) #define LENOVO_X220_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21da) #define LENOVO_X300_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac) +#define LENOVO_T400_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20f2) #define LENOVO_T420_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce) #define LENOVO_T430_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f3) #define LENOVO_T430S_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21fb) adrian@lucy-11i386:~/work/freebsd/head/src/sys/dev/sound/pci/hda % But it still chooses the speakers as pcm0: adrian@lucy-11i386:~/work/freebsd/head/src/sys/dev/sound/pci/hda % dmesg pcm0: detached pcm1: detached hdaa0: detached hdacc0: detached hdac0: detached pci0: at device 27.0 (no driver attached) snd_unit_init() u=0x00ff8000 [512] d=0x00007c00 [32] c=0x000003ff [1024] feeder_register: snd_unit=-1 snd_maxautovchans=16 latency=5 feeder_rate_min=1 feeder_rate_max=2016000 feeder_rate_round=25 pci0: driver added found-> vendor=0x8086, dev=0x2a44, revid=0x07 domain=0, bus=0, slot=3, func=0 class=07-80-00, hdrtype=0x00, mfdev=1 cmdreg=0x0006, statreg=0x0010, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=16 powerspec 3 supports D0 D3 current D0 MSI supports 1 message, 64 bit pci0:0:3:0: reprobing on driver added found-> vendor=0x8086, dev=0x293e, revid=0x03 domain=0, bus=0, slot=27, func=0 class=04-03-00, hdrtype=0x00, mfdev=0 cmdreg=0x0506, statreg=0x0010, cachelnsz=16 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=b, irq=17 powerspec 2 supports D0 D3 current D0 MSI supports 1 message, 64 bit pci0:0:27:0: reprobing on driver added hdac0: mem 0xfc020000-0xfc023fff irq 17 at device 27.0 on pci0 hdac0: PCI card vendor: 0x17aa, device: 0x20f2 hdac0: HDA Driver Revision: 20120126_0002 hdac0: Config options: on=0x00000000 off=0x00000000 hdac0: attempting to allocate 1 MSI vectors (1 supported) msi: routing MSI IRQ 258 to local APIC 1 vector 54 hdac0: using IRQ 258 for MSI hdac0: Caps: OSS 4, ISS 4, BSS 0, NSDO 1, 64bit, CORB 256, RIRB 256 found-> vendor=0x8086, dev=0x2930, revid=0x03 domain=0, bus=0, slot=31, func=3 class=0c-05-00, hdrtype=0x00, mfdev=0 cmdreg=0x0103, statreg=0x0280, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=23 pci0:0:31:3: reprobing on driver added pci2: driver added pci3: driver added pci5: driver added pci13: driver added pci21: driver added found-> vendor=0x1180, dev=0x0832, revid=0x04 domain=0, bus=21, slot=0, func=1 class=0c-00-10, hdrtype=0x00, mfdev=1 cmdreg=0x0106, statreg=0x0210, cachelnsz=16 (dwords) lattimer=0x20 (960 ns), mingnt=0x02 (500 ns), maxlat=0x04 (1000 ns) intpin=b, irq=17 powerspec 2 supports D0 D1 D2 D3 current D0 pci0:21:0:1: reprobing on driver added hdacc0: at cad 0 on hdac0 hdaa0: at nid 1 on hdacc0 hdaa0: Subsystem ID: 0x17aa211c hdaa0: NumGPIO=4 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1 hdaa0: GPIO0: disabled hdaa0: GPIO1: disabled hdaa0: GPIO2: disabled hdaa0: GPIO3: disabled hdaa0: Original pins configuration: hdaa0: nid 0x as seq device conn jack loc color misc hdaa0: 22 022140f0 15 0 Headphones Jack 1/8 Front Green 0 hdaa0: 23 61a190f0 15 0 Mic None 1/8 Ext-Rear Pink 0 hdaa0: 24 02a190f0 15 0 Mic Jack 1/8 Front Pink 0 hdaa0: 25 40f000f0 15 0 Other None Unknown 0x00 Unknown 0 hdaa0: 26 901701f0 15 0 Speaker Fixed Analog Internal Unknown 1 hdaa0: 27 40f001f0 15 0 Other None Unknown 0x00 Unknown 1 hdaa0: 28 40f001f0 15 0 Other None Unknown 0x00 Unknown 1 hdaa0: 29 90a601f0 15 0 Mic Fixed Digital Internal Unknown 1 hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=22 hdaa0: Patching pin config nid=22 0x022140f0 -> 0x0221401f hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=23 hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=24 hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=25 hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=26 hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=27 hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=28 hdac_pin_patch: id=0x14f15051; subid=0x20f217aa; nid=29 hdaa0: Patched pins configuration: hdaa0: nid 0x as seq device conn jack loc color misc hdaa0: 22 0221401f 1 15 Headphones Jack 1/8 Front Green 0 hdaa0: 23 61a190f0 15 0 Mic None 1/8 Ext-Rear Pink 0 DISA hdaa0: 24 02a190f0 15 0 Mic Jack 1/8 Front Pink 0 hdaa0: 25 40f000f0 15 0 Other None Unknown 0x00 Unknown 0 DISA hdaa0: 26 901701f0 15 0 Speaker Fixed Analog Internal Unknown 1 hdaa0: 27 40f001f0 15 0 Other None Unknown 0x00 Unknown 1 DISA hdaa0: 28 40f001f0 15 0 Other None Unknown 0x00 Unknown 1 DISA hdaa0: 29 90a601f0 15 0 Mic Fixed Digital Internal Unknown 1 hdaa0: 4 associations found: hdaa0: Association 0 (1) out: hdaa0: Pin nid=22 seq=15 hdaa0: Association 1 (15) in: hdaa0: Pin nid=24 seq=0 hdaa0: Association 2 (15) out: hdaa0: Pin nid=26 seq=0 hdaa0: Association 3 (15) in: hdaa0: Pin nid=29 seq=0 hdaa0: Tracing association 0 (1) hdaa0: Pin 22 traced to DAC 16 hdaa0: Association 0 (1) trace succeeded hdaa0: Tracing association 1 (15) hdaa0: Unable to trace pin 24 to ADC 20, undo traces hdaa0: Pin 24 traced to ADC 21 hdaa0: Association 1 (15) trace succeeded hdaa0: Tracing association 2 (15) hdaa0: Pin 26 traced to DAC 17 hdaa0: Association 2 (15) trace succeeded hdaa0: Tracing association 3 (15) hdaa0: Pin 29 traced to ADC 20 hdaa0: Association 3 (15) trace succeeded hdaa0: Looking for additional DAC for association 0 (1) hdaa0: Looking for additional ADC for association 1 (15) hdaa0: Looking for additional DAC for association 2 (15) hdaa0: Looking for additional ADC for association 3 (15) hdaa0: Tracing input monitor hdaa0: Tracing other input monitors hdaa0: Tracing nid 24 to out hdaa0: Tracing nid 29 to out hdaa0: Tracing beeper hdaa0: FG config/quirks: forcestereo ivref50 ivref80 ivref100 ivref pcm0: at nid 22 and 24 on hdaa0 pcm0: Playback: pcm0: Stream cap: 0x00000001 PCM pcm0: PCM cap: 0x000e0560 16 20 24 bits, 44 48 96 192 KHz pcm0: DAC: 16 pcm0: pcm0: nid=22 [pin: Headphones (Green Jack)] pcm0: + <- nid=16 [audio output] [src: pcm] pcm0: pcm0: Record: pcm0: Stream cap: 0x00000001 PCM pcm0: PCM cap: 0x000e0160 16 20 24 bits, 44 48 96 KHz pcm0: ADC: 21 pcm0: pcm0: nid=21 [audio input] pcm0: + <- nid=24 [pin: Mic (Pink Jack)] [src: mic] pcm0: pcm0: Master Volume (OSS: vol): -74/0dB pcm0: +- ctl 1 (nid 16 out): -74/0dB (75 steps) pcm0: pcm0: PCM Volume (OSS: pcm): -74/0dB pcm0: +- ctl 1 (nid 16 out): -74/0dB (75 steps) pcm0: pcm0: Microphone Volume (OSS: mic): 0/40dB pcm0: +- ctl 5 (nid 21 in 0): -74/6dB (81 steps) pcm0: +- ctl 7 (nid 24 out): 0/40dB (5 steps) pcm0: pcm0: Speaker/Beep Volume (OSS: speaker): -18/0dB pcm0: +- ctl 3 (nid 19 out): -18/0dB (4 steps) pcm0: pcm0: Recording Level (OSS: rec): -74/6dB pcm0: +- ctl 5 (nid 21 in 0): -74/6dB (81 steps) pcm0: +- ctl 7 (nid 24 out): 0/40dB (5 steps) pcm0: pcm0: Mixer "vol": pcm0: Mixer "pcm": pcm0: Mixer "speaker": pcm0: Mixer "mic": pcm0: Mixer "rec": pcm0: Playback channel matrix is: unknown, assuming 2.0 (disconnected) pcm0: Recording channel set is: Front Left, Front Right, pcm0: Recording channel matrix is: 2.0 (disconnected) pcm1: at nid 26 and 29 on hdaa0 pcm1: Playback: pcm1: Stream cap: 0x00000001 PCM pcm1: PCM cap: 0x000e0560 16 20 24 bits, 44 48 96 192 KHz pcm1: DAC: 17 pcm1: pcm1: nid=26 [pin: Speaker (Fixed)] pcm1: + <- nid=17 [audio output] [src: pcm] pcm1: pcm1: Record: pcm1: Stream cap: 0x00000001 PCM pcm1: PCM cap: 0x000e0160 16 20 24 bits, 44 48 96 KHz pcm1: ADC: 20 pcm1: pcm1: nid=20 [audio input] pcm1: + <- nid=29 [pin: Mic (Fixed)] [src: monitor] pcm1: pcm1: Master Volume (OSS: vol): -74/0dB pcm1: +- ctl 2 (nid 17 out): -74/0dB (75 steps) pcm1: pcm1: PCM Volume (OSS: pcm): -74/0dB pcm1: +- ctl 2 (nid 17 out): -74/0dB (75 steps) pcm1: pcm1: Microphone2 Volume (OSS: monitor): 0/48dB pcm1: +- ctl 4 (nid 20 in 0): -74/6dB (81 steps) pcm1: +- ctl 8 (nid 29 out): 0/48dB (5 steps) pcm1: pcm1: Recording Level (OSS: rec): -74/6dB pcm1: +- ctl 4 (nid 20 in 0): -74/6dB (81 steps) pcm1: +- ctl 8 (nid 29 out): 0/48dB (5 steps) pcm1: pcm1: Mixer "vol": pcm1: Mixer "pcm": pcm1: Mixer "rec": pcm1: Mixer "ogain": pcm1: Mixer "monitor": pcm1: Playback channel set is: Front Left, Front Right, pcm1: Playback channel matrix is: 2.0 (unknown) pcm1: Automatically set rec source to: monitor pcm1: Recording channel set is: Front Left, Front Right, pcm1: Recording channel matrix is: 2.0 (unknown) unknown: at nid 2 on hdacc0 (no driver attached) hdacc0: Subsystem ID: 0xf250584c adrian@lucy-11i386:~/work/freebsd/head/src/sys/dev/sound/pci/hda %