diff options
author | Manu Abraham <abraham.manu@gmail.com> | 2007-10-05 10:41:19 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 14:53:18 -0500 |
commit | 6c1022cbc87bbd962b7c1e551c2af290be9e4277 (patch) | |
tree | b81322fd98aff21a343603b6c68fe25b3763e783 /drivers/media/dvb/frontends/stb0899_drv.c | |
parent | baa40e48d9069c6ec3ac4739f47e2e7560a022d3 (diff) |
V4L/DVB (9414): Initialize DiSEqC
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/stb0899_drv.c')
-rw-r--r-- | drivers/media/dvb/frontends/stb0899_drv.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/drivers/media/dvb/frontends/stb0899_drv.c b/drivers/media/dvb/frontends/stb0899_drv.c index fe298654b34b..319c71ed3214 100644 --- a/drivers/media/dvb/frontends/stb0899_drv.c +++ b/drivers/media/dvb/frontends/stb0899_drv.c | |||
@@ -796,6 +796,42 @@ static int stb0899_send_diseqc_burst(struct dvb_frontend *fe, fe_sec_mini_cmd_t | |||
796 | return 0; | 796 | return 0; |
797 | } | 797 | } |
798 | 798 | ||
799 | static int stb0899_diseqc_init(struct stb0899_state *state) | ||
800 | { | ||
801 | struct dvb_diseqc_master_cmd tx_data; | ||
802 | struct dvb_diseqc_slave_reply rx_data; | ||
803 | |||
804 | u8 f22_tx, f22_rx, reg; | ||
805 | |||
806 | u32 mclk, tx_freq = 22000, count = 0, i; | ||
807 | |||
808 | u32 trial = 0; /* try max = 2 (try 20khz and 17.5 khz) */ | ||
809 | u32 ret_1 = 0; /* 20 Khz status */ | ||
810 | u32 ret_2 = 0; /* 17.5 Khz status */ | ||
811 | |||
812 | tx_data.msg[0] = 0xe2; | ||
813 | tx_data.msg_len = 3; | ||
814 | reg = stb0899_read_reg(state, STB0899_DISCNTRL2); | ||
815 | STB0899_SETFIELD_VAL(ONECHIP_TRX, reg, 0); | ||
816 | stb0899_write_reg(state, STB0899_DISCNTRL2, reg); | ||
817 | |||
818 | /* disable Tx spy */ | ||
819 | reg = stb0899_read_reg(state, STB0899_DISCNTRL1); | ||
820 | STB0899_SETFIELD_VAL(DISEQCRESET, reg, 1); | ||
821 | stb0899_write_reg(state, STB0899_DISCNTRL1, reg); | ||
822 | |||
823 | reg = stb0899_read_reg(state, STB0899_DISCNTRL1); | ||
824 | STB0899_SETFIELD_VAL(DISEQCRESET, reg, 0); | ||
825 | stb0899_write_reg(state, STB0899_DISCNTRL1, reg); | ||
826 | |||
827 | mclk = stb0899_get_mclk(state); | ||
828 | f22_tx = mclk / (tx_freq * 32); | ||
829 | stb0899_write_reg(state, STB0899_DISF22, f22_tx); /* DiSEqC Tx freq */ | ||
830 | state->rx_freq = 20000; | ||
831 | f22_rx = mclk / (state->rx_freq * 32); | ||
832 | |||
833 | return 0; | ||
834 | } | ||
799 | 835 | ||
800 | static int stb0899_sleep(struct dvb_frontend *fe) | 836 | static int stb0899_sleep(struct dvb_frontend *fe) |
801 | { | 837 | { |
@@ -863,7 +899,7 @@ static int stb0899_init(struct dvb_frontend *fe) | |||
863 | stb0899_write_reg(state, config->init_tst[i].address, config->init_tst[i].data); | 899 | stb0899_write_reg(state, config->init_tst[i].address, config->init_tst[i].data); |
864 | 900 | ||
865 | stb0899_init_calc(state); | 901 | stb0899_init_calc(state); |
866 | // stb0899_diseqc_init(state); | 902 | stb0899_diseqc_init(state); |
867 | 903 | ||
868 | return 0; | 904 | return 0; |
869 | } | 905 | } |