diff options
author | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-04 14:15:27 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-07 09:55:04 -0300 |
commit | 34ba2e65bab3693cdd7c2ee0b8ba6477bd8c366b (patch) | |
tree | 682c7aa85afe648a38bb7fec5a6b0849948640b6 /drivers/media | |
parent | ff792c85e60727e66774eb3da8129298690eab0c (diff) | |
download | linux-34ba2e65bab3693cdd7c2ee0b8ba6477bd8c366b.tar.gz linux-34ba2e65bab3693cdd7c2ee0b8ba6477bd8c366b.tar.bz2 linux-34ba2e65bab3693cdd7c2ee0b8ba6477bd8c366b.zip |
[media] dib8000: Fix handling of interleave bigger than 2
If interleave is bigger than 2, the code will set it to 0, as
dib8000 registers use a log2(). So, change the code to handle
it accordingly.
Acked-By: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb-frontends/dib8000.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/dvb-frontends/dib8000.c b/drivers/media/dvb-frontends/dib8000.c index 270a58e3e837..78ccbe13d189 100644 --- a/drivers/media/dvb-frontends/dib8000.c +++ b/drivers/media/dvb-frontends/dib8000.c @@ -2033,9 +2033,8 @@ static u16 dib8000_set_layer(struct dib8000_state *state, u8 layer_index, u16 ma break; } - if ((c->layer[layer_index].interleaving > 0) && ((c->layer[layer_index].interleaving <= 3) || (c->layer[layer_index].interleaving == 4 && c->isdbt_sb_mode == 1))) - time_intlv = c->layer[layer_index].interleaving; - else + time_intlv = fls(c->layer[layer_index].interleaving); + if (time_intlv > 3 && !(time_intlv == 4 && c->isdbt_sb_mode == 1)) time_intlv = 0; dib8000_write_word(state, 2 + layer_index, (constellation << 10) | ((c->layer[layer_index].segment_count & 0xf) << 6) | (cr << 3) | time_intlv); |