Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753063AbcLCOMz (ORCPT ); Sat, 3 Dec 2016 09:12:55 -0500 Received: from mail-pg0-f53.google.com ([74.125.83.53]:36823 "EHLO mail-pg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752096AbcLCOMx (ORCPT ); Sat, 3 Dec 2016 09:12:53 -0500 From: Baoyou Xie To: jun.nie@linaro.org, gregkh@linuxfoundation.org, davem@davemloft.net, geert+renesas@glider.be, akpm@linux-foundation.org, mchehab@kernel.org, linux@roeck-us.net, ulf.hansson@linaro.org, arnd@arndb.de, oss@buserror.net, krzk@kernel.org, qiang.zhao@nxp.com, aar@pengutronix.de, claudiu.manoil@nxp.com, pankaj.dubey@samsung.com, f.fainelli@gmail.com, yangbo.lu@nxp.com, scott.branden@broadcom.com, rmk+kernel@armlinux.org.uk Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, baoyou.xie@linaro.org, xie.baoyou@zte.com.cn, chen.chaokai@zte.com.cn, wang.qiang01@zte.com.cn Subject: [PATCH 2/2] soc: zte: pm_domains: Add support for zx296718 driver Date: Sat, 3 Dec 2016 22:11:31 +0800 Message-Id: <1480774291-6211-2-git-send-email-baoyou.xie@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480774291-6211-1-git-send-email-baoyou.xie@linaro.org> References: <1480774291-6211-1-git-send-email-baoyou.xie@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4422 Lines: 191 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 | 3 + drivers/soc/zte/zx296718_pm_domains.c | 162 ++++++++++++++++++++++++++++++++++ 2 files changed, 165 insertions(+) create mode 100644 drivers/soc/zte/zx296718_pm_domains.c diff --git a/drivers/soc/zte/Makefile b/drivers/soc/zte/Makefile index 97ac8ea..a6e7bfe 100644 --- a/drivers/soc/zte/Makefile +++ b/drivers/soc/zte/Makefile @@ -2,3 +2,6 @@ # zx SOC drivers # obj-$(CONFIG_ZX_PM_DOMAINS) += pm_domains.o +ifeq ($(CONFIG_ZX_PM_DOMAINS), y) + obj-y += zx296718_pm_domains.o +endif diff --git a/drivers/soc/zte/zx296718_pm_domains.c b/drivers/soc/zte/zx296718_pm_domains.c new file mode 100644 index 0000000..fc16dfd --- /dev/null +++ b/drivers/soc/zte/zx296718_pm_domains.c @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2015 ZTE Ltd. + * + * Author: Baoyou Xie + * License terms: GNU General Public License (GPL) version 2 + */ +#include "pm_domains.h" + +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, +}; +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, +}; +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, +}; +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, +}; +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, +}; + +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, +}; +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, +}; +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, +}; +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, +}; +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, +}; +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, +}; +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, +}; +struct generic_pm_domain *zx296718_pm_domains[] = { + //&vou_domain.dm, + &sappu_domain.dm, + &vde_domain.dm, + &vce_domain.dm, + &hde_domain.dm, + &viu_domain.dm, + &usb20_domain.dm, + &usb21_domain.dm, + &usb30_domain.dm, + &hsic_domain.dm, + &gmac_domain.dm, + &ts_domain.dm, + &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