From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0121.outbound.protection.outlook.com. [65.55.169.121]) by gmr-mx.google.com with ESMTPS id do9si263888qcb.0.2015.05.15.07.45.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 May 2015 07:45:29 -0700 (PDT) From: To: , , , , , , , CC: , , , , , Frank Li Subject: [rtc-linux] [PATCH 1/7] arm: imx: power-off: change to syscon to access register Date: Fri, 15 May 2015 21:36:24 +0800 Message-ID: <1431696990-23078-2-git-send-email-Frank.Li@freescale.com> In-Reply-To: <1431696990-23078-1-git-send-email-Frank.Li@freescale.com> References: <1431696990-23078-1-git-send-email-Frank.Li@freescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Reply-To: rtc-linux@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , From: Frank Li snvs is MFP device, which included rtc, ON/OFF key, power off Signed-off-by: Frank Li --- drivers/power/reset/imx-snvs-poweroff.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/power/reset/imx-snvs-poweroff.c b/drivers/power/reset/imx-snvs-poweroff.c index ad6ce50..b4881d7 100644 --- a/drivers/power/reset/imx-snvs-poweroff.c +++ b/drivers/power/reset/imx-snvs-poweroff.c @@ -22,21 +22,30 @@ #include #include #include +#include +#include -static void __iomem *snvs_base; +static struct regmap *snvs; + +#define SNVS_LPCR 0x38 static void do_imx_poweroff(void) { - u32 value = readl(snvs_base); - /* set TOP and DP_EN bit */ - writel(value | 0x60, snvs_base); + regmap_update_bits(snvs, SNVS_LPCR, 0x60, 0x60); } static int imx_poweroff_probe(struct platform_device *pdev) { - snvs_base = of_iomap(pdev->dev.of_node, 0); - if (!snvs_base) { + struct device_node *nd; + + nd = of_get_parent(pdev->dev.of_node); + if (!nd) + return -ENODEV; + snvs = syscon_node_to_regmap (nd); + of_node_put(nd); + + if (!snvs) { dev_err(&pdev->dev, "failed to get memory\n"); return -ENODEV; } -- 1.9.1 -- -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.