aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-video.c
diff options
context:
space:
mode:
authorDevin Heitmueller <devin.heitmueller@gmail.com>2008-11-12 00:05:19 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:32 -0500
commit24a613e4b08c4077b4c809bebab1d4a36d541fcc (patch)
tree3b721a1858db824896da535fa5a6f960beb2511c /drivers/media/video/em28xx/em28xx-video.c
parent95ea4705746f52e17f1f14f9136ea2106ffe3b26 (diff)
V4L/DVB (9588): Don't load em28xx audio module for digital-only devices
Rework the logic so that the em28xx-alsa module does not get loaded for devices that don't support analog audio (such as the em2874) Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index e478ccba0378..129bd06a2ea6 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -1927,6 +1927,19 @@ static struct video_device *em28xx_vdev_init(struct em28xx *dev,
1927 return vfd; 1927 return vfd;
1928} 1928}
1929 1929
1930int em28xx_supports_audio_extension(struct em28xx *dev)
1931{
1932 /* The chip dictates whether we support the Empia analog audio
1933 extension */
1934 switch (dev->chip_id) {
1935 case CHIP_ID_EM2874:
1936 /* Either a digital-only device or provides AC97 audio */
1937 return 0;
1938 case CHIP_ID_EM2883:
1939 default:
1940 return 1;
1941 }
1942}
1930 1943
1931static int register_analog_devices(struct em28xx *dev) 1944static int register_analog_devices(struct em28xx *dev)
1932{ 1945{
@@ -2121,7 +2134,7 @@ static void request_module_async(struct work_struct *work)
2121 2134
2122 if (dev->has_audio_class) 2135 if (dev->has_audio_class)
2123 request_module("snd-usb-audio"); 2136 request_module("snd-usb-audio");
2124 else 2137 else if (dev->has_alsa_audio)
2125 request_module("em28xx-alsa"); 2138 request_module("em28xx-alsa");
2126 2139
2127 if (dev->has_dvb) 2140 if (dev->has_dvb)
@@ -2230,9 +2243,6 @@ static int em28xx_usb_probe(struct usb_interface *interface,
2230 } 2243 }
2231 } 2244 }
2232 2245
2233 printk(KERN_INFO DRIVER_NAME " %s usb audio class\n",
2234 dev->has_audio_class ? "Has" : "Doesn't have");
2235
2236 /* compute alternate max packet sizes */ 2246 /* compute alternate max packet sizes */
2237 uif = udev->actconfig->interface[0]; 2247 uif = udev->actconfig->interface[0];
2238 2248
@@ -2271,6 +2281,17 @@ static int em28xx_usb_probe(struct usb_interface *interface,
2271 2281
2272 em28xx_info("Found %s\n", em28xx_boards[dev->model].name); 2282 em28xx_info("Found %s\n", em28xx_boards[dev->model].name);
2273 2283
2284 if (dev->has_audio_class == 0) {
2285 /* We don't have a USB audio class, let's see if we support
2286 ALSA Audio */
2287 dev->has_alsa_audio = em28xx_supports_audio_extension(dev);
2288 if (dev->has_alsa_audio)
2289 printk(KERN_INFO DRIVER_NAME " supports alsa audio\n");
2290 } else {
2291 printk(KERN_INFO DRIVER_NAME " has usb audio class\n");
2292 }
2293
2294
2274 /* save our data pointer in this interface device */ 2295 /* save our data pointer in this interface device */
2275 usb_set_intfdata(interface, dev); 2296 usb_set_intfdata(interface, dev);
2276 2297