From patchwork Tue Apr 21 15:01:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 6249591 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 136609F313 for ; Tue, 21 Apr 2015 15:00:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B123202AE for ; Tue, 21 Apr 2015 15:00:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5DE4A20142 for ; Tue, 21 Apr 2015 15:00:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755314AbbDUPAH (ORCPT ); Tue, 21 Apr 2015 11:00:07 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:35210 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755237AbbDUPAD (ORCPT ); Tue, 21 Apr 2015 11:00:03 -0400 Received: by pdbqd1 with SMTP id qd1so244534891pdb.2; Tue, 21 Apr 2015 08:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=tSqBwo9Fz14uZM/TVEM3Xi/rxC6viQzo6L9c449Zelg=; b=DihuOtJ1IlpOeWjXx8p0vihNf55wgQl/CxFDV0mCu55TH0bktbe9AbI05yOsm+s0FS dajvZwx+T2ezCdEiJ3HFy5v6G4t9Vhccm0mCgC34dDTwkThgdFS1Dxbjuyj07z9FzfRR YQM0pPc4lU1N8aEmQYUGvp5R76uhiVUKHT+TvK/dPOpJ/TzJ0EqIl6OyrsJ//5i5tjAT saA80euX8WkaLMn6wJ2/HFGVmMdmhlk7TsaGfE02Im52oEnevor8wtP6Xmq4S31TcbP+ 9rnyH+0H2RFRm8ZVk9KxLs97yf1A5SG3A0TVcdQ5FMXWICFPG83qqFY2/viAaQZh+RSq Ov+Q== X-Received: by 10.68.88.196 with SMTP id bi4mr38650125pbb.130.1429628402091; Tue, 21 Apr 2015 08:00:02 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by mx.google.com with ESMTPSA id k4sm2338324pdk.7.2015.04.21.07.59.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Apr 2015 08:00:00 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: jason@lakedaemon.net, geert+renesas@glider.be, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, horms@verge.net.au, Magnus Damm , tglx@linutronix.de Date: Wed, 22 Apr 2015 00:01:37 +0900 Message-Id: <20150421150137.14288.45064.sendpatchset@little-apple> In-Reply-To: <20150421150115.14288.88519.sendpatchset@little-apple> References: <20150421150115.14288.88519.sendpatchset@little-apple> Subject: [PATCH/RFC 02/03] irqchip: renesas-irqc: Add fine grained Runtime PM code Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Convert Runtime PM support from coarse grained "always enabled" into more fine grained per-interrupt optional enablement. Signed-off-by: Magnus Damm --- drivers/irqchip/irq-renesas-irqc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0002/drivers/irqchip/irq-renesas-irqc.c +++ work/drivers/irqchip/irq-renesas-irqc.c 2015-04-21 23:16:17.686370138 +0900 @@ -96,12 +96,18 @@ static void irqc_irq_mask(struct irq_dat static void irqc_irq_enable(struct irq_data *d) { + struct irqc_priv *p = irq_data_get_irq_chip_data(d); + + pm_runtime_get_sync(&p->pdev->dev); irqc_irq_unmask(d); } static void irqc_irq_disable(struct irq_data *d) { + struct irqc_priv *p = irq_data_get_irq_chip_data(d); + irqc_irq_mask(d); + pm_runtime_put(&p->pdev->dev); } static unsigned char irqc_sense[IRQ_TYPE_SENSE_MASK + 1] = { @@ -124,10 +130,12 @@ static int irqc_irq_set_type(struct irq_ if (!value) return -EINVAL; + pm_runtime_get_sync(&p->pdev->dev); tmp = ioread32(p->iomem + IRQC_CONFIG(hw_irq)); tmp &= ~0x3f; tmp |= value; iowrite32(tmp, p->iomem + IRQC_CONFIG(hw_irq)); + pm_runtime_put(&p->pdev->dev); return 0; } @@ -215,7 +223,6 @@ static int irqc_probe(struct platform_de } pm_runtime_enable(&pdev->dev); - pm_runtime_get_sync(&pdev->dev); /* get hold of manadatory IOMEM */ io = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -300,7 +307,6 @@ err3: err2: iounmap(p->iomem); err1: - pm_runtime_put(&pdev->dev); pm_runtime_disable(&pdev->dev); kfree(p); err0: @@ -317,7 +323,6 @@ static int irqc_remove(struct platform_d irq_domain_remove(p->irq_domain); iounmap(p->iomem); - pm_runtime_put(&pdev->dev); pm_runtime_disable(&pdev->dev); kfree(p); return 0;