Date: Sun, 28 Dec 2003 21:11:35 -0800 (PST) From: SHINOHARA Takahiro <shinoharatk@yahoo.co.jp> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/60677: No reaction of volume controy key on IBM Thinkpad i1124 Message-ID: <200312290511.hBT5BZsB058465@www.freebsd.org> Resent-Message-ID: <200312290520.hBT5KFAj013048@freefall.freebsd.org>
index | next in thread | raw e-mail
>Number: 60677
>Category: misc
>Synopsis: No reaction of volume controy key on IBM Thinkpad i1124
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Dec 28 21:20:15 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: SHINOHARA Takahiro
>Release: 5.2-CURRENT
>Organization:
private
>Environment:
FreeBSD kunkun.de.la.grant 5.2-CURRENT FreeBSD 5.2-CURRENT #1: Sun Dec 28 21:33:42 JST 2003 shino@kunkun.de.la.grant:/usr/src/sys/i386/compile/KUNKUN i386
>Description:
ThinkPad i1124 has volume control keys. I push them, but volume is not changed. Because chip(CS4281) register is not set as do so.
>How-To-Repeat:
boot, play some mp3 or any audio file, and push volume control key.
>Fix:
diff -ur sys.orig/conf/options.i386 sys/conf/options.i386
--- sys.orig/conf/options.i386 Sat Apr 12 18:40:37 2003
+++ sys/conf/options.i386 Wed Jul 16 20:46:37 2003
@@ -141,6 +141,9 @@
PCVT_VT220KEYB opt_pcvt.h
PCVT_GREENSAVER opt_pcvt.h
+# Enable hardware volume control for PCM Audio on note PC
+PCM_NOTE_HWVOL opt_sound.h
+
# Video spigot
SPIGOT_UNSECURE opt_spigot.h
diff -ur sys.orig/dev/sound/pci/cs4281.c sys/dev/sound/pci/cs4281.c
--- sys.orig/dev/sound/pci/cs4281.c Fri Feb 21 02:31:11 2003
+++ sys/dev/sound/pci/cs4281.c Wed Jul 16 20:46:50 2003
@@ -29,6 +29,8 @@
* contributed towards power management.
*/
+#include "opt_sound.h"
+
#include <dev/sound/pcm/sound.h>
#include <dev/sound/pcm/ac97.h>
@@ -639,6 +641,13 @@
cs4281_wr(sc,
CS4281PCI_ACOSV,
CS4281PCI_ACOSV_SLV(3) | CS4281PCI_ACOSV_SLV(4));
+
+#ifdef PCM_NOTE_HWVOL
+ /* Set hardware volume control */
+ cs4281_wr(sc,
+ CS4281PCI_SSCR,
+ CS4281PCI_SSCR_HVC);
+#endif /* PCM_NOTE_HWVOL */
/* Set Master and headphone to max */
cs4281_wrcd(0, sc, AC97_MIX_AUXOUT, 0);
diff -ur sys.orig/dev/sound/pci/cs4281.h sys/dev/sound/pci/cs4281.h
--- sys.orig/dev/sound/pci/cs4281.h Thu Apr 19 22:23:50 2001
+++ sys/dev/sound/pci/cs4281.h Wed Jul 16 20:46:51 2003
@@ -146,6 +146,8 @@
# define CS4281PCI_SERMC_PTC_MASK 0x0000000e
# define CS4281PCI_SERMC_ODSEN1 0x01000000
# define CS4281PCI_SERMC_ODSEN2 0x02000000
+# define CS4281PCI_SERMC_PLB 0x00000010
+# define CS4281PCI_SERMC_PXLB 0x00000020
#define CS4281PCI_SERC1 0x428
#define CS4281PCI_SERC2 0x42c
@@ -183,6 +185,15 @@
#define CS4281PCI_DACSR 0x744
#define CS4281PCI_ADCSR 0x748
#define CS4281PCI_SSCR 0x74c
+# define CS4281PCI_SSCR_HVS1 0x00800000
+# define CS4281PCI_SSCR_MVCS 0x00080000
+# define CS4281PCI_SSCR_MVLD 0x00040000
+# define CS4281PCI_SSCR_MVAD 0x00020000
+# define CS4281PCI_SSCR_MVMD 0x00010000
+# define CS4281PCI_SSCR_XLPSRC 0x00000100
+# define CS4281PCI_SSCR_LPSRC 0x00000080
+# define CS4281PCI_SSCR_CDTX 0x00000020
+# define CS4281PCI_SSCR_HVC 0x00000008
#define CS4281PCI_SRCSA 0x75c
# define CS4281PCI_SRCSA_PLSS(x) (x)
diff -ur sys.orig/modules/sound/driver/cs4281/Makefile sys/modules/sound/driver/cs4281/Makefile
--- sys.orig/modules/sound/driver/cs4281/Makefile Wed Jul 16 21:00:11 2003
+++ sys/modules/sound/driver/cs4281/Makefile Wed Jul 16 21:08:16 2003
@@ -3,7 +3,7 @@
.PATH: ${.CURDIR}/../../../../dev/sound/pci
KMOD= snd_cs4281
-SRCS= device_if.h bus_if.h pci_if.h
+SRCS= device_if.h bus_if.h pci_if.h opt_sound.h
SRCS+= cs4281.c
.include <bsd.kmod.mk>
>Release-Note:
>Audit-Trail:
>Unformatted:
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200312290511.hBT5BZsB058465>
