From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753557AbdDLJIn (ORCPT ); Wed, 12 Apr 2017 05:08:43 -0400 Received: from esa1.microchip.iphmx.com ([68.232.147.91]:47004 "EHLO esa1.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752770AbdDLJIk (ORCPT ); Wed, 12 Apr 2017 05:08:40 -0400 X-IronPort-AV: E=Sophos;i="5.37,189,1488870000"; d="scan'208";a="1466166" Subject: Re: [PATCH 2/2] spi: atmel: add PM support to SAMA5D2 To: Quentin Schulz , References: <20170412070520.29621-1-quentin.schulz@free-electrons.com> <20170412070520.29621-2-quentin.schulz@free-electrons.com> CC: , , , From: Nicolas Ferre Organization: microchip Message-ID: <30f4f62b-6fa0-bfd8-a855-8c394fba654b@microchip.com> Date: Wed, 12 Apr 2017 11:08:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170412070520.29621-2-quentin.schulz@free-electrons.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 12/04/2017 à 09:05, Quentin Schulz a écrit : > This adds PM support to the ATMEL SAMA5D2 Xplained. Well not only for this board. The Backup+Self-Refresh PM state is available for all boards using the SAMA5D2 SoC (and beyond)... > When suspending, VDDCore is shut down and the SPI registers are lost. Yes, but only on sama5d2 and only if the Backup+Self-Refresh (or deepest PM state on sama5d2). > Thus, the SPI controller needs to be re-initialized after resuming from > a system suspend. > > Signed-off-by: Quentin Schulz I'm okay with the core of the patch but would prefer a modified commit message. Best regards, > --- > drivers/spi/spi-atmel.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c > index 247d920..1eb83c9 100644 > --- a/drivers/spi/spi-atmel.c > +++ b/drivers/spi/spi-atmel.c > @@ -1702,8 +1702,17 @@ static int atmel_spi_suspend(struct device *dev) > static int atmel_spi_resume(struct device *dev) > { > struct spi_master *master = dev_get_drvdata(dev); > + struct atmel_spi *as = spi_master_get_devdata(master); > int ret; > > + ret = clk_prepare_enable(as->clk); > + if (ret) > + return ret; > + > + atmel_spi_init(as); > + > + clk_disable_unprepare(as->clk); > + > if (!pm_runtime_suspended(dev)) { > ret = atmel_spi_runtime_resume(dev); > if (ret) > -- Nicolas Ferre From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Ferre Subject: Re: [PATCH 2/2] spi: atmel: add PM support to SAMA5D2 Date: Wed, 12 Apr 2017 11:08:50 +0200 Message-ID: <30f4f62b-6fa0-bfd8-a855-8c394fba654b@microchip.com> References: <20170412070520.29621-1-quentin.schulz@free-electrons.com> <20170412070520.29621-2-quentin.schulz@free-electrons.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit Cc: , , , To: Quentin Schulz , Return-path: In-Reply-To: <20170412070520.29621-2-quentin.schulz-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Le 12/04/2017 à 09:05, Quentin Schulz a écrit : > This adds PM support to the ATMEL SAMA5D2 Xplained. Well not only for this board. The Backup+Self-Refresh PM state is available for all boards using the SAMA5D2 SoC (and beyond)... > When suspending, VDDCore is shut down and the SPI registers are lost. Yes, but only on sama5d2 and only if the Backup+Self-Refresh (or deepest PM state on sama5d2). > Thus, the SPI controller needs to be re-initialized after resuming from > a system suspend. > > Signed-off-by: Quentin Schulz I'm okay with the core of the patch but would prefer a modified commit message. Best regards, > --- > drivers/spi/spi-atmel.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c > index 247d920..1eb83c9 100644 > --- a/drivers/spi/spi-atmel.c > +++ b/drivers/spi/spi-atmel.c > @@ -1702,8 +1702,17 @@ static int atmel_spi_suspend(struct device *dev) > static int atmel_spi_resume(struct device *dev) > { > struct spi_master *master = dev_get_drvdata(dev); > + struct atmel_spi *as = spi_master_get_devdata(master); > int ret; > > + ret = clk_prepare_enable(as->clk); > + if (ret) > + return ret; > + > + atmel_spi_init(as); > + > + clk_disable_unprepare(as->clk); > + > if (!pm_runtime_suspended(dev)) { > ret = atmel_spi_runtime_resume(dev); > if (ret) > -- Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html