aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-i2c.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-10-29 23:36:12 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 19:01:36 -0200
commit6c362c8e58da972728a3666a0a00b9c2f1574e1f (patch)
tree7ccf2ea88a4b24c0bfd8324c74d06c1bc324974c /drivers/media/video/em28xx/em28xx-i2c.c
parent1808a698a87366f9d82945270355c2139df0a16d (diff)
downloadkernel_samsung_smdk4412-6c362c8e58da972728a3666a0a00b9c2f1574e1f.zip
kernel_samsung_smdk4412-6c362c8e58da972728a3666a0a00b9c2f1574e1f.tar.gz
kernel_samsung_smdk4412-6c362c8e58da972728a3666a0a00b9c2f1574e1f.tar.bz2
V4L/DVB (6476): Add support for analog tv on HVR-950
This patch adds USB ID for HVR-950. It also adds the callback for handling firmware loading. Thanks to Markus Reichberger for the reset commands. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-i2c.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-i2c.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c
index e48191f..a33878e 100644
--- a/drivers/media/video/em28xx/em28xx-i2c.c
+++ b/drivers/media/video/em28xx/em28xx-i2c.c
@@ -28,6 +28,7 @@
#include <linux/video_decoder.h>
#include "em28xx.h"
+#include "tuner-xc2028.h"
#include <media/v4l2-common.h>
#include <media/tuner.h>
@@ -391,6 +392,26 @@ static u32 functionality(struct i2c_adapter *adap)
}
+static int em28xx_tuner_callback(void *ptr, int command, int arg)
+{
+ int rc = 0;
+ struct em28xx *dev = ptr;
+
+ if (dev->tuner_type != TUNER_XC2028)
+ return 0;
+
+ switch (command) {
+ case XC2028_TUNER_RESET:
+ /* FIXME: This is device-dependent */
+ dev->em28xx_write_regs_req(dev, 0x00, 0x48, "\x00", 1);
+ dev->em28xx_write_regs_req(dev, 0x00, 0x12, "\x67", 1);
+
+ msleep(140);
+ break;
+ }
+ return rc;
+}
+
static int em28xx_set_tuner(int check_eeprom, struct i2c_client *client)
{
struct em28xx *dev = client->adapter->algo_data;
@@ -400,6 +421,8 @@ static int em28xx_set_tuner(int check_eeprom, struct i2c_client *client)
tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
tun_setup.type = dev->tuner_type;
tun_setup.addr = dev->tuner_addr;
+ tun_setup.tuner_callback = em28xx_tuner_callback;
+
em28xx_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup);
}