On Sat, Sep 12, 2009 at 10:50 AM, David Ellingsworth <david@xxxxxxxxxxxxxxxxx> wrote: > From 31243088bd32d5568f06f2044f8ff782641e16b5 Mon Sep 17 00:00:00 2001 > From: David Ellingsworth <david@xxxxxxxxxxxxxxxxx> > Date: Sat, 12 Sep 2009 02:05:57 -0400 > Subject: [PATCH 09/10] mr800: preserve radio state during suspend/resume > > Signed-off-by: David Ellingsworth <david@xxxxxxxxxxxxxxxxx> > --- > drivers/media/radio/radio-mr800.c | 17 +++++++++++------ > 1 files changed, 11 insertions(+), 6 deletions(-) > > diff --git a/drivers/media/radio/radio-mr800.c > b/drivers/media/radio/radio-mr800.c > index 11db6ea..10bed62 100644 > --- a/drivers/media/radio/radio-mr800.c > +++ b/drivers/media/radio/radio-mr800.c > @@ -574,9 +574,12 @@ static int usb_amradio_suspend(struct usb_interface > *intf, pm_message_t message) > > mutex_lock(&radio->lock); > > - retval = amradio_set_mute(radio, AMRADIO_STOP); > - if (retval < 0) > - dev_warn(&intf->dev, "amradio_stop failed\n"); > + if (!radio->muted) { > + retval = amradio_set_mute(radio, AMRADIO_STOP); > + if (retval < 0) > + dev_warn(&intf->dev, "amradio_stop failed\n"); > + radio->muted = 0; > + } > > dev_info(&intf->dev, "going into suspend..\n"); > > @@ -592,9 +595,11 @@ static int usb_amradio_resume(struct usb_interface > *intf) > > mutex_lock(&radio->lock); > > - retval = amradio_set_mute(radio, AMRADIO_START); > - if (retval < 0) > - dev_warn(&intf->dev, "amradio_start failed\n"); > + if (!radio->muted) { > + retval = amradio_set_mute(radio, AMRADIO_START); > + if (retval < 0) > + dev_warn(&intf->dev, "amradio_start failed\n"); > + } > > dev_info(&intf->dev, "coming out of suspend..\n"); > > -- > 1.6.3.3 > > I'm going to rework this patch as well. I think the driver needs to do more than just turn the radio back on. It should also restore the set frequency and stereo mode. Regards, David Ellingsworth -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html