Commit 01373a5c authored by Patrick Boettcher's avatar Patrick Boettcher Committed by Mauro Carvalho Chehab

V4L/DVB (5955): Add support for DiB7070-based devices

This changeset adds support for DiB7070P-based devices by adding the
dib0070-driver and putting the appropriate layouts into
dib0700_devices.c

It also includes a new firmware for the dib0700 which is necessary to
make the DiB7070-boards work and it also should fix the i2c-problems
on some boards.
Signed-off-by: default avatarJean-Philippe Sibers <jpsibers@dibcom.fr>
Signed-off-by: default avatarPatrick Boettcher <pboettcher@dibcom.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent b6884a17
...@@ -75,6 +75,7 @@ config DVB_USB_DIB0700 ...@@ -75,6 +75,7 @@ config DVB_USB_DIB0700
select DVB_DIB3000MC select DVB_DIB3000MC
select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE select DVB_TUNER_MT2060 if !DVB_FE_CUSTOMISE
select DVB_TUNER_MT2266 if !DVB_FE_CUSTOMISE select DVB_TUNER_MT2266 if !DVB_FE_CUSTOMISE
select DVB_TUNER_DIB0070
help help
Support for USB2.0/1.1 DVB receivers based on the DiB0700 USB bridge. The Support for USB2.0/1.1 DVB receivers based on the DiB0700 USB bridge. The
USB bridge is also present in devices having the DiB7700 DVB-T-USB USB bridge is also present in devices having the DiB7700 DVB-T-USB
......
This diff is collapsed.
...@@ -68,6 +68,8 @@ ...@@ -68,6 +68,8 @@
#define USB_PID_DIBCOM_STK7700P 0x1e14 #define USB_PID_DIBCOM_STK7700P 0x1e14
#define USB_PID_DIBCOM_STK7700P_PC 0x1e78 #define USB_PID_DIBCOM_STK7700P_PC 0x1e78
#define USB_PID_DIBCOM_STK7700D 0x1ef0 #define USB_PID_DIBCOM_STK7700D 0x1ef0
#define USB_PID_DIBCOM_STK7070P 0x1ebc
#define USB_PID_DIBCOM_STK7070PD 0x1ebe
#define USB_PID_DIBCOM_ANCHOR_2135_COLD 0x2131 #define USB_PID_DIBCOM_ANCHOR_2135_COLD 0x2131
#define USB_PID_DPOSH_M9206_COLD 0x9206 #define USB_PID_DPOSH_M9206_COLD 0x9206
#define USB_PID_DPOSH_M9206_WARM 0xa090 #define USB_PID_DPOSH_M9206_WARM 0xa090
...@@ -122,6 +124,11 @@ ...@@ -122,6 +124,11 @@
#define USB_PID_AVERMEDIA_VOLAR_2 0xb808 #define USB_PID_AVERMEDIA_VOLAR_2 0xb808
#define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY 0x005a #define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY 0x005a
#define USB_PID_PINNACLE_PCTV2000E 0x022c #define USB_PID_PINNACLE_PCTV2000E 0x022c
#define USB_PID_PINNACLE_PCTV_DVB_T_FLASH 0x0228
#define USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T 0x0229
#define USB_PID_PCTV_200E 0x020e
#define USB_PID_PCTV_400E 0x020f
#define USB_PID_PCTV_450E 0x0222
#define USB_PID_NEBULA_DIGITV 0x0201 #define USB_PID_NEBULA_DIGITV 0x0201
#define USB_PID_DVICO_BLUEBIRD_LGDT 0xd820 #define USB_PID_DVICO_BLUEBIRD_LGDT 0xd820
#define USB_PID_DVICO_BLUEBIRD_LG064F_COLD 0xd500 #define USB_PID_DVICO_BLUEBIRD_LG064F_COLD 0xd500
...@@ -141,9 +148,6 @@ ...@@ -141,9 +148,6 @@
#define USB_PID_MSI_MEGASKY580_55801 0x5581 #define USB_PID_MSI_MEGASKY580_55801 0x5581
#define USB_PID_KYE_DVB_T_COLD 0x701e #define USB_PID_KYE_DVB_T_COLD 0x701e
#define USB_PID_KYE_DVB_T_WARM 0x701f #define USB_PID_KYE_DVB_T_WARM 0x701f
#define USB_PID_PCTV_200E 0x020e
#define USB_PID_PCTV_400E 0x020f
#define USB_PID_PCTV_450E 0x0222
#define USB_PID_LITEON_DVB_T_COLD 0xf000 #define USB_PID_LITEON_DVB_T_COLD 0xf000
#define USB_PID_LITEON_DVB_T_WARM 0xf001 #define USB_PID_LITEON_DVB_T_WARM 0xf001
#define USB_PID_DIGIVOX_MINI_SL_COLD 0xe360 #define USB_PID_DIGIVOX_MINI_SL_COLD 0xe360
......
...@@ -344,6 +344,15 @@ config DVB_TUNER_MT2131 ...@@ -344,6 +344,15 @@ config DVB_TUNER_MT2131
help help
A driver for the silicon baseband tuner MT2131 from Microtune. A driver for the silicon baseband tuner MT2131 from Microtune.
config DVB_TUNER_DIB0070
tristate "DiBcom DiB0070 silicon base-band tuner"
depends on I2C
default m if DVB_FE_CUSTOMISE
help
A driver for the silicon baseband tuner DiB0070 from DiBcom.
This device is only used inside a SiP called togther with a
demodulator for now.
comment "Miscellaneous devices" comment "Miscellaneous devices"
depends on DVB_CORE depends on DVB_CORE
......
...@@ -41,6 +41,7 @@ obj-$(CONFIG_DVB_TDA826X) += tda826x.o ...@@ -41,6 +41,7 @@ obj-$(CONFIG_DVB_TDA826X) += tda826x.o
obj-$(CONFIG_DVB_TDA827X) += tda827x.o obj-$(CONFIG_DVB_TDA827X) += tda827x.o
obj-$(CONFIG_DVB_TUNER_MT2060) += mt2060.o obj-$(CONFIG_DVB_TUNER_MT2060) += mt2060.o
obj-$(CONFIG_DVB_TUNER_MT2266) += mt2266.o obj-$(CONFIG_DVB_TUNER_MT2266) += mt2266.o
obj-$(CONFIG_DVB_TUNER_DIB0070) += dib0070.o
obj-$(CONFIG_DVB_TUNER_QT1010) += qt1010.o obj-$(CONFIG_DVB_TUNER_QT1010) += qt1010.o
obj-$(CONFIG_DVB_TUA6100) += tua6100.o obj-$(CONFIG_DVB_TUA6100) += tua6100.o
obj-$(CONFIG_DVB_TUNER_MT2131) += mt2131.o obj-$(CONFIG_DVB_TUNER_MT2131) += mt2131.o
......
This diff is collapsed.
/*
* Linux-DVB Driver for DiBcom's DiB0070 base-band RF Tuner.
*
* Copyright (C) 2005-7 DiBcom (http://www.dibcom.fr/)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, version 2.
*/
#ifndef DIB0070_H
#define DIB0070_H
struct dvb_frontend;
struct i2c_adapter;
#define DEFAULT_DIB0070_I2C_ADDRESS 0x60
struct dib0070_config {
u8 i2c_address;
/* tuner pins controlled externally */
int (*reset) (struct dvb_frontend *, int);
int (*sleep) (struct dvb_frontend *, int);
/* offset in kHz */
int freq_offset_khz_uhf;
int freq_offset_khz_vhf;
u8 osc_buffer_state; /* 0= normal, 1= tri-state */
u32 clock_khz;
u8 clock_pad_drive; /* (Drive + 1) * 2mA */
u8 invert_iq; /* invert Q - in case I or Q is inverted on the board */
u8 force_crystal_mode; /* if == 0 -> decision is made in the driver default: <24 -> 2, >=24 -> 1 */
u8 flip_chip;
};
extern struct dvb_frontend * dib0070_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0070_config *cfg);
extern void dib0070_ctrl_agc_filter(struct dvb_frontend *, uint8_t open);
extern u16 dib0070_wbd_offset(struct dvb_frontend *);
#endif
...@@ -593,7 +593,7 @@ static int dib3000mc_tune(struct dvb_frontend *demod, struct dvb_frontend_parame ...@@ -593,7 +593,7 @@ static int dib3000mc_tune(struct dvb_frontend *demod, struct dvb_frontend_parame
// activates isi // activates isi
dib3000mc_write_word(state, 29, 0x1073); dib3000mc_write_word(state, 29, 0x1073);
dib3000mc_set_adp_cfg(state, (uint8_t)ch->u.ofdm.constellation); dib3000mc_set_adp_cfg(state, (u8)ch->u.ofdm.constellation);
if (ch->u.ofdm.transmission_mode == TRANSMISSION_MODE_8K) { if (ch->u.ofdm.transmission_mode == TRANSMISSION_MODE_8K) {
dib3000mc_write_word(state, 26, 38528); dib3000mc_write_word(state, 26, 38528);
dib3000mc_write_word(state, 33, 8); dib3000mc_write_word(state, 33, 8);
......
...@@ -42,9 +42,9 @@ struct dib7000m_state { ...@@ -42,9 +42,9 @@ struct dib7000m_state {
u32 timf_default; u32 timf_default;
u32 internal_clk; u32 internal_clk;
uint8_t div_force_off : 1; u8 div_force_off : 1;
uint8_t div_state : 1; u8 div_state : 1;
uint16_t div_sync_wait; u16 div_sync_wait;
u16 revision; u16 revision;
...@@ -302,7 +302,7 @@ static int dib7000m_set_diversity_in(struct dvb_frontend *demod, int onoff) ...@@ -302,7 +302,7 @@ static int dib7000m_set_diversity_in(struct dvb_frontend *demod, int onoff)
dprintk( "diversity combination deactivated - forced by COFDM parameters"); dprintk( "diversity combination deactivated - forced by COFDM parameters");
onoff = 0; onoff = 0;
} }
state->div_state = (uint8_t)onoff; state->div_state = (u8)onoff;
if (onoff) { if (onoff) {
dib7000m_write_word(state, 263 + state->reg_offs, 6); dib7000m_write_word(state, 263 + state->reg_offs, 6);
...@@ -620,7 +620,7 @@ static int dib7000m_update_lna(struct dib7000m_state *state) ...@@ -620,7 +620,7 @@ static int dib7000m_update_lna(struct dib7000m_state *state)
u16 dyn_gain; u16 dyn_gain;
if (state->cfg.update_lna) { if (state->cfg.update_lna) {
// read dyn_gain here (because it is demod-dependent and not tuner) // read dyn_gain here (because it is demod-dependent and not fe)
dyn_gain = dib7000m_read_word(state, 390); dyn_gain = dib7000m_read_word(state, 390);
if (state->cfg.update_lna(&state->demod,dyn_gain)) { // LNA has changed if (state->cfg.update_lna(&state->demod,dyn_gain)) { // LNA has changed
...@@ -754,7 +754,7 @@ static int dib7000m_agc_startup(struct dvb_frontend *demod, struct dvb_frontend_ ...@@ -754,7 +754,7 @@ static int dib7000m_agc_startup(struct dvb_frontend *demod, struct dvb_frontend_
break; break;
case 3: /* split search ended */ case 3: /* split search ended */
agc_split = (uint8_t)dib7000m_read_word(state, 392); /* store the split value for the next time */ agc_split = (u8)dib7000m_read_word(state, 392); /* store the split value for the next time */
dib7000m_write_word(state, 75, dib7000m_read_word(state, 390)); /* set AGC gain start value */ dib7000m_write_word(state, 75, dib7000m_read_word(state, 390)); /* set AGC gain start value */
dib7000m_write_word(state, 72, cfg_72 & ~(1 << 4)); /* std AGC loop */ dib7000m_write_word(state, 72, cfg_72 & ~(1 << 4)); /* std AGC loop */
......
...@@ -36,9 +36,9 @@ struct dib7000p_state { ...@@ -36,9 +36,9 @@ struct dib7000p_state {
struct dibx000_agc_config *current_agc; struct dibx000_agc_config *current_agc;
u32 timf; u32 timf;
uint8_t div_force_off : 1; u8 div_force_off : 1;
uint8_t div_state : 1; u8 div_state : 1;
uint16_t div_sync_wait; u16 div_sync_wait;
u8 agc_state; u8 agc_state;
...@@ -156,7 +156,7 @@ static int dib7000p_set_diversity_in(struct dvb_frontend *demod, int onoff) ...@@ -156,7 +156,7 @@ static int dib7000p_set_diversity_in(struct dvb_frontend *demod, int onoff)
dprintk( "diversity combination deactivated - forced by COFDM parameters"); dprintk( "diversity combination deactivated - forced by COFDM parameters");
onoff = 0; onoff = 0;
} }
state->div_state = (uint8_t)onoff; state->div_state = (u8)onoff;
if (onoff) { if (onoff) {
dib7000p_write_word(state, 204, 6); dib7000p_write_word(state, 204, 6);
...@@ -294,6 +294,16 @@ static int dib7000p_sad_calib(struct dib7000p_state *state) ...@@ -294,6 +294,16 @@ static int dib7000p_sad_calib(struct dib7000p_state *state)
return 0; return 0;
} }
int dib7000p_set_wbd_ref(struct dvb_frontend *demod, u16 value)
{
struct dib7000p_state *state = demod->demodulator_priv;
if (value > 4095)
value = 4095;
state->wbd_ref = value;
return dib7000p_write_word(state, 105, (dib7000p_read_word(state, 105) & 0xf000) | value);
}
EXPORT_SYMBOL(dib7000p_set_wbd_ref);
static void dib7000p_reset_pll(struct dib7000p_state *state) static void dib7000p_reset_pll(struct dib7000p_state *state)
{ {
struct dibx000_bandwidth_config *bw = &state->cfg.bw[0]; struct dibx000_bandwidth_config *bw = &state->cfg.bw[0];
...@@ -335,6 +345,28 @@ static int dib7000p_reset_gpio(struct dib7000p_state *st) ...@@ -335,6 +345,28 @@ static int dib7000p_reset_gpio(struct dib7000p_state *st)
return 0; return 0;
} }
static int dib7000p_cfg_gpio(struct dib7000p_state *st, u8 num, u8 dir, u8 val)
{
st->gpio_dir = dib7000p_read_word(st, 1029);
st->gpio_dir &= ~(1 << num); /* reset the direction bit */
st->gpio_dir |= (dir & 0x1) << num; /* set the new direction */
dib7000p_write_word(st, 1029, st->gpio_dir);
st->gpio_val = dib7000p_read_word(st, 1030);
st->gpio_val &= ~(1 << num); /* reset the direction bit */
st->gpio_val |= (val & 0x01) << num; /* set the new value */
dib7000p_write_word(st, 1030, st->gpio_val);
return 0;
}
int dib7000p_set_gpio(struct dvb_frontend *demod, u8 num, u8 dir, u8 val)
{
struct dib7000p_state *state = demod->demodulator_priv;
return dib7000p_cfg_gpio(state, num, dir, val);
}
EXPORT_SYMBOL(dib7000p_set_gpio);
static u16 dib7000p_defaults[] = static u16 dib7000p_defaults[] =
{ {
...@@ -501,7 +533,7 @@ static int dib7000p_update_lna(struct dib7000p_state *state) ...@@ -501,7 +533,7 @@ static int dib7000p_update_lna(struct dib7000p_state *state)
// when there is no LNA to program return immediatly // when there is no LNA to program return immediatly
if (state->cfg.update_lna) { if (state->cfg.update_lna) {
// read dyn_gain here (because it is demod-dependent and not tuner) // read dyn_gain here (because it is demod-dependent and not fe)
dyn_gain = dib7000p_read_word(state, 394); dyn_gain = dib7000p_read_word(state, 394);
if (state->cfg.update_lna(&state->demod,dyn_gain)) { // LNA has changed if (state->cfg.update_lna(&state->demod,dyn_gain)) { // LNA has changed
dib7000p_restart_agc(state); dib7000p_restart_agc(state);
...@@ -617,7 +649,7 @@ static int dib7000p_agc_startup(struct dvb_frontend *demod, struct dvb_frontend_ ...@@ -617,7 +649,7 @@ static int dib7000p_agc_startup(struct dvb_frontend *demod, struct dvb_frontend_
break; break;
case 3: /* split search ended */ case 3: /* split search ended */
agc_split = (uint8_t)dib7000p_read_word(state, 396); /* store the split value for the next time */ agc_split = (u8)dib7000p_read_word(state, 396); /* store the split value for the next time */
dib7000p_write_word(state, 78, dib7000p_read_word(state, 394)); /* set AGC gain start value */ dib7000p_write_word(state, 78, dib7000p_read_word(state, 394)); /* set AGC gain start value */
dib7000p_write_word(state, 75, state->current_agc->setup); /* std AGC loop */ dib7000p_write_word(state, 75, state->current_agc->setup); /* std AGC loop */
......
...@@ -40,12 +40,7 @@ extern int dib7000p_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods, u ...@@ -40,12 +40,7 @@ extern int dib7000p_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods, u
extern struct i2c_adapter * dib7000p_get_i2c_master(struct dvb_frontend *, enum dibx000_i2c_interface, int); extern struct i2c_adapter * dib7000p_get_i2c_master(struct dvb_frontend *, enum dibx000_i2c_interface, int);
extern int dib7000pc_detection(struct i2c_adapter *i2c_adap); extern int dib7000pc_detection(struct i2c_adapter *i2c_adap);
extern int dib7000p_set_gpio(struct dvb_frontend *, u8 num, u8 dir, u8 val);
/* TODO extern int dib7000p_set_wbd_ref(struct dvb_frontend *, u16 value);
extern INT dib7000p_set_gpio(struct dibDemod *demod, UCHAR num, UCHAR dir, UCHAR val);
extern INT dib7000p_enable_vbg_voltage(struct dibDemod *demod);
extern void dib7000p_set_hostbus_diversity(struct dibDemod *demod, UCHAR onoff);
extern USHORT dib7000p_get_current_agc_global(struct dibDemod *demod);
*/
#endif #endif
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