Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124061
b: refs/heads/master
c: 6c1022c
h: refs/heads/master
i:
  124059: 8aa0a93
v: v3
  • Loading branch information
Manu Abraham authored and Mauro Carvalho Chehab committed Dec 29, 2008
1 parent 6ec7b88 commit 3bf2379
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 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: baa40e48d9069c6ec3ac4739f47e2e7560a022d3
refs/heads/master: 6c1022cbc87bbd962b7c1e551c2af290be9e4277
38 changes: 37 additions & 1 deletion trunk/drivers/media/dvb/frontends/stb0899_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,42 @@ static int stb0899_send_diseqc_burst(struct dvb_frontend *fe, fe_sec_mini_cmd_t
return 0;
}

static int stb0899_diseqc_init(struct stb0899_state *state)
{
struct dvb_diseqc_master_cmd tx_data;
struct dvb_diseqc_slave_reply rx_data;

u8 f22_tx, f22_rx, reg;

u32 mclk, tx_freq = 22000, count = 0, i;

u32 trial = 0; /* try max = 2 (try 20khz and 17.5 khz) */
u32 ret_1 = 0; /* 20 Khz status */
u32 ret_2 = 0; /* 17.5 Khz status */

tx_data.msg[0] = 0xe2;
tx_data.msg_len = 3;
reg = stb0899_read_reg(state, STB0899_DISCNTRL2);
STB0899_SETFIELD_VAL(ONECHIP_TRX, reg, 0);
stb0899_write_reg(state, STB0899_DISCNTRL2, reg);

/* disable Tx spy */
reg = stb0899_read_reg(state, STB0899_DISCNTRL1);
STB0899_SETFIELD_VAL(DISEQCRESET, reg, 1);
stb0899_write_reg(state, STB0899_DISCNTRL1, reg);

reg = stb0899_read_reg(state, STB0899_DISCNTRL1);
STB0899_SETFIELD_VAL(DISEQCRESET, reg, 0);
stb0899_write_reg(state, STB0899_DISCNTRL1, reg);

mclk = stb0899_get_mclk(state);
f22_tx = mclk / (tx_freq * 32);
stb0899_write_reg(state, STB0899_DISF22, f22_tx); /* DiSEqC Tx freq */
state->rx_freq = 20000;
f22_rx = mclk / (state->rx_freq * 32);

return 0;
}

static int stb0899_sleep(struct dvb_frontend *fe)
{
Expand Down Expand Up @@ -863,7 +899,7 @@ static int stb0899_init(struct dvb_frontend *fe)
stb0899_write_reg(state, config->init_tst[i].address, config->init_tst[i].data);

stb0899_init_calc(state);
// stb0899_diseqc_init(state);
stb0899_diseqc_init(state);

return 0;
}
Expand Down

0 comments on commit 3bf2379

Please sign in to comment.