Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3205209iob; Fri, 6 May 2022 22:30:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJ1vpU7hW3jOVKPYa8T649Y4iRDB9KMSbRxTEuAJbUFvsg8yV0k9q46Dbu31Q1ACDBo5B8 X-Received: by 2002:a05:6830:4ab:b0:606:2151:74d6 with SMTP id l11-20020a05683004ab00b00606215174d6mr2320428otd.322.1651901400082; Fri, 06 May 2022 22:30:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651901400; cv=none; d=google.com; s=arc-20160816; b=nG4xg/4vjowAr3bckSz+ZD5h/eB8fvMuYJc6B9XYYVpACaulY+3lT/yA/L4LBP3hCV jVaNiLiYSMETLVny2G6PI1DWPf30/yVrlezA0WbLFI8icnQOL9SfXcWEhDRF/dDNI/9P xGNsZlM9ll8NKsWzGMtF0MvADzmFoHvFj2TVynJZeXw6qEc93bBT/znE7coM3emHB2K1 6D/MZADpYn0sGt0ixl1HHMBrlgtj2/Ab4kEzhNry/8CYhxO/hPfLxtGA7pTueMCQXukW NKouTecYJNPXtF5dmH6gGay7qhfiucCdU97YmV2OWiTVx4gTnKNBg0xKOQcy34P0ZRDK HrUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=B7/awrMq8ptHu515E06FSFVcsH5aRD5n1ud0J2jAhGo=; b=gNd/wlLh3QOBOMlyZ17nqeDwn0HAwN0OUa7I7/ndLSVTRX4E0oHO8htfJEX/DHeTNS JT4ZkbpusqO/vxI557PpB26CtPRvaHg0wtCMsEyQ8Xor8SCHTt8xr1nsaz0nOLKrEIz+ L4L2GndOjndJI3SlG83i+u64lTWX3ZEeckVtTMFTQ7CqUWx1fKhg7nziI0AbAx0usOu0 jdoLRwLic7sqz2bbtMizzGOiBaxhxQ0lIdUx9XK+5UIvk2hic/nBVId1HBeOcCF5LtsG qzO/+fShmOT/v0R3aILiRnTipY1BHdZifYRCst3XoqgwvSzyHDMmXV50cFd0Xc6t90Hi OTIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=iWPgQHzJ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o84-20020acabe57000000b003225a2498basi4015376oif.244.2022.05.06.22.29.46; Fri, 06 May 2022 22:30:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=iWPgQHzJ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353195AbiEDQTP (ORCPT + 99 others); Wed, 4 May 2022 12:19:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353222AbiEDQSt (ORCPT ); Wed, 4 May 2022 12:18:49 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75CA046678 for ; Wed, 4 May 2022 09:15:10 -0700 (PDT) Date: Wed, 04 May 2022 16:15:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1651680909; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B7/awrMq8ptHu515E06FSFVcsH5aRD5n1ud0J2jAhGo=; b=iWPgQHzJIxlk+ssLKRcIkS1dU9HvYTcPk7Oc29RqbUC981nXOZh61Zp91b1BhGwppZc/0k FN2ErxxlBgYOvbHIzE1bvAfYYZORUznsl8/gQ8T5qQFvmmGHuGGWtwrYiE33V0Q4VQFvr0 i9kVNg+1Q2WspxvIYpLQOLki56DAqgH2r36fNPqHOlG6yFopRqbGGo7oBWptDXJhUxg338 9Ny/jqnlCG6z9RwpvXvME+BoE9ncydGVVX/dFVGVmH5eaBU8olBYTIp61xll8KYh6HQrNG g2e/WaiQs4VvCjJ/GmmXDysYCyI9KCHbPVFyAJOirKhoUPiq69gFMhmJihaCMg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1651680909; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B7/awrMq8ptHu515E06FSFVcsH5aRD5n1ud0J2jAhGo=; b=x+XO0WDOIhePhx9Azie1fcRRGWBIVeqTImgoezh3Dfd8vnosJnkDKkzQCTiXhNDU/eXwUV LanxLrtNcthJvCDw== From: "irqchip-bot for Lucas Stach" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/imx-irqsteer: Add runtime PM support Cc: Lucas Stach , Marc Zyngier , tglx@linutronix.de In-Reply-To: <20220406163701.1277930-2-l.stach@pengutronix.de> References: <20220406163701.1277930-2-l.stach@pengutronix.de> MIME-Version: 1.0 Message-ID: <165168090796.4207.16097445461269415468.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: 4730d2233311d86cad9dc510318d1b40e4b53cf2 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/4730d2233311d86cad9dc510318d1b40e4b53cf2 Author: Lucas Stach AuthorDate: Wed, 06 Apr 2022 18:37:01 +02:00 Committer: Marc Zyngier CommitterDate: Wed, 04 May 2022 16:44:51 +01:00 irqchip/imx-irqsteer: Add runtime PM support There are now SoCs that integrate the irqsteer controller within a separate power domain. In order to allow this domain to be powered down when not needed, add runtime PM support to the driver. Signed-off-by: Lucas Stach Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220406163701.1277930-2-l.stach@pengutronix.de --- drivers/irqchip/irq-imx-irqsteer.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-imx-irqsteer.c b/drivers/irqchip/irq-imx-irqsteer.c index e286e7c..96230a0 100644 --- a/drivers/irqchip/irq-imx-irqsteer.c +++ b/drivers/irqchip/irq-imx-irqsteer.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #define CTRL_STRIDE_OFF(_t, _r) (_t * 4 * _r) @@ -175,7 +176,7 @@ static int imx_irqsteer_probe(struct platform_device *pdev) data->irq_count = DIV_ROUND_UP(irqs_num, 64); data->reg_num = irqs_num / 32; - if (IS_ENABLED(CONFIG_PM_SLEEP)) { + if (IS_ENABLED(CONFIG_PM)) { data->saved_reg = devm_kzalloc(&pdev->dev, sizeof(u32) * data->reg_num, GFP_KERNEL); @@ -199,6 +200,7 @@ static int imx_irqsteer_probe(struct platform_device *pdev) ret = -ENOMEM; goto out; } + irq_domain_set_pm_device(data->domain, &pdev->dev); if (!data->irq_count || data->irq_count > CHAN_MAX_OUTPUT_INT) { ret = -EINVAL; @@ -219,6 +221,9 @@ static int imx_irqsteer_probe(struct platform_device *pdev) platform_set_drvdata(pdev, data); + pm_runtime_set_active(&pdev->dev); + pm_runtime_enable(&pdev->dev); + return 0; out: clk_disable_unprepare(data->ipg_clk); @@ -241,7 +246,7 @@ static int imx_irqsteer_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP +#ifdef CONFIG_PM static void imx_irqsteer_save_regs(struct irqsteer_data *data) { int i; @@ -288,7 +293,10 @@ static int imx_irqsteer_resume(struct device *dev) #endif static const struct dev_pm_ops imx_irqsteer_pm_ops = { - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(imx_irqsteer_suspend, imx_irqsteer_resume) + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) + SET_RUNTIME_PM_OPS(imx_irqsteer_suspend, + imx_irqsteer_resume, NULL) }; static const struct of_device_id imx_irqsteer_dt_ids[] = {