diff options
author | Shuah Khan <shuah.kh@samsung.com> | 2014-07-24 16:29:28 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-26 10:22:51 -0400 |
commit | b601fe5688ae285693c64e833003c14acb38378a (patch) | |
tree | cd007c68b19b2611e335cfae223e25f211bd88f1 | |
parent | 30741871117e2be45a4ae26f0507004e5494f75c (diff) |
[media] media: drx39xyj - use drxj_set_lna_state() and remove duplicate LNA code
drx39xxj_set_lna() and drx39xxj_set_frontend() set LNA. Instead of
duplicating LNA configure code, change to use drxj_set_lna_state()
which sets LNA to the caller requested state (on or off).
Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/media/dvb-frontends/drx39xyj/drxj.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c index bcf0a23be878..200554d5f32c 100644 --- a/drivers/media/dvb-frontends/drx39xyj/drxj.c +++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c | |||
@@ -12154,13 +12154,7 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe) | |||
12154 | return -EINVAL; | 12154 | return -EINVAL; |
12155 | } | 12155 | } |
12156 | /* Just for giggles, let's shut off the LNA again.... */ | 12156 | /* Just for giggles, let's shut off the LNA again.... */ |
12157 | uio_data.uio = DRX_UIO1; | 12157 | drxj_set_lna_state(demod, false); |
12158 | uio_data.value = false; | ||
12159 | result = ctrl_uio_write(demod, &uio_data); | ||
12160 | if (result != 0) { | ||
12161 | pr_err("Failed to disable LNA!\n"); | ||
12162 | return 0; | ||
12163 | } | ||
12164 | 12158 | ||
12165 | /* After set_frontend, except for strength, stats aren't available */ | 12159 | /* After set_frontend, except for strength, stats aren't available */ |
12166 | p->strength.stat[0].scale = FE_SCALE_RELATIVE; | 12160 | p->strength.stat[0].scale = FE_SCALE_RELATIVE; |
@@ -12243,26 +12237,7 @@ static int drx39xxj_set_lna(struct dvb_frontend *fe) | |||
12243 | } | 12237 | } |
12244 | } | 12238 | } |
12245 | 12239 | ||
12246 | /* Turn off the LNA */ | 12240 | return drxj_set_lna_state(demod, c->lna); |
12247 | uio_cfg.uio = DRX_UIO1; | ||
12248 | uio_cfg.mode = DRX_UIO_MODE_READWRITE; | ||
12249 | /* Configure user-I/O #3: enable read/write */ | ||
12250 | result = ctrl_set_uio_cfg(demod, &uio_cfg); | ||
12251 | if (result) { | ||
12252 | pr_err("Failed to setup LNA GPIO!\n"); | ||
12253 | return result; | ||
12254 | } | ||
12255 | |||
12256 | uio_data.uio = DRX_UIO1; | ||
12257 | uio_data.value = c->lna; | ||
12258 | result = ctrl_uio_write(demod, &uio_data); | ||
12259 | if (result != 0) { | ||
12260 | pr_err("Failed to %sable LNA!\n", | ||
12261 | c->lna ? "en" : "dis"); | ||
12262 | return result; | ||
12263 | } | ||
12264 | |||
12265 | return 0; | ||
12266 | } | 12241 | } |
12267 | 12242 | ||
12268 | static int drx39xxj_get_tune_settings(struct dvb_frontend *fe, | 12243 | static int drx39xxj_get_tune_settings(struct dvb_frontend *fe, |