Skip to contentSkip to conversation

Patch for btsco kernel module (index parameter)

Bluez-devel Whoopie 1 participant 1 message Aug 16, 2005 Bluetooth drivers

lore
Share & tools
lore

Whoopie

author
#0 lore raw

Hi,
I made a small patch for the btsco kernel module, so that it doesn't grep the ALSA device 0. And you can specify any index parameter.
I think that it's important because the soundcard should be device 0. Now, I can load the module in /etc/modules at startup.

It's based on the ALSA modem drivers, so it was just a copy&paste work.

Regards,
Whoopie

btsco.c renamed from btsco.c.orig +6 -1
@@ -63,6 +63,11 @@
 
 static char *mod_revision = "$Revision: 1.6 $";
 
+static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */
+
+module_param_array(index, int, NULL, 0444);
+MODULE_PARM_DESC(index, "Index value for Bluetooth SCO Headset Soundcard.");
+
 #undef dprintk
 #if 1
 #define dprintk(fmt...) printk(KERN_INFO "snd-bt-sco: " fmt)
@@ -964,7 +969,7 @@
 	snd_hwdep_t *hw;
 
 	card =
-	    snd_card_new(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
+	    snd_card_new(index[dev], SNDRV_DEFAULT_STR1,
 			 THIS_MODULE, 0);
 	if (card == NULL)
 		return -ENOMEM;