From patchwork Mon May 15 18:35:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 13242061 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 1FD8EC7EE24 for ; Mon, 15 May 2023 18:35:50 +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=OeA+nYJjg/wjT2+VZEkhVdzJMbOI5XnQedwUZxtqfGQ=; b=s65tc7+yEsaUK/ 830UUAgOoM+bCooHf/eodwKt7FywZizJt+GudG5dJS0SSHM0K4Rty8BMgpnhOB9L35UAesoc9RGcr kp/bhuPlAjv+4cB/mathSoZebICSZxTssFdFTwTokdAWrEWL98JrQz7oJ2xNyO4/mDZVn5QWXGmYT Da8J+Lz5XwDpfQmJ13O9oiPLywR6PlxBU30AJBXR6UFPJOQMbTH1YO2l3a7wMYRDSaZERLr2JWIEk rK85CB8PW5HTM3V2Gmcm3tDyYHvdP3yOmBY5RZ5KFe2B3Hh3e5VPqkjbUggbRRFccOzzsWYUf4qry woVPPliCPfz8z6L2DHbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyd2d-0039SG-09; Mon, 15 May 2023 18:35:27 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyd2Z-0039Qb-0b for linux-arm-kernel@lists.infradead.org; Mon, 15 May 2023 18:35:24 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 34FIZHJj036901; Mon, 15 May 2023 13:35:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1684175717; bh=xwIE6bmUKSyNu94MutgqMrmchU0RO3UTij1CjBXeXYs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=VKgpyqRZ82xyycLB4kjBZAMPEt5SAbnvBYVD6gYQUGHdyZbWjBWfGGBsv5t6gQgYP e8+ozk9pzD5HDbNTInN8sO2ieBzUY0N7tXyVK1C54V08dwnpocENZbgV4PIQSPeEWX O8gafmw+RqwJqo3KGzripBiGJxgXDWT8I6rNrzIQ= Received: from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 34FIZHIv126958 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 15 May 2023 13:35:17 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 15 May 2023 13:35:17 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 15 May 2023 13:35:17 -0500 Received: from lelv0327.itg.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 34FIZGXO103396; Mon, 15 May 2023 13:35:16 -0500 From: Andrew Davis To: Nishanth Menon , Vignesh Raghavendra , Santosh Shilimkar , Rob Herring , Krzysztof Kozlowski CC: , , , Andrew Davis Subject: [PATCH 2/5] ARM: keystone: Merge PM function into main support file Date: Mon, 15 May 2023 13:35:12 -0500 Message-ID: <20230515183515.509371-2-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230515183515.509371-1-afd@ti.com> References: <20230515183515.509371-1-afd@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230515_113523_331977_51A7D2DF X-CRM114-Status: GOOD ( 20.27 ) 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 one function left in this file does not justify a whole extra file nor the keystone.h support file used to forward declare that function. Merge this into the main keystone.c file. Signed-off-by: Andrew Davis --- arch/arm/mach-keystone/Makefile | 3 -- arch/arm/mach-keystone/keystone.c | 37 ++++++++++++++++++++-- arch/arm/mach-keystone/keystone.h | 16 ---------- arch/arm/mach-keystone/pm_domain.c | 50 ------------------------------ 4 files changed, 35 insertions(+), 71 deletions(-) delete mode 100644 arch/arm/mach-keystone/keystone.h delete mode 100644 arch/arm/mach-keystone/pm_domain.c diff --git a/arch/arm/mach-keystone/Makefile b/arch/arm/mach-keystone/Makefile index 0c1d54aec60f..66598d29dd3c 100644 --- a/arch/arm/mach-keystone/Makefile +++ b/arch/arm/mach-keystone/Makefile @@ -1,5 +1,2 @@ # SPDX-License-Identifier: GPL-2.0 obj-y := keystone.o - -# PM domain driver for Keystone SOCs -obj-$(CONFIG_ARCH_KEYSTONE) += pm_domain.o diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c index fdc7d3621bd0..a870b3f46f1a 100644 --- a/arch/arm/mach-keystone/keystone.c +++ b/arch/arm/mach-keystone/keystone.c @@ -6,10 +6,13 @@ * Cyril Chemparathy * Santosh Shilimkar */ + #include #include #include #include +#include +#include #include #include #include @@ -20,8 +23,6 @@ #include #include -#include "keystone.h" - #define KEYSTONE_LOW_PHYS_START 0x80000000ULL #define KEYSTONE_LOW_PHYS_SIZE 0x80000000ULL /* 2G */ #define KEYSTONE_LOW_PHYS_END (KEYSTONE_LOW_PHYS_START + \ @@ -32,6 +33,38 @@ #define KEYSTONE_HIGH_PHYS_END (KEYSTONE_HIGH_PHYS_START + \ KEYSTONE_HIGH_PHYS_SIZE - 1) +static struct dev_pm_domain keystone_pm_domain = { + .ops = { + USE_PM_CLK_RUNTIME_OPS + USE_PLATFORM_PM_SLEEP_OPS + }, +}; + +static struct pm_clk_notifier_block platform_domain_notifier = { + .pm_domain = &keystone_pm_domain, + .con_ids = { NULL }, +}; + +static const struct of_device_id of_keystone_table[] = { + {.compatible = "ti,k2hk"}, + {.compatible = "ti,k2e"}, + {.compatible = "ti,k2l"}, + { /* end of list */ }, +}; + +int __init keystone_pm_runtime_init(void) +{ + struct device_node *np; + + np = of_find_matching_node(NULL, of_keystone_table); + if (!np) + return 0; + + pm_clk_add_notifier(&platform_bus_type, &platform_domain_notifier); + + return 0; +} + #ifdef CONFIG_ARM_LPAE static int keystone_platform_notifier(struct notifier_block *nb, unsigned long event, void *data) diff --git a/arch/arm/mach-keystone/keystone.h b/arch/arm/mach-keystone/keystone.h deleted file mode 100644 index 71ff8cd2ee4a..000000000000 --- a/arch/arm/mach-keystone/keystone.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Copyright 2013 Texas Instruments, Inc. - * Cyril Chemparathy - * Santosh Shilimkar - */ - -#ifndef __KEYSTONE_H__ -#define __KEYSTONE_H__ - -#ifndef __ASSEMBLER__ - -extern int keystone_pm_runtime_init(void); - -#endif /* __ASSEMBLER__ */ -#endif /* __KEYSTONE_H__ */ diff --git a/arch/arm/mach-keystone/pm_domain.c b/arch/arm/mach-keystone/pm_domain.c deleted file mode 100644 index 5eea01cbecf0..000000000000 --- a/arch/arm/mach-keystone/pm_domain.c +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * PM domain driver for Keystone2 devices - * - * Copyright 2013 Texas Instruments, Inc. - * Santosh Shilimkar - * - * Based on Kevins work on DAVINCI SOCs - * Kevin Hilman - */ - -#include -#include -#include -#include -#include - -#include "keystone.h" - -static struct dev_pm_domain keystone_pm_domain = { - .ops = { - USE_PM_CLK_RUNTIME_OPS - USE_PLATFORM_PM_SLEEP_OPS - }, -}; - -static struct pm_clk_notifier_block platform_domain_notifier = { - .pm_domain = &keystone_pm_domain, - .con_ids = { NULL }, -}; - -static const struct of_device_id of_keystone_table[] = { - {.compatible = "ti,k2hk"}, - {.compatible = "ti,k2e"}, - {.compatible = "ti,k2l"}, - { /* end of list */ }, -}; - -int __init keystone_pm_runtime_init(void) -{ - struct device_node *np; - - np = of_find_matching_node(NULL, of_keystone_table); - if (!np) - return 0; - - pm_clk_add_notifier(&platform_bus_type, &platform_domain_notifier); - - return 0; -}