diff options
author | Nicola Soranzo <nsoranzo@tiscali.it> | 2009-02-19 13:41:56 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-02-26 22:29:18 -0300 |
commit | 7662b00c378fe638e84a853418cd833303fc050c (patch) | |
tree | 8542073ecba7294c03db979f49f9798dc2bb6a42 /drivers/media | |
parent | 169d418b127b98a3e464e9c4b807ad083760f98c (diff) | |
download | kernel_samsung_aries-7662b00c378fe638e84a853418cd833303fc050c.zip kernel_samsung_aries-7662b00c378fe638e84a853418cd833303fc050c.tar.gz kernel_samsung_aries-7662b00c378fe638e84a853418cd833303fc050c.tar.bz2 |
V4L/DVB (10659): em28xx: register device to soundcard for sysfs
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.
Signed-off-by: Nicola Soranzo <nsoranzo@tiscali.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-audio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index 5d882a4..2ac738f 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c @@ -463,6 +463,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"); |