aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/dib9000.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/frontends/dib9000.c')
-rw-r--r--drivers/media/dvb/frontends/dib9000.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/drivers/media/dvb/frontends/dib9000.c b/drivers/media/dvb/frontends/dib9000.c
index 660f80661ed..863ef3cfab9 100644
--- a/drivers/media/dvb/frontends/dib9000.c
+++ b/drivers/media/dvb/frontends/dib9000.c
@@ -1136,7 +1136,7 @@ static int dib9000_fw_init(struct dib9000_state *state)
1136 return 0; 1136 return 0;
1137} 1137}
1138 1138
1139static void dib9000_fw_set_channel_head(struct dib9000_state *state, struct dvb_frontend_parameters *ch) 1139static void dib9000_fw_set_channel_head(struct dib9000_state *state)
1140{ 1140{
1141 u8 b[9]; 1141 u8 b[9];
1142 u32 freq = state->fe[0]->dtv_property_cache.frequency / 1000; 1142 u32 freq = state->fe[0]->dtv_property_cache.frequency / 1000;
@@ -1157,7 +1157,7 @@ static void dib9000_fw_set_channel_head(struct dib9000_state *state, struct dvb_
1157 dib9000_risc_mem_write(state, FE_MM_W_CHANNEL_HEAD, b); 1157 dib9000_risc_mem_write(state, FE_MM_W_CHANNEL_HEAD, b);
1158} 1158}
1159 1159
1160static int dib9000_fw_get_channel(struct dvb_frontend *fe, struct dvb_frontend_parameters *channel) 1160static int dib9000_fw_get_channel(struct dvb_frontend *fe)
1161{ 1161{
1162 struct dib9000_state *state = fe->demodulator_priv; 1162 struct dib9000_state *state = fe->demodulator_priv;
1163 struct dibDVBTChannel { 1163 struct dibDVBTChannel {
@@ -1309,7 +1309,7 @@ error:
1309 return ret; 1309 return ret;
1310} 1310}
1311 1311
1312static int dib9000_fw_set_channel_union(struct dvb_frontend *fe, struct dvb_frontend_parameters *channel) 1312static int dib9000_fw_set_channel_union(struct dvb_frontend *fe)
1313{ 1313{
1314 struct dib9000_state *state = fe->demodulator_priv; 1314 struct dib9000_state *state = fe->demodulator_priv;
1315 struct dibDVBTChannel { 1315 struct dibDVBTChannel {
@@ -1454,7 +1454,7 @@ static int dib9000_fw_set_channel_union(struct dvb_frontend *fe, struct dvb_fron
1454 return 0; 1454 return 0;
1455} 1455}
1456 1456
1457static int dib9000_fw_tune(struct dvb_frontend *fe, struct dvb_frontend_parameters *ch) 1457static int dib9000_fw_tune(struct dvb_frontend *fe)
1458{ 1458{
1459 struct dib9000_state *state = fe->demodulator_priv; 1459 struct dib9000_state *state = fe->demodulator_priv;
1460 int ret = 10, search = state->channel_status.status == CHANNEL_STATUS_PARAMETERS_UNKNOWN; 1460 int ret = 10, search = state->channel_status.status == CHANNEL_STATUS_PARAMETERS_UNKNOWN;
@@ -1462,7 +1462,7 @@ static int dib9000_fw_tune(struct dvb_frontend *fe, struct dvb_frontend_paramete
1462 1462
1463 switch (state->tune_state) { 1463 switch (state->tune_state) {
1464 case CT_DEMOD_START: 1464 case CT_DEMOD_START:
1465 dib9000_fw_set_channel_head(state, ch); 1465 dib9000_fw_set_channel_head(state);
1466 1466
1467 /* write the channel context - a channel is initialized to 0, so it is OK */ 1467 /* write the channel context - a channel is initialized to 0, so it is OK */
1468 dib9000_risc_mem_write(state, FE_MM_W_CHANNEL_CONTEXT, (u8 *) fe_info); 1468 dib9000_risc_mem_write(state, FE_MM_W_CHANNEL_CONTEXT, (u8 *) fe_info);
@@ -1471,7 +1471,7 @@ static int dib9000_fw_tune(struct dvb_frontend *fe, struct dvb_frontend_paramete
1471 if (search) 1471 if (search)
1472 dib9000_mbx_send(state, OUT_MSG_FE_CHANNEL_SEARCH, NULL, 0); 1472 dib9000_mbx_send(state, OUT_MSG_FE_CHANNEL_SEARCH, NULL, 0);
1473 else { 1473 else {
1474 dib9000_fw_set_channel_union(fe, ch); 1474 dib9000_fw_set_channel_union(fe);
1475 dib9000_mbx_send(state, OUT_MSG_FE_CHANNEL_TUNE, NULL, 0); 1475 dib9000_mbx_send(state, OUT_MSG_FE_CHANNEL_TUNE, NULL, 0);
1476 } 1476 }
1477 state->tune_state = CT_DEMOD_STEP_1; 1477 state->tune_state = CT_DEMOD_STEP_1;
@@ -1867,7 +1867,7 @@ static int dib9000_fe_get_tune_settings(struct dvb_frontend *fe, struct dvb_fron
1867 return 0; 1867 return 0;
1868} 1868}
1869 1869
1870static int dib9000_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) 1870static int dib9000_get_frontend(struct dvb_frontend *fe)
1871{ 1871{
1872 struct dib9000_state *state = fe->demodulator_priv; 1872 struct dib9000_state *state = fe->demodulator_priv;
1873 u8 index_frontend, sub_index_frontend; 1873 u8 index_frontend, sub_index_frontend;
@@ -1883,7 +1883,7 @@ static int dib9000_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
1883 dprintk("TPS lock on the slave%i", index_frontend); 1883 dprintk("TPS lock on the slave%i", index_frontend);
1884 1884
1885 /* synchronize the cache with the other frontends */ 1885 /* synchronize the cache with the other frontends */
1886 state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend], fep); 1886 state->fe[index_frontend]->ops.get_frontend(state->fe[index_frontend]);
1887 for (sub_index_frontend = 0; (sub_index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[sub_index_frontend] != NULL); 1887 for (sub_index_frontend = 0; (sub_index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[sub_index_frontend] != NULL);
1888 sub_index_frontend++) { 1888 sub_index_frontend++) {
1889 if (sub_index_frontend != index_frontend) { 1889 if (sub_index_frontend != index_frontend) {
@@ -1911,7 +1911,7 @@ static int dib9000_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
1911 } 1911 }
1912 1912
1913 /* get the channel from master chip */ 1913 /* get the channel from master chip */
1914 ret = dib9000_fw_get_channel(fe, fep); 1914 ret = dib9000_fw_get_channel(fe);
1915 if (ret != 0) 1915 if (ret != 0)
1916 goto return_value; 1916 goto return_value;
1917 1917
@@ -1958,7 +1958,7 @@ static int dib9000_set_channel_status(struct dvb_frontend *fe, struct dvb_fronte
1958 return 0; 1958 return 0;
1959} 1959}
1960 1960
1961static int dib9000_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *fep) 1961static int dib9000_set_frontend(struct dvb_frontend *fe)
1962{ 1962{
1963 struct dib9000_state *state = fe->demodulator_priv; 1963 struct dib9000_state *state = fe->demodulator_priv;
1964 int sleep_time, sleep_time_slave; 1964 int sleep_time, sleep_time_slave;
@@ -1983,8 +1983,10 @@ static int dib9000_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
1983 fe->dtv_property_cache.delivery_system = SYS_DVBT; 1983 fe->dtv_property_cache.delivery_system = SYS_DVBT;
1984 1984
1985 /* set the master status */ 1985 /* set the master status */
1986 if (fep->u.ofdm.transmission_mode == TRANSMISSION_MODE_AUTO || 1986 if (state->fe[0]->dtv_property_cache.transmission_mode == TRANSMISSION_MODE_AUTO ||
1987 fep->u.ofdm.guard_interval == GUARD_INTERVAL_AUTO || fep->u.ofdm.constellation == QAM_AUTO || fep->u.ofdm.code_rate_HP == FEC_AUTO) { 1987 state->fe[0]->dtv_property_cache.guard_interval == GUARD_INTERVAL_AUTO ||
1988 state->fe[0]->dtv_property_cache.modulation == QAM_AUTO ||
1989 state->fe[0]->dtv_property_cache.code_rate_HP == FEC_AUTO) {
1988 /* no channel specified, autosearch the channel */ 1990 /* no channel specified, autosearch the channel */
1989 state->channel_status.status = CHANNEL_STATUS_PARAMETERS_UNKNOWN; 1991 state->channel_status.status = CHANNEL_STATUS_PARAMETERS_UNKNOWN;
1990 } else 1992 } else
@@ -2008,9 +2010,9 @@ static int dib9000_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
2008 exit_condition = 0; /* 0: tune pending; 1: tune failed; 2:tune success */ 2010 exit_condition = 0; /* 0: tune pending; 1: tune failed; 2:tune success */
2009 index_frontend_success = 0; 2011 index_frontend_success = 0;
2010 do { 2012 do {
2011 sleep_time = dib9000_fw_tune(state->fe[0], NULL); 2013 sleep_time = dib9000_fw_tune(state->fe[0]);
2012 for (index_frontend = 1; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) { 2014 for (index_frontend = 1; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) {
2013 sleep_time_slave = dib9000_fw_tune(state->fe[index_frontend], NULL); 2015 sleep_time_slave = dib9000_fw_tune(state->fe[index_frontend]);
2014 if (sleep_time == FE_CALLBACK_TIME_NEVER) 2016 if (sleep_time == FE_CALLBACK_TIME_NEVER)
2015 sleep_time = sleep_time_slave; 2017 sleep_time = sleep_time_slave;
2016 else if ((sleep_time_slave != FE_CALLBACK_TIME_NEVER) && (sleep_time_slave > sleep_time)) 2018 else if ((sleep_time_slave != FE_CALLBACK_TIME_NEVER) && (sleep_time_slave > sleep_time))
@@ -2052,7 +2054,7 @@ static int dib9000_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
2052 2054
2053 /* synchronize all the channel cache */ 2055 /* synchronize all the channel cache */
2054 state->get_frontend_internal = 1; 2056 state->get_frontend_internal = 1;
2055 dib9000_get_frontend(state->fe[0], fep); 2057 dib9000_get_frontend(state->fe[0]);
2056 state->get_frontend_internal = 0; 2058 state->get_frontend_internal = 0;
2057 2059
2058 /* retune the other frontends with the found channel */ 2060 /* retune the other frontends with the found channel */
@@ -2068,7 +2070,7 @@ static int dib9000_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
2068 sleep_time = FE_CALLBACK_TIME_NEVER; 2070 sleep_time = FE_CALLBACK_TIME_NEVER;
2069 for (index_frontend = 0; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) { 2071 for (index_frontend = 0; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) {
2070 if (index_frontend != index_frontend_success) { 2072 if (index_frontend != index_frontend_success) {
2071 sleep_time_slave = dib9000_fw_tune(state->fe[index_frontend], NULL); 2073 sleep_time_slave = dib9000_fw_tune(state->fe[index_frontend]);
2072 if (sleep_time == FE_CALLBACK_TIME_NEVER) 2074 if (sleep_time == FE_CALLBACK_TIME_NEVER)
2073 sleep_time = sleep_time_slave; 2075 sleep_time = sleep_time_slave;
2074 else if ((sleep_time_slave != FE_CALLBACK_TIME_NEVER) && (sleep_time_slave > sleep_time)) 2076 else if ((sleep_time_slave != FE_CALLBACK_TIME_NEVER) && (sleep_time_slave > sleep_time))
@@ -2495,9 +2497,9 @@ error:
2495EXPORT_SYMBOL(dib9000_attach); 2497EXPORT_SYMBOL(dib9000_attach);
2496 2498
2497static struct dvb_frontend_ops dib9000_ops = { 2499static struct dvb_frontend_ops dib9000_ops = {
2500 .delsys = { SYS_DVBT },
2498 .info = { 2501 .info = {
2499 .name = "DiBcom 9000", 2502 .name = "DiBcom 9000",
2500 .type = FE_OFDM,
2501 .frequency_min = 44250000, 2503 .frequency_min = 44250000,
2502 .frequency_max = 867250000, 2504 .frequency_max = 867250000,
2503 .frequency_stepsize = 62500, 2505 .frequency_stepsize = 62500,