Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752560AbcLFLPR (ORCPT ); Tue, 6 Dec 2016 06:15:17 -0500 Received: from mail-qk0-f179.google.com ([209.85.220.179]:35958 "EHLO mail-qk0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751670AbcLFLPN (ORCPT ); Tue, 6 Dec 2016 06:15:13 -0500 MIME-Version: 1.0 In-Reply-To: <1480987828-20549-2-git-send-email-baoyou.xie@linaro.org> References: <1480987828-20549-1-git-send-email-baoyou.xie@linaro.org> <1480987828-20549-2-git-send-email-baoyou.xie@linaro.org> From: Jun Nie Date: Tue, 6 Dec 2016 19:14:21 +0800 Message-ID: Subject: Re: [PATCH v2 2/2] soc: zte: pm_domains: Add support for zx296718 board To: Baoyou Xie Cc: oss@buserror.net, krzk@kernel.org, Arnd Bergmann , Ulf Hansson , scott.branden@broadcom.com, yangbo.lu@nxp.com, Florian Fainelli , alex.aring@gmail.com, claudiu.manoil@nxp.com, qiang.zhao@freescale.com, pankaj.dubey@samsung.com, rmk+kernel@arm.linux.org.uk, geert+renesas@glider.be, Linux Kernel Mailing List , linux-arm-kernel@lists.infradead.org, Shawn Guo , "xie.baoyou" , chen.chaokai@zte.com.cn, wang.qiang01@zte.com.cn Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7097 Lines: 213 2016-12-06 9:30 GMT+08:00 Baoyou Xie : > This patch introduces the power domain driver of zx296718 > which belongs to zte's 2967 family. > > Signed-off-by: Baoyou Xie > --- > drivers/soc/zte/Makefile | 2 +- > drivers/soc/zte/zx296718_pm_domains.c | 182 ++++++++++++++++++++++++++++++++++ > 2 files changed, 183 insertions(+), 1 deletion(-) > create mode 100644 drivers/soc/zte/zx296718_pm_domains.c > > diff --git a/drivers/soc/zte/Makefile b/drivers/soc/zte/Makefile > index 97ac8ea..2d2a2cc 100644 > --- a/drivers/soc/zte/Makefile > +++ b/drivers/soc/zte/Makefile > @@ -1,4 +1,4 @@ > # > # zx SOC drivers > # > -obj-$(CONFIG_ZX_PM_DOMAINS) += pm_domains.o > +obj-$(CONFIG_ZX_PM_DOMAINS) += pm_domains.o zx296718_pm_domains.o > diff --git a/drivers/soc/zte/zx296718_pm_domains.c b/drivers/soc/zte/zx296718_pm_domains.c > new file mode 100644 > index 0000000..ed18b33 > --- /dev/null > +++ b/drivers/soc/zte/zx296718_pm_domains.c > @@ -0,0 +1,182 @@ > +/* > + * Copyright (C) 2015 ZTE Ltd. > + * > + * Author: Baoyou Xie > + * License terms: GNU General Public License (GPL) version 2 > + */ > +#include > +#include "pm_domains.h" > + > +static u16 zx296718_offsets[REG_ARRAY_SIZE] = { > + [REG_CLKEN] = 0x18, > + [REG_ISOEN] = 0x1c, > + [REG_RSTEN] = 0x20, > + [REG_PWREN] = 0x24, > + [REG_ACK_SYNC] = 0x28, > +}; > + > +enum { > + PCU_DM_VOU = 0, > + PCU_DM_SAPPU, > + PCU_DM_VDE, > + PCU_DM_VCE, > + PCU_DM_HDE, > + PCU_DM_VIU, > + PCU_DM_USB20, > + PCU_DM_USB21, > + PCU_DM_USB30, > + PCU_DM_HSIC, > + PCU_DM_GMAC, > + PCU_DM_TS, > +}; > + > +static struct zx_pm_domain vou_domain = { > + .dm = { > + .name = "vou_domain", > + .power_off = zx_normal_power_off, > + .power_on = zx_normal_power_on, > + }, > + .bit = PCU_DM_VOU, > + .reg_offset = zx296718_offsets, > +}; > +static struct zx_pm_domain sappu_domain = { > + .dm = { > + .name = "sappu_domain", > + .power_off = zx_normal_power_off, > + .power_on = zx_normal_power_on, > + }, > + .bit = PCU_DM_SAPPU, > + .reg_offset = zx296718_offsets, > +}; > +static struct zx_pm_domain vde_domain = { > + .dm = { > + .name = "vde_domain", > + .power_off = zx_normal_power_off, > + .power_on = zx_normal_power_on, > + }, > + .bit = PCU_DM_VDE, > + .reg_offset = zx296718_offsets, > +}; > +static struct zx_pm_domain vce_domain = { > + .dm = { > + .name = "vce_domain", > + .power_off = zx_normal_power_off, > + .power_on = zx_normal_power_on, > + }, > + .bit = PCU_DM_VCE, > + .reg_offset = zx296718_offsets, > +}; > +static struct zx_pm_domain hde_domain = { > + .dm = { > + .name = "hde_domain", > + .power_off = zx_normal_power_off, > + .power_on = zx_normal_power_on, > + }, > + .bit = PCU_DM_HDE, > + .reg_offset = zx296718_offsets, > +}; > + > +static struct zx_pm_domain viu_domain = { > + .dm = { > + .name = "viu_domain", > + .power_off = zx_normal_power_off, > + .power_on = zx_normal_power_on, > + }, > + .bit = PCU_DM_VIU, > + .reg_offset = zx296718_offsets, > +}; > +static struct zx_pm_domain usb20_domain = { > + .dm = { > + .name = "usb20_domain", > + .power_off = zx_normal_power_off, > + .power_on = zx_normal_power_on, > + }, > + .bit = PCU_DM_USB20, > + .reg_offset = zx296718_offsets, > +}; > +static struct zx_pm_domain usb21_domain = { > + .dm = { > + .name = "usb21_domain", > + .power_off = zx_normal_power_off, > + .power_on = zx_normal_power_on, > + }, > + .bit = PCU_DM_USB21, > + .reg_offset = zx296718_offsets, > +}; > +static struct zx_pm_domain usb30_domain = { > + .dm = { > + .name = "usb30_domain", > + .power_off = zx_normal_power_off, > + .power_on = zx_normal_power_on, > + }, > + .bit = PCU_DM_USB30, > + .reg_offset = zx296718_offsets, > +}; > +static struct zx_pm_domain hsic_domain = { > + .dm = { > + .name = "hsic_domain", > + .power_off = zx_normal_power_off, > + .power_on = zx_normal_power_on, > + }, > + .bit = PCU_DM_HSIC, > + .reg_offset = zx296718_offsets, > +}; > +static struct zx_pm_domain gmac_domain = { > + .dm = { > + .name = "gmac_domain", > + .power_off = zx_normal_power_off, > + .power_on = zx_normal_power_on, > + }, > + .bit = PCU_DM_GMAC, > + .reg_offset = zx296718_offsets, > +}; > +static struct zx_pm_domain ts_domain = { > + .dm = { > + .name = "ts_domain", > + .power_off = zx_normal_power_off, > + .power_on = zx_normal_power_on, > + }, > + .bit = PCU_DM_TS, > + .reg_offset = zx296718_offsets, > +}; > +struct generic_pm_domain *zx296718_pm_domains[] = { > + [DM_ZX296718_SAPPU] = &sappu_domain.dm, > + [DM_ZX296718_VDE] = &vde_domain.dm, > + [DM_ZX296718_VCE] = &vce_domain.dm, > + [DM_ZX296718_HDE] = &hde_domain.dm, > + [DM_ZX296718_VIU] = &viu_domain.dm, > + [DM_ZX296718_USB20] = &usb20_domain.dm, > + [DM_ZX296718_USB21] = &usb21_domain.dm, > + [DM_ZX296718_USB30] = &usb30_domain.dm, > + [DM_ZX296718_HSIC] = &hsic_domain.dm, > + [DM_ZX296718_GMAC] = &gmac_domain.dm, > + [DM_ZX296718_TS] = &ts_domain.dm, > + [DM_ZX296718_VOU] = &vou_domain.dm, > +}; > + > +static int zx296718_pd_probe(struct platform_device *pdev) > +{ > + return zx_pd_probe(pdev, > + zx296718_pm_domains, > + ARRAY_SIZE(zx296718_pm_domains)); > +} > + > +static const struct of_device_id zx296718_pm_domain_matches[] = { > + { .compatible = "zte,zx296718-pcu", }, > + { }, > +}; > + > +static struct platform_driver zx296718_pd_driver = { > + .driver = { > + .name = "zx-powerdomain", > + .owner = THIS_MODULE, > + .of_match_table = zx296718_pm_domain_matches, > + }, > + .probe = zx296718_pd_probe, > +}; > + > +static int __init zx296718_pd_init(void) > +{ > + return platform_driver_register(&zx296718_pd_driver); > +} > +subsys_initcall(zx296718_pd_init); > -- > 2.7.4 > Reviewed-by: Jun Nie