From nobody@FreeBSD.org  Tue Mar  5 05:49:58 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id E4D48D32
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  5 Mar 2013 05:49:58 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id BDACE1BE
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  5 Mar 2013 05:49:58 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r255nwOa073036
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 5 Mar 2013 05:49:58 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r255nwtO073035;
	Tue, 5 Mar 2013 05:49:58 GMT
	(envelope-from nobody)
Message-Id: <201303050549.r255nwtO073035@red.freebsd.org>
Date: Tue, 5 Mar 2013 05:49:58 GMT
From: Hiren Panchasara <hiren.panchasara@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Headphones redirection for Lenovo T420 and T520
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         176656
>Category:       misc
>Synopsis:       Headphones redirection for Lenovo T420 and T520
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    glebius
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 05 06:00:00 UTC 2013
>Closed-Date:    Mon Jun 24 09:19:56 UTC 2013
>Last-Modified:  Mon Jun 24 09:19:56 UTC 2013
>Originator:     Hiren Panchasara
>Release:        current
>Organization:
>Environment:
FreeBSD my.machine.com 10.0-CURRENT FreeBSD 10.0-CURRENT  #0 r247409M: Mon Mar  4 14:36:48 PST 2013
>Description:
Inspired by r247815 from mav@
http://svnweb.freebsd.org/base?view=revision&revision=247815

Adding similar quirks for Lenovo T420 and T520.

>How-To-Repeat:
With the patch, sound gets redirected to headphones when inserted and back to laptop speakers when removed. 
>Fix:
Index: sys/dev/sound/pci/hda/hdaa_patches.c
===================================================================
--- sys/dev/sound/pci/hda/hdaa_patches.c	(revision 247821)
+++ sys/dev/sound/pci/hda/hdaa_patches.c	(working copy)
@@ -334,7 +334,9 @@
 			break;
 		}
 	} else if (id == HDA_CODEC_CX20590 &&
-	    subid == LENOVO_X220_SUBVENDOR) {
+	    (subid == LENOVO_X220_SUBVENDOR ||
+	    subid == LENOVO_T420_SUBVENDOR ||
+	    subid == LENOVO_T520_SUBVENDOR)) {
 		switch (nid) {
 		case 25:
 			patch = "as=1 seq=15";
Index: sys/dev/sound/pci/hda/hdac.h
===================================================================
--- sys/dev/sound/pci/hda/hdac.h	(revision 247821)
+++ sys/dev/sound/pci/hda/hdac.h	(working copy)
@@ -222,6 +222,8 @@
 #define LENOVO_TCA55_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x1015)
 #define LENOVO_X220_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x21da)
 #define LENOVO_X300_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac)
+#define LENOVO_T420_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce)
+#define LENOVO_T520_SUBVENDOR   HDA_MODEL_CONSTRUCT(LENOVO, 0x21cf)
 #define LENOVO_ALL_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0xffff)
 
 /* Samsung */


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->glebius 
Responsible-Changed-By: glebius 
Responsible-Changed-When: Wed Mar 6 13:38:35 UTC 2013 
Responsible-Changed-Why:  
I'll take this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=176656 

From: Sean Bruno <seanbru@yahoo-inc.com>
To: bug-followup@FreeBSD.org, hiren.panchasara@gmail.com
Cc:  
Subject: Re: misc/176656: Headphones redirection for Lenovo T420 and T520
Date: Wed, 06 Mar 2013 13:22:33 +0000

 Confirmed as fixing this problem on a T520.  THANKS!
 
 Sean
 
 p.s. I can commit if needed.
 
State-Changed-From-To: open->patched 
State-Changed-By: glebius 
State-Changed-When: Thu Mar 7 08:00:09 UTC 2013 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=176656 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: misc/176656: commit references a PR
Date: Thu,  7 Mar 2013 08:01:10 +0000 (UTC)

 Author: glebius
 Date: Thu Mar  7 08:00:04 2013
 New Revision: 247911
 URL: http://svnweb.freebsd.org/changeset/base/247911
 
 Log:
   Add quirks to enable headphones redirection on number of Lenovo
   laptops, namely X1, X1 Carbon, T420, T520.
   
   PR:		misc/176656
   Submitted by:	Hiren Panchasar <hiren.panchasara gmail.com>
   Tested by:	glebius, X1 Carbon
   Tested by:	osa, X1
   Tested by:	Hiren Panchasar, T420
   Tested by:	sbruno, T520
   Reviewed by:	mav
   Sponsored by:	Nginx, Inc.
 
 Modified:
   head/sys/dev/sound/pci/hda/hdaa_patches.c
   head/sys/dev/sound/pci/hda/hdac.h
 
 Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c
 ==============================================================================
 --- head/sys/dev/sound/pci/hda/hdaa_patches.c	Thu Mar  7 07:54:50 2013	(r247910)
 +++ head/sys/dev/sound/pci/hda/hdaa_patches.c	Thu Mar  7 08:00:04 2013	(r247911)
 @@ -334,12 +334,22 @@ hdac_pin_patch(struct hdaa_widget *w)
  			break;
  		}
  	} else if (id == HDA_CODEC_CX20590 &&
 -	    subid == LENOVO_X220_SUBVENDOR) {
 +	    (subid == LENOVO_X1_SUBVENDOR ||
 +	    subid == LENOVO_X220_SUBVENDOR ||
 +	    subid == LENOVO_T420_SUBVENDOR ||
 +	    subid == LENOVO_T520_SUBVENDOR)) {
  		switch (nid) {
  		case 25:
  			patch = "as=1 seq=15";
  			break;
  		}
 +	} else if (id == HDA_CODEC_ALC269 &&
 +	    subid == LENOVO_X1CRBN_SUBVENDOR) {
 +		switch (nid) {
 +		case 21:
 +			patch = "as=1 seq=15";
 +			break;
 +		}
  	}
  
  	if (patch != NULL)
 
 Modified: head/sys/dev/sound/pci/hda/hdac.h
 ==============================================================================
 --- head/sys/dev/sound/pci/hda/hdac.h	Thu Mar  7 07:54:50 2013	(r247910)
 +++ head/sys/dev/sound/pci/hda/hdac.h	Thu Mar  7 08:00:04 2013	(r247911)
 @@ -220,8 +220,12 @@
  #define LENOVO_3KN200_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x384e)
  #define LENOVO_B450_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x3a0d)
  #define LENOVO_TCA55_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x1015)
 +#define	LENOVO_X1_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x21e8)
 +#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_T420_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce)
 +#define	LENOVO_T520_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0x21cf)
  #define LENOVO_ALL_SUBVENDOR	HDA_MODEL_CONSTRUCT(LENOVO, 0xffff)
  
  /* Samsung */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: glebius 
State-Changed-When: Mon Jun 24 09:19:41 UTC 2013 
State-Changed-Why:  
Merged to stable/9. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=176656 
>Unformatted:
