diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-03 05:27:59 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-12-29 08:16:28 -0200 |
commit | 68541cdaadecbc280cd50122f11fdbb249a2ae29 (patch) | |
tree | c82b6c50215e59559ed8d0daf454b8f68e46b7d1 /drivers | |
parent | 7572f9c5575c721f43b575a71fda1ecd896e0327 (diff) |
[media] Add support for Kworld SBTVD board
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/frontends/mb86a20s.c | 23 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-cards.c | 109 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134.h | 1 |
3 files changed, 133 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/mb86a20s.c b/drivers/media/dvb/frontends/mb86a20s.c index b4de8f12df27..d3ad3e75a35a 100644 --- a/drivers/media/dvb/frontends/mb86a20s.c +++ b/drivers/media/dvb/frontends/mb86a20s.c @@ -376,6 +376,9 @@ static int mb86a20s_initfe(struct dvb_frontend *fe) dprintk("\n"); + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 0); + /* Initialize the frontend */ rc = mb86a20s_writeregdata(state, mb86a20s_init); if (rc < 0) @@ -392,6 +395,9 @@ static int mb86a20s_initfe(struct dvb_frontend *fe) return rc; } + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 1); + return 0; } @@ -403,6 +409,9 @@ static int mb86a20s_read_signal_strength(struct dvb_frontend *fe, u16 *strength) dprintk("\n"); + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 0); + /* Does a binary search to get RF strength */ rf_max = 0xfff; rf_min = 0; @@ -426,6 +435,9 @@ static int mb86a20s_read_signal_strength(struct dvb_frontend *fe, u16 *strength) dprintk("signal strength = %d\n", *strength); + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 1); + return 0; } @@ -437,7 +449,11 @@ static int mb86a20s_read_status(struct dvb_frontend *fe, fe_status_t *status) dprintk("\n"); *status = 0; + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 0); val = mb86a20s_readreg(state, 0x0a) & 0xf; + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 1); if (val >= 2) *status |= FE_HAS_SIGNAL; @@ -467,8 +483,15 @@ static int mb86a20s_set_frontend(struct dvb_frontend *fe, dprintk("\n"); + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 1); fe->ops.tuner_ops.set_params(fe, p); + + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 0); rc = mb86a20s_writeregdata(state, mb86a20s_reset_reception); + if (fe->ops.i2c_gate_ctrl) + fe->ops.i2c_gate_ctrl(fe, 1); return rc; } diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index 1d4d0a49ea52..58c8c03fd8f7 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c @@ -5176,6 +5176,47 @@ struct saa7134_board saa7134_boards[] = { .amux = 2, }, }, + [SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG] = { + .name = "Kworld PCI SBTVD/ISDB-T Full-Seg Hybrid", + .audio_clock = 0x00187de7, + .tuner_type = TUNER_NXP_TDA18271, /* TUNER_PHILIPS_TDA8290 */ + .radio_type = UNSET, + .tuner_addr = 0x60, + .radio_addr = ADDR_UNSET, + .gpiomask = 0x8e054000, + .mpeg = SAA7134_MPEG_DVB, + .inputs = { { + .name = name_tv, + .vmux = 1, + .amux = TV, + .tv = 1, +#if 0 /* FIXME */ + }, { + .name = name_comp1, + .vmux = 3, + .amux = LINE1, + .gpio = 0x200, + }, { + .name = name_svideo, + .vmux = 8, + .amux = LINE1, + .gpio = 0x200, +#endif + } }, +#if 0 + .radio = { + .name = name_radio, + .vmux = 1, + .amux = LINE1, + .gpio = 0x100, + }, +#endif + .mute = { + .name = name_mute, + .vmux = 0, + .amux = TV, + }, + }, [SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS] = { .name = "Avermedia AVerTV GO 007 FM Plus", .audio_clock = 0x00187de7, @@ -6615,6 +6656,12 @@ struct pci_device_id saa7134_pci_tbl[] = { }, { .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7133, + .subvendor = 0x17de, + .subdevice = 0xb136, + .driver_data = SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG, + }, { + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, .subvendor = 0x1461, /* Avermedia Technologies Inc */ .subdevice = 0xf31d, .driver_data = SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS, @@ -6831,6 +6878,23 @@ static inline int saa7134_tda18271_hvr11x0_toggle_agc(struct saa7134_dev *dev, return 0; } +static inline int saa7134_kworld_sbtvd_toggle_agc(struct saa7134_dev *dev, + enum tda18271_mode mode) +{ + /* toggle AGC switch through GPIO 27 */ + switch (mode) { + case TDA18271_ANALOG: + saa7134_set_gpio(dev, 27, 0); + break; + case TDA18271_DIGITAL: + saa7134_set_gpio(dev, 27, 1); + break; + default: + return -EINVAL; + } + return 0; +} + static int saa7134_tda8290_18271_callback(struct saa7134_dev *dev, int command, int arg) { @@ -6843,6 +6907,9 @@ static int saa7134_tda8290_18271_callback(struct saa7134_dev *dev, case SAA7134_BOARD_HAUPPAUGE_HVR1120: ret = saa7134_tda18271_hvr11x0_toggle_agc(dev, arg); break; + case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG: + ret = saa7134_kworld_sbtvd_toggle_agc(dev, arg); + break; default: break; } @@ -6863,6 +6930,7 @@ static int saa7134_tda8290_callback(struct saa7134_dev *dev, case SAA7134_BOARD_HAUPPAUGE_HVR1150: case SAA7134_BOARD_HAUPPAUGE_HVR1120: case SAA7134_BOARD_AVERMEDIA_M733A: + case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG: /* tda8290 + tda18271 */ ret = saa7134_tda8290_18271_callback(dev, command, arg); break; @@ -7541,6 +7609,47 @@ int saa7134_board_init2(struct saa7134_dev *dev) dev->name); break; } + case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG: + { + struct i2c_msg msg = { .addr = 0x4b, .flags = 0 }; + int i; + static u8 buffer[][2] = { + {0x30, 0x31}, + {0xff, 0x00}, + {0x41, 0x03}, + {0x41, 0x1a}, + {0xff, 0x02}, + {0x34, 0x00}, + {0x45, 0x97}, + {0x45, 0xc1}, + }; + + saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x0000); + saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0000); + saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x0000); + saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x4000); + saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0000); + saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x4000); + saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x4000); + saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x4000); + saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0000); + saa_writel(SAA7134_GPIO_GPMODE0 >> 2, 0x4000); + saa_writel(SAA7134_GPIO_GPSTATUS0 >> 2, 0x4000); + + /* + * FIXME: identify what device is at addr 0x4b and what means + * this initialization + */ + for (i = 0; i < ARRAY_SIZE(buffer); i++) { + msg.buf = &buffer[i][0]; + msg.len = ARRAY_SIZE(buffer[0]); + if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) + printk(KERN_WARNING + "%s: Unable to enable tuner(%i).\n", + dev->name, i); + } + break; + } } /* switch() */ /* initialize tuner */ diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h index d3b6a196e5dc..4e37b8bfb6fa 100644 --- a/drivers/media/video/saa7134/saa7134.h +++ b/drivers/media/video/saa7134/saa7134.h @@ -305,6 +305,7 @@ struct saa7134_format { #define SAA7134_BOARD_BEHOLD_A7 179 #define SAA7134_BOARD_AVERMEDIA_M733A 180 #define SAA7134_BOARD_TECHNOTREND_BUDGET_T3000 181 +#define SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG 182 #define SAA7134_MAXBOARDS 32 #define SAA7134_INPUT_MAX 8 |