Commit 68541cda authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] Add support for Kworld SBTVD board

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 7572f9c5
...@@ -376,6 +376,9 @@ static int mb86a20s_initfe(struct dvb_frontend *fe) ...@@ -376,6 +376,9 @@ static int mb86a20s_initfe(struct dvb_frontend *fe)
dprintk("\n"); dprintk("\n");
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
/* Initialize the frontend */ /* Initialize the frontend */
rc = mb86a20s_writeregdata(state, mb86a20s_init); rc = mb86a20s_writeregdata(state, mb86a20s_init);
if (rc < 0) if (rc < 0)
...@@ -392,6 +395,9 @@ static int mb86a20s_initfe(struct dvb_frontend *fe) ...@@ -392,6 +395,9 @@ static int mb86a20s_initfe(struct dvb_frontend *fe)
return rc; return rc;
} }
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
return 0; return 0;
} }
...@@ -403,6 +409,9 @@ static int mb86a20s_read_signal_strength(struct dvb_frontend *fe, u16 *strength) ...@@ -403,6 +409,9 @@ static int mb86a20s_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
dprintk("\n"); dprintk("\n");
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
/* Does a binary search to get RF strength */ /* Does a binary search to get RF strength */
rf_max = 0xfff; rf_max = 0xfff;
rf_min = 0; rf_min = 0;
...@@ -426,6 +435,9 @@ static int mb86a20s_read_signal_strength(struct dvb_frontend *fe, u16 *strength) ...@@ -426,6 +435,9 @@ static int mb86a20s_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
dprintk("signal strength = %d\n", *strength); dprintk("signal strength = %d\n", *strength);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
return 0; return 0;
} }
...@@ -437,7 +449,11 @@ static int mb86a20s_read_status(struct dvb_frontend *fe, fe_status_t *status) ...@@ -437,7 +449,11 @@ static int mb86a20s_read_status(struct dvb_frontend *fe, fe_status_t *status)
dprintk("\n"); dprintk("\n");
*status = 0; *status = 0;
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
val = mb86a20s_readreg(state, 0x0a) & 0xf; val = mb86a20s_readreg(state, 0x0a) & 0xf;
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
if (val >= 2) if (val >= 2)
*status |= FE_HAS_SIGNAL; *status |= FE_HAS_SIGNAL;
...@@ -467,8 +483,15 @@ static int mb86a20s_set_frontend(struct dvb_frontend *fe, ...@@ -467,8 +483,15 @@ static int mb86a20s_set_frontend(struct dvb_frontend *fe,
dprintk("\n"); dprintk("\n");
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
fe->ops.tuner_ops.set_params(fe, p); 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); rc = mb86a20s_writeregdata(state, mb86a20s_reset_reception);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
return rc; return rc;
} }
......
...@@ -5176,6 +5176,47 @@ struct saa7134_board saa7134_boards[] = { ...@@ -5176,6 +5176,47 @@ struct saa7134_board saa7134_boards[] = {
.amux = 2, .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] = { [SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS] = {
.name = "Avermedia AVerTV GO 007 FM Plus", .name = "Avermedia AVerTV GO 007 FM Plus",
.audio_clock = 0x00187de7, .audio_clock = 0x00187de7,
...@@ -6612,6 +6653,12 @@ struct pci_device_id saa7134_pci_tbl[] = { ...@@ -6612,6 +6653,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
.subvendor = 0x17de, .subvendor = 0x17de,
.subdevice = 0x7128, .subdevice = 0x7128,
.driver_data = SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG, .driver_data = SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG,
}, {
.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, .vendor = PCI_VENDOR_ID_PHILIPS,
.device = PCI_DEVICE_ID_PHILIPS_SAA7133, .device = PCI_DEVICE_ID_PHILIPS_SAA7133,
...@@ -6831,6 +6878,23 @@ static inline int saa7134_tda18271_hvr11x0_toggle_agc(struct saa7134_dev *dev, ...@@ -6831,6 +6878,23 @@ static inline int saa7134_tda18271_hvr11x0_toggle_agc(struct saa7134_dev *dev,
return 0; 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, static int saa7134_tda8290_18271_callback(struct saa7134_dev *dev,
int command, int arg) int command, int arg)
{ {
...@@ -6843,6 +6907,9 @@ static int saa7134_tda8290_18271_callback(struct saa7134_dev *dev, ...@@ -6843,6 +6907,9 @@ static int saa7134_tda8290_18271_callback(struct saa7134_dev *dev,
case SAA7134_BOARD_HAUPPAUGE_HVR1120: case SAA7134_BOARD_HAUPPAUGE_HVR1120:
ret = saa7134_tda18271_hvr11x0_toggle_agc(dev, arg); ret = saa7134_tda18271_hvr11x0_toggle_agc(dev, arg);
break; break;
case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG:
ret = saa7134_kworld_sbtvd_toggle_agc(dev, arg);
break;
default: default:
break; break;
} }
...@@ -6863,6 +6930,7 @@ static int saa7134_tda8290_callback(struct saa7134_dev *dev, ...@@ -6863,6 +6930,7 @@ static int saa7134_tda8290_callback(struct saa7134_dev *dev,
case SAA7134_BOARD_HAUPPAUGE_HVR1150: case SAA7134_BOARD_HAUPPAUGE_HVR1150:
case SAA7134_BOARD_HAUPPAUGE_HVR1120: case SAA7134_BOARD_HAUPPAUGE_HVR1120:
case SAA7134_BOARD_AVERMEDIA_M733A: case SAA7134_BOARD_AVERMEDIA_M733A:
case SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG:
/* tda8290 + tda18271 */ /* tda8290 + tda18271 */
ret = saa7134_tda8290_18271_callback(dev, command, arg); ret = saa7134_tda8290_18271_callback(dev, command, arg);
break; break;
...@@ -7541,6 +7609,47 @@ int saa7134_board_init2(struct saa7134_dev *dev) ...@@ -7541,6 +7609,47 @@ int saa7134_board_init2(struct saa7134_dev *dev)
dev->name); dev->name);
break; 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() */ } /* switch() */
/* initialize tuner */ /* initialize tuner */
......
...@@ -305,6 +305,7 @@ struct saa7134_format { ...@@ -305,6 +305,7 @@ struct saa7134_format {
#define SAA7134_BOARD_BEHOLD_A7 179 #define SAA7134_BOARD_BEHOLD_A7 179
#define SAA7134_BOARD_AVERMEDIA_M733A 180 #define SAA7134_BOARD_AVERMEDIA_M733A 180
#define SAA7134_BOARD_TECHNOTREND_BUDGET_T3000 181 #define SAA7134_BOARD_TECHNOTREND_BUDGET_T3000 181
#define SAA7134_BOARD_KWORLD_PCI_SBTVD_FULLSEG 182
#define SAA7134_MAXBOARDS 32 #define SAA7134_MAXBOARDS 32
#define SAA7134_INPUT_MAX 8 #define SAA7134_INPUT_MAX 8
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment