Commit b858c331 authored by Igor M. Liplianin's avatar Igor M. Liplianin Committed by Mauro Carvalho Chehab

[media] m88rs2000: make use ts2020

Tuner part of Montage rs2000 chip is similar to ts2020 tuner.
Patch to use ts2020 code.

[mchehab@redhat.com: a few CodingStyle fixes]
Signed-off-by: default avatarIgor M. Liplianin <liplianin@me.by>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 43385c8a
This diff is collapsed.
......@@ -26,8 +26,6 @@
struct m88rs2000_config {
/* Demodulator i2c address */
u8 demod_addr;
/* Tuner address */
u8 tuner_addr;
u8 *inittab;
......@@ -55,12 +53,8 @@ static inline struct dvb_frontend *m88rs2000_attach(
}
#endif /* CONFIG_DVB_M88RS2000 */
#define FE_CRYSTAL_KHZ 27000
#define FREQ_OFFSET_LOW_SYM_RATE 3000
enum {
DEMOD_WRITE = 0x1,
TUNER_WRITE,
WRITE_DELAY = 0x10,
};
#endif /* M88RS2000_H */
This diff is collapsed.
......@@ -26,6 +26,7 @@
struct ts2020_config {
u8 tuner_address;
u8 clk_out_div;
};
#if defined(CONFIG_DVB_TS2020) || \
......
......@@ -474,6 +474,7 @@ static struct ds3000_config tevii_ds3000_config = {
static struct ts2020_config tevii_ts2020_config = {
.tuner_address = 0x60,
.clk_out_div = 1,
};
static struct cx24116_config dvbworld_cx24116_config = {
......
......@@ -703,6 +703,7 @@ static struct ds3000_config tevii_ds3000_config = {
static struct ts2020_config tevii_ts2020_config = {
.tuner_address = 0x60,
.clk_out_div = 1,
};
static const struct stv0900_config prof_7301_stv0900_config = {
......
......@@ -852,6 +852,7 @@ static struct ds3000_config dvbworld_ds3000_config = {
static struct ts2020_config dvbworld_ts2020_config = {
.tuner_address = 0x60,
.clk_out_div = 1,
};
static int __devinit frontend_init(struct dm1105_dev *dev)
......
......@@ -120,6 +120,7 @@ config DVB_USB_LME2510
select DVB_STV0299 if MEDIA_SUBDRV_AUTOSELECT
select DVB_PLL if MEDIA_SUBDRV_AUTOSELECT
select DVB_M88RS2000 if MEDIA_SUBDRV_AUTOSELECT
select DVB_TS2020 if MEDIA_SUBDRV_AUTOSELECT
help
Say Y here to support the LME DM04/QQBOX DVB-S USB2.0
......
......@@ -81,6 +81,7 @@
#include "dvb-pll.h"
#include "z0194a.h"
#include "m88rs2000.h"
#include "ts2020.h"
#define LME2510_C_S7395 "dvb-usb-lme2510c-s7395.fw";
......@@ -944,10 +945,14 @@ static int dm04_rs2000_set_ts_param(struct dvb_frontend *fe,
static struct m88rs2000_config m88rs2000_config = {
.demod_addr = 0xd0,
.tuner_addr = 0xc0,
.set_ts_params = dm04_rs2000_set_ts_param,
};
static struct ts2020_config ts2020_config = {
.tuner_address = 0x60,
.clk_out_div = 7,
};
static int dm04_lme2510_set_voltage(struct dvb_frontend *fe,
fe_sec_voltage_t voltage)
{
......@@ -1097,6 +1102,8 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap)
if (adap->fe[0]) {
info("FE Found M88RS2000");
dvb_attach(ts2020_attach, adap->fe[0], &ts2020_config,
&d->i2c_adap);
st->i2c_tuner_gate_w = 5;
st->i2c_tuner_gate_r = 5;
st->i2c_tuner_addr = 0xc0;
......
......@@ -29,6 +29,7 @@
#include "stb6100.h"
#include "stb6100_proc.h"
#include "m88rs2000.h"
#include "ts2020.h"
#ifndef USB_PID_DW2102
#define USB_PID_DW2102 0x2102
......@@ -953,10 +954,12 @@ static struct ds3000_config dw2104_ds3000_config = {
static struct ts2020_config dw2104_ts2020_config = {
.tuner_address = 0x60,
.clk_out_div = 1,
};
static struct ds3000_config s660_ds3000_config = {
.demod_address = 0x68,
.ci_mode = 1,
.set_lock_led = dw210x_led_ctrl,
};
......@@ -1009,10 +1012,7 @@ static struct stv0900_config prof_7500_stv0900_config = {
static struct ds3000_config su3000_ds3000_config = {
.demod_address = 0x68,
.ci_mode = 1,
};
static struct ts2020_config su3000_ts2020_config = {
.tuner_address = 0x60,
.set_lock_led = dw210x_led_ctrl,
};
static u8 m88rs2000_inittab[] = {
......@@ -1022,14 +1022,6 @@ static u8 m88rs2000_inittab[] = {
DEMOD_WRITE, 0x00, 0x00,
DEMOD_WRITE, 0x9a, 0xb0,
DEMOD_WRITE, 0x81, 0xc1,
TUNER_WRITE, 0x42, 0x73,
TUNER_WRITE, 0x05, 0x07,
TUNER_WRITE, 0x20, 0x27,
TUNER_WRITE, 0x07, 0x02,
TUNER_WRITE, 0x11, 0xff,
TUNER_WRITE, 0x60, 0xf9,
TUNER_WRITE, 0x08, 0x01,
TUNER_WRITE, 0x00, 0x41,
DEMOD_WRITE, 0x81, 0x81,
DEMOD_WRITE, 0x86, 0xc6,
DEMOD_WRITE, 0x9a, 0x30,
......@@ -1043,7 +1035,6 @@ static u8 m88rs2000_inittab[] = {
static struct m88rs2000_config s421_m88rs2000_config = {
.demod_addr = 0x68,
.tuner_addr = 0x60,
.inittab = m88rs2000_inittab,
};
......@@ -1250,6 +1241,14 @@ static int su3000_frontend_attach(struct dvb_usb_adapter *d)
if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
err("command 0x0e transfer failed.");
obuf[0] = 0xe;
obuf[1] = 0x02;
obuf[2] = 1;
if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
err("command 0x0e transfer failed.");
msleep(300);
obuf[0] = 0xe;
obuf[1] = 0x83;
obuf[2] = 0;
......@@ -1274,12 +1273,15 @@ static int su3000_frontend_attach(struct dvb_usb_adapter *d)
if (d->fe_adap[0].fe == NULL)
return -EIO;
dvb_attach(ts2020_attach, d->fe_adap[0].fe, &su3000_ts2020_config,
&d->dev->i2c_adap);
info("Attached DS3000!\n");
if (dvb_attach(ts2020_attach, d->fe_adap[0].fe,
&dw2104_ts2020_config,
&d->dev->i2c_adap)) {
info("Attached DS3000/TS2020!\n");
return 0;
}
info("Failed to attach DS3000/TS2020!\n");
return -EIO;
}
static int m88rs2000_frontend_attach(struct dvb_usb_adapter *d)
......@@ -1292,12 +1294,19 @@ static int m88rs2000_frontend_attach(struct dvb_usb_adapter *d)
d->fe_adap[0].fe = dvb_attach(m88rs2000_attach, &s421_m88rs2000_config,
&d->dev->i2c_adap);
if (d->fe_adap[0].fe == NULL)
return -EIO;
info("Attached m88rs2000!\n");
if (dvb_attach(ts2020_attach, d->fe_adap[0].fe,
&dw2104_ts2020_config,
&d->dev->i2c_adap)) {
info("Attached RS2000/TS2020!\n");
return 0;
}
info("Failed to attach RS2000/TS2020!\n");
return -EIO;
}
static int dw2102_tuner_attach(struct dvb_usb_adapter *adap)
......
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