aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/stb0899_drv.c
diff options
context:
space:
mode:
authorManu Abraham <abraham.manu@gmail.com>2007-10-30 18:46:49 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:20 -0500
commitb168e351a50086e582d3cb42eb4336387ce1ddab (patch)
treee5ac1d69611c5ec81fc122f32229302d3ced6d50 /drivers/media/dvb/frontends/stb0899_drv.c
parent947881a999e8bcde98c9cb637316cb8026af4f71 (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.c34
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)
580 dprintk(verbose, FE_DEBUG, 1, "MasterCLOCK=%d", internal->master_clk); 580 dprintk(verbose, FE_DEBUG, 1, "MasterCLOCK=%d", internal->master_clk);
581} 581}
582 582
583static int stb0899_postproc(struct stb0899_state *state, u8 ctl, int enable)
584{
585 struct stb0899_config *config = state->config;
586 struct stb0899_postproc *postproc = config->postproc;
587
588 /* post process event */
589 if (postproc) {
590 if (enable) {
591 if (postproc[STB0899_POSTPROC_GPIO_POWER].level == STB0899_GPIOPULLUP)
592 stb0899_write_reg(state, postproc[ctl].gpio, 0x02);
593 else
594 stb0899_write_reg(state, postproc[ctl].gpio, 0x82);
595 } else {
596 if (postproc[STB0899_POSTPROC_GPIO_POWER].level == STB0899_GPIOPULLUP)
597 stb0899_write_reg(state, postproc[ctl].gpio, 0x82);
598 else
599 stb0899_write_reg(state, postproc[ctl].gpio, 0x02);
600 }
601 }
602 return 0;
603}
604
583static void stb0899_release(struct dvb_frontend *fe) 605static void stb0899_release(struct dvb_frontend *fe)
584{ 606{
585 struct stb0899_state *state = fe->demodulator_priv; 607 struct stb0899_state *state = fe->demodulator_priv;
586 608
587 dprintk(verbose, FE_DEBUG, 1, "Release Frontend"); 609 dprintk(verbose, FE_DEBUG, 1, "Release Frontend");
610 /* post process event */
611 stb0899_postproc(state, STB0899_POSTPROC_GPIO_POWER, 0);
588 kfree(state); 612 kfree(state);
589} 613}
590 614
@@ -839,6 +863,9 @@ static int stb0899_sleep(struct dvb_frontend *fe)
839 u8 reg; 863 u8 reg;
840 864
841 dprintk(verbose, FE_DEBUG, 1, "Going to Sleep .. (Really tired .. :-))"); 865 dprintk(verbose, FE_DEBUG, 1, "Going to Sleep .. (Really tired .. :-))");
866 /* post process event */
867 stb0899_postproc(state, STB0899_POSTPROC_GPIO_POWER, 0);
868
842 return 0; 869 return 0;
843} 870}
844 871
@@ -855,6 +882,9 @@ static int stb0899_wakeup(struct dvb_frontend *fe)
855 if ((rc = stb0899_write_reg(state, STB0899_STOPCLK2, 0x00))) 882 if ((rc = stb0899_write_reg(state, STB0899_STOPCLK2, 0x00)))
856 return rc; 883 return rc;
857 884
885 /* post process event */
886 stb0899_postproc(state, STB0899_POSTPROC_GPIO_POWER, 1);
887
858 return 0; 888 return 0;
859} 889}
860 890
@@ -1050,6 +1080,8 @@ static int stb0899_read_status(struct dvb_frontend *fe, enum fe_status *status)
1050 if (STB0899_GETFIELD(VITCURPUN, reg)) { 1080 if (STB0899_GETFIELD(VITCURPUN, reg)) {
1051 dprintk(state->verbose, FE_DEBUG, 1, "--------> FE_HAS_VITERBI | FE_HAS_SYNC"); 1081 dprintk(state->verbose, FE_DEBUG, 1, "--------> FE_HAS_VITERBI | FE_HAS_SYNC");
1052 *status |= FE_HAS_VITERBI | FE_HAS_SYNC; 1082 *status |= FE_HAS_VITERBI | FE_HAS_SYNC;
1083 /* post process event */
1084 stb0899_postproc(state, STB0899_POSTPROC_GPIO_LOCK, 1);
1053 } 1085 }
1054 } 1086 }
1055 } 1087 }
@@ -1079,6 +1111,8 @@ static int stb0899_read_status(struct dvb_frontend *fe, enum fe_status *status)
1079 *status |= FE_HAS_SYNC; 1111 *status |= FE_HAS_SYNC;
1080 dprintk(state->verbose, FE_DEBUG, 1, 1112 dprintk(state->verbose, FE_DEBUG, 1,
1081 "Packet Delineator found SYNC ! -----> DVB-S2 FE_HAS_SYNC"); 1113 "Packet Delineator found SYNC ! -----> DVB-S2 FE_HAS_SYNC");
1114 /* post process event */
1115 stb0899_postproc(state, STB0899_POSTPROC_GPIO_LOCK, 1);
1082 } 1116 }
1083 } 1117 }
1084 } 1118 }