From: Takashi Iwai <tiwai@suse.de>
To: Gerd Knorr <kraxel@suse.de>
Cc: Jaroslav Kysela <perex@suse.cz>,
Clemens Ladisch <clemens@ladisch.de>,
Holger Waechtler <holger@qanu.de>,
dvb list <linux-dvb@linuxtv.org>,
alsa-devel@lists.sourceforge.net
Subject: Re: Problem with Avermedia 771
Date: Wed, 20 Oct 2004 15:17:59 +0200 [thread overview]
Message-ID: <s5hy8i1h6k8.wl@alsa2.suse.de> (raw)
In-Reply-To: <s5hzn2hh735.wl@alsa2.suse.de>
[-- Attachment #1: Type: text/plain, Size: 629 bytes --]
At Wed, 20 Oct 2004 15:06:38 +0200,
I wrote:
>
> > So we'll have to build a whitelist from scratch from user feedback, and
> > maybe add a insmod option so you can ask the driver to grab the device
> > even if not whitelisted for easy use.
>
> We have some options for this kind of behavior:
>
> 1. the driver has one pci_driver struct, and its pci_id array includes
> the default entries (with PCI_ANY_ID for subsystem ids).
>
> In this case, the driver checks the pci id in probe and rejects
> unless it's in the whitelist or a specific module option is given.
The experimental patch for this is below.
Takashi
[-- Attachment #2: Type: text/plain, Size: 2313 bytes --]
Index: alsa-kernel/pci/bt87x.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/pci/bt87x.c,v
retrieving revision 1.14
diff -u -r1.14 bt87x.c
--- alsa-kernel/pci/bt87x.c 29 Sep 2004 16:17:59 -0000 1.14
+++ alsa-kernel/pci/bt87x.c 20 Oct 2004 13:17:26 -0000
@@ -45,6 +45,7 @@
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
static int digital_rate[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0 }; /* digital input rate */
+static int load_all; /* allow to load the non-whitelisted cards */
static int boot_devs;
module_param_array(index, int, boot_devs, 0444);
@@ -55,6 +56,8 @@
MODULE_PARM_DESC(enable, "Enable Bt87x soundcard");
module_param_array(digital_rate, int, boot_devs, 0444);
MODULE_PARM_DESC(digital_rate, "Digital input rate for Bt87x soundcard");
+module_param(load_all, bool, 0444);
+MODULE_PARM_DESC(load_all, "Allow to load the non-whitelisted cards");
#ifndef PCI_VENDOR_ID_BROOKTREE
@@ -148,6 +151,9 @@
#endif
#define CLOCK_DIV_MAX 15
+#define DRIVER_DEFAULT_ENTRY (1<<24)
+#define DRIVER_RATE_MASK ((1<<24)-1)
+
#define ERROR_INTERRUPTS (INT_FBUS | INT_FTRGT | INT_PPERR | \
INT_RIPERR | INT_PABORT | INT_OCERR)
#define MY_INTERRUPTS (INT_RISCI | ERROR_INTERRUPTS)
@@ -746,6 +752,11 @@
bt87x_t *chip;
int err;
+ if (pci_id->driver_data & DRIVER_DEFAULT_ENTRY) {
+ if (! load_all)
+ return -ENODEV;
+ }
+
if (dev >= SNDRV_CARDS)
return -ENODEV;
if (!enable[dev]) {
@@ -764,7 +775,7 @@
if (digital_rate[dev] > 0)
chip->dig_rate = digital_rate[dev];
else
- chip->dig_rate = (int)pci_id->driver_data;
+ chip->dig_rate = (int)(pci_id->driver_data & DRIVER_RATE_MASK);
err = snd_bt87x_pcm(chip, DEVICE_DIGITAL, "Bt87x Digital");
if (err < 0)
@@ -819,8 +830,8 @@
BT_DEVICE(878, 0x0070, 0xff01, 44100), /* Osprey 200 */
/* default entries for 32kHz and generic Bt87x cards */
- BT_DEVICE(878, PCI_ANY_ID, PCI_ANY_ID, 32000),
- BT_DEVICE(879, PCI_ANY_ID, PCI_ANY_ID, 32000),
+ BT_DEVICE(878, PCI_ANY_ID, PCI_ANY_ID, 32000 | DRIVER_DEFAULT_ENTRY),
+ BT_DEVICE(879, PCI_ANY_ID, PCI_ANY_ID, 32000 | DRIVER_DEFAULT_ENTRY),
{ }
};
MODULE_DEVICE_TABLE(pci, snd_bt87x_ids);
next prev parent reply other threads:[~2004-10-20 13:17 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <416ED29A.7060200@qanu.de>
2004-10-15 10:11 ` Problem with Avermedia 771 Gerd Knorr
2004-10-15 11:03 ` Jaroslav Kysela
2004-10-15 11:58 ` [Alsa-devel] " Holger Waechtler
2004-10-18 13:01 ` Gerd Knorr
2004-10-18 14:50 ` Takashi Iwai
2004-10-19 16:13 ` Gerd Knorr
2004-10-20 13:06 ` Takashi Iwai
2004-10-20 13:17 ` Takashi Iwai [this message]
2004-10-20 15:02 ` Clemens Ladisch
2004-10-20 15:20 ` Takashi Iwai
2004-10-21 7:22 ` Clemens Ladisch
2004-10-21 8:59 ` [Alsa-devel] " Gerd Knorr
2004-10-21 10:05 ` Takashi Iwai
2004-10-21 10:18 ` Gerd Knorr
2004-10-21 10:38 ` Takashi Iwai
2004-10-21 11:43 ` Gerd Knorr
2004-10-21 12:11 ` Takashi Iwai
2004-10-21 16:36 ` Takashi Iwai
2004-10-25 9:36 ` Clemens Ladisch
2004-10-20 15:27 ` Gerd Knorr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hy8i1h6k8.wl@alsa2.suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@lists.sourceforge.net \
--cc=clemens@ladisch.de \
--cc=holger@qanu.de \
--cc=kraxel@suse.de \
--cc=linux-dvb@linuxtv.org \
--cc=perex@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox