diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-06 10:45:44 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-06 10:45:44 -0200 |
commit | 6474fb8a2f4a3259d13f6bd75908e3141dd15092 (patch) | |
tree | 6fa5f7f1c5f7c6eaa667f0a8602fb0a3ae2ca683 /linux/drivers/media/video | |
parent | 308a58a5767151876fc77afd0653195fdb69aebd (diff) | |
download | mediapointer-dvb-s2-6474fb8a2f4a3259d13f6bd75908e3141dd15092.tar.gz mediapointer-dvb-s2-6474fb8a2f4a3259d13f6bd75908e3141dd15092.tar.bz2 |
Avoid causing regressions for non-HVR950 boards
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Only HVR950 has analog_gpio configured. It makes no sense to set gpio to 0 for
other boards. Better to add a test, while this var is not set for all xc3028
devices.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-cards.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-cards.c b/linux/drivers/media/video/em28xx/em28xx-cards.c index 25344980a..d418abc2d 100644 --- a/linux/drivers/media/video/em28xx/em28xx-cards.c +++ b/linux/drivers/media/video/em28xx/em28xx-cards.c @@ -486,27 +486,31 @@ static int em28xx_tuner_callback(void *ptr, int command, int arg) switch (command) { case XC2028_TUNER_RESET: { - char gpio0, gpio1, gpio4; - - /* GPIO and initialization codes for analog TV */ - gpio0 = dev->analog_gpio & 0xff; - gpio1 = (dev->analog_gpio >> 8) & 0xff; - gpio4 = dev->analog_gpio >> 24; + /* GPIO and initialization codes for analog TV and radio + This code should be complemented for DTV, since reset + codes are different. + */ dev->em28xx_write_regs_req(dev, 0x00, 0x48, "\x00", 1); dev->em28xx_write_regs_req(dev, 0x00, 0x12, "\x67", 1); - if (gpio4) { - dev->em28xx_write_regs(dev, 0x04, &gpio4, 1); - msleep(140); + if (dev->analog_gpio) { + char gpio0 = dev->analog_gpio & 0xff; + char gpio1 = (dev->analog_gpio >> 8) & 0xff; + char gpio4 = dev->analog_gpio >> 24; + + if (gpio4) { + dev->em28xx_write_regs(dev, 0x04, &gpio4, 1); + msleep(140); + } + + msleep(6); + dev->em28xx_write_regs(dev, 0x08, &gpio0, 1); + msleep(10); + dev->em28xx_write_regs(dev, 0x08, &gpio1, 1); + msleep(5); } - msleep(6); - dev->em28xx_write_regs(dev, 0x08, &gpio0, 1); - msleep(10); - dev->em28xx_write_regs(dev, 0x08, &gpio1, 1); - msleep(5); - break; } } |