summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends/m88rs2000.c
diff options
context:
space:
mode:
authorMalcolm Priestley <tvboxspy@gmail.com>2013-12-28 18:02:44 +0100
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-01-07 12:40:04 +0100
commit49c44802a79ca558c78d9b86f4c1ff6bb5ba0208 (patch)
treeab6fc5ccd65e2da14653714cde6bf8520a76b5a4 /drivers/media/dvb-frontends/m88rs2000.c
parent[media] m88rs2000: correct read status lock value (diff)
downloadlinux-49c44802a79ca558c78d9b86f4c1ff6bb5ba0208.tar.xz
linux-49c44802a79ca558c78d9b86f4c1ff6bb5ba0208.zip
[media] m88rs2000: Correct m88rs2000_set_fec settings
Register 0x70 is used to set fec, register 0x76 is used to get fec Register 0x76 is set to 0x8. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/m88rs2000.c')
-rw-r--r--drivers/media/dvb-frontends/m88rs2000.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/media/dvb-frontends/m88rs2000.c b/drivers/media/dvb-frontends/m88rs2000.c
index f9d04db7275c..002b109d9383 100644
--- a/drivers/media/dvb-frontends/m88rs2000.c
+++ b/drivers/media/dvb-frontends/m88rs2000.c
@@ -541,33 +541,38 @@ static int m88rs2000_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
static int m88rs2000_set_fec(struct m88rs2000_state *state,
fe_code_rate_t fec)
{
- u16 fec_set;
+ u8 fec_set, reg;
+ int ret;
+
switch (fec) {
- /* This is not confirmed kept for reference */
-/* case FEC_1_2:
- fec_set = 0x88;
+ case FEC_1_2:
+ fec_set = 0x8;
break;
case FEC_2_3:
- fec_set = 0x68;
+ fec_set = 0x10;
break;
case FEC_3_4:
- fec_set = 0x48;
+ fec_set = 0x20;
break;
case FEC_5_6:
- fec_set = 0x28;
+ fec_set = 0x40;
break;
case FEC_7_8:
- fec_set = 0x18;
- break; */
+ fec_set = 0x80;
+ break;
case FEC_AUTO:
default:
- fec_set = 0x08;
+ fec_set = 0x0;
}
- m88rs2000_writereg(state, 0x76, fec_set);
- return 0;
-}
+ reg = m88rs2000_readreg(state, 0x70);
+ reg &= 0x7;
+ ret = m88rs2000_writereg(state, 0x70, reg | fec_set);
+ ret |= m88rs2000_writereg(state, 0x76, 0x8);
+
+ return ret;
+}
static fe_code_rate_t m88rs2000_get_fec(struct m88rs2000_state *state)
{
@@ -650,12 +655,8 @@ static int m88rs2000_set_frontend(struct dvb_frontend *fe)
if (ret < 0)
return -ENODEV;
- /* Unknown */
- reg = m88rs2000_readreg(state, 0x70);
- ret = m88rs2000_writereg(state, 0x70, reg);
-
/* Set FEC */
- ret |= m88rs2000_set_fec(state, c->fec_inner);
+ ret = m88rs2000_set_fec(state, c->fec_inner);
ret |= m88rs2000_writereg(state, 0x85, 0x1);
ret |= m88rs2000_writereg(state, 0x8a, 0xbf);
ret |= m88rs2000_writereg(state, 0x8d, 0x1e);