[linux-dvb] [PATCH] function for checking if the dvb framework is idle

Markus Rechberger mrechberger at gmail.com
Tue Aug 14 13:45:20 CEST 2007


Could anyone comment or add this patch?

thanks,
Markus

On 8/9/07, Markus Rechberger <markus.rechberger at amd.com> wrote:
> Following patch adds the functionality to check if the dvb framework is
> idle or currently processing some commands.
>
> The return value of that function is true if fepriv->thread is set and
> false if not.
>
> This might become important for devices which supports video4linux
> (analogue TV) and digital TV. In case of a firmware reupload for a
> specific mode one framework has to be idle and should not interfere,
> this function adds the possibility for checking the current status of
> the DVB side.
>
> Signed-off-by: Markus Rechberger <markus.rechberger at amd.com>
>
> http://mcentral.de/~mrec/patches/dvb_frontend_eventstatus.diff
>
> diff -r cae47793b091 linux/drivers/media/dvb/dvb-core/dvb_frontend.c
> --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c    Tue Aug 07
> 10:52:55 2007 -0300
> +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c    Thu Aug 09
> 13:53:47 2007 +0200
> @@ -133,6 +133,25 @@ struct dvb_frontend_private {
>  };
>
>  static void dvb_frontend_wakeup(struct dvb_frontend *fe);
> +
> +int dvb_frontend_eventstatus(struct dvb_frontend *fe)
> +{
> +      struct dvb_frontend_private *fepriv = fe->frontend_priv;
> +      struct dvb_fe_events *events = &fepriv->events;
> +      int ret;
> +
> +      if (mutex_lock_interruptible (&events->mtx))
> +              return -EINTR;
> +
> +      ret = (fepriv->thread) ? true:false;
> +      mutex_unlock (&events->mtx);
> +
> +      return ret;
> +}
> +
> +
> +
> +EXPORT_SYMBOL(dvb_frontend_eventstatus);
>
>  static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t
> status)
>  {
> diff -r cae47793b091 linux/drivers/media/dvb/dvb-core/dvb_frontend.h
> --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.h    Tue Aug 07
> 10:52:55 2007 -0300
> +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.h    Thu Aug 09
> 13:52:26 2007 +0200
> @@ -170,6 +170,8 @@ extern void dvb_frontend_detach(struct d
>
>  extern void dvb_frontend_reinitialise(struct dvb_frontend *fe);
>
> +extern int dvb_frontend_eventstatus(struct dvb_frontend *fe);
> +
>  extern void dvb_frontend_sleep_until(struct timeval *waketime, u32
> add_usec);
>  extern s32 timeval_usec_diff(struct timeval lasttime, struct timeval
> curtime);
>
>
>
>
> _______________________________________________
> linux-dvb mailing list
> linux-dvb at linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
>


-- 
Markus Rechberger



More information about the linux-dvb mailing list