Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124186
b: refs/heads/master
c: 24a613e
h: refs/heads/master
v: v3
  • Loading branch information
Devin Heitmueller authored and Mauro Carvalho Chehab committed Dec 29, 2008
1 parent a08cad9 commit 159d307
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 95ea4705746f52e17f1f14f9136ea2106ffe3b26
refs/heads/master: 24a613e4b08c4077b4c809bebab1d4a36d541fcc
10 changes: 6 additions & 4 deletions trunk/drivers/media/video/em28xx/em28xx-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,10 @@ static int em28xx_audio_init(struct em28xx *dev)
static int devnr;
int err;

if (dev->has_audio_class) {
if (dev->has_alsa_audio != 1) {
/* This device does not support the extension (in this case
the device is expecting the snd-usb-audio module) */
the device is expecting the snd-usb-audio module or
doesn't have analog audio support at all) */
return 0;
}

Expand Down Expand Up @@ -480,9 +481,10 @@ static int em28xx_audio_fini(struct em28xx *dev)
if (dev == NULL)
return 0;

if (dev->has_audio_class) {
if (dev->has_alsa_audio != 1) {
/* This device does not support the extension (in this case
the device is expecting the snd-usb-audio module */
the device is expecting the snd-usb-audio module or
doesn't have analog audio support at all) */
return 0;
}

Expand Down
29 changes: 25 additions & 4 deletions trunk/drivers/media/video/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1927,6 +1927,19 @@ static struct video_device *em28xx_vdev_init(struct em28xx *dev,
return vfd;
}

int em28xx_supports_audio_extension(struct em28xx *dev)
{
/* The chip dictates whether we support the Empia analog audio
extension */
switch (dev->chip_id) {
case CHIP_ID_EM2874:
/* Either a digital-only device or provides AC97 audio */
return 0;
case CHIP_ID_EM2883:
default:
return 1;
}
}

static int register_analog_devices(struct em28xx *dev)
{
Expand Down Expand Up @@ -2121,7 +2134,7 @@ static void request_module_async(struct work_struct *work)

if (dev->has_audio_class)
request_module("snd-usb-audio");
else
else if (dev->has_alsa_audio)
request_module("em28xx-alsa");

if (dev->has_dvb)
Expand Down Expand Up @@ -2230,9 +2243,6 @@ static int em28xx_usb_probe(struct usb_interface *interface,
}
}

printk(KERN_INFO DRIVER_NAME " %s usb audio class\n",
dev->has_audio_class ? "Has" : "Doesn't have");

/* compute alternate max packet sizes */
uif = udev->actconfig->interface[0];

Expand Down Expand Up @@ -2271,6 +2281,17 @@ static int em28xx_usb_probe(struct usb_interface *interface,

em28xx_info("Found %s\n", em28xx_boards[dev->model].name);

if (dev->has_audio_class == 0) {
/* We don't have a USB audio class, let's see if we support
ALSA Audio */
dev->has_alsa_audio = em28xx_supports_audio_extension(dev);
if (dev->has_alsa_audio)
printk(KERN_INFO DRIVER_NAME " supports alsa audio\n");
} else {
printk(KERN_INFO DRIVER_NAME " has usb audio class\n");
}


/* save our data pointer in this interface device */
usb_set_intfdata(interface, dev);

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/video/em28xx/em28xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ struct em28xx {
unsigned int has_tda9887:1;
unsigned int stream_on:1; /* Locks streams */
unsigned int has_audio_class:1;
unsigned int has_alsa_audio:1;
unsigned int has_12mhz_i2s:1;
unsigned int max_range_640_480:1;
unsigned int has_dvb:1;
Expand Down

0 comments on commit 159d307

Please sign in to comment.