Received: by 2002:a17:90a:37e8:0:0:0:0 with SMTP id v95csp8818413pjb; Tue, 1 Oct 2019 04:42:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyAx4j0Bl6GZj8JT2CjnKUd1QCEahhYN7vuW3Hpo9xWnA+iHElUb4ILbsNP2J6WDiSlCmFX X-Received: by 2002:a17:906:1f12:: with SMTP id w18mr10078672ejj.224.1569930159724; Tue, 01 Oct 2019 04:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569930159; cv=none; d=google.com; s=arc-20160816; b=E/QXFE5kqbJ139pSsolwweFpyG4BeOE92pbMKehp5nKYiDopoWf7Bk8lUhthx3Iu3x VTF9ye3hh4SPfFQdMZiQXhensfZ9n9gdadaMsIeOq85gc1iD8M79jSW/DbdPiy7/eyz4 OLDQfSfvIw9fIdt9eBrggPWTLLaT/95nrmpCuoZSc7KJnAJOQyyel7VeHr3h73+Yl2BK GNqxYhyYpTZ/nQhok6UrFU76MmOgspCX7y+Kbiy8GceAW9VEIZZwt3W+EFjfE4Wqkt8a PKjtSQbWL4GdZS/+YtOZ9EiKEm/GOOzj8LbcDquqJbJ6I8GhHei5VXyn9dnuDkvoDwQW SgWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=IFeB5ECHHyQUSd0qbFzo9VI7arD5hh/X+75w2dLv8rE=; b=CP/a38EdWmtojKoKs4AflHgRufR4ugqmaURCiHcrUV/yZbp+RjiIvgKJCybpqjlApu xCwIeU08jXqgS5qs/OcjGG/10oFkypWQ/DO96HYe7MZ522TcxsGAdiL8ElQLMlhQ6isu ujmF6FPYTDcutDXrUaM/rpYCL3MzRixBRyRgquoZCBVeOIJCCx168X04+vTUDQQuIUnq XOeWor8Si7uaB0sO33jd0qfD3drW2ghcbGHMgIKhmFD37YutF3lohGudBKlFLFLhl6zG 8IKYI369/n4wyEMEeYPZIUjJEG8fD7tOoAboeQf0OVE0suGarqHHHwyNZ7AnDG9JI6Yi /SjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=XlziAkRb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v57si8547584edc.171.2019.10.01.04.42.15; Tue, 01 Oct 2019 04:42:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=XlziAkRb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387678AbfJALlR (ORCPT + 99 others); Tue, 1 Oct 2019 07:41:17 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:41152 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387627AbfJALlL (ORCPT ); Tue, 1 Oct 2019 07:41:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=IFeB5ECHHyQUSd0qbFzo9VI7arD5hh/X+75w2dLv8rE=; b=XlziAkRb2VbZ vGGcuzALH1pTD0p3EXQkSqfNZBHIJkZzUlAmT9zWtLsFMBcH9N2vRdWgj4PnRMlUsD0+eHsK1BKej AJEWzNlRG9de5fceemRshTItVBIPCaCvpz41ENz90CS0gd5dLMGWiGKgK/mkQNarD3HS4QZP9m0qI ePjN8=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=ypsilon.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iFGWi-0004ZB-1M; Tue, 01 Oct 2019 11:41:08 +0000 Received: by ypsilon.sirena.org.uk (Postfix, from userid 1000) id 79E5727429C0; Tue, 1 Oct 2019 12:41:07 +0100 (BST) From: Mark Brown To: Phil Edworthy Cc: Gareth Williams , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Mark Brown Subject: Applied "spi: dw: Add basic runtime PM support" to the spi tree In-Reply-To: <1568793876-9009-4-git-send-email-gareth.williams.jx@renesas.com> X-Patchwork-Hint: ignore Message-Id: <20191001114107.79E5727429C0@ypsilon.sirena.org.uk> Date: Tue, 1 Oct 2019 12:41:07 +0100 (BST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch spi: dw: Add basic runtime PM support has been applied to the spi tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-5.5 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 1e695983251029dc0b0fc516290077539df400ff Mon Sep 17 00:00:00 2001 From: Phil Edworthy Date: Wed, 18 Sep 2019 09:04:35 +0100 Subject: [PATCH] spi: dw: Add basic runtime PM support Enable runtime PM so that the clock used to access the registers in the peripheral is turned on using a clock domain. Signed-off-by: Phil Edworthy Signed-off-by: Gareth Williams Link: https://lore.kernel.org/r/1568793876-9009-4-git-send-email-gareth.williams.jx@renesas.com Signed-off-by: Mark Brown --- drivers/spi/spi-dw.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 9a49e073e8b7..54ed6eb3e252 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -493,10 +494,13 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) master->dev.of_node = dev->of_node; master->dev.fwnode = dev->fwnode; master->flags = SPI_MASTER_GPIO_SS; + master->auto_runtime_pm = true; if (dws->set_cs) master->set_cs = dws->set_cs; + pm_runtime_enable(dev); + /* Basic HW init */ spi_hw_init(dev, dws); @@ -525,6 +529,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) spi_enable_chip(dws, 0); free_irq(dws->irq, master); err_free_master: + pm_runtime_disable(dev); spi_controller_put(master); return ret; } @@ -539,6 +544,9 @@ void dw_spi_remove_host(struct dw_spi *dws) spi_shutdown_chip(dws); + if (dws->master) + pm_runtime_disable(&dws->master->dev); + free_irq(dws->irq, dws->master); } EXPORT_SYMBOL_GPL(dw_spi_remove_host); -- 2.20.1