From: Reinhard Nißl Date: Sun, 2 Jun 2013 18:01:18 +0000 (-0300) Subject: upstream: [media] stb0899: store autodetected inversion while tuning in non S2 mode X-Git-Tag: submit/tizen/20141121.110247~2265 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84b9b6a3d4ccab2c0fad4058ee572372826922af;p=platform%2Fkernel%2Flinux-3.10.git upstream: [media] stb0899: store autodetected inversion while tuning in non S2 mode In non S2 mode, the device is able to autodetect inversion. So let's store it for tuning to S2 transponders. Signed-off-by: Reinhard Nißl Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb-frontends/stb0899_algo.c b/drivers/media/dvb-frontends/stb0899_algo.c index 4b49efb..4ce542c 100644 --- a/drivers/media/dvb-frontends/stb0899_algo.c +++ b/drivers/media/dvb-frontends/stb0899_algo.c @@ -425,6 +425,14 @@ static enum stb0899_status stb0899_search_data(struct stb0899_state *state) if (internal->status == DATAOK) { stb0899_read_regs(state, STB0899_CFRM, cfr, 2); /* get derotator frequency */ + + /* store autodetected IQ swapping as default for DVB-S2 tuning */ + reg = stb0899_read_reg(state, STB0899_IQSWAP); + if (STB0899_GETFIELD(SYM, reg)) + internal->inversion = IQ_SWAP_ON; + else + internal->inversion = IQ_SWAP_OFF; + internal->derot_freq = state->config->inversion * MAKEWORD16(cfr[0], cfr[1]); dprintk(state->verbose, FE_DEBUG, 1, "------> DATAOK ! Derot Freq=%d", internal->derot_freq); }