Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 85752
b: refs/heads/master
c: ea75baf
h: refs/heads/master
v: v3
  • Loading branch information
Hartmut Hackmann authored and Mauro Carvalho Chehab committed Feb 18, 2008
1 parent c5e1c8b commit 9fc0445
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 83947d307d63dc0c30ab0809714f0bcbbdf8c3e2
refs/heads/master: ea75baf4b0f117564bd50827a49c4b14d61d24e9
1 change: 1 addition & 0 deletions trunk/drivers/media/dvb/dvb-usb/ttusb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ static int ttusb2_power_ctrl(struct dvb_usb_device *d, int onoff)
static struct tda10086_config tda10086_config = {
.demod_address = 0x0e,
.invert = 0,
.diseqc_tone = 1,
};

static int ttusb2_frontend_attach(struct dvb_usb_adapter *adap)
Expand Down
28 changes: 22 additions & 6 deletions trunk/drivers/media/dvb/frontends/tda10086.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,12 @@ static int tda10086_write_mask(struct tda10086_state *state, int reg, int mask,
static int tda10086_init(struct dvb_frontend* fe)
{
struct tda10086_state* state = fe->demodulator_priv;
u8 t22k_off = 0x80;

dprintk ("%s\n", __FUNCTION__);

if (state->config->diseqc_tone)
t22k_off = 0;
// reset
tda10086_write_byte(state, 0x00, 0x00);
msleep(10);
Expand Down Expand Up @@ -158,7 +161,7 @@ static int tda10086_init(struct dvb_frontend* fe)
tda10086_write_byte(state, 0x3d, 0x80);

// setup SEC
tda10086_write_byte(state, 0x36, 0x80); // all SEC off, no 22k tone
tda10086_write_byte(state, 0x36, t22k_off); // all SEC off, 22k tone
tda10086_write_byte(state, 0x34, (((1<<19) * (22000/1000)) / (SACLK/1000))); // } tone frequency
tda10086_write_byte(state, 0x35, (((1<<19) * (22000/1000)) / (SACLK/1000)) >> 8); // }

Expand All @@ -180,16 +183,20 @@ static void tda10086_diseqc_wait(struct tda10086_state *state)
static int tda10086_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone)
{
struct tda10086_state* state = fe->demodulator_priv;
u8 t22k_off = 0x80;

dprintk ("%s\n", __FUNCTION__);

if (state->config->diseqc_tone)
t22k_off = 0;

switch (tone) {
case SEC_TONE_OFF:
tda10086_write_byte(state, 0x36, 0x80);
tda10086_write_byte(state, 0x36, t22k_off);
break;

case SEC_TONE_ON:
tda10086_write_byte(state, 0x36, 0x81);
tda10086_write_byte(state, 0x36, 0x01 + t22k_off);
break;
}

Expand All @@ -202,17 +209,22 @@ static int tda10086_send_master_cmd (struct dvb_frontend* fe,
struct tda10086_state* state = fe->demodulator_priv;
int i;
u8 oldval;
u8 t22k_off = 0x80;

dprintk ("%s\n", __FUNCTION__);

if (state->config->diseqc_tone)
t22k_off = 0;

if (cmd->msg_len > 6)
return -EINVAL;
oldval = tda10086_read_byte(state, 0x36);

for(i=0; i< cmd->msg_len; i++) {
tda10086_write_byte(state, 0x48+i, cmd->msg[i]);
}
tda10086_write_byte(state, 0x36, 0x88 | ((cmd->msg_len - 1) << 4));
tda10086_write_byte(state, 0x36, (0x08 + t22k_off)
| ((cmd->msg_len - 1) << 4));

tda10086_diseqc_wait(state);

Expand All @@ -225,16 +237,20 @@ static int tda10086_send_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t minic
{
struct tda10086_state* state = fe->demodulator_priv;
u8 oldval = tda10086_read_byte(state, 0x36);
u8 t22k_off = 0x80;

dprintk ("%s\n", __FUNCTION__);

if (state->config->diseqc_tone)
t22k_off = 0;

switch(minicmd) {
case SEC_MINI_A:
tda10086_write_byte(state, 0x36, 0x84);
tda10086_write_byte(state, 0x36, 0x04 + t22k_off);
break;

case SEC_MINI_B:
tda10086_write_byte(state, 0x36, 0x86);
tda10086_write_byte(state, 0x36, 0x06 + t22k_off);
break;
}

Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/media/dvb/frontends/tda10086.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ struct tda10086_config

/* does the "inversion" need inverted? */
u8 invert;

/* do we need the diseqc signal with carrier? */
u8 diseqc_tone;
};

#if defined(CONFIG_DVB_TDA10086) || (defined(CONFIG_DVB_TDA10086_MODULE) && defined(MODULE))
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/dvb/ttpci/budget.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ static struct s5h1420_config s5h1420_config = {
static struct tda10086_config tda10086_config = {
.demod_address = 0x0e,
.invert = 0,
.diseqc_tone = 1,
};

static u8 read_pwm(struct budget* budget)
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/media/video/saa7134/saa7134-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,7 @@ static struct tda1004x_config ads_tech_duo_config = {
static struct tda10086_config flydvbs = {
.demod_address = 0x0e,
.invert = 0,
.diseqc_tone = 0,
};

/* ==================================================================
Expand Down Expand Up @@ -955,9 +956,9 @@ static int dvb_init(struct saa7134_dev *dev)
configure_tda827x_fe(dev, &tda827x_lifeview_config);
break;
case SAA7134_BOARD_FLYDVB_TRIO:
if(! use_frontend) { //terrestrial
if(! use_frontend) { /* terrestrial */
configure_tda827x_fe(dev, &lifeview_trio_config);
} else { //satellite
} else { /* satellite */
dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs, &dev->i2c_adap);
if (dev->dvb.frontend) {
if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x63,
Expand Down

0 comments on commit 9fc0445

Please sign in to comment.