aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorAbylay Ospan <aospan@netup.ru>2009-10-17 07:38:45 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:41:24 -0500
commit9329fb5b731cd535a7c7d0690d30e872f29a33d3 (patch)
tree0c4ddd57967573a20bbd7aa23e752e9973097470 /drivers/media/dvb/frontends
parent873688cd30294412e185ba39f8487e3eed0f692d (diff)
V4L/DVB (13335): stv0900: fix diseqc support for NetUP card
Signed-off-by: Abylay Ospan <aospan@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r--drivers/media/dvb/frontends/stv0900_core.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/media/dvb/frontends/stv0900_core.c b/drivers/media/dvb/frontends/stv0900_core.c
index 768a1611e8ce..4729be7fdf7b 100644
--- a/drivers/media/dvb/frontends/stv0900_core.c
+++ b/drivers/media/dvb/frontends/stv0900_core.c
@@ -1771,7 +1771,6 @@ static int stv0900_diseqc_send(struct stv0900_internal *i_params , u8 *Data,
1771 msleep(10); 1771 msleep(10);
1772 i++; 1772 i++;
1773 } 1773 }
1774
1775 break; 1774 break;
1776 } 1775 }
1777 1776
@@ -1795,19 +1794,20 @@ static int stv0900_send_burst(struct dvb_frontend *fe, fe_sec_mini_cmd_t burst)
1795 struct stv0900_internal *i_params = state->internal; 1794 struct stv0900_internal *i_params = state->internal;
1796 enum fe_stv0900_demod_num demod = state->demod; 1795 enum fe_stv0900_demod_num demod = state->demod;
1797 s32 mode_field; 1796 s32 mode_field;
1798 u32 diseqc_fifo; 1797 u8 data;
1799 1798
1800 dmd_reg(mode_field, F0900_P1_DISTX_MODE, F0900_P2_DISTX_MODE); 1799 dmd_reg(mode_field, F0900_P1_DISTX_MODE, F0900_P2_DISTX_MODE);
1801 dmd_reg(diseqc_fifo, R0900_P1_DISTXDATA, R0900_P2_DISTXDATA);
1802 1800
1803 switch (burst) { 1801 switch (burst) {
1804 case SEC_MINI_A: 1802 case SEC_MINI_A:
1805 stv0900_write_bits(i_params, mode_field, 3);/* Unmodulated */ 1803 stv0900_write_bits(i_params, mode_field, 3);/* Unmodulated */
1806 stv0900_write_reg(i_params, diseqc_fifo, 0x00); 1804 data = 0x00;
1805 stv0900_diseqc_send(state->internal, &data, 1, state->demod);
1807 break; 1806 break;
1808 case SEC_MINI_B: 1807 case SEC_MINI_B:
1809 stv0900_write_bits(i_params, mode_field, 2);/* Modulated */ 1808 stv0900_write_bits(i_params, mode_field, 2);/* Modulated */
1810 stv0900_write_reg(i_params, diseqc_fifo, 0xff); 1809 data = 0xff;
1810 stv0900_diseqc_send(state->internal, &data, 1, state->demod);
1811 break; 1811 break;
1812 } 1812 }
1813 1813
@@ -1858,28 +1858,37 @@ static int stv0900_recv_slave_reply(struct dvb_frontend *fe,
1858 return 0; 1858 return 0;
1859} 1859}
1860 1860
1861static int stv0900_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone) 1861static int stv0900_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t toneoff)
1862{ 1862{
1863 struct stv0900_state *state = fe->demodulator_priv; 1863 struct stv0900_state *state = fe->demodulator_priv;
1864 struct stv0900_internal *i_params = state->internal; 1864 struct stv0900_internal *i_params = state->internal;
1865 enum fe_stv0900_demod_num demod = state->demod; 1865 enum fe_stv0900_demod_num demod = state->demod;
1866 s32 mode_field, reset_field; 1866 s32 mode_field, reset_field;
1867 1867
1868 dprintk("%s: %s\n", __func__, ((tone == 0) ? "Off" : "On")); 1868 dprintk("%s: %s\n", __func__, ((toneoff == 0) ? "On" : "Off"));
1869 1869
1870 dmd_reg(mode_field, F0900_P1_DISTX_MODE, F0900_P2_DISTX_MODE); 1870 dmd_reg(mode_field, F0900_P1_DISTX_MODE, F0900_P2_DISTX_MODE);
1871 dmd_reg(reset_field, F0900_P1_DISEQC_RESET, F0900_P2_DISEQC_RESET); 1871 dmd_reg(reset_field, F0900_P1_DISEQC_RESET, F0900_P2_DISEQC_RESET);
1872 1872
1873 if (tone) { 1873 switch (toneoff) {
1874 /*Set the DiseqC mode to 22Khz continues tone*/ 1874 case SEC_TONE_ON:
1875 /*Set the DiseqC mode to 22Khz _continues_ tone*/
1875 stv0900_write_bits(i_params, mode_field, 0); 1876 stv0900_write_bits(i_params, mode_field, 0);
1876 stv0900_write_bits(i_params, reset_field, 1); 1877 stv0900_write_bits(i_params, reset_field, 1);
1877 /*release DiseqC reset to enable the 22KHz tone*/ 1878 /*release DiseqC reset to enable the 22KHz tone*/
1878 stv0900_write_bits(i_params, reset_field, 0); 1879 stv0900_write_bits(i_params, reset_field, 0);
1879 } else { 1880 break;
1880 stv0900_write_bits(i_params, mode_field, 0); 1881 case SEC_TONE_OFF:
1882 /*return diseqc mode to config->diseqc_mode.
1883 Usually it's without _continues_ tone */
1884 stv0900_write_bits(i_params, mode_field,
1885 state->config->diseqc_mode);
1881 /*maintain the DiseqC reset to disable the 22KHz tone*/ 1886 /*maintain the DiseqC reset to disable the 22KHz tone*/
1882 stv0900_write_bits(i_params, reset_field, 1); 1887 stv0900_write_bits(i_params, reset_field, 1);
1888 stv0900_write_bits(i_params, reset_field, 0);
1889 break;
1890 default:
1891 return -EINVAL;
1883 } 1892 }
1884 1893
1885 return 0; 1894 return 0;