patch-2.4.19 linux-2.4.19/drivers/sound/cs4232.c

Next file: linux-2.4.19/drivers/sound/cs4281/cs4281_wrapper.h
Previous file: linux-2.4.19/drivers/sound/cmpci.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/drivers/sound/cs4232.c linux-2.4.19/drivers/sound/cs4232.c
@@ -34,6 +34,8 @@
  * anyway.
  *
  * Changes
+ *      John Rood               Added Bose Sound System Support.
+ *      Toshio Spoor
  *	Alan Cox		Modularisation, Basic cleanups.
  *      Paul Barton-Davis	Separated MPU configuration, added
  *                                       Tropez+ (WaveFront) support
@@ -58,6 +60,10 @@
 
 #define KEY_PORT	0x279	/* Same as LPT1 status port */
 #define CSN_NUM		0x99	/* Just a random number */
+#define INDEX_ADDRESS   0x00    /* (R0) Index Address Register */
+#define INDEX_DATA      0x01    /* (R1) Indexed Data Register */
+#define PIN_CONTROL     0x0a    /* (I10) Pin Control */
+#define ENABLE_PINS     0xc0    /* XCTRL0/XCTRL1 enable */
 
 static void CS_OUT(unsigned char a)
 {
@@ -67,6 +73,7 @@
 #define CS_OUT2(a, b)		{CS_OUT(a);CS_OUT(b);}
 #define CS_OUT3(a, b, c)	{CS_OUT(a);CS_OUT(b);CS_OUT(c);}
 
+static int __initdata bss       = 0;
 static int mpu_base = 0, mpu_irq = 0;
 static int synth_base = 0, synth_irq = 0;
 static int mpu_detected = 0;
@@ -97,6 +104,30 @@
 	schedule_timeout(howlong);
 }
 
+static void enable_xctrl(int baseio)
+{
+        unsigned char regd;
+                
+        /*
+         * Some IBM Aptiva's have the Bose Sound System. By default
+         * the Bose Amplifier is disabled. The amplifier will be 
+         * activated, by setting the XCTRL0 and XCTRL1 bits.
+         * Volume of the monitor bose speakers/woofer, can then
+         * be set by changing the PCM volume.
+         *
+         */
+                
+        printk("cs4232: enabling Bose Sound System Amplifier.\n");
+        
+        /* Switch to Pin Control Address */                   
+        regd = inb(baseio + INDEX_ADDRESS) & 0xe0;
+        outb(((unsigned char) (PIN_CONTROL | regd)), baseio + INDEX_ADDRESS );
+        
+        /* Activate the XCTRL0 and XCTRL1 Pins */
+        regd = inb(baseio + INDEX_DATA);
+        outb(((unsigned char) (ENABLE_PINS | regd)), baseio + INDEX_DATA );
+}
+
 int __init probe_cs4232(struct address_info *hw_config, int isapnp_configured)
 {
 	int i, n;
@@ -275,6 +306,11 @@
 		}
 		hw_config->slots[1] = hw_config2.slots[1];
 	}
+	
+	if (bss)
+	{
+        	enable_xctrl(base);
+	}
 }
 
 void unload_cs4232(struct address_info *hw_config)
@@ -349,6 +385,8 @@
 MODULE_PARM_DESC(synthirq,"Maui WaveTable IRQ");
 MODULE_PARM(isapnp,"i");
 MODULE_PARM_DESC(isapnp,"Enable ISAPnP probing (default 1)");
+MODULE_PARM(bss,"i");
+MODULE_PARM_DESC(bss,"Enable Bose Sound System Support (default 0)");
 
 /*
  *	Install a CS4232 based card. Need to have ad1848 and mpu401

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)