aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/dvb/frontends/dib8000.c96
1 files changed, 48 insertions, 48 deletions
diff --git a/drivers/media/dvb/frontends/dib8000.c b/drivers/media/dvb/frontends/dib8000.c
index 3961fed9da6e..3e20aa8db23b 100644
--- a/drivers/media/dvb/frontends/dib8000.c
+++ b/drivers/media/dvb/frontends/dib8000.c
@@ -2134,54 +2134,54 @@ static int dib8000_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
2134 ((state->fe[0]->dtv_property_cache.layer[1].segment_count == 0) || 2134 ((state->fe[0]->dtv_property_cache.layer[1].segment_count == 0) ||
2135 ((state->fe[0]->dtv_property_cache.isdbt_layer_enabled & (2 << 0)) == 0)) && 2135 ((state->fe[0]->dtv_property_cache.isdbt_layer_enabled & (2 << 0)) == 0)) &&
2136 ((state->fe[0]->dtv_property_cache.layer[2].segment_count == 0) || ((state->fe[0]->dtv_property_cache.isdbt_layer_enabled & (3 << 0)) == 0)))) { 2136 ((state->fe[0]->dtv_property_cache.layer[2].segment_count == 0) || ((state->fe[0]->dtv_property_cache.isdbt_layer_enabled & (3 << 0)) == 0)))) {
2137 int i = 80000; 2137 int i = 80000;
2138 u8 found = 0; 2138 u8 found = 0;
2139 u8 tune_failed = 0; 2139 u8 tune_failed = 0;
2140 2140
2141 for (index_frontend = 0; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) { 2141 for (index_frontend = 0; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) {
2142 dib8000_set_bandwidth(state->fe[index_frontend], fe->dtv_property_cache.bandwidth_hz / 1000); 2142 dib8000_set_bandwidth(state->fe[index_frontend], fe->dtv_property_cache.bandwidth_hz / 1000);
2143 dib8000_autosearch_start(state->fe[index_frontend]); 2143 dib8000_autosearch_start(state->fe[index_frontend]);
2144 } 2144 }
2145 2145
2146 do { 2146 do {
2147 msleep(20); 2147 msleep(20);
2148 nbr_pending = 0; 2148 nbr_pending = 0;
2149 exit_condition = 0; /* 0: tune pending; 1: tune failed; 2:tune success */ 2149 exit_condition = 0; /* 0: tune pending; 1: tune failed; 2:tune success */
2150 for (index_frontend = 0; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) { 2150 for (index_frontend = 0; (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) {
2151 if (((tune_failed >> index_frontend) & 0x1) == 0) { 2151 if (((tune_failed >> index_frontend) & 0x1) == 0) {
2152 found = dib8000_autosearch_irq(state->fe[index_frontend]); 2152 found = dib8000_autosearch_irq(state->fe[index_frontend]);
2153 switch (found) { 2153 switch (found) {
2154 case 0: /* tune pending */ 2154 case 0: /* tune pending */
2155 nbr_pending++; 2155 nbr_pending++;
2156 break; 2156 break;
2157 case 2: 2157 case 2:
2158 dprintk("autosearch succeed on the frontend%i", index_frontend); 2158 dprintk("autosearch succeed on the frontend%i", index_frontend);
2159 exit_condition = 2; 2159 exit_condition = 2;
2160 index_frontend_success = index_frontend; 2160 index_frontend_success = index_frontend;
2161 break; 2161 break;
2162 default: 2162 default:
2163 dprintk("unhandled autosearch result"); 2163 dprintk("unhandled autosearch result");
2164 case 1: 2164 case 1:
2165 dprintk("autosearch failed for the frontend%i", index_frontend); 2165 dprintk("autosearch failed for the frontend%i", index_frontend);
2166 break; 2166 break;
2167 } 2167 }
2168 } 2168 }
2169 } 2169 }
2170 2170
2171 /* if all tune are done and no success, exit: tune failed */ 2171 /* if all tune are done and no success, exit: tune failed */
2172 if ((nbr_pending == 0) && (exit_condition == 0)) 2172 if ((nbr_pending == 0) && (exit_condition == 0))
2173 exit_condition = 1; 2173 exit_condition = 1;
2174 } while ((exit_condition == 0) && i--); 2174 } while ((exit_condition == 0) && i--);
2175 2175
2176 if (exit_condition == 1) { /* tune failed */ 2176 if (exit_condition == 1) { /* tune failed */
2177 dprintk("tune failed"); 2177 dprintk("tune failed");
2178 return 0; 2178 return 0;
2179 } 2179 }
2180 2180
2181 dprintk("tune success on frontend%i", index_frontend_success); 2181 dprintk("tune success on frontend%i", index_frontend_success);
2182 2182
2183 dib8000_get_frontend(fe, fep); 2183 dib8000_get_frontend(fe, fep);
2184 } 2184 }
2185 2185
2186 for (index_frontend = 0, ret = 0; (ret >= 0) && (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++) 2186 for (index_frontend = 0, ret = 0; (ret >= 0) && (index_frontend < MAX_NUMBER_OF_FRONTENDS) && (state->fe[index_frontend] != NULL); index_frontend++)
2187 ret = dib8000_tune(state->fe[index_frontend]); 2187 ret = dib8000_tune(state->fe[index_frontend]);