diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-07-12 17:22:38 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-27 10:07:30 -0400 |
commit | 452a53a247d9181bb0ec07ce1def51769619e9d2 (patch) | |
tree | faab5dd402e9afbdd79a563666764978365a08b7 /drivers/media | |
parent | 2a83e4d5e40fd8eda3c04a5847f0876a4be9d45b (diff) |
V4L/DVB (8529): mxl5007t: enable _init and _sleep power management functionality
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/common/tuners/mxl5007t.c | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/drivers/media/common/tuners/mxl5007t.c b/drivers/media/common/tuners/mxl5007t.c index 80cfa9ba1dcf..f3b193ac6614 100644 --- a/drivers/media/common/tuners/mxl5007t.c +++ b/drivers/media/common/tuners/mxl5007t.c | |||
@@ -830,27 +830,53 @@ fail: | |||
830 | static int mxl5007t_init(struct dvb_frontend *fe) | 830 | static int mxl5007t_init(struct dvb_frontend *fe) |
831 | { | 831 | { |
832 | struct mxl5007t_state *state = fe->tuner_priv; | 832 | struct mxl5007t_state *state = fe->tuner_priv; |
833 | //int ret; | 833 | int ret; |
834 | u8 d; | ||
834 | 835 | ||
835 | mutex_lock(&state->lock); | 836 | mutex_lock(&state->lock); |
836 | /* do init */ | 837 | |
837 | //fail: | 838 | if (fe->ops.i2c_gate_ctrl) |
839 | fe->ops.i2c_gate_ctrl(fe, 1); | ||
840 | |||
841 | ret = mxl5007t_read_reg(state, 0x05, &d); | ||
842 | if (mxl_fail(ret)) | ||
843 | goto fail; | ||
844 | |||
845 | ret = mxl5007t_write_reg(state, 0x05, d | 0x01); | ||
846 | mxl_fail(ret); | ||
847 | fail: | ||
848 | if (fe->ops.i2c_gate_ctrl) | ||
849 | fe->ops.i2c_gate_ctrl(fe, 0); | ||
850 | |||
838 | mutex_unlock(&state->lock); | 851 | mutex_unlock(&state->lock); |
839 | 852 | ||
840 | return 0;//ret; | 853 | return ret; |
841 | } | 854 | } |
842 | 855 | ||
843 | static int mxl5007t_sleep(struct dvb_frontend *fe) | 856 | static int mxl5007t_sleep(struct dvb_frontend *fe) |
844 | { | 857 | { |
845 | struct mxl5007t_state *state = fe->tuner_priv; | 858 | struct mxl5007t_state *state = fe->tuner_priv; |
846 | //int ret; | 859 | int ret; |
860 | u8 d; | ||
847 | 861 | ||
848 | mutex_lock(&state->lock); | 862 | mutex_lock(&state->lock); |
849 | /* do standby */ | 863 | |
850 | //fail: | 864 | if (fe->ops.i2c_gate_ctrl) |
865 | fe->ops.i2c_gate_ctrl(fe, 1); | ||
866 | |||
867 | ret = mxl5007t_read_reg(state, 0x05, &d); | ||
868 | if (mxl_fail(ret)) | ||
869 | goto fail; | ||
870 | |||
871 | ret = mxl5007t_write_reg(state, 0x05, d & ~0x01); | ||
872 | mxl_fail(ret); | ||
873 | fail: | ||
874 | if (fe->ops.i2c_gate_ctrl) | ||
875 | fe->ops.i2c_gate_ctrl(fe, 0); | ||
876 | |||
851 | mutex_unlock(&state->lock); | 877 | mutex_unlock(&state->lock); |
852 | 878 | ||
853 | return 0;//ret; | 879 | return ret; |
854 | } | 880 | } |
855 | 881 | ||
856 | /* ------------------------------------------------------------------------- */ | 882 | /* ------------------------------------------------------------------------- */ |