From patchwork Mon Dec 11 16:55:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Izard X-Patchwork-Id: 10105535 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 3C44160360 for ; Mon, 11 Dec 2017 16:56:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2873D2976F for ; Mon, 11 Dec 2017 16:56:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D3E7297C6; Mon, 11 Dec 2017 16:56:24 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 C43A82976F for ; Mon, 11 Dec 2017 16:56:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752645AbdLKQ4K (ORCPT ); Mon, 11 Dec 2017 11:56:10 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:34251 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752586AbdLKQ4H (ORCPT ); Mon, 11 Dec 2017 11:56:07 -0500 Received: by mail-wr0-f196.google.com with SMTP id y21so18340772wrc.1; Mon, 11 Dec 2017 08:56:06 -0800 (PST) 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=DeYGtgfuLlCkT17JNszL/yiEnzlN0/lXqfT/duwLA88=; b=ApyEW9qPZKgE2zik+qwcSCMXW2/R0OqIFGzb2oqG03tCtnu0xVxzxXjU3xZBaPftT9 55ozHq4S51X99WORff8m9B/EnRfA5wsGAuMdbF2PxC8hsPiRU5VSxbH3So6+taGcE+NT JeViIoRTbTlRqjnM4Js0IFY9kzpMbtQwO8YjHrdl7icrLbZOBFQ2jFQ1JcmeIw7gmMVK 4RlQIPTPe5JWmJevlQfNNaM4aprqFeSN/YhuMRZBtofV+nOw5y8Kq7nXDpfaNY1B2n1R tT0Ef116KVwB03wMgKOaCklR2s7Fmbl7FV7aXONNDKRPKehbdAI9WFUVCi62Bn4CL5dj sdaQ== 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=DeYGtgfuLlCkT17JNszL/yiEnzlN0/lXqfT/duwLA88=; b=XHpG8cIngWguse4BUu08Qmo+GvUtySyUBseAMKQjn//kPwLHrnzCstaQYDuJszeYLD wxmaGDD56G/XI75ouHc4oT7bQYzfj/BSCE1RAXGz5ux2FdXsAVHnJ1OsnHB8uiYvr5+d H04Zi00bbsujMvUfy4Zm2Tj4r4rRybTfEcL+Ztutq3g6ziw67WY+ejxMxJSV0rmUSxAx fgO2dvxyxQixrEsviC+1KsnhhCWE0y9/h9i+LbwPJNlCdHGu/BI1rZuFkURIBzn4YuAp Dc9iSqWBBnbP3yAUWZa7pST3AJ6B8DAb13X+WJGli8J5Srbv7o23tFiFtUxT+QZLMe9T MMRw== X-Gm-Message-State: AKGB3mLCcE55a/XxAzkWEcK9f80mI2PNDqjMEQj+68Uw0JLpwWaaR+ww pJKB40miOiZhC9Nt7aOcP94= X-Google-Smtp-Source: ACJfBov91P5Nm1O3smplKZI9FZYzCLhOa+HmAxRca0uDQhUR4xp/yAkhwWVHcF9tY9cC1H+1ORbVoA== X-Received: by 10.223.156.133 with SMTP id d5mr1046928wre.43.1513011366093; Mon, 11 Dec 2017 08:56:06 -0800 (PST) Received: from localhost.localdomain (146.187.3.109.rev.sfr.net. [109.3.187.146]) by smtp.gmail.com with ESMTPSA id j77sm12699597wmf.36.2017.12.11.08.56.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 08:56:05 -0800 (PST) From: Romain Izard To: Boris Brezillon , Michael Turquette , Stephen Boyd , Alexandre Belloni , Nicolas Ferre , Ludovic Desroches Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Romain Izard Subject: [PATCH v6 2/3] clk: at91: pmc: Save SCSR during suspend Date: Mon, 11 Dec 2017 17:55:34 +0100 Message-Id: <20171211165535.5126-3-romain.izard.pro@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171211165535.5126-1-romain.izard.pro@gmail.com> References: <20171211165535.5126-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 Acked-by: Alexandre Belloni --- 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);