[media] dvb_frontend: implement suspend / resume
Move initial suspend / resume support from dvb_usb_v2 to dvb_frontend as it is dvb general feature that could be used all dvb devices. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Цей коміт міститься в:

зафіксовано
Mauro Carvalho Chehab

джерело
0898b95409
коміт
06bae1227a
@@ -307,15 +307,6 @@ void dvb_frontend_reinitialise(struct dvb_frontend *fe)
|
||||
}
|
||||
EXPORT_SYMBOL(dvb_frontend_reinitialise);
|
||||
|
||||
void dvb_frontend_retune(struct dvb_frontend *fe)
|
||||
{
|
||||
struct dvb_frontend_private *fepriv = fe->frontend_priv;
|
||||
|
||||
fepriv->state = FESTATE_RETUNE;
|
||||
dvb_frontend_wakeup(fe);
|
||||
}
|
||||
EXPORT_SYMBOL(dvb_frontend_retune);
|
||||
|
||||
static void dvb_frontend_swzigzag_update_delay(struct dvb_frontend_private *fepriv, int locked)
|
||||
{
|
||||
int q2;
|
||||
@@ -2448,6 +2439,44 @@ static const struct file_operations dvb_frontend_fops = {
|
||||
.llseek = noop_llseek,
|
||||
};
|
||||
|
||||
int dvb_frontend_suspend(struct dvb_frontend *fe)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
dev_dbg(fe->dvb->device, "%s: adap=%d fe=%d\n", __func__, fe->dvb->num,
|
||||
fe->id);
|
||||
|
||||
if (fe->ops.tuner_ops.sleep)
|
||||
ret = fe->ops.tuner_ops.sleep(fe);
|
||||
|
||||
if (fe->ops.sleep)
|
||||
ret = fe->ops.sleep(fe);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(dvb_frontend_suspend);
|
||||
|
||||
int dvb_frontend_resume(struct dvb_frontend *fe)
|
||||
{
|
||||
struct dvb_frontend_private *fepriv = fe->frontend_priv;
|
||||
int ret = 0;
|
||||
|
||||
dev_dbg(fe->dvb->device, "%s: adap=%d fe=%d\n", __func__, fe->dvb->num,
|
||||
fe->id);
|
||||
|
||||
if (fe->ops.init)
|
||||
ret = fe->ops.init(fe);
|
||||
|
||||
if (fe->ops.tuner_ops.init)
|
||||
ret = fe->ops.tuner_ops.init(fe);
|
||||
|
||||
fepriv->state = FESTATE_RETUNE;
|
||||
dvb_frontend_wakeup(fe);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(dvb_frontend_resume);
|
||||
|
||||
int dvb_register_frontend(struct dvb_adapter* dvb,
|
||||
struct dvb_frontend* fe)
|
||||
{
|
||||
|
@@ -418,7 +418,8 @@ extern int dvb_unregister_frontend(struct dvb_frontend *fe);
|
||||
extern void dvb_frontend_detach(struct dvb_frontend *fe);
|
||||
|
||||
extern void dvb_frontend_reinitialise(struct dvb_frontend *fe);
|
||||
extern void dvb_frontend_retune(struct dvb_frontend *fe);
|
||||
extern int dvb_frontend_suspend(struct dvb_frontend *fe);
|
||||
extern int dvb_frontend_resume(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);
|
||||
|
Посилання в новій задачі
Заблокувати користувача