From patchwork Mon Dec 24 09:51:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laxman Dewangan X-Patchwork-Id: 208046 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-gh0-f190.google.com (mail-gh0-f190.google.com [209.85.160.190]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 403AD2C008E for ; Mon, 24 Dec 2012 20:52:33 +1100 (EST) Received: by mail-gh0-f190.google.com with SMTP id 3sf2301445ghz.27 for ; Mon, 24 Dec 2012 01:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-received:x-beenthere:x-received:x-received:received-spf :x-pgp-universal:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=MvGfCFeG66qvec/HTJU5uPAULT+7b52Ange4/4uy1WI=; b=gXWZlntQSP1u/xDA5CLzSGvvUr0ZYdp2TSJuIatdQ/e6qcVd4YPkVdwTR36M5uZLR6 lmUlVujSdeQsEaVT3w4CPXguLyhwV7j4VBVR/TFNf3q6mD/jW3gXwt/XVnkrpMhMdOf1 mtFUJUWf+SS4ubhyvitcJPm7j1xTR/SQbR0lLH64hI/R1Pp7eLXLja+2WfsVoMW9K/7E 4pPH0T2wspw7RER8sV7kvzyhE6X0JJKs2j95Kgen5e9AQb4jbdVjwzwtBG4peOFmYote 6qAULPRMsmnXstJOMF9u2zyvxozWg6s2zaghUM1IuOKOqLIDJBaADd+gHqP1KYrdN+4K x2wg== X-Received: by 10.50.33.171 with SMTP id s11mr5560119igi.13.1356342750802; Mon, 24 Dec 2012 01:52:30 -0800 (PST) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.50.1.135 with SMTP id 7ls8399833igm.39.canary; Mon, 24 Dec 2012 01:52:30 -0800 (PST) X-Received: by 10.66.82.164 with SMTP id j4mr2802347pay.15.1356342750477; Mon, 24 Dec 2012 01:52:30 -0800 (PST) X-Received: by 10.66.82.164 with SMTP id j4mr2802346pay.15.1356342750465; Mon, 24 Dec 2012 01:52:30 -0800 (PST) Received: from hqemgate03.nvidia.com (hqemgate03.nvidia.com. [216.228.121.140]) by gmr-mx.google.com with ESMTPS id n8si4125222paz.2.2012.12.24.01.52.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Dec 2012 01:52:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of ldewangan@nvidia.com designates 216.228.121.140 as permitted sender) client-ip=216.228.121.140; Received: from hqnvupgp05.nvidia.com (Not Verified[216.228.121.13]) by hqemgate03.nvidia.com id ; Mon, 24 Dec 2012 01:55:23 -0800 Received: from hqemhub02.nvidia.com ([172.17.108.22]) by hqnvupgp05.nvidia.com (PGP Universal service); Mon, 24 Dec 2012 01:51:43 -0800 X-PGP-Universal: processed; by hqnvupgp05.nvidia.com on Mon, 24 Dec 2012 01:51:43 -0800 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by hqemhub02.nvidia.com (172.20.150.31) with Microsoft SMTP Server id 8.3.279.1; Mon, 24 Dec 2012 01:51:42 -0800 Received: from daphne.nvidia.com (Not Verified[172.16.212.96]) by hqnvemgw02.nvidia.com with MailMarshal (v6,7,2,8378) id ; Mon, 24 Dec 2012 01:51:42 -0800 Received: from ldewangan-ubuntu.nvidia.com ([10.19.65.30]) by daphne.nvidia.com (8.13.8+Sun/8.8.8) with ESMTP id qBO9pY8I007111; Mon, 24 Dec 2012 01:51:41 -0800 (PST) From: Laxman Dewangan To: CC: , , , , Laxman Dewangan Subject: [rtc-linux] [PATCH 2/4] rtc: tps65910: remove un-necessary irq stat save and restore Date: Mon, 24 Dec 2012 15:21:25 +0530 Message-ID: <1356342687-3432-3-git-send-email-ldewangan@nvidia.com> X-Mailer: git-send-email 1.7.1.1 In-Reply-To: <1356342687-3432-1-git-send-email-ldewangan@nvidia.com> References: <1356342687-3432-1-git-send-email-ldewangan@nvidia.com> MIME-Version: 1.0 X-Original-Sender: ldewangan@nvidia.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of ldewangan@nvidia.com designates 216.228.121.140 as permitted sender) smtp.mail=ldewangan@nvidia.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , The driver stores the interrupt enable register before going to suspend and restore in resume. Also it enables alarm before going to suspend. The driver only write the Interrupt enable register for enabling ALARM and does not enable any other bits. So it is not require to save complete register and enable ALARM interrupt before suspend and restore in resume. Also ALARM interrupt already enable if alarm is enabled before going to suspend and hence it is not require to enable explictly in suspend. Removing such above code. Signed-off-by: Laxman Dewangan --- drivers/rtc/rtc-tps65910.c | 21 ++------------------- 1 files changed, 2 insertions(+), 19 deletions(-) diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c index c637fff..728bb8b 100644 --- a/drivers/rtc/rtc-tps65910.c +++ b/drivers/rtc/rtc-tps65910.c @@ -28,8 +28,6 @@ struct tps65910_rtc { struct rtc_device *rtc; int irq; - /* To store the list of enabled interrupts */ - u32 irqstat; }; /* Total number of RTC registers needed to set time*/ @@ -309,35 +307,20 @@ static int __devexit tps65910_rtc_remove(struct platform_device *pdev) static int tps65910_rtc_suspend(struct device *dev) { - struct tps65910 *tps = dev_get_drvdata(dev->parent); struct tps65910_rtc *tps_rtc = dev_get_drvdata(dev); - u8 alarm = TPS65910_RTC_INTERRUPTS_IT_ALARM; - int ret; if (device_may_wakeup(dev)) enable_irq_wake(tps_rtc->irq); - - /* Store current list of enabled interrupts*/ - ret = regmap_read(tps->regmap, TPS65910_RTC_INTERRUPTS, - &tps->rtc->irqstat); - if (ret < 0) - return ret; - - /* Enable RTC ALARM interrupt only */ - return regmap_write(tps->regmap, TPS65910_RTC_INTERRUPTS, alarm); + return 0; } static int tps65910_rtc_resume(struct device *dev) { - struct tps65910 *tps = dev_get_drvdata(dev->parent); struct tps65910_rtc *tps_rtc = dev_get_drvdata(dev); if (device_may_wakeup(dev)) disable_irq_wake(tps_rtc->irq); - - /* Restore list of enabled interrupts before suspend */ - return regmap_write(tps->regmap, TPS65910_RTC_INTERRUPTS, - tps->rtc->irqstat); + return 0; } static const struct dev_pm_ops tps65910_rtc_pm_ops = {