Support for platform bus
I am attempting to write an ALSA driver for the sound card on the Dreamcast.
I have this in the code:
snd_card_set_dev(dreamcastcard, &platform_bus);
No errors are reported but the card doesn't show up in sysfs as a device registered to the platform bus - is this because I need to do more to force the device to appear there? (it doesn't appear under any bus but it does show up as a module in sysfs):
sh-3.00# cd module
sh-3.00# ls -l
drwxr-xr-x 3 root root 0 Aug 31 18:23 lockd drwxr-xr-x 3 root root 0 Aug 31 18:23 psmouse drwxr-xr-x 3 root root 0 Aug 31 18:26 snd drwxr-xr-x 2 root root 0 Aug 31 18:26 snd_card_aica drwxr-xr-x 2 root root 0 Aug 31 18:26 soundcore
sh-3.00# ls -l snd_card_aica/
-r--r--r-- 1 root root 4096 Aug 31 18:29 refcnt
Please cc me into any replies as I am not (yet - mailman seems slow) subscribed to the list.
Thanks
Adrian
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
Quoted 2 lines · Adrian McMenamin
I am attempting to write an ALSA driver for the sound card on the Dreamcast.
Please post your driver source code.
Lee
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
Quoted 7 lines · Lee Revell
Quoted 2 lines · Adrian McMenamin
I am attempting to write an ALSA driver for the sound card on the Dreamcast.
Please post your driver source code.
Lee
Anybody who wants to see all of it can look at
http://newgolddream.dyndns.info/repos but here's the relevant bit (obviously this is a work in progress so be gentle with me):
static int __init aica_pcm_init(void)
{
int err;
int idx;
struct snd_aicapcmchip *chip;
snd_printk("Probing for AICA device\n");
/* Are we in a Dreamcast at all? */
if (!mach_is_dreamcast()) return -ENODEV;
dreamcastcard = NULL;
/* Can only be one real device on a Dreamcast
but we might have the dummy or some other driver loaded */
for (idx = 0; idx < SNDRV_CARDS; idx++)
{
dreamcastcard = snd_card_new(idx, "AICA", THIS_MODULE, 0);
if (dreamcastcard) break;
}
if (!dreamcastcard) return -ENODEV;
strcpy(dreamcastcard->shortname, "AICA ");
strcpy(dreamcastcard->longname, "Dreamcast AICA PCM Sound device ");
/* Load the PCM 'chip' */
if ((err = snd_aicapcmchip(dreamcastcard, &chip)) < 0) {
snd_card_free(dreamcastcard);
snd_printk("Could not initialise AICA PCM device\n");
return err;
}
/* Set up the ALSA PCM subsystem */
/* register with sysfs etc - this is not on a 'proper' bus so just use
the generic */
snd_card_set_dev(dreamcastcard, &platform_bus);
/* Register the card with ALSA subsystem */
if ((err = snd_card_register(dreamcastcard)) < 0) {
snd_card_free(dreamcastcard);
return err;
}
snd_printk("Dreamcast AICA device registered on slot %d\n", idx);
return 0; -------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
At Thu, 01 Sep 2005 00:42:36 +0100,
Quoted 7 lines · Adrian McMenamin
I am attempting to write an ALSA driver for the sound card on the Dreamcast.
I have this in the code:
snd_card_set_dev(dreamcastcard, &platform_bus);
The second argument is the pointer to struct device. You should have got a compiler warning about pointer cast.
Takashi
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf