[linux-dvb] [patch/rfc] frontend powermanagement
Gerd Knorr
kraxel at bytesex.org
Tue Feb 15 17:29:44 CET 2005
Hi,
Coming back to $subject: Something like the patch below should work I
think, with dvb_{resume|suspend}_frontend() being called by the power
management functions of the adapter driver, i.e. cx88-dvb for example.
It's untested through. Comments?
Gerd
Index: linux-2.6.11-rc3/drivers/media/dvb/dvb-core/dvb_frontend.c
===================================================================
--- linux-2.6.11-rc3.orig/drivers/media/dvb/dvb-core/dvb_frontend.c 2005-02-04 11:23:37.000000000 +0100
+++ linux-2.6.11-rc3/drivers/media/dvb/dvb-core/dvb_frontend.c 2005-02-04 13:46:00.000000000 +0100
@@ -919,3 +919,24 @@ int dvb_unregister_frontend(struct dvb_f
return 0;
}
EXPORT_SYMBOL(dvb_unregister_frontend);
+
+void dvb_suspend_frontend(struct dvb_frontend* fe)
+{
+ if (fe->ops->sleep)
+ fe->ops->sleep(fe);
+}
+EXPORT_SYMBOL(dvb_suspend_frontend);
+
+void dvb_resume_frontend(struct dvb_frontend* fe)
+{
+ struct dvb_frontend_private *fepriv = fe->frontend_priv;
+
+ if (fe->ops->init)
+ fe->ops->init(fe);
+ fepriv->state = FESTATE_RETUNE;
+ dvb_frontend_wakeup(fe);
+ dvb_frontend_add_event (fe, 0);
+ fepriv->status = 0;
+}
+EXPORT_SYMBOL(dvb_resume_frontend);
+
Index: linux-2.6.11-rc3/drivers/media/dvb/dvb-core/dvb_frontend.h
===================================================================
--- linux-2.6.11-rc3.orig/drivers/media/dvb/dvb-core/dvb_frontend.h 2005-02-04 11:25:55.000000000 +0100
+++ linux-2.6.11-rc3/drivers/media/dvb/dvb-core/dvb_frontend.h 2005-02-04 13:43:20.000000000 +0100
@@ -122,5 +122,7 @@ extern int dvb_register_frontend(struct
struct dvb_frontend* fe);
extern int dvb_unregister_frontend(struct dvb_frontend* fe);
+extern void dvb_suspend_frontend(struct dvb_frontend* fe);
+extern void dvb_resume_frontend(struct dvb_frontend* fe);
#endif
More information about the linux-dvb
mailing list