diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-02-19 16:41:56 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-02-19 16:41:56 +0000 |
commit | 0992bac9732a651a2024c68cdf87bcd54fa1e381 (patch) | |
tree | 74451db8858e8024a699a0a258645af906b268c9 /linux | |
parent | 549f66e3e6f4a7fd57d6419903467daaf099461e (diff) | |
download | mediapointer-dvb-s2-0992bac9732a651a2024c68cdf87bcd54fa1e381.tar.gz mediapointer-dvb-s2-0992bac9732a651a2024c68cdf87bcd54fa1e381.tar.bz2 |
em28xx: register device to soundcard for sysfs
From: Nicola Soranzo <nsoranzo@tiscali.it>
As explained in "Writing an ALSA driver" (T. Iwai), audio drivers should
set the struct device for the card before registering the card instance.
This will add the correct /sys/class/sound/cardN/device symlink, so HAL
can see the device and ConsoleKit sets its ACL permissions for the
logged-in user.
For em28xx audio capture cards found e.g. in Hauppauge WinTV-HVR-900 (R2),
this patch fixes errors like:
ALSA lib pcm_hw.c:1429:(_snd_pcm_hw_open) Invalid value for card
Error opening audio: Permission denied
when running mplayer as a normal user.
Priority: normal
Signed-off-by: Nicola Soranzo <nsoranzo@tiscali.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-audio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-audio.c b/linux/drivers/media/video/em28xx/em28xx-audio.c index bfa3986f5..eb49a1364 100644 --- a/linux/drivers/media/video/em28xx/em28xx-audio.c +++ b/linux/drivers/media/video/em28xx/em28xx-audio.c @@ -560,6 +560,8 @@ static int em28xx_audio_init(struct em28xx *dev) pcm->info_flags = 0; pcm->private_data = dev; strcpy(pcm->name, "Empia 28xx Capture"); + + snd_card_set_dev(card, &dev->udev->dev); strcpy(card->driver, "Empia Em28xx Audio"); strcpy(card->shortname, "Em28xx Audio"); strcpy(card->longname, "Empia Em28xx Audio"); |