From patchwork Fri Jan 21 11:22:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12719621 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 20FBAC433EF for ; Fri, 21 Jan 2022 11:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ztDuEad6f+0yAjO+yw/Zm+r973PIkJeAAI7eSeP9gKE=; b=rAPVExWX56PScq RYpkpQie5yfcvIEWEEiAiwXf30XdZVCwN+ocqnFSpP9Iy4hCax6nNVwYEsARMJSkknQ6gOLtmkwRR Sa3UoxS8YxzljpnU2m3ZSQkHfUR9kZ/PriT03H9weYuQWaQYiv/utbfgbYa+DhN3AYaCGllBz/l8e c6t7xp3DHIBsVuU11Gbk4BhoLKqfAiF7NkCET5Js4UnSuvGdb8H+frFxEVZ49qN78TKJkIqKmi5Ox D9XfLcOOWgbl5dgy8UchpNslPGZH70J+5iW2rfLLAb51iW88JnQy3Yz6/dCae54ksDA96r6T4OSPJ QRwzdcdANB8PnvarHLjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAs0e-00ElaV-Mk; Fri, 21 Jan 2022 11:23:12 +0000 Received: from mail-eopbgr130087.outbound.protection.outlook.com ([40.107.13.87] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAs0Q-00ElVG-Td for linux-arm-kernel@lists.infradead.org; Fri, 21 Jan 2022 11:23:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kkyb7ZEEDBjIwse2BXokWso28lLp+tixBSZS2LLvhm30El0ainHsGnnSdVzeC3QMuVtVxWO/VjAqJz9JPR19+cfQUjId/hegmQV5NqaBKvVMPM+KJkjT2n+YEULXyQ9APWu4XVMem6PKBNKWR/pSISD+86Gphlx4gCy0t50GKL4QRjp7Gl6241RsJ4T6FMwGPH5A6ezDi6kGNRdWLczCOZ1BOb9DUJReIFTXolpLqzUYTkxpXy+P9N7MoCIlIXlCNbjrV5DEyArCcUYI6eNMFXlC+bc4ZKosoy9o0l2eTlRHvJbgbHGO6WfQJwwE6SgAvRdEOEd2sS0u0f8mvvuKkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QYEpV3PKUC+e2MeZlO5Rad/2xQP28AwkpnTx2FN8Tiw=; b=gpaAva7H5SGOySWYF6w4AAemnpKO7On+zrC6vy06QJNudOWEZdmFjSwxoHkfF+xCVm2rUq7sIUFAAvP6wn8avT6VokpXY+w9/w35FmiwV+yt5Lzss0ov5bsyOVylHzBSOScM2tHhxqxAWhWJ54NT6yUa0BIkZL4KQs/X8grQwsVDt9GIx1z6lzAtBWL2DMyXi+5auy0j4VNqkaV6cIAg1DauEX6Z9WwviNhK1d9HGCspL4PnCrhpgYzoy65mES9K+S9nMtiZO2Y32MY+wrrCFjoNjW3f5EfiMnJkVQPDV6tG37BP/95yKzSKuegPOO4Mvs/rT4gv32dLsq/9b1zM+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QYEpV3PKUC+e2MeZlO5Rad/2xQP28AwkpnTx2FN8Tiw=; b=qIEVwtWsxhwlY34ppUImwzKdle+aZVvC9ns0MMQCl7AR9EA8VE7DSedTld1uxNjDGqtl7tW7Z0e6GI8nAo+KoDJHcS7F691RR7U1+sMgEJ96mzAeXsCsK0M0b5sNEWzhIY1LWAsp0a7zE47o6DPw2nEuD20OIaJc+khjiVyHp3I= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) by DB8PR04MB6731.eurprd04.prod.outlook.com (2603:10a6:10:104::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Fri, 21 Jan 2022 11:22:53 +0000 Received: from VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::f853:4e9a:7ab6:dbf7]) by VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::f853:4e9a:7ab6:dbf7%6]) with mapi id 15.20.4909.010; Fri, 21 Jan 2022 11:22:52 +0000 From: Abel Vesa To: Shawn Guo , Sascha Hauer , Fabio Estevam , Lucas Stach Cc: Pengutronix Kernel Team , NXP Linux Team , Frieder Schrempf , Ezequiel Garcia , Linux Kernel Mailing List , linux-arm-kernel@lists.infradead.org Subject: [RFC 1/3] soc: imx: make i.MX8MM BLK CTRL a separate driver Date: Fri, 21 Jan 2022 13:22:36 +0200 Message-Id: <20220121112238.47281-2-abel.vesa@nxp.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220121112238.47281-1-abel.vesa@nxp.com> References: <20220121112238.47281-1-abel.vesa@nxp.com> X-ClientProxiedBy: VI1PR08CA0238.eurprd08.prod.outlook.com (2603:10a6:802:15::47) To VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 76d61ce4-d52e-445e-e35e-08d9dcd05d29 X-MS-TrafficTypeDiagnostic: DB8PR04MB6731:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E8dywfOXi4O+y4pTUNhKkNVKecAUDx5R2BykRsYu5hH/pOsiJiR9Ne3Zvvm38Wk5eLjP5Ed7XRVFRfEYDmzzwXbf1Ec4Q0GZy5/9WBJCVJnTSnfdDVOr1os50sp3+Rl8Ij+gLPRulTYTMTKn8Om+47O+0ZWh3wzWWOxk3yOdAn6yx1JEr/0y5hqfRqFVHvyZxKv5jZou+Eh9uG07RYsg06J/rVZNIZbul5w53lrfth5MuSylkr8Jx8BtM2Dyb1PPT4zVhCOgZeq/LEzqYHPgFCcXLDcqAhXQqCWRcLNpHS03X5al6Oh1psz8QsYetYkrcN70h9G20/fg8MiCWS0EvTwv7RI66k5yfZcFoCtNJd4V7IheUOiIQeueMOc1VNk87uQpeNIG56+SR56uZfVdlya2s7LmFQ2VtlQvFwjiydkJVRapDsHsaZTMbFxkmsU8o16vPxm/qtOrzqHrqYAtLz96653rH5oR35+pn0ga9RpwjVjGJ0OyX3GTc5gr+2PMSUsuUu/9fhNDM4kybuSp2CSYWlVS9hRsfLxLuMWzky1ywXRKlUS0v6GZp9FXImpuiHhXsY+r4wSGNdyaTbE2socPkYZF3ztJFjPvjS7/nqYO2p2jBKyX5GI9XMyzOwsJgXrz5GVYhxkjuach8jxBRAewMiRD/QH37hX5XemGjPVoA+p2fRnelJa6Ip6rppcGsj/sSav9+/nBF+nzV9dHSQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB4688.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(38100700002)(38350700002)(52116002)(2616005)(8676002)(6512007)(1076003)(6666004)(316002)(110136005)(54906003)(86362001)(6506007)(30864003)(6486002)(66946007)(5660300002)(4326008)(66556008)(66476007)(8936002)(36756003)(44832011)(83380400001)(2906002)(186003)(26005)(508600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6F5h2/CF3iWQcDvw41oqRq/hlOyOxFqKZY5eU6RKX1STRDacvaxLbWXeG+vouWulx0J4yz7izFBqE4vgcgEZL95xYwPdurvLb5aVcbBMVq80l2y2cc0nxaLCFDoAyCXSLJ06VmTLTM6qRPJxVfD38EG3+r2BGz9ssB08+syB6IsgQB/r92BJTSCnC1sCiW5Y0RdrmjqrTX4jw3ikNGj5HcQLVZFbygCGWL0HRKPJKsCaipEUTJnOvEI5vzUVzZ/UhmMQhnwie35LFRqU9uyK+2taRXda+XznpOPw6XwzzNqq/mBQTeH3zHqNRzb8cAFFSpawAmC6B8Gzz6I0mOAo2+3N9te0Dx6QWT0fXSTFsxRqDhmla6o0jFr+lElnLhutmSrfUt+24E6U1X5ztlryYuUwBE+Nep9+1EgnyTuaME0Qv6eQ4gGZ/eYVky20ZzY1Ov5e0qTDa/0HYV1Kv3CwTzcHh32OynuApAV5IcrK6RtuLpkMRjqGMyuVz4p2eualQI/AsLTceHL9XDsLUIwZixgILxrtgsjVAskN0+W4xpzAVlCZwO0/1c3UmjbIY45JmRuHkNeFPc9C4Fv7WUBziXVw8jZszeDMbJ+fc82m2HT8Y6588hCLOX3YtFkvPt6JeywTpfw0QGOo5vh3e3rUXtUfYoPhO2ww9LmJYAdhW+K5oSeJhx2b2Dai5M10GAoLxKhpw7TFkxeJlRxjHMOqf/Uap+HFmVA26KHmWlvoduaFkFlpf5H4dB2WGcRliuw3ATwH6/mkKnuoUpqtZfrEflNKnxdgkGpBHD1sKjEq7bmW+DIcb4TKwM0iUN/cAU682UMeWRWtF81YE1tO8phGPvT4sT/UUSOKbRR+pbIXGUgkbnO/zw7D9x6YXATd8CNYghWsgkQ0OITOz3Qd3b+qszyBgdYfX8zdWrU1gXSF1dqsIN+stkoSTh5kDgY1bnM9lsXk/bXphPWUi5gOgVvyvM3n1rXw1r7A7VuCAGFEJNqjUsq9JT1PgbguKNL5vlV7JSN2zWwzPVF8U7VLkfMsr0g8MI8P/0PQH0TCe+4xOygkUoZfs0TEKrpINNatsorFwUAETex82tXA44+ZGyIFDknSsid12Oj11drl7kayjveZ3rf1zXiwAIUq/KuW06DduzmRJ5ycpdOAAJpfS3ME5Nqxf0OjW0cH8rFLJb7T9CG0AvKb/bL4OOVe8y2BbqZeMjVKkYJd7blYymdxGGS4b1fXtIhCVB5GLSBl/9QGt7V0jv1LtqLxfM7RyjZrehteiIH/CMr0l5CeoLkTwQVMvMa2aJb6yPb3XLsD7a/iceTKPFZwZzdS4BnxIVUp0WOVoGjt0fdNZy36JOoJpF1ua1jgnMhOrrfafROA0/mFFrRre5YvvZ+yc6UNWthJeJqedxTmk8j7tU0lLrcduEYgtEdkVyxkDwbihAMUMnak7naAdK+pIigLDuSUYS6cugsqaPPDwRdTa+Mj66LSJo65E3Aoe/acfpr+0bgR8hz6pp1c8bglrj4NhiiCYQdojedrx++dONCCiRDSH+9MoYHffrEvNV+i4evpFF/cLqP0ilr+S54u+5T+X6gk/XTHmkr98SXM2e2F8Ud+g0aoYB6bDUNYc3DZc5lyGvd83+G/tY8= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 76d61ce4-d52e-445e-e35e-08d9dcd05d29 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB4688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 11:22:52.5220 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: shEX1/xgRdQnlyq87+F+yojnMOUMuYpL4QpjEBiy8mq/F2nTFXmB3W9Klu31cMR9O4j5s+Cjtw2iMK321/18ew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6731 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220121_032259_164293_119C092C X-CRM114-Status: GOOD ( 23.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The imx8m-blk-ctrl driver was increasing in size with every new BLK CTRL addition for every SoC. Lets split the SoC specific parts into separate drivers. Do that for i.MX8MM now. Signed-off-by: Abel Vesa --- drivers/soc/imx/Kconfig | 7 + drivers/soc/imx/Makefile | 1 + drivers/soc/imx/imx8m-blk-ctrl.c | 210 +----------------------------- drivers/soc/imx/imx8m-blk-ctrl.h | 72 ++++++++++ drivers/soc/imx/imx8mm-blk-ctrl.c | 173 ++++++++++++++++++++++++ 5 files changed, 257 insertions(+), 206 deletions(-) create mode 100644 drivers/soc/imx/imx8m-blk-ctrl.h create mode 100644 drivers/soc/imx/imx8mm-blk-ctrl.c diff --git a/drivers/soc/imx/Kconfig b/drivers/soc/imx/Kconfig index a840494e849a..b0cc53f3fc2c 100644 --- a/drivers/soc/imx/Kconfig +++ b/drivers/soc/imx/Kconfig @@ -20,4 +20,11 @@ config SOC_IMX8M support, it will provide the SoC info like SoC family, ID and revision etc. +config SOC_IMX8MM_BLK_CTRL + bool "i.MX8MM SoC BLK CTRL support" + depends on SOC_IMX8M + help + If you say yes here you get support for the NXP i.MX8MM BLK CTRL + support. + endmenu diff --git a/drivers/soc/imx/Makefile b/drivers/soc/imx/Makefile index 8a707077914c..06c2970e6308 100644 --- a/drivers/soc/imx/Makefile +++ b/drivers/soc/imx/Makefile @@ -6,3 +6,4 @@ obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o obj-$(CONFIG_IMX_GPCV2_PM_DOMAINS) += gpcv2.o obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o obj-$(CONFIG_SOC_IMX8M) += imx8m-blk-ctrl.o +obj-$(CONFIG_SOC_IMX8MM_BLK_CTRL) += imx8mm-blk-ctrl.o diff --git a/drivers/soc/imx/imx8m-blk-ctrl.c b/drivers/soc/imx/imx8m-blk-ctrl.c index 511e74f0db8a..599b2a9a38bb 100644 --- a/drivers/soc/imx/imx8m-blk-ctrl.c +++ b/drivers/soc/imx/imx8m-blk-ctrl.c @@ -4,67 +4,11 @@ * Copyright 2021 Pengutronix, Lucas Stach */ -#include -#include #include -#include -#include -#include -#include -#include -#include #include -#define BLK_SFT_RSTN 0x0 -#define BLK_CLK_EN 0x4 -#define BLK_MIPI_RESET_DIV 0x8 /* Mini/Nano DISPLAY_BLK_CTRL only */ - -struct imx8m_blk_ctrl_domain; - -struct imx8m_blk_ctrl { - struct device *dev; - struct notifier_block power_nb; - struct device *bus_power_dev; - struct regmap *regmap; - struct imx8m_blk_ctrl_domain *domains; - struct genpd_onecell_data onecell_data; -}; - -struct imx8m_blk_ctrl_domain_data { - const char *name; - const char * const *clk_names; - int num_clks; - const char *gpc_name; - u32 rst_mask; - u32 clk_mask; - - /* - * i.MX8M Mini and Nano have a third DISPLAY_BLK_CTRL register - * which is used to control the reset for the MIPI Phy. - * Since it's only present in certain circumstances, - * an if-statement should be used before setting and clearing this - * register. - */ - u32 mipi_phy_rst_mask; -}; - -#define DOMAIN_MAX_CLKS 3 - -struct imx8m_blk_ctrl_domain { - struct generic_pm_domain genpd; - const struct imx8m_blk_ctrl_domain_data *data; - struct clk_bulk_data clks[DOMAIN_MAX_CLKS]; - struct device *power_dev; - struct imx8m_blk_ctrl *bc; -}; - -struct imx8m_blk_ctrl_data { - int max_reg; - notifier_fn_t power_notifier_fn; - const struct imx8m_blk_ctrl_domain_data *domains; - int num_domains; -}; +#include "imx8m-blk-ctrl.h" static inline struct imx8m_blk_ctrl_domain * to_imx8m_blk_ctrl_domain(struct generic_pm_domain *genpd) @@ -165,7 +109,7 @@ imx8m_blk_ctrl_xlate(struct of_phandle_args *args, void *data) static struct lock_class_key blk_ctrl_genpd_lock_class; -static int imx8m_blk_ctrl_probe(struct platform_device *pdev) +int imx8m_blk_ctrl_probe(struct platform_device *pdev) { const struct imx8m_blk_ctrl_data *bc_data; struct device *dev = &pdev->dev; @@ -299,7 +243,7 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev) return ret; } -static int imx8m_blk_ctrl_remove(struct platform_device *pdev) +int imx8m_blk_ctrl_remove(struct platform_device *pdev) { struct imx8m_blk_ctrl *bc = dev_get_drvdata(&pdev->dev); int i; @@ -375,150 +319,10 @@ static int imx8m_blk_ctrl_resume(struct device *dev) } #endif -static const struct dev_pm_ops imx8m_blk_ctrl_pm_ops = { +const struct dev_pm_ops imx8m_blk_ctrl_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(imx8m_blk_ctrl_suspend, imx8m_blk_ctrl_resume) }; -static int imx8mm_vpu_power_notifier(struct notifier_block *nb, - unsigned long action, void *data) -{ - struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, - power_nb); - - if (action != GENPD_NOTIFY_ON && action != GENPD_NOTIFY_PRE_OFF) - return NOTIFY_OK; - - /* - * The ADB in the VPUMIX domain has no separate reset and clock - * enable bits, but is ungated together with the VPU clocks. To - * allow the handshake with the GPC to progress we put the VPUs - * in reset and ungate the clocks. - */ - regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, BIT(0) | BIT(1) | BIT(2)); - regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(0) | BIT(1) | BIT(2)); - - if (action == GENPD_NOTIFY_ON) { - /* - * On power up we have no software backchannel to the GPC to - * wait for the ADB handshake to happen, so we just delay for a - * bit. On power down the GPC driver waits for the handshake. - */ - udelay(5); - - /* set "fuse" bits to enable the VPUs */ - regmap_set_bits(bc->regmap, 0x8, 0xffffffff); - regmap_set_bits(bc->regmap, 0xc, 0xffffffff); - regmap_set_bits(bc->regmap, 0x10, 0xffffffff); - regmap_set_bits(bc->regmap, 0x14, 0xffffffff); - } - - return NOTIFY_OK; -} - -static const struct imx8m_blk_ctrl_domain_data imx8mm_vpu_blk_ctl_domain_data[] = { - [IMX8MM_VPUBLK_PD_G1] = { - .name = "vpublk-g1", - .clk_names = (const char *[]){ "g1", }, - .num_clks = 1, - .gpc_name = "g1", - .rst_mask = BIT(1), - .clk_mask = BIT(1), - }, - [IMX8MM_VPUBLK_PD_G2] = { - .name = "vpublk-g2", - .clk_names = (const char *[]){ "g2", }, - .num_clks = 1, - .gpc_name = "g2", - .rst_mask = BIT(0), - .clk_mask = BIT(0), - }, - [IMX8MM_VPUBLK_PD_H1] = { - .name = "vpublk-h1", - .clk_names = (const char *[]){ "h1", }, - .num_clks = 1, - .gpc_name = "h1", - .rst_mask = BIT(2), - .clk_mask = BIT(2), - }, -}; - -static const struct imx8m_blk_ctrl_data imx8mm_vpu_blk_ctl_dev_data = { - .max_reg = 0x18, - .power_notifier_fn = imx8mm_vpu_power_notifier, - .domains = imx8mm_vpu_blk_ctl_domain_data, - .num_domains = ARRAY_SIZE(imx8mm_vpu_blk_ctl_domain_data), -}; - -static int imx8mm_disp_power_notifier(struct notifier_block *nb, - unsigned long action, void *data) -{ - struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, - power_nb); - - if (action != GENPD_NOTIFY_ON && action != GENPD_NOTIFY_PRE_OFF) - return NOTIFY_OK; - - /* Enable bus clock and deassert bus reset */ - regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(12)); - regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(6)); - - /* - * On power up we have no software backchannel to the GPC to - * wait for the ADB handshake to happen, so we just delay for a - * bit. On power down the GPC driver waits for the handshake. - */ - if (action == GENPD_NOTIFY_ON) - udelay(5); - - - return NOTIFY_OK; -} - -static const struct imx8m_blk_ctrl_domain_data imx8mm_disp_blk_ctl_domain_data[] = { - [IMX8MM_DISPBLK_PD_CSI_BRIDGE] = { - .name = "dispblk-csi-bridge", - .clk_names = (const char *[]){ "csi-bridge-axi", "csi-bridge-apb", - "csi-bridge-core", }, - .num_clks = 3, - .gpc_name = "csi-bridge", - .rst_mask = BIT(0) | BIT(1) | BIT(2), - .clk_mask = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5), - }, - [IMX8MM_DISPBLK_PD_LCDIF] = { - .name = "dispblk-lcdif", - .clk_names = (const char *[]){ "lcdif-axi", "lcdif-apb", "lcdif-pix", }, - .num_clks = 3, - .gpc_name = "lcdif", - .clk_mask = BIT(6) | BIT(7), - }, - [IMX8MM_DISPBLK_PD_MIPI_DSI] = { - .name = "dispblk-mipi-dsi", - .clk_names = (const char *[]){ "dsi-pclk", "dsi-ref", }, - .num_clks = 2, - .gpc_name = "mipi-dsi", - .rst_mask = BIT(5), - .clk_mask = BIT(8) | BIT(9), - .mipi_phy_rst_mask = BIT(17), - }, - [IMX8MM_DISPBLK_PD_MIPI_CSI] = { - .name = "dispblk-mipi-csi", - .clk_names = (const char *[]){ "csi-aclk", "csi-pclk" }, - .num_clks = 2, - .gpc_name = "mipi-csi", - .rst_mask = BIT(3) | BIT(4), - .clk_mask = BIT(10) | BIT(11), - .mipi_phy_rst_mask = BIT(16), - }, -}; - -static const struct imx8m_blk_ctrl_data imx8mm_disp_blk_ctl_dev_data = { - .max_reg = 0x2c, - .power_notifier_fn = imx8mm_disp_power_notifier, - .domains = imx8mm_disp_blk_ctl_domain_data, - .num_domains = ARRAY_SIZE(imx8mm_disp_blk_ctl_domain_data), -}; - - static int imx8mn_disp_power_notifier(struct notifier_block *nb, unsigned long action, void *data) { @@ -591,12 +395,6 @@ static const struct imx8m_blk_ctrl_data imx8mn_disp_blk_ctl_dev_data = { static const struct of_device_id imx8m_blk_ctrl_of_match[] = { { - .compatible = "fsl,imx8mm-vpu-blk-ctrl", - .data = &imx8mm_vpu_blk_ctl_dev_data - }, { - .compatible = "fsl,imx8mm-disp-blk-ctrl", - .data = &imx8mm_disp_blk_ctl_dev_data - }, { .compatible = "fsl,imx8mn-disp-blk-ctrl", .data = &imx8mn_disp_blk_ctl_dev_data }, { diff --git a/drivers/soc/imx/imx8m-blk-ctrl.h b/drivers/soc/imx/imx8m-blk-ctrl.h new file mode 100644 index 000000000000..618b3429bb69 --- /dev/null +++ b/drivers/soc/imx/imx8m-blk-ctrl.h @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2021 Pengutronix, Lucas Stach + * Copyright 2022 NXP, Abel Vesa + */ + +#ifndef __IMX_BLK_CTRL_H +#define __IMX_BLK_CTRL_H + +#include +#include +#include +#include +#include + +#define BLK_SFT_RSTN 0x0 +#define BLK_CLK_EN 0x4 +#define BLK_MIPI_RESET_DIV 0x8 /* Mini/Nano DISPLAY_BLK_CTRL only */ + +struct imx8m_blk_ctrl_domain; + +struct imx8m_blk_ctrl { + struct device *dev; + struct notifier_block power_nb; + struct device *bus_power_dev; + struct regmap *regmap; + struct imx8m_blk_ctrl_domain *domains; + struct genpd_onecell_data onecell_data; +}; + +struct imx8m_blk_ctrl_domain_data { + const char *name; + const char * const *clk_names; + int num_clks; + const char *gpc_name; + u32 rst_mask; + u32 clk_mask; + + /* + * i.MX8M Mini and Nano have a third DISPLAY_BLK_CTRL register + * which is used to control the reset for the MIPI Phy. + * Since it's only present in certain circumstances, + * an if-statement should be used before setting and clearing this + * register. + */ + u32 mipi_phy_rst_mask; +}; + +#define DOMAIN_MAX_CLKS 3 + +struct imx8m_blk_ctrl_domain { + struct generic_pm_domain genpd; + const struct imx8m_blk_ctrl_domain_data *data; + struct clk_bulk_data clks[DOMAIN_MAX_CLKS]; + struct device *power_dev; + struct imx8m_blk_ctrl *bc; +}; + +struct imx8m_blk_ctrl_data { + int max_reg; + notifier_fn_t power_notifier_fn; + const struct imx8m_blk_ctrl_domain_data *domains; + int num_domains; +}; + +extern const struct dev_pm_ops imx8m_blk_ctrl_pm_ops; + +int imx8m_blk_ctrl_remove(struct platform_device *pdev); +int imx8m_blk_ctrl_probe(struct platform_device *pdev); + +#endif diff --git a/drivers/soc/imx/imx8mm-blk-ctrl.c b/drivers/soc/imx/imx8mm-blk-ctrl.c new file mode 100644 index 000000000000..eb63d28b0157 --- /dev/null +++ b/drivers/soc/imx/imx8mm-blk-ctrl.c @@ -0,0 +1,173 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2021 Pengutronix, Lucas Stach + * Copyright 2022 NXP, Abel Vesa + */ + +#include + +#include "imx8m-blk-ctrl.h" + +static int imx8mm_vpu_power_notifier(struct notifier_block *nb, + unsigned long action, void *data) +{ + struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, + power_nb); + + if (action != GENPD_NOTIFY_ON && action != GENPD_NOTIFY_PRE_OFF) + return NOTIFY_OK; + + /* + * The ADB in the VPUMIX domain has no separate reset and clock + * enable bits, but is ungated together with the VPU clocks. To + * allow the handshake with the GPC to progress we put the VPUs + * in reset and ungate the clocks. + */ + regmap_clear_bits(bc->regmap, BLK_SFT_RSTN, BIT(0) | BIT(1) | BIT(2)); + regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(0) | BIT(1) | BIT(2)); + + if (action == GENPD_NOTIFY_ON) { + /* + * On power up we have no software backchannel to the GPC to + * wait for the ADB handshake to happen, so we just delay for a + * bit. On power down the GPC driver waits for the handshake. + */ + udelay(5); + + /* set "fuse" bits to enable the VPUs */ + regmap_set_bits(bc->regmap, 0x8, 0xffffffff); + regmap_set_bits(bc->regmap, 0xc, 0xffffffff); + regmap_set_bits(bc->regmap, 0x10, 0xffffffff); + regmap_set_bits(bc->regmap, 0x14, 0xffffffff); + } + + return NOTIFY_OK; +} + +static const struct imx8m_blk_ctrl_domain_data imx8mm_vpu_blk_ctl_domain_data[] = { + [IMX8MM_VPUBLK_PD_G1] = { + .name = "vpublk-g1", + .clk_names = (const char *[]){ "g1", }, + .num_clks = 1, + .gpc_name = "g1", + .rst_mask = BIT(1), + .clk_mask = BIT(1), + }, + [IMX8MM_VPUBLK_PD_G2] = { + .name = "vpublk-g2", + .clk_names = (const char *[]){ "g2", }, + .num_clks = 1, + .gpc_name = "g2", + .rst_mask = BIT(0), + .clk_mask = BIT(0), + }, + [IMX8MM_VPUBLK_PD_H1] = { + .name = "vpublk-h1", + .clk_names = (const char *[]){ "h1", }, + .num_clks = 1, + .gpc_name = "h1", + .rst_mask = BIT(2), + .clk_mask = BIT(2), + }, +}; + +static const struct imx8m_blk_ctrl_data imx8mm_vpu_blk_ctl_dev_data = { + .max_reg = 0x18, + .power_notifier_fn = imx8mm_vpu_power_notifier, + .domains = imx8mm_vpu_blk_ctl_domain_data, + .num_domains = ARRAY_SIZE(imx8mm_vpu_blk_ctl_domain_data), +}; + +static int imx8mm_disp_power_notifier(struct notifier_block *nb, + unsigned long action, void *data) +{ + struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, + power_nb); + + if (action != GENPD_NOTIFY_ON && action != GENPD_NOTIFY_PRE_OFF) + return NOTIFY_OK; + + /* Enable bus clock and deassert bus reset */ + regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(12)); + regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(6)); + + /* + * On power up we have no software backchannel to the GPC to + * wait for the ADB handshake to happen, so we just delay for a + * bit. On power down the GPC driver waits for the handshake. + */ + if (action == GENPD_NOTIFY_ON) + udelay(5); + + + return NOTIFY_OK; +} + +static const struct imx8m_blk_ctrl_domain_data imx8mm_disp_blk_ctl_domain_data[] = { + [IMX8MM_DISPBLK_PD_CSI_BRIDGE] = { + .name = "dispblk-csi-bridge", + .clk_names = (const char *[]){ "csi-bridge-axi", "csi-bridge-apb", + "csi-bridge-core", }, + .num_clks = 3, + .gpc_name = "csi-bridge", + .rst_mask = BIT(0) | BIT(1) | BIT(2), + .clk_mask = BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) | BIT(5), + }, + [IMX8MM_DISPBLK_PD_LCDIF] = { + .name = "dispblk-lcdif", + .clk_names = (const char *[]){ "lcdif-axi", "lcdif-apb", "lcdif-pix", }, + .num_clks = 3, + .gpc_name = "lcdif", + .clk_mask = BIT(6) | BIT(7), + }, + [IMX8MM_DISPBLK_PD_MIPI_DSI] = { + .name = "dispblk-mipi-dsi", + .clk_names = (const char *[]){ "dsi-pclk", "dsi-ref", }, + .num_clks = 2, + .gpc_name = "mipi-dsi", + .rst_mask = BIT(5), + .clk_mask = BIT(8) | BIT(9), + .mipi_phy_rst_mask = BIT(17), + }, + [IMX8MM_DISPBLK_PD_MIPI_CSI] = { + .name = "dispblk-mipi-csi", + .clk_names = (const char *[]){ "csi-aclk", "csi-pclk" }, + .num_clks = 2, + .gpc_name = "mipi-csi", + .rst_mask = BIT(3) | BIT(4), + .clk_mask = BIT(10) | BIT(11), + .mipi_phy_rst_mask = BIT(16), + }, +}; + +static const struct imx8m_blk_ctrl_data imx8mm_disp_blk_ctl_dev_data = { + .max_reg = 0x2c, + .power_notifier_fn = imx8mm_disp_power_notifier, + .domains = imx8mm_disp_blk_ctl_domain_data, + .num_domains = ARRAY_SIZE(imx8mm_disp_blk_ctl_domain_data), +}; + +static const struct of_device_id imx8mm_blk_ctrl_of_match[] = { + { + .compatible = "fsl,imx8mm-vpu-blk-ctrl", + .data = &imx8mm_vpu_blk_ctl_dev_data + }, { + .compatible = "fsl,imx8mm-disp-blk-ctrl", + .data = &imx8mm_disp_blk_ctl_dev_data + }, { + /* Sentinel */ + } +}; +MODULE_DEVICE_TABLE(of, imx8mm_blk_ctrl_of_match); + +static struct platform_driver imx8mm_blk_ctrl_driver = { + .probe = imx8m_blk_ctrl_probe, + .remove = imx8m_blk_ctrl_remove, + .driver = { + .name = "imx8mm-blk-ctrl", + .pm = &imx8m_blk_ctrl_pm_ops, + .of_match_table = imx8mm_blk_ctrl_of_match, + }, +}; +module_platform_driver(imx8mm_blk_ctrl_driver); From patchwork Fri Jan 21 11:22:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12719622 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 726D8C433EF for ; Fri, 21 Jan 2022 11:25:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=likumoe4lIBbExys3LbjcfrtHd+Eme/OHi/o+tJciuI=; b=JOF9SpMHeuCNio abBIx//m8ERrodbvGqTDTR6Cj2aXVaERsvX1gKk0wvtqBTeasCL3GhmngtwdBcFcQNOcQtcO6hR0s RIC+Po28yM3qaAmmqnygHCF/u5qVmH8SvbisaIFq9tSlJyCrUE9iPUeHVJKl2sG6LVDSBPqqcQj3i 0N+sKC48j0xsoB0lz0E8PapEz3EQVy4fHoZ5bypsg4GWOUww6xwzLey9ZWl/Yq3C8ppIMPe2yYjpz fgW9bSEr3keU3PZnWZcpbBigU1CxLEfqJUqIBcQMy+hdO759+6Y6cuRxPqbZLvikOS9O8MxlYLqeZ 6oTqM3/Aj6KH50TKN5Cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAs0q-00Elds-Bd; Fri, 21 Jan 2022 11:23:24 +0000 Received: from mail-eopbgr130087.outbound.protection.outlook.com ([40.107.13.87] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAs0U-00ElVG-1S for linux-arm-kernel@lists.infradead.org; Fri, 21 Jan 2022 11:23:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K89bWqb3DE0IZz98syY763HUExUJ7JUTN+ikHU1opmohIL6UR0YHt0D8tfPtAcVd9lwFDfYpapR967X2mwH+gPwFQZxI8+LpdxhxFjZlFd+zcuFWeY+g4P+nYzhScYtuxGPrjMurQ/zoKKgkjL6nxMThA0i+h/5k1IgGmTRPW+s0Q13tL/A0LYfUh7E58nsMOkQoNbAHyM7yHn6YWCs7h7Q0FXYcH6V/8bOKxWNn2q7WKF/5Jb0YDoODbSaSsQVW8H4eXJpP+7T04ngwWi5PGqDxiPFBM/IjasxSr6OtWuL1iPQXChjdkHVmr0mOdEMLgIdfxJSAViX3LnZSV6wx0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=x5ZRw7hHS0vm1qG8ufV0oYLtf+nVvMrPEiu5I7GvN48=; b=k3ls+iDP3hrzuVMez/zkdTdcZ+1Lo4++3se/12E71PrTBhZJzCung1sAo4baQBCrqVfdDube3yMg9T4195mlSKPD4atTZQIj/nQ8xTIinRKz3/xYyIlZ9XwCibWy2xsuuKxB+jA5MEXuRYuji9JLr11MQyf78AJDaV+0R+2k7WEnJHHKXpbPO/fUvkb9u9r91t6AmzD1KBjzQvv/VOb2AG55CINfvj9vY0AYQb3jEqqVOQrCjzjazgfnFPACsc9b5F965amGKt4ZY87UVLEFYtN3wSIN4+1HaKB8PsfwskiNestPa5A2TwXjAmgfDospLDd1aB5aqbEi2Dm7jNNPkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x5ZRw7hHS0vm1qG8ufV0oYLtf+nVvMrPEiu5I7GvN48=; b=d589WXJQ3tAQt9VkHgGhkMtWcALSCgCrcwtRy6xYKIr9N7DI2gAf3B3W0eN/uXZ+Vs+D9OZF52h3/YhhsLMQNFS6nzdS44Vzb0V2CPNBJxnZot4a1U/U4+618xffHVXb6AkuhT0WfYdY2DEmS3nCer8qIDNv+7r0SQLjIX9nw5k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) by DB8PR04MB6731.eurprd04.prod.outlook.com (2603:10a6:10:104::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Fri, 21 Jan 2022 11:22:53 +0000 Received: from VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::f853:4e9a:7ab6:dbf7]) by VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::f853:4e9a:7ab6:dbf7%6]) with mapi id 15.20.4909.010; Fri, 21 Jan 2022 11:22:53 +0000 From: Abel Vesa To: Shawn Guo , Sascha Hauer , Fabio Estevam , Lucas Stach Cc: Pengutronix Kernel Team , NXP Linux Team , Frieder Schrempf , Ezequiel Garcia , Linux Kernel Mailing List , linux-arm-kernel@lists.infradead.org Subject: [RFC 2/3] soc: imx: make i.MX8MN BLK CTRL a separate driver Date: Fri, 21 Jan 2022 13:22:37 +0200 Message-Id: <20220121112238.47281-3-abel.vesa@nxp.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220121112238.47281-1-abel.vesa@nxp.com> References: <20220121112238.47281-1-abel.vesa@nxp.com> X-ClientProxiedBy: VI1PR08CA0238.eurprd08.prod.outlook.com (2603:10a6:802:15::47) To VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e6447996-305a-4cf4-8f70-08d9dcd05d78 X-MS-TrafficTypeDiagnostic: DB8PR04MB6731:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:901; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DrIDrEqUlZcpYsuosOZw9kHK0Q//5s4jW6F/snhBfbPyLU+GELefzd39ZBKLmBJcl9yZ1HiqChcvr4+ZN/wmWfl8CNet03exKdvMe1yKy3of9B2y1wA53f9cx2t5PqF0obZEMVcZIPusoCRSfGhCCIX4gj9XxONS+X8DOmWsmIzS5nwWL9mVaBSVzmW2M35Ei1yvidlPwMCAc/fwyTCviUcBvxDK7Jgw7UmV654UGkL595f/l7oohKXZOe4I+O5sUdeY9kUnYWpZoWeATORx4Oil4hCgMzgDGtOmYo8x4xsSrszKJ3HKvvom02Tl0jSeGLmLLPNzzC13vXpLteo91UlI0NrsWqG3R46T0taqbIlhEXbepC6u6Ygxzygg/ZLbc6nitsu+OaI4UjYmbvu3KMp7L13FodQTX5uZuL1MlKtnySENmatBleE1vOdigG+lKQKSrePJKDV5lCLPslmdpRXhJ+WmdcIp+T7jsZ6supjejfSUbFhHjx7qEiWM4KFjgHn8HYPfSAyD7/QZrkGfiP51u9jQvbXADEW/SvSnKBCt0w5socbKH/NzxCm4LZBCEr+N+7n2TY51tL/MB8L6GacJAjf9Vvy34z6n6+pSqJOi/E8/QoKZraeKwxAEMchWmXNLhV/5YwhXBbHZGxI+1CGjKycX5haAcuMZq+PPjZ1IMpSoZycPde/xxOH+yxOrnZNO3NEDNmNBJAn3SrX5uA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB4688.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(38100700002)(38350700002)(52116002)(2616005)(8676002)(6512007)(1076003)(6666004)(316002)(110136005)(54906003)(86362001)(6506007)(6486002)(66946007)(5660300002)(4326008)(66556008)(66476007)(8936002)(36756003)(44832011)(83380400001)(2906002)(186003)(26005)(508600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DiUEMgnMyj9mA3dE+tSg4TyIOSbtvJUbNqhoxtz/iW/qGD/vV18EkE/8oYKBFBdDsYB94VWHgFMUZA8FHgtmQUz6LwFQ+7Mxnwl5fLCyZnI/gyVyFcThf0NbRCARBjlV66l50WQn6lwUqH6rVQ3yryFfBisdZAbyGVYmt/vtJBS00q6tRuUoX9hHA27/lLarYvGwPm3E/jRLExmvtDKtG78PEV8S+MJiQDFfcqVqDQLr5LGLmcoXoaxtX/aQkx9YWhg4yc3Sfxfg2PtG+O0fIE8ylxDxUnUc3rkpMUFIYv3KJ4aQ01k3dq7fbYX9blLNTvKLzDDnLS/CJZr2aPpVEs6yzaEZGTZVN70Jx2UCMogZsBXNxC39keakYFmBqe126JmrGB41VEyq6sEDFi7GPXBa1x9olBoTfUm2Oby56B6F+vsZAg3I/Qii1XvYwwqNOSH0+qyjdb+HgLOnlyi2TNeBXyDzhRA8BsPZ3Z42TaNbprE7kRfUb48YJYDBw3qyKLJjgLCb5PIF/WiVnBLNT8z1fFo9NScsmgTUC/IXN34ea/+be6qz/XJl0xz2TpiglBnmxvb7QWAO6oBKjQP9IFpUIoemAbWUa5jVphhAmGpq1jI6nYH+qzfgHXFOafuBD7s1FzLKMDD4eWOFvf5Gqk4VfSRFR2hkROMbzSeeZQhEnM3htfKKMwupcWbzsjo/aRHHzW+bRqaXpoli/BctbRUri5xheOVZueJuf2tmQM2CG/3eN5u2ckhDFJN4zMZd8HKkCOrVRNY4kJ+wB8/odIRg5eIWExnHVDk5QZ/oA57MYzlNYGHqaDiim4ryNOR6CNm1ICo55KhHP77B5GM/QDptwpqjQnsy5ciuu+tYFjYTE1Cq0pLX0JEiJeXxW2BofVYLkxBXcEU61udqEGQCxGPUuYuy9N8vPV24BDcenVPrL95FD/vBdzWwr/7ksRyRydGehoylz1AA+lyZbU1yOjdNBMthDXtwLEL7/1cZyVkgOz3hqmI8Fbeah9uIqJVlnLRKQ2ZxirfRENfATdHYVL7VefPK4UxhiqX790jnVlZByTNVAlmkBfOdSFB+SWpo1y6pMU/TZZa7v7FD8SzyUeywA6NSoLMkB4JCOfDShLcqkwhaVRMvD45l6fzfDQEwzWt4xYkqRGGeR8LYwOUiwOHkFjC7ie4UmV6Gu1qWKsZOiII1tL5LXODnCCn4FnQMkZG/Cle5FybzpleH6TkwFdhqOXyeL2lWa5TjgickI1bV5aaRfnVGmp328QcQ6m0VNPb60yd5lEUxjIOOQLlCg8X/rJsBU9x3biwawoxM/DshoetPQZYC+6YxFZIdHmqgZt7mudUQoFMdf1IOb7HnHdxXxpY0Y5wJv3Y/98TEqnIq2kMQLwSbJYCB8YpT2puDLKJWPEEg9fsUpYD4HsNvfX/FuTGm9R+TtGwyvvJs4RXUmPjAcKks1vx5Pt1wh73W68NnOQ+0BhBKS4m+c5jsr+gicvPeagewUSaVWELCdSIYiN5HyQJ/dAUBMUTX28tabxdUOgJ4SKmw/5lY4molx/HdcuPcUVJV+n+ZRz0SBwx9s+eO07xKwDeqfx5X9lhlvj5wCjExzAOZq9ALsDnI5g0O02kCgz8LpNnYpZo2s6A= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e6447996-305a-4cf4-8f70-08d9dcd05d78 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB4688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 11:22:53.0219 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9Dlm1z3rqvreWq+SIO9jC2gTbiLRDnZ3mNxDEm7PJ4wYngXza/GYonq1ycOjwK4M8GpGnuNJd3bpiRE1E4F8IA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6731 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220121_032302_119259_52ABC7A7 X-CRM114-Status: GOOD ( 24.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The imx8m-blk-ctrl driver was increasing in size with every new BLK CTRL addition for every SoC. Lets split the SoC specific parts into separate drivers. Do that for i.MX8MN now. Signed-off-by: Abel Vesa --- drivers/soc/imx/Kconfig | 7 +++ drivers/soc/imx/Makefile | 1 + drivers/soc/imx/imx8m-blk-ctrl.c | 93 --------------------------- drivers/soc/imx/imx8mn-blk-ctrl.c | 101 ++++++++++++++++++++++++++++++ 4 files changed, 109 insertions(+), 93 deletions(-) create mode 100644 drivers/soc/imx/imx8mn-blk-ctrl.c diff --git a/drivers/soc/imx/Kconfig b/drivers/soc/imx/Kconfig index b0cc53f3fc2c..8a3e0920b022 100644 --- a/drivers/soc/imx/Kconfig +++ b/drivers/soc/imx/Kconfig @@ -27,4 +27,11 @@ config SOC_IMX8MM_BLK_CTRL If you say yes here you get support for the NXP i.MX8MM BLK CTRL support. +config SOC_IMX8MN_BLK_CTRL + bool "i.MX8MN SoC BLK CTRL support" + depends on SOC_IMX8M + help + If you say yes here you get support for the NXP i.MX8MN BLK CTRL + support. + endmenu diff --git a/drivers/soc/imx/Makefile b/drivers/soc/imx/Makefile index 06c2970e6308..f5243bc5f08f 100644 --- a/drivers/soc/imx/Makefile +++ b/drivers/soc/imx/Makefile @@ -7,3 +7,4 @@ obj-$(CONFIG_IMX_GPCV2_PM_DOMAINS) += gpcv2.o obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o obj-$(CONFIG_SOC_IMX8M) += imx8m-blk-ctrl.o obj-$(CONFIG_SOC_IMX8MM_BLK_CTRL) += imx8mm-blk-ctrl.o +obj-$(CONFIG_SOC_IMX8MN_BLK_CTRL) += imx8mn-blk-ctrl.o diff --git a/drivers/soc/imx/imx8m-blk-ctrl.c b/drivers/soc/imx/imx8m-blk-ctrl.c index 599b2a9a38bb..ebdb044c6afa 100644 --- a/drivers/soc/imx/imx8m-blk-ctrl.c +++ b/drivers/soc/imx/imx8m-blk-ctrl.c @@ -6,8 +6,6 @@ #include -#include - #include "imx8m-blk-ctrl.h" static inline struct imx8m_blk_ctrl_domain * @@ -322,94 +320,3 @@ static int imx8m_blk_ctrl_resume(struct device *dev) const struct dev_pm_ops imx8m_blk_ctrl_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(imx8m_blk_ctrl_suspend, imx8m_blk_ctrl_resume) }; - -static int imx8mn_disp_power_notifier(struct notifier_block *nb, - unsigned long action, void *data) -{ - struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, - power_nb); - - if (action != GENPD_NOTIFY_ON && action != GENPD_NOTIFY_PRE_OFF) - return NOTIFY_OK; - - /* Enable bus clock and deassert bus reset */ - regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(8)); - regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(8)); - - /* - * On power up we have no software backchannel to the GPC to - * wait for the ADB handshake to happen, so we just delay for a - * bit. On power down the GPC driver waits for the handshake. - */ - if (action == GENPD_NOTIFY_ON) - udelay(5); - - - return NOTIFY_OK; -} - -static const struct imx8m_blk_ctrl_domain_data imx8mn_disp_blk_ctl_domain_data[] = { - [IMX8MN_DISPBLK_PD_MIPI_DSI] = { - .name = "dispblk-mipi-dsi", - .clk_names = (const char *[]){ "dsi-pclk", "dsi-ref", }, - .num_clks = 2, - .gpc_name = "mipi-dsi", - .rst_mask = BIT(0) | BIT(1), - .clk_mask = BIT(0) | BIT(1), - .mipi_phy_rst_mask = BIT(17), - }, - [IMX8MN_DISPBLK_PD_MIPI_CSI] = { - .name = "dispblk-mipi-csi", - .clk_names = (const char *[]){ "csi-aclk", "csi-pclk" }, - .num_clks = 2, - .gpc_name = "mipi-csi", - .rst_mask = BIT(2) | BIT(3), - .clk_mask = BIT(2) | BIT(3), - .mipi_phy_rst_mask = BIT(16), - }, - [IMX8MN_DISPBLK_PD_LCDIF] = { - .name = "dispblk-lcdif", - .clk_names = (const char *[]){ "lcdif-axi", "lcdif-apb", "lcdif-pix", }, - .num_clks = 3, - .gpc_name = "lcdif", - .rst_mask = BIT(4) | BIT(5), - .clk_mask = BIT(4) | BIT(5), - }, - [IMX8MN_DISPBLK_PD_ISI] = { - .name = "dispblk-isi", - .clk_names = (const char *[]){ "disp_axi", "disp_apb", "disp_axi_root", - "disp_apb_root"}, - .num_clks = 4, - .gpc_name = "isi", - .rst_mask = BIT(6) | BIT(7), - .clk_mask = BIT(6) | BIT(7), - }, -}; - -static const struct imx8m_blk_ctrl_data imx8mn_disp_blk_ctl_dev_data = { - .max_reg = 0x84, - .power_notifier_fn = imx8mn_disp_power_notifier, - .domains = imx8mn_disp_blk_ctl_domain_data, - .num_domains = ARRAY_SIZE(imx8mn_disp_blk_ctl_domain_data), -}; - -static const struct of_device_id imx8m_blk_ctrl_of_match[] = { - { - .compatible = "fsl,imx8mn-disp-blk-ctrl", - .data = &imx8mn_disp_blk_ctl_dev_data - }, { - /* Sentinel */ - } -}; -MODULE_DEVICE_TABLE(of, imx8m_blk_ctrl_of_match); - -static struct platform_driver imx8m_blk_ctrl_driver = { - .probe = imx8m_blk_ctrl_probe, - .remove = imx8m_blk_ctrl_remove, - .driver = { - .name = "imx8m-blk-ctrl", - .pm = &imx8m_blk_ctrl_pm_ops, - .of_match_table = imx8m_blk_ctrl_of_match, - }, -}; -module_platform_driver(imx8m_blk_ctrl_driver); diff --git a/drivers/soc/imx/imx8mn-blk-ctrl.c b/drivers/soc/imx/imx8mn-blk-ctrl.c new file mode 100644 index 000000000000..20f53cd4e387 --- /dev/null +++ b/drivers/soc/imx/imx8mn-blk-ctrl.c @@ -0,0 +1,101 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/* + * Copyright 2021 Pengutronix, Lucas Stach + * Copyright 2022 NXP, Abel Vesa + */ + +#include + +#include "imx8m-blk-ctrl.h" + +static int imx8mn_disp_power_notifier(struct notifier_block *nb, + unsigned long action, void *data) +{ + struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, + power_nb); + + if (action != GENPD_NOTIFY_ON && action != GENPD_NOTIFY_PRE_OFF) + return NOTIFY_OK; + + /* Enable bus clock and deassert bus reset */ + regmap_set_bits(bc->regmap, BLK_CLK_EN, BIT(8)); + regmap_set_bits(bc->regmap, BLK_SFT_RSTN, BIT(8)); + + /* + * On power up we have no software backchannel to the GPC to + * wait for the ADB handshake to happen, so we just delay for a + * bit. On power down the GPC driver waits for the handshake. + */ + if (action == GENPD_NOTIFY_ON) + udelay(5); + + + return NOTIFY_OK; +} + +static const struct imx8m_blk_ctrl_domain_data imx8mn_disp_blk_ctl_domain_data[] = { + [IMX8MN_DISPBLK_PD_MIPI_DSI] = { + .name = "dispblk-mipi-dsi", + .clk_names = (const char *[]){ "dsi-pclk", "dsi-ref", }, + .num_clks = 2, + .gpc_name = "mipi-dsi", + .rst_mask = BIT(0) | BIT(1), + .clk_mask = BIT(0) | BIT(1), + .mipi_phy_rst_mask = BIT(17), + }, + [IMX8MN_DISPBLK_PD_MIPI_CSI] = { + .name = "dispblk-mipi-csi", + .clk_names = (const char *[]){ "csi-aclk", "csi-pclk" }, + .num_clks = 2, + .gpc_name = "mipi-csi", + .rst_mask = BIT(2) | BIT(3), + .clk_mask = BIT(2) | BIT(3), + .mipi_phy_rst_mask = BIT(16), + }, + [IMX8MN_DISPBLK_PD_LCDIF] = { + .name = "dispblk-lcdif", + .clk_names = (const char *[]){ "lcdif-axi", "lcdif-apb", "lcdif-pix", }, + .num_clks = 3, + .gpc_name = "lcdif", + .rst_mask = BIT(4) | BIT(5), + .clk_mask = BIT(4) | BIT(5), + }, + [IMX8MN_DISPBLK_PD_ISI] = { + .name = "dispblk-isi", + .clk_names = (const char *[]){ "disp_axi", "disp_apb", "disp_axi_root", + "disp_apb_root"}, + .num_clks = 4, + .gpc_name = "isi", + .rst_mask = BIT(6) | BIT(7), + .clk_mask = BIT(6) | BIT(7), + }, +}; + +static const struct imx8m_blk_ctrl_data imx8mn_disp_blk_ctl_dev_data = { + .max_reg = 0x84, + .power_notifier_fn = imx8mn_disp_power_notifier, + .domains = imx8mn_disp_blk_ctl_domain_data, + .num_domains = ARRAY_SIZE(imx8mn_disp_blk_ctl_domain_data), +}; + +static const struct of_device_id imx8mn_blk_ctrl_of_match[] = { + { + .compatible = "fsl,imx8mn-disp-blk-ctrl", + .data = &imx8mn_disp_blk_ctl_dev_data + }, { + /* Sentinel */ + } +}; +MODULE_DEVICE_TABLE(of, imx8mn_blk_ctrl_of_match); + +static struct platform_driver imx8mn_blk_ctrl_driver = { + .probe = imx8m_blk_ctrl_probe, + .remove = imx8m_blk_ctrl_remove, + .driver = { + .name = "imx8mn-blk-ctrl", + .pm = &imx8m_blk_ctrl_pm_ops, + .of_match_table = imx8mn_blk_ctrl_of_match, + }, +}; +module_platform_driver(imx8mn_blk_ctrl_driver); From patchwork Fri Jan 21 11:22:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 12719623 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 591ABC433EF for ; Fri, 21 Jan 2022 11:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=82+lx+STQOVE8SVmZ4DAlWE6LXHQtv73QqjUcPG6yW8=; b=puNGHVGUWg/DEq SNbQTx5WbNXMU384UJanC9FUK/07+7S3L+HyDOuTtiAT9HB+98r5vlvctreTCVSUuciuyjswBFdTP cKE1FLaMi72ArrTnRMVLzdP3pDlWlpcrNm41YGDzdAfrxQoPUowIgCISTjDFFf89diohAhNdvD6lW LHpT7XSuDLqC1hhsZ4mRe/763pTspJ8qAu0q/BOVxN/+3M9tH7LUyinUj5jISv8U7yvQF0ukL+3l5 1QP71W8rv2rm4l7Fqoe+eOYlXryoGSqI/17hHPE3gBSzFrPj65qOupn1mYRjmvzqrpOAvii9OjEyK qKGqwK83PCIzezGUG8NA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAs15-00EliM-4Z; Fri, 21 Jan 2022 11:23:39 +0000 Received: from mail-eopbgr130087.outbound.protection.outlook.com ([40.107.13.87] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAs0W-00ElVG-D1 for linux-arm-kernel@lists.infradead.org; Fri, 21 Jan 2022 11:23:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QfJ5wIF273kO9kP+Ee+w1N+V1L+J4rKJZUS+oVrmeWNFMhP7IQWapBh2Pur/4OGANkOD30CnQ3vb/SV2niAU6pY0mNqL8JdNOF/MshKhTMrLhNH+FjwQSkOP5O8pamOYP6o07GO558vdt9Yxv11VtGNhuxMeI6Fij3PPxdFwT2i5DKsjUoPaNrKSchyiLQZoP7g7d0Tibmhq8EufZdDzs59nz291+kCbIKqGHPx/X61IJpRLbrgqQhbpR2w6vn+JaUMeKqwbx7+ThqQPsfa8QIgOmbZtCoOj8ox/wNFE7RSEfcYws/Ud6kSfCh3vz9oawXj/sHKdjhWtn3MKDHHLJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=V3IKSnQV1ODAqPm2Nk0E+p1P1DBTcXvUIb92QOZi1lA=; b=YHGUwIzPpbA50JYHKZ7FIvRWMN3+ptr+SlSeGcpHRa6vfvSIFuY7BgmEb2czujuX6tEqK5t7n0L08rnV1QEQnNQlLDDTKkPkWu6iCe1mLQksYbgc1+1cV/paPwR5fGu9nqO05ewMElqo3WQ69kvocRlK5OkQn0GBQFECdHZQASAhLvCC3zAzUQ0gHMJeEd8M/5X1lAZlx7NO4Bk2eyP/j+LGx1f2zvgKqMQ2HUaFy6tDDw1Gv5SgYjzQRBrTS7JW7g4qnRI3Ytu06vUdvg65kencWIDPjlSVZTVEL1mGfhfwNDfVf4X9pMbHKvw3urA8Y/PHefkPr/6viMKEj9Z4uw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V3IKSnQV1ODAqPm2Nk0E+p1P1DBTcXvUIb92QOZi1lA=; b=XhDWkcMGbSPZRbj0YIlLdDi2K0Pe0VVqaYXygMbt/uOqBNusQfNovsm848lhb1Nscn2HQx+LiBYSLLEu82XcgW6kciCjMOnm2VtlClcDW293IA+ANXpUVbSsBtjX/yUuipiz1xYEGaPHwbZD/hLHM6yBXivURKrPcWfH9pqw0os= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) by DB8PR04MB6731.eurprd04.prod.outlook.com (2603:10a6:10:104::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Fri, 21 Jan 2022 11:22:54 +0000 Received: from VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::f853:4e9a:7ab6:dbf7]) by VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::f853:4e9a:7ab6:dbf7%6]) with mapi id 15.20.4909.010; Fri, 21 Jan 2022 11:22:53 +0000 From: Abel Vesa To: Shawn Guo , Sascha Hauer , Fabio Estevam , Lucas Stach Cc: Pengutronix Kernel Team , NXP Linux Team , Frieder Schrempf , Ezequiel Garcia , Linux Kernel Mailing List , linux-arm-kernel@lists.infradead.org Subject: [RFC 3/3] soc: imx: Rename generic BLK CTRL driver to suggest future usability Date: Fri, 21 Jan 2022 13:22:38 +0200 Message-Id: <20220121112238.47281-4-abel.vesa@nxp.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220121112238.47281-1-abel.vesa@nxp.com> References: <20220121112238.47281-1-abel.vesa@nxp.com> X-ClientProxiedBy: VI1PR08CA0238.eurprd08.prod.outlook.com (2603:10a6:802:15::47) To VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:6a::30) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 983a08bf-57ea-47ee-d936-08d9dcd05dc4 X-MS-TrafficTypeDiagnostic: DB8PR04MB6731:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1775; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kV0z7+eCQRj4WeHHBjXA9YFQAHyobqiN0y8ugOJOgMVvcaowwvTLrXEtOs043PoGrZtBjLN5eQKo0F2DgnDWqe7hlujty/EEDHqEGAvGkOajsL/jTgHrVmYtOuLl4Dio9JjzvPR7m3RvPpPQPOhIm9ffAiQG90j1Nk2xbKGEbvXqOaS5joSM2EllJ/a+GhZWobPVzdJL1RobIMbiwehfJ6IcxRHg1cdSpq45JHjZWrJSKA0fvXGc5M63GoSdte/F1GLnX0Y7Z4yqmDBWUq8DI+I/CUE8w8wwdCx6OsgLOBikk8BjmEZshcR+XYCIL8I0vsGScRjMDlHludnU5YU0g6dcCXoED17E6lqp28NMWN2xHARYYnebNj5uCA3AMPPt26r8uALO+mOdvtXPC5z4OPrZHuIq4wlR/+F9oAvRqot4HhJAz1h02O1SUdN3oRutJfhPkBUlHH322yled0mBB6sTgrqMbbdlwYPWLpOxDBzABS/WLmpWdj/C9jKMoyNg7+6x9PFzZOfLMg0FT6vnNaIrjRu+8BypYkC4dNzqxSiA7fx5bbmGz6sY+MT/EB7MGoPGB+TndoUTEhu28HBdZz8PmZ8gbhke+e/T8R6w8DXlK7PUyCiS3zBx9TOOJDShsBJhm7grzJsehktd65szSSBMuPFAnIFmURJe2soTXbOPnYY672ARUtbuzg3GhkRmHz70YIcACUP/IieJn/bGg2WvnrwQ8zYR3NsaIezYQt4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB4688.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(38100700002)(38350700002)(52116002)(2616005)(8676002)(6512007)(1076003)(6666004)(316002)(110136005)(54906003)(86362001)(6506007)(30864003)(6486002)(66946007)(5660300002)(4326008)(66556008)(66476007)(8936002)(36756003)(44832011)(83380400001)(2906002)(186003)(26005)(508600001)(41533002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bRYIo+VShwShBhXhMqKdng9NZJGMJ5yy4/RG5Y8QoVcg/GmW9MLRrbswvuv1xXDvxZ4VbUmSFEsEzNtM5uSs2unJWa/rkvmZlNgquVQs/BW9fSCZINICpODanFKUlj2WAgwoE91Rg5nthbydW7f3ypX+JXloi2j981t4uJNhqoTgqeZrl9YzTuiK9/srhFp6Nsj7mNwTa/Zkm5xaqqXVgtwxw9ptbKcJY1X8IX7VjwHI379iPcX4mw+H9gMOFL4ZakUOUQUj5MYbRvAg68SrI+mBNV7T0SnqpQNyFokRHi5DTi3wPIJ1urT90SisSsIzPFGzAUoLKL9CtwRsl23hb2dqRceTEN0ZH37tQC0feZKSNLsfxLbuU8Brmnt3N6ztXBArpZrfsXNOLmMfbKKPP7Zj12cvTIv4QFCtpwJdhoEdUghmk37CMbNQlcdOJBwVqiaV5WIyVOhDSwBXYCneBBs18irfuOZKqHLM01TDheNoFC+fBaOq0/7+qWVx+ffikDQm7XNuLhryAiStAj/38rPHu15I6L0L8AFGe9oOVEZo/A29WjR4uk6Txa2zYJdR6djB+gaA+SQXGXbDxgggC4BoD+il5DtMLtiDfRtB/IKN5ZOUBzoYPoxJILGi/XeWsR5UsfqelB87JjBp3AfJZ6joTxkfJf2gfegM3WcAVM8rn6t0yat5PsPGgG8AAdhjaJew6sMPhvuenTKY1wAxISNv3DrIdIL36wLixXpbm3yPUZYcIrF3R6kk9TJrJWIqQGKPxOevSlSzek9dVzNL2wT/w/O1HLCsylZSS2h/kuNIynNpprybe8S0c9BP5B+ZRlA5pZCHwAab0ZB4dXOm9nGmV/hw9FvdHtdgSihlooGipeYYLJjSRY1vhQjhL2MaJAcMaaBA5ErH93HE63GLVF8GSZ3mYlT/KnjIV5PAufq+b5H/RxGzBUAheUwMqrBhzBXZrOsAoFyQjWIXZufL13vR33IW9gpl5555by5YgkcinIhsHNBFipPSXyQBM8bO1mcoJFGQXwG4dIydY41F2L1R6wq2253HW915AN3khEzEqEb+Q2xGdWNetryOnPxu1bOBVz3pjZl5694kMl5VTFdKgTyiLOoMa9UU9XVcIEbd8IkDxoQwZHANAjyRl/rFvZVqyEpJClv8MLgcfdERYWkeL3+obDCq8N6ZNR8Fzo8K/yWujCSUw4P3OAZIzdY674SYg0Awb8FpkT+gCMynTpwvNRpK0PkkcDvPwxifwGjk+wy9emA3lf/rOY2au12r0oR5XprvKmFiKjVXy/RNsWKwCBVf1uwE7bviolPUBE7CaFgB3SKsJ1Z89T44ERWKnSGFaja7CpiArB3eFLRFoJHjS7ep/8NiaxmKvfx9z9uyor92ivET0c0W+ZeiOIG3OYjdRlKNIHjjrIRkSVdPDnk7cW74ez9roiZ4xclHrrAH/GL/IdnYjSdKl7QWUmlHb/91+23JUD/e2C0S5AKI5cVpysDHo1ejIyOyzXiNJFuU/EWgdOVe1dP62SXjFoi7fvKy1ulwWkMk1iN+v7O5VmpcqE/X10d53T5Kc8bGbSP3V10YDCkew3sVLHADzmJ0yuLAGR6w1Z1AZoU0glvFTeGtKR6nH0Okf5cQBEHgPjo= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 983a08bf-57ea-47ee-d936-08d9dcd05dc4 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB4688.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2022 11:22:53.5063 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +87WGbmiqTHbO6dO7fJGTMEl6IP1+3j77BVwK2u5j7TjcYpMxIFHJY99dI3PeNRkto426P9WYVsYMmfrgDat7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6731 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220121_032304_485982_749D0646 X-CRM114-Status: GOOD ( 18.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org By changing the prefix for every single generic API from "imx8m_" to "imx_" we suggest that it can be used by future i.MX SoC families. Signed-off-by: Abel Vesa --- drivers/soc/imx/Makefile | 2 +- .../imx/{imx8m-blk-ctrl.c => imx-blk-ctrl.c} | 64 +++++++++---------- .../imx/{imx8m-blk-ctrl.h => imx-blk-ctrl.h} | 24 +++---- drivers/soc/imx/imx8mm-blk-ctrl.c | 20 +++--- drivers/soc/imx/imx8mn-blk-ctrl.c | 14 ++-- 5 files changed, 62 insertions(+), 62 deletions(-) rename drivers/soc/imx/{imx8m-blk-ctrl.c => imx-blk-ctrl.c} (79%) rename drivers/soc/imx/{imx8m-blk-ctrl.h => imx-blk-ctrl.h} (72%) diff --git a/drivers/soc/imx/Makefile b/drivers/soc/imx/Makefile index f5243bc5f08f..5cbcb14ab631 100644 --- a/drivers/soc/imx/Makefile +++ b/drivers/soc/imx/Makefile @@ -5,6 +5,6 @@ endif obj-$(CONFIG_HAVE_IMX_GPC) += gpc.o obj-$(CONFIG_IMX_GPCV2_PM_DOMAINS) += gpcv2.o obj-$(CONFIG_SOC_IMX8M) += soc-imx8m.o -obj-$(CONFIG_SOC_IMX8M) += imx8m-blk-ctrl.o +obj-$(CONFIG_SOC_IMX8M) += imx-blk-ctrl.o obj-$(CONFIG_SOC_IMX8MM_BLK_CTRL) += imx8mm-blk-ctrl.o obj-$(CONFIG_SOC_IMX8MN_BLK_CTRL) += imx8mn-blk-ctrl.o diff --git a/drivers/soc/imx/imx8m-blk-ctrl.c b/drivers/soc/imx/imx-blk-ctrl.c similarity index 79% rename from drivers/soc/imx/imx8m-blk-ctrl.c rename to drivers/soc/imx/imx-blk-ctrl.c index ebdb044c6afa..58452a936085 100644 --- a/drivers/soc/imx/imx8m-blk-ctrl.c +++ b/drivers/soc/imx/imx-blk-ctrl.c @@ -6,19 +6,19 @@ #include -#include "imx8m-blk-ctrl.h" +#include "imx-blk-ctrl.h" -static inline struct imx8m_blk_ctrl_domain * -to_imx8m_blk_ctrl_domain(struct generic_pm_domain *genpd) +static inline struct imx_blk_ctrl_domain * +to_imx_blk_ctrl_domain(struct generic_pm_domain *genpd) { - return container_of(genpd, struct imx8m_blk_ctrl_domain, genpd); + return container_of(genpd, struct imx_blk_ctrl_domain, genpd); } -static int imx8m_blk_ctrl_power_on(struct generic_pm_domain *genpd) +static int imx_blk_ctrl_power_on(struct generic_pm_domain *genpd) { - struct imx8m_blk_ctrl_domain *domain = to_imx8m_blk_ctrl_domain(genpd); - const struct imx8m_blk_ctrl_domain_data *data = domain->data; - struct imx8m_blk_ctrl *bc = domain->bc; + struct imx_blk_ctrl_domain *domain = to_imx_blk_ctrl_domain(genpd); + const struct imx_blk_ctrl_domain_data *data = domain->data; + struct imx_blk_ctrl *bc = domain->bc; int ret; /* make sure bus domain is awake */ @@ -70,11 +70,11 @@ static int imx8m_blk_ctrl_power_on(struct generic_pm_domain *genpd) return ret; } -static int imx8m_blk_ctrl_power_off(struct generic_pm_domain *genpd) +static int imx_blk_ctrl_power_off(struct generic_pm_domain *genpd) { - struct imx8m_blk_ctrl_domain *domain = to_imx8m_blk_ctrl_domain(genpd); - const struct imx8m_blk_ctrl_domain_data *data = domain->data; - struct imx8m_blk_ctrl *bc = domain->bc; + struct imx_blk_ctrl_domain *domain = to_imx_blk_ctrl_domain(genpd); + const struct imx_blk_ctrl_domain_data *data = domain->data; + struct imx_blk_ctrl *bc = domain->bc; /* put devices into reset and disable clocks */ if (data->mipi_phy_rst_mask) @@ -93,7 +93,7 @@ static int imx8m_blk_ctrl_power_off(struct generic_pm_domain *genpd) } static struct generic_pm_domain * -imx8m_blk_ctrl_xlate(struct of_phandle_args *args, void *data) +imx_blk_ctrl_xlate(struct of_phandle_args *args, void *data) { struct genpd_onecell_data *onecell_data = data; unsigned int index = args->args[0]; @@ -107,11 +107,11 @@ imx8m_blk_ctrl_xlate(struct of_phandle_args *args, void *data) static struct lock_class_key blk_ctrl_genpd_lock_class; -int imx8m_blk_ctrl_probe(struct platform_device *pdev) +int imx_blk_ctrl_probe(struct platform_device *pdev) { - const struct imx8m_blk_ctrl_data *bc_data; + const struct imx_blk_ctrl_data *bc_data; struct device *dev = &pdev->dev; - struct imx8m_blk_ctrl *bc; + struct imx_blk_ctrl *bc; void __iomem *base; int i, ret; @@ -140,13 +140,13 @@ int imx8m_blk_ctrl_probe(struct platform_device *pdev) "failed to init regmap\n"); bc->domains = devm_kcalloc(dev, bc_data->num_domains, - sizeof(struct imx8m_blk_ctrl_domain), + sizeof(struct imx_blk_ctrl_domain), GFP_KERNEL); if (!bc->domains) return -ENOMEM; bc->onecell_data.num_domains = bc_data->num_domains; - bc->onecell_data.xlate = imx8m_blk_ctrl_xlate; + bc->onecell_data.xlate = imx_blk_ctrl_xlate; bc->onecell_data.domains = devm_kcalloc(dev, bc_data->num_domains, sizeof(struct generic_pm_domain *), GFP_KERNEL); @@ -159,8 +159,8 @@ int imx8m_blk_ctrl_probe(struct platform_device *pdev) "failed to attach power domain\n"); for (i = 0; i < bc_data->num_domains; i++) { - const struct imx8m_blk_ctrl_domain_data *data = &bc_data->domains[i]; - struct imx8m_blk_ctrl_domain *domain = &bc->domains[i]; + const struct imx_blk_ctrl_domain_data *data = &bc_data->domains[i]; + struct imx_blk_ctrl_domain *domain = &bc->domains[i]; int j; domain->data = data; @@ -184,8 +184,8 @@ int imx8m_blk_ctrl_probe(struct platform_device *pdev) } domain->genpd.name = data->name; - domain->genpd.power_on = imx8m_blk_ctrl_power_on; - domain->genpd.power_off = imx8m_blk_ctrl_power_off; + domain->genpd.power_on = imx_blk_ctrl_power_on; + domain->genpd.power_off = imx_blk_ctrl_power_off; domain->bc = bc; ret = pm_genpd_init(&domain->genpd, NULL, true); @@ -241,15 +241,15 @@ int imx8m_blk_ctrl_probe(struct platform_device *pdev) return ret; } -int imx8m_blk_ctrl_remove(struct platform_device *pdev) +int imx_blk_ctrl_remove(struct platform_device *pdev) { - struct imx8m_blk_ctrl *bc = dev_get_drvdata(&pdev->dev); + struct imx_blk_ctrl *bc = dev_get_drvdata(&pdev->dev); int i; of_genpd_del_provider(pdev->dev.of_node); for (i = 0; bc->onecell_data.num_domains; i++) { - struct imx8m_blk_ctrl_domain *domain = &bc->domains[i]; + struct imx_blk_ctrl_domain *domain = &bc->domains[i]; pm_genpd_remove(&domain->genpd); dev_pm_domain_detach(domain->power_dev, true); @@ -263,9 +263,9 @@ int imx8m_blk_ctrl_remove(struct platform_device *pdev) } #ifdef CONFIG_PM_SLEEP -static int imx8m_blk_ctrl_suspend(struct device *dev) +static int imx_blk_ctrl_suspend(struct device *dev) { - struct imx8m_blk_ctrl *bc = dev_get_drvdata(dev); + struct imx_blk_ctrl *bc = dev_get_drvdata(dev); int ret, i; /* @@ -283,7 +283,7 @@ static int imx8m_blk_ctrl_suspend(struct device *dev) } for (i = 0; i < bc->onecell_data.num_domains; i++) { - struct imx8m_blk_ctrl_domain *domain = &bc->domains[i]; + struct imx_blk_ctrl_domain *domain = &bc->domains[i]; ret = pm_runtime_get_sync(domain->power_dev); if (ret < 0) { @@ -303,9 +303,9 @@ static int imx8m_blk_ctrl_suspend(struct device *dev) return ret; } -static int imx8m_blk_ctrl_resume(struct device *dev) +static int imx_blk_ctrl_resume(struct device *dev) { - struct imx8m_blk_ctrl *bc = dev_get_drvdata(dev); + struct imx_blk_ctrl *bc = dev_get_drvdata(dev); int i; for (i = 0; i < bc->onecell_data.num_domains; i++) @@ -317,6 +317,6 @@ static int imx8m_blk_ctrl_resume(struct device *dev) } #endif -const struct dev_pm_ops imx8m_blk_ctrl_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(imx8m_blk_ctrl_suspend, imx8m_blk_ctrl_resume) +const struct dev_pm_ops imx_blk_ctrl_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(imx_blk_ctrl_suspend, imx_blk_ctrl_resume) }; diff --git a/drivers/soc/imx/imx8m-blk-ctrl.h b/drivers/soc/imx/imx-blk-ctrl.h similarity index 72% rename from drivers/soc/imx/imx8m-blk-ctrl.h rename to drivers/soc/imx/imx-blk-ctrl.h index 618b3429bb69..8b70e072db1c 100644 --- a/drivers/soc/imx/imx8m-blk-ctrl.h +++ b/drivers/soc/imx/imx-blk-ctrl.h @@ -18,18 +18,18 @@ #define BLK_CLK_EN 0x4 #define BLK_MIPI_RESET_DIV 0x8 /* Mini/Nano DISPLAY_BLK_CTRL only */ -struct imx8m_blk_ctrl_domain; +struct imx_blk_ctrl_domain; -struct imx8m_blk_ctrl { +struct imx_blk_ctrl { struct device *dev; struct notifier_block power_nb; struct device *bus_power_dev; struct regmap *regmap; - struct imx8m_blk_ctrl_domain *domains; + struct imx_blk_ctrl_domain *domains; struct genpd_onecell_data onecell_data; }; -struct imx8m_blk_ctrl_domain_data { +struct imx_blk_ctrl_domain_data { const char *name; const char * const *clk_names; int num_clks; @@ -49,24 +49,24 @@ struct imx8m_blk_ctrl_domain_data { #define DOMAIN_MAX_CLKS 3 -struct imx8m_blk_ctrl_domain { +struct imx_blk_ctrl_domain { struct generic_pm_domain genpd; - const struct imx8m_blk_ctrl_domain_data *data; + const struct imx_blk_ctrl_domain_data *data; struct clk_bulk_data clks[DOMAIN_MAX_CLKS]; struct device *power_dev; - struct imx8m_blk_ctrl *bc; + struct imx_blk_ctrl *bc; }; -struct imx8m_blk_ctrl_data { +struct imx_blk_ctrl_data { int max_reg; notifier_fn_t power_notifier_fn; - const struct imx8m_blk_ctrl_domain_data *domains; + const struct imx_blk_ctrl_domain_data *domains; int num_domains; }; -extern const struct dev_pm_ops imx8m_blk_ctrl_pm_ops; +extern const struct dev_pm_ops imx_blk_ctrl_pm_ops; -int imx8m_blk_ctrl_remove(struct platform_device *pdev); -int imx8m_blk_ctrl_probe(struct platform_device *pdev); +int imx_blk_ctrl_remove(struct platform_device *pdev); +int imx_blk_ctrl_probe(struct platform_device *pdev); #endif diff --git a/drivers/soc/imx/imx8mm-blk-ctrl.c b/drivers/soc/imx/imx8mm-blk-ctrl.c index eb63d28b0157..15f1e431c1f3 100644 --- a/drivers/soc/imx/imx8mm-blk-ctrl.c +++ b/drivers/soc/imx/imx8mm-blk-ctrl.c @@ -7,12 +7,12 @@ #include -#include "imx8m-blk-ctrl.h" +#include "imx-blk-ctrl.h" static int imx8mm_vpu_power_notifier(struct notifier_block *nb, unsigned long action, void *data) { - struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, + struct imx_blk_ctrl *bc = container_of(nb, struct imx_blk_ctrl, power_nb); if (action != GENPD_NOTIFY_ON && action != GENPD_NOTIFY_PRE_OFF) @@ -45,7 +45,7 @@ static int imx8mm_vpu_power_notifier(struct notifier_block *nb, return NOTIFY_OK; } -static const struct imx8m_blk_ctrl_domain_data imx8mm_vpu_blk_ctl_domain_data[] = { +static const struct imx_blk_ctrl_domain_data imx8mm_vpu_blk_ctl_domain_data[] = { [IMX8MM_VPUBLK_PD_G1] = { .name = "vpublk-g1", .clk_names = (const char *[]){ "g1", }, @@ -72,7 +72,7 @@ static const struct imx8m_blk_ctrl_domain_data imx8mm_vpu_blk_ctl_domain_data[] }, }; -static const struct imx8m_blk_ctrl_data imx8mm_vpu_blk_ctl_dev_data = { +static const struct imx_blk_ctrl_data imx8mm_vpu_blk_ctl_dev_data = { .max_reg = 0x18, .power_notifier_fn = imx8mm_vpu_power_notifier, .domains = imx8mm_vpu_blk_ctl_domain_data, @@ -82,7 +82,7 @@ static const struct imx8m_blk_ctrl_data imx8mm_vpu_blk_ctl_dev_data = { static int imx8mm_disp_power_notifier(struct notifier_block *nb, unsigned long action, void *data) { - struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, + struct imx_blk_ctrl *bc = container_of(nb, struct imx_blk_ctrl, power_nb); if (action != GENPD_NOTIFY_ON && action != GENPD_NOTIFY_PRE_OFF) @@ -104,7 +104,7 @@ static int imx8mm_disp_power_notifier(struct notifier_block *nb, return NOTIFY_OK; } -static const struct imx8m_blk_ctrl_domain_data imx8mm_disp_blk_ctl_domain_data[] = { +static const struct imx_blk_ctrl_domain_data imx8mm_disp_blk_ctl_domain_data[] = { [IMX8MM_DISPBLK_PD_CSI_BRIDGE] = { .name = "dispblk-csi-bridge", .clk_names = (const char *[]){ "csi-bridge-axi", "csi-bridge-apb", @@ -141,7 +141,7 @@ static const struct imx8m_blk_ctrl_domain_data imx8mm_disp_blk_ctl_domain_data[] }, }; -static const struct imx8m_blk_ctrl_data imx8mm_disp_blk_ctl_dev_data = { +static const struct imx_blk_ctrl_data imx8mm_disp_blk_ctl_dev_data = { .max_reg = 0x2c, .power_notifier_fn = imx8mm_disp_power_notifier, .domains = imx8mm_disp_blk_ctl_domain_data, @@ -162,11 +162,11 @@ static const struct of_device_id imx8mm_blk_ctrl_of_match[] = { MODULE_DEVICE_TABLE(of, imx8mm_blk_ctrl_of_match); static struct platform_driver imx8mm_blk_ctrl_driver = { - .probe = imx8m_blk_ctrl_probe, - .remove = imx8m_blk_ctrl_remove, + .probe = imx_blk_ctrl_probe, + .remove = imx_blk_ctrl_remove, .driver = { .name = "imx8mm-blk-ctrl", - .pm = &imx8m_blk_ctrl_pm_ops, + .pm = &imx_blk_ctrl_pm_ops, .of_match_table = imx8mm_blk_ctrl_of_match, }, }; diff --git a/drivers/soc/imx/imx8mn-blk-ctrl.c b/drivers/soc/imx/imx8mn-blk-ctrl.c index 20f53cd4e387..932b81515792 100644 --- a/drivers/soc/imx/imx8mn-blk-ctrl.c +++ b/drivers/soc/imx/imx8mn-blk-ctrl.c @@ -7,12 +7,12 @@ #include -#include "imx8m-blk-ctrl.h" +#include "imx-blk-ctrl.h" static int imx8mn_disp_power_notifier(struct notifier_block *nb, unsigned long action, void *data) { - struct imx8m_blk_ctrl *bc = container_of(nb, struct imx8m_blk_ctrl, + struct imx_blk_ctrl *bc = container_of(nb, struct imx_blk_ctrl, power_nb); if (action != GENPD_NOTIFY_ON && action != GENPD_NOTIFY_PRE_OFF) @@ -34,7 +34,7 @@ static int imx8mn_disp_power_notifier(struct notifier_block *nb, return NOTIFY_OK; } -static const struct imx8m_blk_ctrl_domain_data imx8mn_disp_blk_ctl_domain_data[] = { +static const struct imx_blk_ctrl_domain_data imx8mn_disp_blk_ctl_domain_data[] = { [IMX8MN_DISPBLK_PD_MIPI_DSI] = { .name = "dispblk-mipi-dsi", .clk_names = (const char *[]){ "dsi-pclk", "dsi-ref", }, @@ -72,7 +72,7 @@ static const struct imx8m_blk_ctrl_domain_data imx8mn_disp_blk_ctl_domain_data[] }, }; -static const struct imx8m_blk_ctrl_data imx8mn_disp_blk_ctl_dev_data = { +static const struct imx_blk_ctrl_data imx8mn_disp_blk_ctl_dev_data = { .max_reg = 0x84, .power_notifier_fn = imx8mn_disp_power_notifier, .domains = imx8mn_disp_blk_ctl_domain_data, @@ -90,11 +90,11 @@ static const struct of_device_id imx8mn_blk_ctrl_of_match[] = { MODULE_DEVICE_TABLE(of, imx8mn_blk_ctrl_of_match); static struct platform_driver imx8mn_blk_ctrl_driver = { - .probe = imx8m_blk_ctrl_probe, - .remove = imx8m_blk_ctrl_remove, + .probe = imx_blk_ctrl_probe, + .remove = imx_blk_ctrl_remove, .driver = { .name = "imx8mn-blk-ctrl", - .pm = &imx8m_blk_ctrl_pm_ops, + .pm = &imx_blk_ctrl_pm_ops, .of_match_table = imx8mn_blk_ctrl_of_match, }, };