From patchwork Fri Apr 27 18:51:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 10369625 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 0A5CB6053F for ; Fri, 27 Apr 2018 18:51:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E82B5294B4 for ; Fri, 27 Apr 2018 18:51:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6AC9294E2; Fri, 27 Apr 2018 18:51:56 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EFBE294B4 for ; Fri, 27 Apr 2018 18:51:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758062AbeD0Svu (ORCPT ); Fri, 27 Apr 2018 14:51:50 -0400 Received: from mail-eopbgr50083.outbound.protection.outlook.com ([40.107.5.83]:52320 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757996AbeD0Svs (ORCPT ); Fri, 27 Apr 2018 14:51:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Iw+Qhw8GBhMVRflj5shVJGcjRR72zAubLtgyL9x82d4=; b=P7oC773ZNQmzuZPeqqAmTD4rsL2EPJ/169qhk4fJ4uHFtoVlVxqoMn4v7XpWK3/BqWUqfnRxnxnysHS8Q8ma6xIuFdjLN9WTE2JEDnZvzn5jsU8MaOAsLLU5FTBc1WovqCiWLAohjRidr97l8mSQzajf5PlLqSj0jGiE1oL7oL0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aisheng.dong@nxp.com; Received: from b29396-OptiPlex-7040.ap.freescale.net (119.31.174.66) by DB7PR04MB4217.eurprd04.prod.outlook.com (2603:10a6:5:27::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Fri, 27 Apr 2018 18:51:40 +0000 From: Dong Aisheng To: linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, fabio.estevam@nxp.com, linux-imx@nxp.com, rjw@rjwysocki.net, ulf.hansson@linaro.org, khilman@kernel.org, linux-pm@vger.kernel.org, Dong Aisheng Subject: [PATCH 2/2] soc: imx: add SCU power domains driver Date: Sat, 28 Apr 2018 02:51:03 +0800 Message-Id: <1524855063-14996-3-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524855063-14996-1-git-send-email-aisheng.dong@nxp.com> References: <1524855063-14996-1-git-send-email-aisheng.dong@nxp.com> MIME-Version: 1.0 X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: KAXPR01CA0010.jpnprd01.prod.outlook.com (2603:1096:402:19::20) To DB7PR04MB4217.eurprd04.prod.outlook.com (2603:10a6:5:27::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:DB7PR04MB4217; X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4217; 3:v9Syu8m1n3Uwkz4dutn/CkBOQzwdT7xgmWbRUnzgeW75yDOXLKwjXMqyHxreuYb3w5Pw93Gu390wr7/iB+9fbF53NY5KWCA6yEJJLb+xELDNJki2wBii879NchOk9+ph2YwmCOfjsip0nB+PgiCZPEvNF95RdVbNUqvEJQ812IdTp5qbSh3ueHbfC2bmpUCiRVmRZCpeNuWOdt0GnAeuzj6/msXq+mmhpGta8euR4KyJR8ipgK1iCb/3wcYoa/sA; 25:HDlIf1/gXoiYcTKljAt5061TGaRbnA0ehBm5Kr4C4IQxcLSpakMp9NHPQgnyKf4TM3ZWt/RJQgVVW8ocDJz1BPn6ldNfdvacEbv1VFzPzMCfWCgVmSwD6g6tJAEIpBmj0Zf1qh7xoEX79VEBkxuKjkTznGkht+xUEpAtQYjXc3z4VgIBBn0VVkrvaEZihbg/JR0QcFjJWrNKvmtFBLqkIgYkARlCN90AjR0Rpay7OD65uKKFwg/MHTY9NngofSgITl/BmpUMhS5l67KIOJgc/94VVFMFLF+dZwednDLuz8YDh8rr0xZatePsz8lMh3Oqs+lb221ds/HSR6VodAoLWA==; 31:ACIpuCgcgPNkC647Ei+5pLF/XCJjrYj9tG9w0eVoJjkxMbo/ImeZxiSQhd+mmhT2QLTQrwOfvfephdNA1EL1knjVI0toIRBnZqQfC5uHcXKilZkp0ilbFOpMAOK1G5haCULuKgp+yotL3UtBJ5d7CM2/TFqX1Ct+8tmFetxg3orPglHVxOFqJcXtg3QXVXfMON+DQisAltm60P5a2TXxhJ6kWlqkP2pdjMp3LKuRQ4E= X-MS-TrafficTypeDiagnostic: DB7PR04MB4217: X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4217; 20:F5QKAmH+DOlR/gI6xTpjU6k2TUH4XsurZeLgN6CB7mzLAj5Ui+JP2imurhKA3tsdxnfz7VgbFIWYXUoqWtjuQkoySaHt+I+07Zs09+vTggu0GTpgWdR0priwlyMxABnzBPp/LIDB6Z3iF5CAI494DXXqF53D26Fpv2UX1G6h7UprtuwIxdQy+5/xO7gEYVq+d/+U6zVIinPbuMxz63x7RVmfT269mzzA5Ucv4cDJfTwnBddBPQOaPhEQSAazYgZoRpQL/EZ61BlZgOuNW5HuJsPW4TkAwSLj3yP/f4VXDjDDjppIzd/n8bE6Km8AU9KkfTTLbuX4Y9WHQyxxhK21mhtQQTZIJ8HaxRofk7hu4p9YAooNxmuROFhTpYVnjQF4Rmn9/6fFD+0RPac7OyG9JOT2nuYmtZko9797vYpz7oU1A6yJLZV9JY8hko3EIv7TaBE9+uz87KY2MaHnp5aeCr9EnNQNZlpz2MIZj6KnHd2w0oZSzq+tJgkuKOYgy7hr; 4:kbfpvnnUY+b45Nfq/z2LfncZrAi6qGZPFPQi5i6qQe0Vw+UzD0yhplJuUSq/aaKPSDinEYhRJ0QCjkKkXkRunxwC5d7cntjuvnVTt/kuWIlaANSQp1a7h87/d5rAXifHBqYmzXf5OH6JwZ50ahk1prxxGi089o82SJVV558OVAjoL4OjNH4uh5xJwC7/DUA+KVKrCqjhvP+nqdwMsMeMdEXEsIQzKY8DLfNm1GM33DqAZnX5JvFr/Zg8r7Itzf10pYuYACLFV4n1K/PWQ3fWo45VTRWPDuIux6ocNHq3qN1vDnkoUacx+nsPXoX8fUrwVZprwYW0bm3ROceqiRAaGZk9/7yAX1pZ7LWB6W/XMvo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231232)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(6072148)(201708071742011); SRVR:DB7PR04MB4217; BCL:0; PCL:0; RULEID:; SRVR:DB7PR04MB4217; X-Forefront-PRVS: 0655F9F006 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(346002)(366004)(376002)(396003)(189003)(199004)(5660300001)(16586007)(68736007)(956004)(53936002)(76176011)(86362001)(4326008)(39060400002)(36756003)(11346002)(2361001)(2616005)(8936002)(186003)(8676002)(16526019)(305945005)(2351001)(26005)(25786009)(2906002)(52116002)(97736004)(48376002)(50466002)(6916009)(486006)(7736002)(446003)(50226002)(81156014)(6512007)(6666003)(105586002)(47776003)(316002)(478600001)(66066001)(476003)(386003)(3846002)(81166006)(6486002)(6116002)(51416003)(6506007)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB4217; H:b29396-OptiPlex-7040.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB7PR04MB4217; 23:VrYD7YyJz9dxbyN8ISklgVg8wo5vZTlXY9oRw4AIX?= =?us-ascii?Q?N52wQKU46FIB6WpMV9qTNGe8KUFMUbSYUq9U5Yu5l2E6Acx+NxmP52tUqqjm?= =?us-ascii?Q?JDte1O04ZDmFJH5YC8/sn+JZemGa1GstA/qnilsY4koxkjkljAb0lvcJ0NJ5?= =?us-ascii?Q?iVeqnvZ5e+W8JAMpUKhmuceJOpjGTu7TvCaS+76qcFktAzc1hAoYkJyaRAnC?= =?us-ascii?Q?6SbiwFhPgLYhW77oksk6RVWtlnFdyqvKSPrygl0DsafvZ8P5vvbT5WbMCfx3?= =?us-ascii?Q?EgJsJaVzWioQGDBOLUTGWaBiO3O0evwXU7hIHPOneliE0IafWR4Lq098xTz2?= =?us-ascii?Q?PE3PZ08YmpchcRk3K80nI7RMmG4KIs036Z3xJ9Up2z7CkhLPrRu+NtJW0a7t?= =?us-ascii?Q?KTOOha0UliRblJx/nuxJ2OSJNSGbcMl3hei9GmDqaxy87WpZXdk1L6AeNDqX?= =?us-ascii?Q?DTmr/WOjQfwlkmTcjaSB6ElFm9eUV36QqiDeKA8QHCKypRZS5TsR2gVS9a7X?= =?us-ascii?Q?3VV8jWfaLzZY9qG1ertpQgqZc0vXmCmNm63YrX5EB8q3GPQQpd/1nSstiUpN?= =?us-ascii?Q?vgUFageqdqSCp4meAqf8C4ROcYmq/pONJ0/uubiE5frn4xD7z7IdvZUUVT0V?= =?us-ascii?Q?7D70ezfM3/yvaI8Nu2HughUvnYF6Uz0LB64xp8zhTgxUlexpWpNiwYyTDkth?= =?us-ascii?Q?U2zMSdMcyKuh9IU1Ug8WZwtMUupZX6Odg0TkHy3Uuqe3ftrRr6SzHYN9OPwl?= =?us-ascii?Q?DuP0YvKO5hiKgpT+z6p4qzDrV6wVOUrW+2BomU8OIczAoiUH5w38lbsCifK3?= =?us-ascii?Q?JZI363oeuHLb71kQz4umeUwiMZ3Af8w21WyrYnwgS+e0jktaEl3LikRy9tLp?= =?us-ascii?Q?rMjEeVtEDiep4sb/c5a66pDJonTPG88jVZOHELr4BIvvmsUyVma8255mn3KJ?= =?us-ascii?Q?Mjsnr0JCPh4PB4VkNThj8m1/Cuxmwtjse5WLXUeEzoBDPFhxSOtW0uRhW8ni?= =?us-ascii?Q?S5iHJgHprEZqEH61XIsxjTl7vgd66gJbotSnaIg5C9rBEM8ymbrQItQR10QY?= =?us-ascii?Q?xKO/lEWO9H95ZJj4AkROz5H1e/km0pPON18CQaq6x5wwa/KFxX04HwJgs3nQ?= =?us-ascii?Q?qqgFLmsUMnTHMxo5fedl4L1gP1M7HinIAGGFSZ454eANsmnb8tDUIm6N2hU6?= =?us-ascii?Q?qHWV9clmsuUCN7M7+t4TWf/1VprGMpSjP8oDuC8BW1uLurgkbx2w8TyIJD7k?= =?us-ascii?Q?ex6xOYkB1HOM8fNzVE=3D?= X-Microsoft-Antispam-Message-Info: FLiRaCqOy9OIA7qxAg8jasm+5+lh/mH7a/LFxJ0WaVG2d3KCGiNSh3atT9Z86nBl2U7/n4EOBUD4afCKNG1mX6Y99KPSym3lBkkmk5T1lrTx95Seub5KiMEj/xtAvUlbMisLOcjaijT351+rI4GshnbTTeG+5K3QBmPNrhvXXGyMsQh/EhxT5nAtTPAiWdAG X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4217; 6:OLZl9YRHLOupNQiKr1oSP0aD3oGR/6fynG/qmgZIMqXxoW1PSHPwa8fo82qlw/pnhD3kE9yoyiY1CHdCbUFVBlG7guFCvF7uFNEuVHVYqTnImZ9nC06TRXQiCipLRmxdu7dTe9cXb4bwV/MdTyZ+eaRNESm1xybuRTUHbLXXtWOxJKbDGQkTGc2p958MaLBQcsWQ15BoXYGSum/kEldWFX21xezUo3giOYzR6INBlTBBaNPpllvg55qyT4ree0V4jdGaFUp1unq7Dewk84z2wHitBA1xt1A5hrPYgz1COBtWrqwdRrDJo9IxoHCfUSPpkooJVC1LJaJf6aPAcqYeMHtINxj4rCm1GGG68+puDmXANCZGDJYxUPsCbQsfxwF2A15WXnLktPo/fcVvc7v+yKQP1+i/6IA7uoVrmSatkV9U9hPj5peJuzeGobAi6bNXVxiTOYnMJtztbkECrVHFMA==; 5:RlHFafbTyIPnUMl0EtnZyD9w/RI/G7VcqZYesWpi89XmicpInBYUEqU2KDWu+DIdr6BH/9pITDFTTjylLi2As9YTC90XGpBn4A2L7hfA15QtoLpb/MgP+7taE4ySgHaHYa+1McdEb7+B+LX4wVikQX7/9+o6DicgdDeCqR6evlg=; 24:zmkOu6r4SNRPr3LxjS2i0O7L2KgMCXyqR3mOuD8h0lI3Revp+35UPfS0/9fN8rm3QL8zN5Ozfyx+q2KpivqE0qwVnSOwRbWA+B/pdQxqbWo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4217; 7:7sT7SytXw2XfQP9d7b/4QzhG5jtdo0WymJf5zbg1sBNdEZiWecx2I+XvN391/8BgKPfnDotadG9IBVPXoeA4XcR2AHyEHw2xi8coULfgEcrU3U5sUxgI1jEGIMpOROoxwmFAuwtp1v4wh440v9t/0d1aHwH2/2mwvfVoRl6QNImRxo5QLdkxT8QQ+hVPUWZHEAQczJFV5Mo0qN68tA0sJk07UekkUtXeuFESMV5GIYyXNyo7X14cOGMGpihagFCW X-MS-Office365-Filtering-Correlation-Id: 84393d31-34c2-4136-5233-08d5ac6fec83 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2018 18:51:40.1856 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 84393d31-34c2-4136-5233-08d5ac6fec83 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4217 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some i.MX SoCs contain a system controller that is responsible for controlling the state of the IPs that are present. Communication between the host processor running an OS and the system controller happens through a SCU protocol. This patch adds SCU protocol based power domains drivers. Cc: Shawn Guo Cc: Sascha Hauer Cc: Fabio Estevam Cc: "Rafael J. Wysocki" Cc: Kevin Hilman Cc: Ulf Hansson Cc: linux-pm@vger.kernel.org Signed-off-by: Dong Aisheng Reviewed-by: Ulf Hansson --- drivers/soc/imx/Kconfig | 4 ++ drivers/soc/imx/Makefile | 1 + drivers/soc/imx/sc-pd.c | 151 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 drivers/soc/imx/sc-pd.c diff --git a/drivers/soc/imx/Kconfig b/drivers/soc/imx/Kconfig index 4cad3c0..8d56e9b 100644 --- a/drivers/soc/imx/Kconfig +++ b/drivers/soc/imx/Kconfig @@ -14,4 +14,8 @@ config HAVE_IMX_SCU bool depends on HAVE_IMX_MU +config HAVE_IMX_SC_PD + bool + depends on HAVE_IMX_SCU + endmenu diff --git a/drivers/soc/imx/Makefile b/drivers/soc/imx/Makefile index f931984..40ad2a5 100644 --- a/drivers/soc/imx/Makefile +++ b/drivers/soc/imx/Makefile @@ -2,3 +2,4 @@ obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o obj-$(CONFIG_IMX7_PM_DOMAINS) += gpcv2.o obj-$(CONFIG_HAVE_IMX_MU) += imx_mu.o obj-$(CONFIG_HAVE_IMX_SCU) += sc/ +obj-$(CONFIG_HAVE_IMX_SC_PD) += sc-pd.o diff --git a/drivers/soc/imx/sc-pd.c b/drivers/soc/imx/sc-pd.c new file mode 100644 index 0000000..ecbfd2c --- /dev/null +++ b/drivers/soc/imx/sc-pd.c @@ -0,0 +1,151 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2016 Freescale Semiconductor, Inc. + * Copyright 2017~2018 NXP + * Dong Aisheng + * + * Implementation of the SCU based Power Domains + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +struct imx_sc_pm_domain { + struct generic_pm_domain pd; + sc_rsrc_t rsrc_id; +}; + +static sc_ipc_t pm_ipc_handle; + +static int imx_sc_pd_power(struct generic_pm_domain *domain, bool power_on) +{ + struct imx_sc_pm_domain *pd; + sc_err_t sci_err; + + pd = container_of(domain, struct imx_sc_pm_domain, pd); + + sci_err = sc_pm_set_resource_power_mode(pm_ipc_handle, pd->rsrc_id, + power_on ? SC_PM_PW_MODE_ON : + SC_PM_PW_MODE_LP); + if (sci_err) { + pr_err("imx_sc_pm: failed to power %s resource %d ret %d\n", + power_on ? "up" : "off", pd->rsrc_id, sci_err); + return -EPERM; + } + + return 0; +} + +static int imx_sc_pd_power_on(struct generic_pm_domain *domain) +{ + return imx_sc_pd_power(domain, true); +} + +static int imx_sc_pd_power_off(struct generic_pm_domain *domain) +{ + return imx_sc_pd_power(domain, false); +} + +static struct __init generic_pm_domain * imx_sc_pm_add_one_domain(struct device_node *np, + struct generic_pm_domain *genpd_parent) +{ + struct imx_sc_pm_domain *imx_sc_pd; + sc_rsrc_t rsrc_id; + int ret; + + imx_sc_pd = kzalloc(sizeof(*imx_sc_pd), GFP_KERNEL); + if (!imx_sc_pd) + return ERR_PTR(-ENOMEM); + + if (!of_property_read_u32(np, "reg", &rsrc_id)) { + if (rsrc_id > SC_R_LAST) { + pr_warn("%pOF: invalid rsrc id %d found", np, rsrc_id); + ret = -EINVAL; + goto err; + } + imx_sc_pd->rsrc_id = rsrc_id; + } else { + imx_sc_pd->rsrc_id = SC_R_LAST; + } + + if (imx_sc_pd->rsrc_id != SC_R_LAST) { + imx_sc_pd->pd.power_off = imx_sc_pd_power_off; + imx_sc_pd->pd.power_on = imx_sc_pd_power_on; + } + + imx_sc_pd->pd.name = np->name; + + ret = pm_genpd_init(&imx_sc_pd->pd, NULL, true); + if (ret < 0) + goto err; + + if (genpd_parent) { + ret = pm_genpd_add_subdomain(genpd_parent, &imx_sc_pd->pd); + if (ret) + goto err; + } + + ret = of_genpd_add_provider_simple(np, &imx_sc_pd->pd); + if (!ret) + return &imx_sc_pd->pd; + + pm_genpd_remove_subdomain(genpd_parent, &imx_sc_pd->pd); +err: + pr_warn("imx_sc_pm: failed to add PM domain %pOF: %d\n", np, ret); + kfree(imx_sc_pd); + return ERR_PTR(ret); +} + +static void __init imx_sc_pm_add_subdomains(struct device_node *parent, + struct generic_pm_domain *genpd_parent) +{ + struct generic_pm_domain *pd; + struct device_node *np; + + for_each_child_of_node(parent, np) { + pd = imx_sc_pm_add_one_domain(np, genpd_parent); + if (!IS_ERR(pd)) + imx_sc_pm_add_subdomains(np, pd); + } +} + +static const struct of_device_id imx_sc_pm_domain_of_match[] __initconst = { + { + .compatible = "nxp,imx8qxp-pd", + }, + { }, +}; + +static int __init imx_sc_init_pm_domains(void) +{ + struct generic_pm_domain *pd; + struct device_node *np; + sc_err_t sci_err; + + if (!of_machine_is_compatible("fsl,imx8qxp")) + return 0; + + sci_err = sc_ipc_get_handle(&pm_ipc_handle); + if (sci_err != SC_ERR_NONE) { + pr_err("imx_sc_pd: can't get sc ipc handle\n"); + return -ENODEV; + } + + for_each_matching_node(np, imx_sc_pm_domain_of_match) { + pd = imx_sc_pm_add_one_domain(np, NULL); + if (!IS_ERR(pd)) + imx_sc_pm_add_subdomains(np, pd); + } + + return 0; +} +early_initcall(imx_sc_init_pm_domains);