summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/em28xx
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-10-30 01:08:11 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-30 01:08:11 -0200
commit47c9bdaf6e07f0a4b5ccaec663d41aec4bf62e63 (patch)
tree40c30a3a55122a33867122d2e2937ceb20af95ff /linux/drivers/media/video/em28xx
parentee189d9d96dcebde4ec27edbda3f1582949ca8a4 (diff)
parentdb7fcfc5c5821ff5568dd32c567e0c42488c503f (diff)
downloadmediapointer-dvb-s2-47c9bdaf6e07f0a4b5ccaec663d41aec4bf62e63.tar.gz
mediapointer-dvb-s2-47c9bdaf6e07f0a4b5ccaec663d41aec4bf62e63.tar.bz2
merge: http://linuxtv.org/hg/~dougsland/v4l-dvb
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/em28xx')
-rw-r--r--linux/drivers/media/video/em28xx/Kconfig2
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-cards.c28
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-i2c.c23
3 files changed, 45 insertions, 8 deletions
diff --git a/linux/drivers/media/video/em28xx/Kconfig b/linux/drivers/media/video/em28xx/Kconfig
index 5b6a40371..c1127802a 100644
--- a/linux/drivers/media/video/em28xx/Kconfig
+++ b/linux/drivers/media/video/em28xx/Kconfig
@@ -1,6 +1,6 @@
config VIDEO_EM28XX
tristate "Empia EM2800/2820/2840 USB video capture support"
- depends on VIDEO_V4L1 && I2C
+ depends on VIDEO_V4L1 && I2C && INPUT
select VIDEO_TUNER
select VIDEO_TVEEPROM
select VIDEO_IR
diff --git a/linux/drivers/media/video/em28xx/em28xx-cards.c b/linux/drivers/media/video/em28xx/em28xx-cards.c
index 9809463b6..b9a11dee2 100644
--- a/linux/drivers/media/video/em28xx/em28xx-cards.c
+++ b/linux/drivers/media/video/em28xx/em28xx-cards.c
@@ -36,6 +36,7 @@
#include <media/v4l2-common.h>
#include "em28xx.h"
+#include "tuner-xc2028.h"
struct em28xx_board em28xx_boards[] = {
[EM2800_BOARD_UNKNOWN] = {
@@ -157,13 +158,12 @@ struct em28xx_board em28xx_boards[] = {
MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
}},
},
-#ifdef CONFIG_XC3028
[EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
.name = "Hauppauge WinTV HVR 900",
.vchannels = 3,
.norm = VIDEO_MODE_PAL,
.tda9887_conf = TDA9887_PRESENT,
- .tuner_type = TUNER_XCEIVE_XC3028,
+ .tuner_type = TUNER_XC2028,
.has_tuner = 1,
.decoder = EM28XX_TVP5150,
.input = {{
@@ -186,7 +186,7 @@ struct em28xx_board em28xx_boards[] = {
.norm = VIDEO_MODE_PAL,
.tda9887_conf = TDA9887_PRESENT,
.has_tuner = 1,
- .tuner_type = TUNER_XCEIVE_XC3028,
+ .tuner_type = TUNER_XC2028,
.decoder = EM28XX_TVP5150,
.input = {{
.type = EM28XX_VMUX_TELEVISION,
@@ -210,7 +210,7 @@ struct em28xx_board em28xx_boards[] = {
.norm = VIDEO_MODE_PAL,
.tda9887_conf = TDA9887_PRESENT,
.has_tuner = 1,
- .tuner_type = TUNER_XCEIVE_XC3028,
+ .tuner_type = TUNER_XC2028,
.decoder = EM28XX_TVP5150,
.input = {{
.type = EM28XX_VMUX_TELEVISION,
@@ -226,7 +226,6 @@ struct em28xx_board em28xx_boards[] = {
.amux = 1,
}},
},
-#endif
[EM2820_BOARD_MSI_VOX_USB_2] = {
.name = "MSI VOX USB 2.0",
.vchannels = 3,
@@ -345,11 +344,10 @@ struct usb_device_id em28xx_id_table [] = {
{ USB_DEVICE(0x2304, 0x0208), .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
{ USB_DEVICE(0x2040, 0x4200), .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
{ USB_DEVICE(0x2304, 0x0207), .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
-#ifdef CONFIG_XC3028
{ USB_DEVICE(0x2040, 0x6500), .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
+ { USB_DEVICE(0x2040, 0x6513), .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
{ USB_DEVICE(0x0ccd, 0x0042), .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS },
{ USB_DEVICE(0x0ccd, 0x0047), .driver_info = EM2880_BOARD_TERRATEC_PRODIGY_XS },
-#endif
{ },
};
@@ -367,6 +365,21 @@ void em28xx_pre_card_setup(struct em28xx *dev)
}
}
+static void em28xx_config_tuner (struct em28xx *dev)
+{
+ struct v4l2_priv_tun_config xc2028_cfg;
+ struct xc2028_ctrl ctl;
+
+ memset (&ctl,0,sizeof(ctl));
+
+ ctl.fname = XC2028_DEFAULT_FIRMWARE;
+
+ xc2028_cfg.tuner = TUNER_XC2028;
+ xc2028_cfg.priv = &ctl;
+
+ em28xx_i2c_call_clients(dev, TUNER_SET_CONFIG, &xc2028_cfg);
+}
+
void em28xx_card_setup(struct em28xx *dev)
{
/* request some modules */
@@ -399,6 +412,7 @@ void em28xx_card_setup(struct em28xx *dev)
}
}
+ em28xx_config_tuner (dev);
}
MODULE_DEVICE_TABLE (usb, em28xx_id_table);
diff --git a/linux/drivers/media/video/em28xx/em28xx-i2c.c b/linux/drivers/media/video/em28xx/em28xx-i2c.c
index 5d102ec8c..209370e2b 100644
--- a/linux/drivers/media/video/em28xx/em28xx-i2c.c
+++ b/linux/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>
@@ -402,6 +403,26 @@ static void dec_use(struct i2c_adapter *adap)
}
#endif
+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;
@@ -411,6 +432,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);
}