diff options
author | Devin Heitmueller <dheitmueller@kernellabs.com> | 2009-06-09 22:40:39 -0400 |
---|---|---|
committer | Devin Heitmueller <dheitmueller@kernellabs.com> | 2009-06-09 22:40:39 -0400 |
commit | 6e323483b126ac7589cadb5bad2f666cf4b7eb9d (patch) | |
tree | ff67ea7f031f10f36634719a216369487483cf9b /linux/drivers/media/video/em28xx | |
parent | 7ef1e386396d4ebc645310511099bf2526e519c4 (diff) | |
download | mediapointer-dvb-s2-6e323483b126ac7589cadb5bad2f666cf4b7eb9d.tar.gz mediapointer-dvb-s2-6e323483b126ac7589cadb5bad2f666cf4b7eb9d.tar.bz2 |
em28xx: don't create audio device if not supported
From: Devin Heitmueller <dheitmueller@kernellabs.com>
In cases where the device does not actually provide a USB audio class *or*
vendor audio, do not load the driver that provides vendor audio support (such
as the KWorld 2800d). Otherwise, the /dev/audio1 device file gets created and
users get confused.
Also, reworks the logic a bit so that we don't try to inspect the register
content if the register read failed entirely.
Priority: normal
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Diffstat (limited to 'linux/drivers/media/video/em28xx')
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-core.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-core.c b/linux/drivers/media/video/em28xx/em28xx-core.c index 02e51af9d..2bce72e4f 100644 --- a/linux/drivers/media/video/em28xx/em28xx-core.c +++ b/linux/drivers/media/video/em28xx/em28xx-core.c @@ -500,18 +500,21 @@ int em28xx_audio_setup(struct em28xx *dev) /* See how this device is configured */ cfg = em28xx_read_reg(dev, EM28XX_R00_CHIPCFG); - if (cfg < 0) + em28xx_info("Config register raw data: 0x%02x\n", cfg); + if (cfg < 0) { + /* Register read error? */ cfg = EM28XX_CHIPCFG_AC97; /* Be conservative */ - else - em28xx_info("Config register raw data: 0x%02x\n", cfg); - - if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) == - EM28XX_CHIPCFG_I2S_3_SAMPRATES) { + } else if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) == 0x00) { + /* The device doesn't have vendor audio at all */ + dev->has_alsa_audio = 0; + dev->audio_mode.has_audio = 0; + return 0; + } else if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) == + EM28XX_CHIPCFG_I2S_3_SAMPRATES) { em28xx_info("I2S Audio (3 sample rates)\n"); dev->audio_mode.i2s_3rates = 1; - } - if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) == - EM28XX_CHIPCFG_I2S_5_SAMPRATES) { + } else if ((cfg & EM28XX_CHIPCFG_AUDIOMASK) == + EM28XX_CHIPCFG_I2S_5_SAMPRATES) { em28xx_info("I2S Audio (5 sample rates)\n"); dev->audio_mode.i2s_5rates = 1; } |