From patchwork Sat Sep 12 14:50:08 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ellingsworth X-Patchwork-Id: 47080 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8CEoCuB027624 for ; Sat, 12 Sep 2009 14:50:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754648AbZILOuQ (ORCPT ); Sat, 12 Sep 2009 10:50:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754645AbZILOuQ (ORCPT ); Sat, 12 Sep 2009 10:50:16 -0400 Received: from qw-out-2122.google.com ([74.125.92.27]:15620 "EHLO qw-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754637AbZILOuO (ORCPT ); Sat, 12 Sep 2009 10:50:14 -0400 Received: by qw-out-2122.google.com with SMTP id 9so632979qwb.37 for ; Sat, 12 Sep 2009 07:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :reply-to:user-agent:mime-version:to:subject:content-type; bh=S0w56Ox0FS8Azba4VWUUgBOFyN+QLRfNNGhLfuxNXR8=; b=pTif/ezTqRbgnfk2VmUw58MmTmFYb8qNBuJ9swsz5pLiXbxzR/QhHxplqEaKDb9BiO gtmZb5OUCfMweyLu9WEv3UFSZbCLPL2EOEwlEvSpFOgIGhJboZMFM0PN6kSwJiVHlrSs dDLh6fpS6IQcbEPvo/2LcZ9ODx70cIFdnm1tc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:reply-to:user-agent:mime-version:to :subject:content-type; b=a4fASU7sxFWJsQilenwcwKWu5D0iwlWD83PxZ1cWkOtz1NpHbIz6lj5zLm30UuzFyj ARDsNfphXpm5GqOENWXw/1Vhz50W+Ofskfmb916xJOYHTKVrto7QdOhtzaSBfWDCFx1S V7KLCEjJfROawV4QhPHp5127TbANHXKEerOF4= Received: by 10.224.56.145 with SMTP id y17mr3767067qag.317.1252767017836; Sat, 12 Sep 2009 07:50:17 -0700 (PDT) Received: from ?192.168.10.110? (cpe-71-72-62-249.neo.res.rr.com [71.72.62.249]) by mx.google.com with ESMTPS id 4sm2017993qwe.25.2009.09.12.07.50.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 12 Sep 2009 07:50:17 -0700 (PDT) Message-ID: <4AABB520.9030805@gmail.com> Date: Sat, 12 Sep 2009 10:50:08 -0400 From: David Ellingsworth Reply-To: david@identd.dyndns.org User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090701) MIME-Version: 1.0 To: linux-media@vger.kernel.org, klimov.linux@gmail.com Subject: [RFC/RFT 09/10] radio-mr800: preserve radio state during suspend/resume Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From 31243088bd32d5568f06f2044f8ff782641e16b5 Mon Sep 17 00:00:00 2001 From: David Ellingsworth 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 --- drivers/media/radio/radio-mr800.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) @@ -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"); From 31243088bd32d5568f06f2044f8ff782641e16b5 Mon Sep 17 00:00:00 2001 From: David Ellingsworth 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 --- 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