diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-11-25 13:05:06 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 22:53:41 +0300 |
commit | a2070c665459ac37a36bebae5e97bb4a2568990e (patch) | |
tree | 1ceaae36fa9a2c937acf835c8f50ebf3dd402de8 /drivers/media/video/em28xx/em28xx-core.c | |
parent | 6d676d8af852e483044837240ad9ca669a01aaf2 (diff) | |
download | linux-a2070c665459ac37a36bebae5e97bb4a2568990e.tar.xz |
V4L/DVB (9747): em28xx: Properly handles XCLK and I2C speed
The previous patches removed XCLK and I2C magic. Now, we finally know
what those registers do. Also, only a very few cards need different
setups for those.
Instead of keeping the setups for those values inside the per-device
hack magic switch, move the uncommon values to the board-specific
struct, and have a common setup for all other boards.
So, almost 100 lines of hacking magic were removed.
A co-lateral effect of this patch is that it also fixes a bug at em28xx-core, where xclk
were set, without taking any care about not overriding a previous xclk setup.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-core.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-core.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c index 413428aeccd7..53c7252416f0 100644 --- a/drivers/media/video/em28xx/em28xx-core.c +++ b/drivers/media/video/em28xx/em28xx-core.c @@ -399,7 +399,7 @@ struct em28xx_vol_table outputs[] = { int em28xx_audio_analog_set(struct em28xx *dev) { int ret, i; - u8 xclk = 0x07; + u8 xclk; if (!dev->audio_mode.has_audio) return 0; @@ -417,13 +417,11 @@ int em28xx_audio_analog_set(struct em28xx *dev) } } - if (dev->has_12mhz_i2s) - xclk |= 0x20; - + xclk = dev->xclk & 0x7f; if (!dev->mute) xclk |= 0x80; - ret = em28xx_write_reg_bits(dev, EM28XX_R0F_XCLK, xclk, 0xa7); + ret = em28xx_write_reg(dev, EM28XX_R0F_XCLK, xclk); if (ret < 0) return ret; msleep(10); |