|
@@ -293,7 +293,7 @@ static int philips_tu1216_tuner_60_set_params(struct dvb_frontend *fe, struct dv
|
|
|
return philips_tda6651_pll_set(0x60, fe, params);
|
|
|
}
|
|
|
|
|
|
-static int philips_tu1216_request_firmware(struct dvb_frontend *fe,
|
|
|
+static int philips_tda1004x_request_firmware(struct dvb_frontend *fe,
|
|
|
const struct firmware **fw, char *name)
|
|
|
{
|
|
|
struct saa7134_dev *dev = fe->dvb->priv;
|
|
@@ -308,7 +308,7 @@ static struct tda1004x_config philips_tu1216_60_config = {
|
|
|
.xtal_freq = TDA10046_XTAL_4M,
|
|
|
.agc_config = TDA10046_AGC_DEFAULT,
|
|
|
.if_freq = TDA10046_FREQ_3617,
|
|
|
- .request_firmware = philips_tu1216_request_firmware,
|
|
|
+ .request_firmware = philips_tda1004x_request_firmware,
|
|
|
};
|
|
|
|
|
|
/* ------------------------------------------------------------------ */
|
|
@@ -331,7 +331,7 @@ static struct tda1004x_config philips_tu1216_61_config = {
|
|
|
.xtal_freq = TDA10046_XTAL_4M,
|
|
|
.agc_config = TDA10046_AGC_DEFAULT,
|
|
|
.if_freq = TDA10046_FREQ_3617,
|
|
|
- .request_firmware = philips_tu1216_request_firmware,
|
|
|
+ .request_firmware = philips_tda1004x_request_firmware,
|
|
|
};
|
|
|
|
|
|
/* ------------------------------------------------------------------ */
|
|
@@ -812,32 +812,40 @@ static int philips_tda827xa_tuner_sleep(u8 addr, struct dvb_frontend *fe)
|
|
|
if (fe->ops.i2c_gate_ctrl)
|
|
|
fe->ops.i2c_gate_ctrl(fe, 1);
|
|
|
i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
|
|
|
+ if (fe->ops.i2c_gate_ctrl)
|
|
|
+ fe->ops.i2c_gate_ctrl(fe, 0);
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
/* ------------------------------------------------------------------ */
|
|
|
|
|
|
-static int philips_tiger_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
|
|
|
+static int tda8290_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
|
|
|
{
|
|
|
- int ret;
|
|
|
struct saa7134_dev *dev = fe->dvb->priv;
|
|
|
static u8 tda8290_close[] = { 0x21, 0xc0};
|
|
|
static u8 tda8290_open[] = { 0x21, 0x80};
|
|
|
struct i2c_msg tda8290_msg = {.addr = 0x4b,.flags = 0, .len = 2};
|
|
|
-
|
|
|
- /* close tda8290 i2c bridge */
|
|
|
- tda8290_msg.buf = tda8290_close;
|
|
|
- ret = i2c_transfer(&dev->i2c_adap, &tda8290_msg, 1);
|
|
|
- if (ret != 1)
|
|
|
+ if (enable) {
|
|
|
+ tda8290_msg.buf = tda8290_close;
|
|
|
+ } else {
|
|
|
+ tda8290_msg.buf = tda8290_open;
|
|
|
+ }
|
|
|
+ if (i2c_transfer(&dev->i2c_adap, &tda8290_msg, 1) != 1)
|
|
|
return -EIO;
|
|
|
msleep(20);
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+/* ------------------------------------------------------------------ */
|
|
|
+
|
|
|
+static int philips_tiger_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
|
|
|
+{
|
|
|
+ int ret;
|
|
|
+
|
|
|
ret = philips_tda827xa_pll_set(0x61, fe, params);
|
|
|
if (ret != 0)
|
|
|
return ret;
|
|
|
- /* open tda8290 i2c bridge */
|
|
|
- tda8290_msg.buf = tda8290_open;
|
|
|
- i2c_transfer(&dev->i2c_adap, &tda8290_msg, 1);
|
|
|
- return ret;
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
static int philips_tiger_tuner_init(struct dvb_frontend *fe)
|
|
@@ -874,6 +882,18 @@ static struct tda1004x_config philips_tiger_config = {
|
|
|
|
|
|
/* ------------------------------------------------------------------ */
|
|
|
|
|
|
+static struct tda1004x_config pinnacle_pctv_310i_config = {
|
|
|
+ .demod_address = 0x08,
|
|
|
+ .invert = 1,
|
|
|
+ .invert_oclk = 0,
|
|
|
+ .xtal_freq = TDA10046_XTAL_16M,
|
|
|
+ .agc_config = TDA10046_AGC_TDA827X,
|
|
|
+ .if_freq = TDA10046_FREQ_045,
|
|
|
+ .request_firmware = philips_tda1004x_request_firmware,
|
|
|
+};
|
|
|
+
|
|
|
+/* ------------------------------------------------------------------ */
|
|
|
+
|
|
|
static int asus_p7131_dual_tuner_init(struct dvb_frontend *fe)
|
|
|
{
|
|
|
struct saa7134_dev *dev = fe->dvb->priv;
|
|
@@ -1168,6 +1188,18 @@ static int dvb_init(struct saa7134_dev *dev)
|
|
|
&philips_tiger_config,
|
|
|
&dev->i2c_adap);
|
|
|
if (dev->dvb.frontend) {
|
|
|
+ dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl;
|
|
|
+ dev->dvb.frontend->ops.tuner_ops.init = philips_tiger_tuner_init;
|
|
|
+ dev->dvb.frontend->ops.tuner_ops.sleep = philips_tiger_tuner_sleep;
|
|
|
+ dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case SAA7134_BOARD_PINNACLE_PCTV_310i:
|
|
|
+ dev->dvb.frontend = dvb_attach(tda10046_attach,
|
|
|
+ &pinnacle_pctv_310i_config,
|
|
|
+ &dev->i2c_adap);
|
|
|
+ if (dev->dvb.frontend) {
|
|
|
+ dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl;
|
|
|
dev->dvb.frontend->ops.tuner_ops.init = philips_tiger_tuner_init;
|
|
|
dev->dvb.frontend->ops.tuner_ops.sleep = philips_tiger_tuner_sleep;
|
|
|
dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params;
|