Message ID | 1407494627-1555-3-git-send-email-m.chehab@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Aug 8, 2014 at 4:43 AM, Mauro Carvalho Chehab <m.chehab@samsung.com> wrote: > Trying to make au0828 to suspend can do very bad things, as > the polling Kthread is not handled. We should disable it > during suspend, only re-enabling it at resume. > > Still, analog and digital TV won't work, as we don't reinit > the settings at resume, but at least it won't hang. > > Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> > --- > drivers/media/usb/au0828/au0828-core.c | 32 ++++++++++++++++++++++++++++++-- > 1 file changed, 30 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c > index 56025e689442..eb5f2b1b182b 100644 > --- a/drivers/media/usb/au0828/au0828-core.c > +++ b/drivers/media/usb/au0828/au0828-core.c > @@ -285,13 +285,41 @@ static int au0828_usb_probe(struct usb_interface *interface, > return retval; > } > > +static int au0828_suspend(struct usb_interface *interface, > + pm_message_t message) > +{ > + struct au0828_dev *dev = usb_get_intfdata(interface); > + > + if (!dev) > + return 0; > + > + au0828_rc_suspend(dev); > + > + /* FIXME: should suspend also ATV/DTV */ > + > + return 0; > +} > + > +static int au0828_resume(struct usb_interface *interface) > +{ > + struct au0828_dev *dev = usb_get_intfdata(interface); > + if (!dev) > + return 0; > + > + au0828_rc_resume(dev); > + > + /* FIXME: should resume also ATV/DTV */ > + > + return 0; > +} > + > static struct usb_driver au0828_usb_driver = { > .name = DRIVER_NAME, > .probe = au0828_usb_probe, > .disconnect = au0828_usb_disconnect, > .id_table = au0828_usb_id_table, > - > - /* FIXME: Add suspend and resume functions */ > + .suspend = au0828_suspend, > + .resume = au0828_resume, > }; all the extensions will need suspend/resume hooks similar to em28xx would like me to take a look at that?? -- Shuah -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c index 56025e689442..eb5f2b1b182b 100644 --- a/drivers/media/usb/au0828/au0828-core.c +++ b/drivers/media/usb/au0828/au0828-core.c @@ -285,13 +285,41 @@ static int au0828_usb_probe(struct usb_interface *interface, return retval; } +static int au0828_suspend(struct usb_interface *interface, + pm_message_t message) +{ + struct au0828_dev *dev = usb_get_intfdata(interface); + + if (!dev) + return 0; + + au0828_rc_suspend(dev); + + /* FIXME: should suspend also ATV/DTV */ + + return 0; +} + +static int au0828_resume(struct usb_interface *interface) +{ + struct au0828_dev *dev = usb_get_intfdata(interface); + if (!dev) + return 0; + + au0828_rc_resume(dev); + + /* FIXME: should resume also ATV/DTV */ + + return 0; +} + static struct usb_driver au0828_usb_driver = { .name = DRIVER_NAME, .probe = au0828_usb_probe, .disconnect = au0828_usb_disconnect, .id_table = au0828_usb_id_table, - - /* FIXME: Add suspend and resume functions */ + .suspend = au0828_suspend, + .resume = au0828_resume, }; static int __init au0828_init(void)
Trying to make au0828 to suspend can do very bad things, as the polling Kthread is not handled. We should disable it during suspend, only re-enabling it at resume. Still, analog and digital TV won't work, as we don't reinit the settings at resume, but at least it won't hang. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> --- drivers/media/usb/au0828/au0828-core.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-)