Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932718AbdIHPjL (ORCPT ); Fri, 8 Sep 2017 11:39:11 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:34530 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932183AbdIHPgV (ORCPT ); Fri, 8 Sep 2017 11:36:21 -0400 X-Google-Smtp-Source: ADKCNb4zDKdZlUxvWvNNAbhPe45hRJh6QAn8A+MXH5xh7Zuw4wzc8nzN+7814Q3NAxX9NkX+IzNskw== 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 , Romain Izard Subject: [PATCH v1 03/10] clk: at91: pmc: Support backup for programmable clocks Date: Fri, 8 Sep 2017 17:35:57 +0200 Message-Id: <20170908153604.28383-4-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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1117 Lines: 42 From: Romain Izard Save and restore the System Clock and Programmable Clock register for the backup use case. Signed-off-by: Romain Izard --- drivers/clk/at91/pmc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c index 07dc2861ad3f..5421b03553ec 100644 --- a/drivers/clk/at91/pmc.c +++ b/drivers/clk/at91/pmc.c @@ -66,6 +66,7 @@ static struct u32 pcr[PMC_MAX_IDS]; u32 audio_pll0; u32 audio_pll1; + u32 pckr[3]; } pmc_cache; void pmc_register_id(u8 id) @@ -103,6 +104,8 @@ static int pmc_suspend(void) regmap_read(pmcreg, AT91_PMC_PCR, &pmc_cache.pcr[registered_ids[i]]); } + for (i = 0; i < 3; i++) + regmap_read(pmcreg, AT91_PMC_PCKR(i), &pmc_cache.pckr[i]); return 0; } @@ -143,6 +146,8 @@ static void pmc_resume(void) pmc_cache.pcr[registered_ids[i]] | AT91_PMC_PCR_CMD); } + for (i = 0; i < 3; i++) + regmap_write(pmcreg, AT91_PMC_PCKR(i), pmc_cache.pckr[i]); if (pmc_cache.uckr & AT91_PMC_UPLLEN) mask |= AT91_PMC_LOCKU; -- 2.11.0