From patchwork Fri Sep 8 15:35:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Izard X-Patchwork-Id: 9944573 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D8DBA6035D for ; Fri, 8 Sep 2017 15:40:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8563287E7 for ; Fri, 8 Sep 2017 15:40:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD1C6287F8; Fri, 8 Sep 2017 15:40:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62D99287E7 for ; Fri, 8 Sep 2017 15:40:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756593AbdIHPj6 (ORCPT ); Fri, 8 Sep 2017 11:39:58 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37147 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756546AbdIHPgT (ORCPT ); Fri, 8 Sep 2017 11:36:19 -0400 Received: by mail-wm0-f66.google.com with SMTP id f4so1972259wmh.4; Fri, 08 Sep 2017 08:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZgQ0/Qh5f5QbU+VDEqyOpLBz/AqelVRfzse4RDneeD4=; b=S9+gqD8ywuZrkquhxtNxPxC2dF60FByurSqd/JEorJgwWeR0ZdsKn6SfR6Yxo26hdn sw56JQ0fYCOJwlIxGl0vMM9IoUfgSEegnSkyK/6IYfzAMhiFzPdpu8NcvYxHTNmN7xuQ TelqixI+2vm+SY91GQ2dyfnSH19HihwFtRwzWQUFJEj9yNaN4nmHjtDyE3ijmzeb52wn W5W+9OJGYRvAyfs49Qs+LUjgN6M5gdqdDajc/l7jSeTftuKIcS9eRR1dBkw5HLdzXQwn 7x1pKfonOHCJjgQD4gyCGFM9wlKzmW56CoTg9Kn2pwi5WMkpe1gOO3bob3Zua3Hv3aL+ 4hGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZgQ0/Qh5f5QbU+VDEqyOpLBz/AqelVRfzse4RDneeD4=; b=T+X13x7KaQDt0zUxMbha+Q0xuYF/Dn+iQm4jICATxjb3sbLcLWYXTO30nEHFfEvVWa KfVbbX4OJ9MYkQFlAaknteAdbrls+0BYOOsf3C2K9OGvxc2C/Pz8YcvIOWKHTeWan6PA lEMdGdQDMgX7BgyuYMv+rIXtmJuke1eROGxC06NrM1mMQazoNi/uqUDI9uSuraSX7VR/ IeY78jnzw7on/L5h+ClGFZf+OzuqOUUCbWtBpg8H8edeP3lu+LDm1l/plvHiMyYgNj39 rQSnRR8UszmatWhRLUA/opy/57kHiLSfQ2hBj7W4Rd5IWWMbnOMykMLPr4QxUkWIXDIw XjfA== X-Gm-Message-State: AHPjjUg9dKByqWaMxcrXR9ddx9yYXW2jEoXaZ45VHSBS3R4FeUdbIrQW GoLxqV1PyrVClsmh4nPKoKY= X-Google-Smtp-Source: AOwi7QAJUrAv3VmrgsS9GWM3nQ91hzvUf/nafsaJvXRmJOvmW5HVsLSRX5hiHaU2NOmFJYEO3mWLgQ== X-Received: by 10.28.150.69 with SMTP id y66mr1902353wmd.8.1504884977199; Fri, 08 Sep 2017 08:36:17 -0700 (PDT) Received: from localhost.localdomain (146.187.3.109.rev.sfr.net. [109.3.187.146]) by smtp.gmail.com with ESMTPSA id p199sm1689224wmb.28.2017.09.08.08.36.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Sep 2017 08:36:16 -0700 (PDT) From: Romain Izard To: Nicolas Ferre , Boris Brezillon , Michael Turquette , Stephen Boyd , Ludovic Desroches , Jonathan Cameron , Wenyou Yang , Josh Wu , David Woodhouse , Brian Norris , Marek Vasut , Cyrille Pitchen , Thierry Reding , Richard Genoud , Greg Kroah-Hartman , Alan Stern Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-mtd@lists.infradead.org, linux-pwm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Romain Izard Subject: [PATCH v1 02/10] clk: at91: pmc: Save SCSR during suspend Date: Fri, 8 Sep 2017 17:35:56 +0200 Message-Id: <20170908153604.28383-3-romain.izard.pro@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170908153604.28383-1-romain.izard.pro@gmail.com> References: <20170908153604.28383-1-romain.izard.pro@gmail.com> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The contents of the System Clock Status Register (SCSR) needs to be restored into the System Clock Enable Register (SCER). As the bootloader will restore some clocks by itself, the issue can be missed as only the USB controller, the LCD controller, the Image Sensor controller and the programmable clocks will be impacted. Fix the obvious typo in the suspend/resume code, as the IMR register does not need to be saved twice. Signed-off-by: Romain Izard Acked-by: Nicolas Ferre --- drivers/clk/at91/pmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c index 5c2b26de303e..07dc2861ad3f 100644 --- a/drivers/clk/at91/pmc.c +++ b/drivers/clk/at91/pmc.c @@ -86,7 +86,7 @@ static int pmc_suspend(void) { int i; - regmap_read(pmcreg, AT91_PMC_IMR, &pmc_cache.scsr); + regmap_read(pmcreg, AT91_PMC_SCSR, &pmc_cache.scsr); regmap_read(pmcreg, AT91_PMC_PCSR, &pmc_cache.pcsr0); regmap_read(pmcreg, AT91_CKGR_UCKR, &pmc_cache.uckr); regmap_read(pmcreg, AT91_CKGR_MOR, &pmc_cache.mor); @@ -129,7 +129,7 @@ static void pmc_resume(void) if (pmc_cache.pllar != tmp) pr_warn("PLLAR was not configured properly by the firmware\n"); - regmap_write(pmcreg, AT91_PMC_IMR, pmc_cache.scsr); + regmap_write(pmcreg, AT91_PMC_SCER, pmc_cache.scsr); regmap_write(pmcreg, AT91_PMC_PCER, pmc_cache.pcsr0); regmap_write(pmcreg, AT91_CKGR_UCKR, pmc_cache.uckr); regmap_write(pmcreg, AT91_CKGR_MOR, pmc_cache.mor);