diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2015-11-19 18:03:56 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-12-03 12:06:16 -0200 |
commit | eae56684a000f2be0f62a7cfd427376b1fb02538 (patch) | |
tree | 0d9353a41a1f4bb8b025f3fec7e1e1dd638e88bd /drivers | |
parent | a5293dbd7033b4d3bab63c21025f76d00a8a2585 (diff) |
[media] si2165: only write agc registers after reset before start_syncro
Datasheet says they must be rewritten after reset.
But it only makes sense to write them when trying to tune afterwards.
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb-frontends/si2165.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/media/dvb-frontends/si2165.c b/drivers/media/dvb-frontends/si2165.c index 222d7750f98d..07247e307f55 100644 --- a/drivers/media/dvb-frontends/si2165.c +++ b/drivers/media/dvb-frontends/si2165.c @@ -690,23 +690,6 @@ static int si2165_init(struct dvb_frontend *fe) goto error; } - /* write adc values after each reset*/ - ret = si2165_writereg8(state, 0x012a, 0x46); - if (ret < 0) - goto error; - ret = si2165_writereg8(state, 0x012c, 0x00); - if (ret < 0) - goto error; - ret = si2165_writereg8(state, 0x012e, 0x0a); - if (ret < 0) - goto error; - ret = si2165_writereg8(state, 0x012f, 0xff); - if (ret < 0) - goto error; - ret = si2165_writereg8(state, 0x0123, 0x70); - if (ret < 0) - goto error; - return 0; error: return ret; @@ -788,6 +771,14 @@ static int si2165_set_if_freq_shift(struct si2165_state *state, u32 IF) return si2165_writereg32(state, 0x00e8, reg_value); } +static const struct si2165_reg_value_pair agc_rewrite[] = { + { 0x012a, 0x46 }, + { 0x012c, 0x00 }, + { 0x012e, 0x0a }, + { 0x012f, 0xff }, + { 0x0123, 0x70 } +}; + static int si2165_set_frontend(struct dvb_frontend *fe) { int ret; @@ -924,6 +915,13 @@ static int si2165_set_frontend(struct dvb_frontend *fe) ret = si2165_writereg32(state, 0x0384, 0x00000000); if (ret < 0) return ret; + + /* write adc values after each reset*/ + ret = si2165_write_reg_list(state, agc_rewrite, + ARRAY_SIZE(agc_rewrite)); + if (ret < 0) + return ret; + /* start_synchro */ ret = si2165_writereg8(state, 0x02e0, 0x01); if (ret < 0) |