I think this model has potential but before we go that direction I'd like to hear
your reactions on another more simplistic model. I'll express it with a
hypothetical code example. This model completely drops individual card matching
and is compatible with both card users and non-card users.
static struct pnp_device_id snd_als100_pnpids[] = {
/* ALS100 - PRO16PNP */
{.card_id = "ALS0001" .id = "@@@0001", .driver_data = ALS100_AUDIO},
{.card_id = "ALS0001" .id = "@X@0001", .driver_data = ALS100_MPU},
{.card_id = "ALS0001" .id = "@H@0001", .driver_data = ALS100_OPL},
/* ALS110 - MF1000 - Digimate 3D Sound */
{.card_id = "ALS0110" .id = "@@@1001", .driver_data = ALS100_AUDIO},
{.card_id = "ALS0001" .id = "@X@1001", .driver_data = ALS100_MPU},
{.card_id = "ALS0001" .id = "@H@1001", .driver_data = ALS100_OPL},
---> snip
};
static int __init snd_card_als100_probe(struct pnp_dev * dev, struct pnp_device_id * id)
{
---> snip
snd_card_t *card;
---> snip
card = snd_card_find(dev->card); /* this function searches for previously
registered sound cards and binds this
device to it if it finds that it was a
member of the same pnp_card */
if (!card) {
if ((card = snd_card_new(index[dev], id[dev], THIS_MODULE,
sizeof(struct snd_card_als100))) == NULL)
return -ENOMEM;
}
switch (id->driver_data) {
case ALS100_AUDIO:
---> snip
case ALS100_MPU:
---> snip
case ALS100_OPL:
---> snip
etc . . .
I'm interested in your opinions on this approach.
Thanks,
Adam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/