diff options
author | Manu Abraham <abraham.manu@gmail.com> | 2007-10-30 19:46:49 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 17:53:20 -0200 |
commit | b168e351a50086e582d3cb42eb4336387ce1ddab (patch) | |
tree | e5ac1d69611c5ec81fc122f32229302d3ced6d50 /drivers/media/dvb/frontends/stb0899_drv.c | |
parent | 947881a999e8bcde98c9cb637316cb8026af4f71 (diff) |
V4L/DVB (9435): Add post process interfaces
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/stb0899_drv.c')
-rw-r--r-- | drivers/media/dvb/frontends/stb0899_drv.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/stb0899_drv.c b/drivers/media/dvb/frontends/stb0899_drv.c index 9f5254aee39..0b1d9447663 100644 --- a/drivers/media/dvb/frontends/stb0899_drv.c +++ b/drivers/media/dvb/frontends/stb0899_drv.c @@ -580,11 +580,35 @@ static void stb0899_set_mclk(struct stb0899_state *state, u32 Mclk) dprintk(verbose, FE_DEBUG, 1, "MasterCLOCK=%d", internal->master_clk); } +static int stb0899_postproc(struct stb0899_state *state, u8 ctl, int enable) +{ + struct stb0899_config *config = state->config; + struct stb0899_postproc *postproc = config->postproc; + + /* post process event */ + if (postproc) { + if (enable) { + if (postproc[STB0899_POSTPROC_GPIO_POWER].level == STB0899_GPIOPULLUP) + stb0899_write_reg(state, postproc[ctl].gpio, 0x02); + else + stb0899_write_reg(state, postproc[ctl].gpio, 0x82); + } else { + if (postproc[STB0899_POSTPROC_GPIO_POWER].level == STB0899_GPIOPULLUP) + stb0899_write_reg(state, postproc[ctl].gpio, 0x82); + else + stb0899_write_reg(state, postproc[ctl].gpio, 0x02); + } + } + return 0; +} + static void stb0899_release(struct dvb_frontend *fe) { struct stb0899_state *state = fe->demodulator_priv; dprintk(verbose, FE_DEBUG, 1, "Release Frontend"); + /* post process event */ + stb0899_postproc(state, STB0899_POSTPROC_GPIO_POWER, 0); kfree(state); } @@ -839,6 +863,9 @@ static int stb0899_sleep(struct dvb_frontend *fe) u8 reg; dprintk(verbose, FE_DEBUG, 1, "Going to Sleep .. (Really tired .. :-))"); + /* post process event */ + stb0899_postproc(state, STB0899_POSTPROC_GPIO_POWER, 0); + return 0; } @@ -855,6 +882,9 @@ static int stb0899_wakeup(struct dvb_frontend *fe) if ((rc = stb0899_write_reg(state, STB0899_STOPCLK2, 0x00))) return rc; + /* post process event */ + stb0899_postproc(state, STB0899_POSTPROC_GPIO_POWER, 1); + return 0; } @@ -1050,6 +1080,8 @@ static int stb0899_read_status(struct dvb_frontend *fe, enum fe_status *status) if (STB0899_GETFIELD(VITCURPUN, reg)) { dprintk(state->verbose, FE_DEBUG, 1, "--------> FE_HAS_VITERBI | FE_HAS_SYNC"); *status |= FE_HAS_VITERBI | FE_HAS_SYNC; + /* post process event */ + stb0899_postproc(state, STB0899_POSTPROC_GPIO_LOCK, 1); } } } @@ -1079,6 +1111,8 @@ static int stb0899_read_status(struct dvb_frontend *fe, enum fe_status *status) *status |= FE_HAS_SYNC; dprintk(state->verbose, FE_DEBUG, 1, "Packet Delineator found SYNC ! -----> DVB-S2 FE_HAS_SYNC"); + /* post process event */ + stb0899_postproc(state, STB0899_POSTPROC_GPIO_LOCK, 1); } } } |