Skip to contentSkip to conversation

Platform bus question

DISCUSSION Adrian McMenamin 2 participants 4 messages Sep 14, 2005 – Sep 16, 2005

lore
Share & tools
lore
#0 lore raw

I am writing a driver for the sound card on the Sega Dreamcast (you can view it at http://newgolddream.dyndns.info/repos/aica) and I am using this:

	snd_card_set_dev(dreamcastcard, &platform_bus);	

	/* Register the card with ALSA subsystem */
	if ((err = snd_card_register(dreamcastcard)) < 0) {
		snd_aicapcm_free();	
		snd_card_free(dreamcastcard);
		return err;
	}

In the hope that the card will be registered with the generic platform bus.

The code does not generate any errors, but doesn't appear to work either!

eg

sh-3.00# cd /sys
sh-3.00# ls
block bus class devices firmware kernel module
sh-3.00# cd bus
sh-3.00# ls
pci platform serio shbus
sh-3.00# cd platform
sh-3.00# ls
devices drivers
sh-3.00# cd devices
sh-3.00# ls -l
sh-3.00#

(ie nothing appearing in /sys/bus/platform/devices)

and

sh-3.00# cd /sys
sh-3.00# ls
block bus class devices firmware kernel module
sh-3.00# cd devices
sh-3.00# ls
pci0000:00 platform shbus system
sh-3.00# cd platform
sh-3.00# ls -l
sh-3.00#

Yet it also reports this...
sh-3.00# cd /sys
sh-3.00# ls
block bus class devices firmware kernel module
sh-3.00# cd class
sh-3.00# ls

graphics  mem       net       sound     vc
input     misc      pci_bus   tty

sh-3.00# cd sound
sh-3.00# ls
controlC0 pcmC0D0p timer
sh-3.00# ls -l

drwxr-xr-x    2 root     root            0 Sep 14 17:07 controlC0
drwxr-xr-x    2 root     root            0 Sep 14 17:07 pcmC0D0p
drwxr-xr-x    2 root     root            0 Sep 14 17:07 timer

sh-3.00# cd pcmC0D0p/
sh-3.00# ls
dev device
sh-3.00# ls -l

-r--r--r--    1 root     root         4096 Sep 14 17:11 dev
lrwxrwxrwx    1 root     root            0 Sep 14 17:11 device

-> ../../../devices/platform

Do I need to write specific platform bus code for this device or should ALSA handle it for me?

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php

#1 lore raw

At Wed, 14 Sep 2005 23:11:29 +0100,

Quoted 15 lines · Adrian McMenamin

I am writing a driver for the sound card on the Sega Dreamcast (you can view it at http://newgolddream.dyndns.info/repos/aica) and I am using this:

	snd_card_set_dev(dreamcastcard, &platform_bus);	

	/* Register the card with ALSA subsystem */
	if ((err = snd_card_register(dreamcastcard)) < 0) {
		snd_aicapcm_free();	
		snd_card_free(dreamcastcard);
		return err;
	}
Quoted 5 lines

In the hope that the card will be registered with the generic platform bus.

The code does not generate any errors, but doesn't appear to work either!

Use a new function snd_card_set_generic_dev() for such a purpose if the device isn't assigned to a proper bus.

Takashi

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php

#2 lore raw
Quoted 17 lines · Takashi Iwai

At Wed, 14 Sep 2005 23:11:29 +0100,

Quoted 15 lines · Adrian McMenamin

I am writing a driver for the sound card on the Sega Dreamcast (you can view it at http://newgolddream.dyndns.info/repos/aica) and I am using this:

	snd_card_set_dev(dreamcastcard, &platform_bus);	

	/* Register the card with ALSA subsystem */
	if ((err = snd_card_register(dreamcastcard)) < 0) {
		snd_aicapcm_free();	
		snd_card_free(dreamcastcard);
		return err;
	}
Quoted 9 lines
Quoted 5 lines

In the hope that the card will be registered with the generic platform bus.

The code does not generate any errors, but doesn't appear to work either!

Use a new function snd_card_set_generic_dev() for such a purpose if the device isn't assigned to a proper bus.

Meaning the snd_card_set_dev macro + snd_card_register function combo won't work?

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php

#3 lore raw

At Thu, 15 Sep 2005 23:42:56 +0100,

Quoted 22 lines · Adrian McMenamin
Quoted 20 lines · Takashi Iwai

At Wed, 14 Sep 2005 23:11:29 +0100,

Quoted 18 lines · Adrian McMenamin

I am writing a driver for the sound card on the Sega Dreamcast (you can view it at http://newgolddream.dyndns.info/repos/aica) and I am using this:

	snd_card_set_dev(dreamcastcard, &platform_bus);	

	/* Register the card with ALSA subsystem */
	if ((err = snd_card_register(dreamcastcard)) < 0) {
		snd_aicapcm_free();	
		snd_card_free(dreamcastcard);
		return err;
	}

In the hope that the card will be registered with the generic platform bus.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

The code does not generate any errors, but doesn't appear to work either!

Use a new function snd_card_set_generic_dev() for such a purpose if the device isn't assigned to a proper bus.

Meaning the snd_card_set_dev macro + snd_card_register function combo won't work?

It would work but you are passing a wrong instance in snd_card_set_dev(). It's the device object of its own, not the bus to be assigned.

Takashi

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php