From patchwork Mon Nov 14 23:04:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 9428657 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 9E6436047D for ; Mon, 14 Nov 2016 23:06:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A553B289C6 for ; Mon, 14 Nov 2016 23:06:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A36328A49; Mon, 14 Nov 2016 23:06:59 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 158B5289C6 for ; Mon, 14 Nov 2016 23:06:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c6QJp-00012Q-M0; Mon, 14 Nov 2016 23:05:41 +0000 Received: from mail-pg0-x233.google.com ([2607:f8b0:400e:c05::233]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c6QJF-0007uh-Kp for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2016 23:05:07 +0000 Received: by mail-pg0-x233.google.com with SMTP id x23so56171563pgx.1 for ; Mon, 14 Nov 2016 15:04:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o5OWsGWZlOTff5CF/Yu8a/SJEIloUwROsHlYQ3N6+38=; b=fhY3030ng2Om3UlAASYbKjHm9CzbDZYslB3dutr31ioqmkN9E0iJMpJuoBHMtal2jH gRX+KJrD+X3VpeZZOgjqHK5QheRIcMlkkFBswnQbX4N9lay6H3d7OY5n1n1WFb4vdJBF vFwTHuv75+gEl0koCFK1j/1az5Q4toQ91InDs8iieTxCdWOtMHUPsV7UC/rX1E7TpYJX 3QQwRsJq9wqCR7/jtE/c82g++3Z2b2V0IESbi9oUdf+Okis3FJ2WWCYBcdiXNzLcyXIm d/QzTu0jilJEgJuFqTZQHkXDHichFxBNaI9/2JrtDhDR21JGJ3hdkyjp8OTgo/sFUP50 TO8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o5OWsGWZlOTff5CF/Yu8a/SJEIloUwROsHlYQ3N6+38=; b=g3fvnSsO1DAqDROPFRhz1oWzl/iTfQDa6T7rDnIFQFgILJHBz4VlsGE+x7Itm94CEh bm7MiO2Y67SmXIYLYpV2sLdHkXr7x3S95QjAlUFWXBOMRmfBqyaXD4DocPTfdmxHhS1D Z3Lrl3c1elmh8htrKBBJ2EVEa990rhZ2XWvi4XUQtyaX/2U9EZPJYw0cS2QgLeZNzzHo aTBPKFYcnz6/8Odx3NR/hFGvM/uPpVaS9SnKwMmBu+UAXvMimDD+cI4NJ9Y8EjTNEWiQ gsenZIgtfivqVr1+RNhD9R7mmcW7drA65YN8hr9hoKzBokqB4CAISm5hJKeQrLQGogA3 ybNw== X-Gm-Message-State: ABUngvfxd4WnKM6NjRRu0u0l9wgTyXkLoXMs1ZoGnrCIPADf2QkVTSm1qcJLNUPbUxEjMIbD X-Received: by 10.99.50.67 with SMTP id y64mr32864036pgy.146.1479164684602; Mon, 14 Nov 2016 15:04:44 -0800 (PST) Received: from localhost (c-98-203-232-209.hsd1.wa.comcast.net. [98.203.232.209]) by smtp.gmail.com with ESMTPSA id l69sm22710097pfk.34.2016.11.14.15.04.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 15:04:44 -0800 (PST) From: Kevin Hilman To: Sekhar Nori Subject: [PATCH 2/2] ARM: davinci: PM: rework init: cleanup Date: Mon, 14 Nov 2016 15:04:41 -0800 Message-Id: <20161114230441.356-3-khilman@baylibre.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161114230441.356-1-khilman@baylibre.com> References: <20161114230441.356-1-khilman@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161114_150505_822958_BB5E87D2 X-CRM114-Status: GOOD ( 14.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Bartosz=20Go=C5=82aszewski?= , Alexandre Bailon , Axel Haslam , David Lechner Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP A follow-on cleanup renaming 'pdata' since it is no longer platform_data. Signed-off-by: Kevin Hilman --- arch/arm/mach-davinci/pm.c | 61 +++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/arch/arm/mach-davinci/pm.c b/arch/arm/mach-davinci/pm.c index fc6a5710b3fa..1f2ac36efe11 100644 --- a/arch/arm/mach-davinci/pm.c +++ b/arch/arm/mach-davinci/pm.c @@ -34,7 +34,6 @@ static void (*davinci_sram_suspend) (struct davinci_pm_config *); static struct davinci_pm_config pm_config; -static struct davinci_pm_config *pdata = &pm_config; static void davinci_sram_push(void *dest, void *src, unsigned int size) { @@ -46,58 +45,58 @@ static void davinci_pm_suspend(void) { unsigned val; - if (pdata->cpupll_reg_base != pdata->ddrpll_reg_base) { + if (pm_config.cpupll_reg_base != pm_config.ddrpll_reg_base) { /* Switch CPU PLL to bypass mode */ - val = __raw_readl(pdata->cpupll_reg_base + PLLCTL); + val = __raw_readl(pm_config.cpupll_reg_base + PLLCTL); val &= ~(PLLCTL_PLLENSRC | PLLCTL_PLLEN); - __raw_writel(val, pdata->cpupll_reg_base + PLLCTL); + __raw_writel(val, pm_config.cpupll_reg_base + PLLCTL); udelay(PLL_BYPASS_TIME); /* Powerdown CPU PLL */ - val = __raw_readl(pdata->cpupll_reg_base + PLLCTL); + val = __raw_readl(pm_config.cpupll_reg_base + PLLCTL); val |= PLLCTL_PLLPWRDN; - __raw_writel(val, pdata->cpupll_reg_base + PLLCTL); + __raw_writel(val, pm_config.cpupll_reg_base + PLLCTL); } /* Configure sleep count in deep sleep register */ - val = __raw_readl(pdata->deepsleep_reg); + val = __raw_readl(pm_config.deepsleep_reg); val &= ~DEEPSLEEP_SLEEPCOUNT_MASK, - val |= pdata->sleepcount; - __raw_writel(val, pdata->deepsleep_reg); + val |= pm_config.sleepcount; + __raw_writel(val, pm_config.deepsleep_reg); /* System goes to sleep in this call */ - davinci_sram_suspend(pdata); + davinci_sram_suspend(&pm_config); - if (pdata->cpupll_reg_base != pdata->ddrpll_reg_base) { + if (pm_config.cpupll_reg_base != pm_config.ddrpll_reg_base) { /* put CPU PLL in reset */ - val = __raw_readl(pdata->cpupll_reg_base + PLLCTL); + val = __raw_readl(pm_config.cpupll_reg_base + PLLCTL); val &= ~PLLCTL_PLLRST; - __raw_writel(val, pdata->cpupll_reg_base + PLLCTL); + __raw_writel(val, pm_config.cpupll_reg_base + PLLCTL); /* put CPU PLL in power down */ - val = __raw_readl(pdata->cpupll_reg_base + PLLCTL); + val = __raw_readl(pm_config.cpupll_reg_base + PLLCTL); val &= ~PLLCTL_PLLPWRDN; - __raw_writel(val, pdata->cpupll_reg_base + PLLCTL); + __raw_writel(val, pm_config.cpupll_reg_base + PLLCTL); /* wait for CPU PLL reset */ udelay(PLL_RESET_TIME); /* bring CPU PLL out of reset */ - val = __raw_readl(pdata->cpupll_reg_base + PLLCTL); + val = __raw_readl(pm_config.cpupll_reg_base + PLLCTL); val |= PLLCTL_PLLRST; - __raw_writel(val, pdata->cpupll_reg_base + PLLCTL); + __raw_writel(val, pm_config.cpupll_reg_base + PLLCTL); /* Wait for CPU PLL to lock */ udelay(PLL_LOCK_TIME); /* Remove CPU PLL from bypass mode */ - val = __raw_readl(pdata->cpupll_reg_base + PLLCTL); + val = __raw_readl(pm_config.cpupll_reg_base + PLLCTL); val &= ~PLLCTL_PLLENSRC; val |= PLLCTL_PLLEN; - __raw_writel(val, pdata->cpupll_reg_base + PLLCTL); + __raw_writel(val, pm_config.cpupll_reg_base + PLLCTL); } } @@ -130,23 +129,23 @@ int __init davinci_pm_init(void) if (ret) return ret; - pdata->sleepcount = DEEPSLEEP_SLEEPCOUNT; - pdata->ddr2_ctlr_base = da8xx_get_mem_ctlr(); - pdata->deepsleep_reg = DA8XX_SYSCFG1_VIRT(DA8XX_DEEPSLEEP_REG); - pdata->ddrpsc_num = DA8XX_LPSC1_EMIF3C; + pm_config.sleepcount = DEEPSLEEP_SLEEPCOUNT; + pm_config.ddr2_ctlr_base = da8xx_get_mem_ctlr(); + pm_config.deepsleep_reg = DA8XX_SYSCFG1_VIRT(DA8XX_DEEPSLEEP_REG); + pm_config.ddrpsc_num = DA8XX_LPSC1_EMIF3C; - pdata->cpupll_reg_base = ioremap(DA8XX_PLL0_BASE, SZ_4K); - if (!pdata->cpupll_reg_base) + pm_config.cpupll_reg_base = ioremap(DA8XX_PLL0_BASE, SZ_4K); + if (!pm_config.cpupll_reg_base) return -ENOMEM; - pdata->ddrpll_reg_base = ioremap(DA850_PLL1_BASE, SZ_4K); - if (!pdata->ddrpll_reg_base) { + pm_config.ddrpll_reg_base = ioremap(DA850_PLL1_BASE, SZ_4K); + if (!pm_config.ddrpll_reg_base) { ret = -ENOMEM; goto no_ddrpll_mem; } - pdata->ddrpsc_reg_base = ioremap(DA8XX_PSC1_BASE, SZ_4K); - if (!pdata->ddrpsc_reg_base) { + pm_config.ddrpsc_reg_base = ioremap(DA8XX_PSC1_BASE, SZ_4K); + if (!pm_config.ddrpsc_reg_base) { ret = -ENOMEM; goto no_ddrpsc_mem; } @@ -163,8 +162,8 @@ int __init davinci_pm_init(void) suspend_set_ops(&davinci_pm_ops); no_ddrpsc_mem: - iounmap(pdata->ddrpll_reg_base); + iounmap(pm_config.ddrpll_reg_base); no_ddrpll_mem: - iounmap(pdata->cpupll_reg_base); + iounmap(pm_config.cpupll_reg_base); return ret; }