Skip to content

Commit d33dbdd

Browse files
glneonmenon
authored andcommitted
ARM: keystone: Merge PM function into main support file
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 <afd@ti.com> Link: https://lore.kernel.org/r/20230726160441.101566-2-afd@ti.com Signed-off-by: Nishanth Menon <nm@ti.com>
1 parent 04a0137 commit d33dbdd

File tree

4 files changed

+36
-71
lines changed

4 files changed

+36
-71
lines changed

arch/arm/mach-keystone/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
# SPDX-License-Identifier: GPL-2.0
22
obj-y := keystone.o
3-
4-
# PM domain driver for Keystone SOCs
5-
obj-$(CONFIG_ARCH_KEYSTONE) += pm_domain.o

arch/arm/mach-keystone/keystone.c

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66
* Cyril Chemparathy <cyril@ti.com>
77
* Santosh Shilimkar <santosh.shillimkar@ti.com>
88
*/
9+
910
#include <linux/io.h>
1011
#include <linux/dma-map-ops.h>
1112
#include <linux/init.h>
13+
#include <linux/pm_runtime.h>
14+
#include <linux/pm_clock.h>
1215
#include <linux/memblock.h>
16+
#include <linux/of.h>
1317
#include <linux/platform_device.h>
1418

1519
#include <asm/setup.h>
@@ -18,8 +22,6 @@
1822
#include <asm/mach/time.h>
1923
#include <asm/page.h>
2024

21-
#include "keystone.h"
22-
2325
#define KEYSTONE_LOW_PHYS_START 0x80000000ULL
2426
#define KEYSTONE_LOW_PHYS_SIZE 0x80000000ULL /* 2G */
2527
#define KEYSTONE_LOW_PHYS_END (KEYSTONE_LOW_PHYS_START + \
@@ -30,6 +32,38 @@
3032
#define KEYSTONE_HIGH_PHYS_END (KEYSTONE_HIGH_PHYS_START + \
3133
KEYSTONE_HIGH_PHYS_SIZE - 1)
3234

35+
static struct dev_pm_domain keystone_pm_domain = {
36+
.ops = {
37+
USE_PM_CLK_RUNTIME_OPS
38+
USE_PLATFORM_PM_SLEEP_OPS
39+
},
40+
};
41+
42+
static struct pm_clk_notifier_block platform_domain_notifier = {
43+
.pm_domain = &keystone_pm_domain,
44+
.con_ids = { NULL },
45+
};
46+
47+
static const struct of_device_id of_keystone_table[] = {
48+
{.compatible = "ti,k2hk"},
49+
{.compatible = "ti,k2e"},
50+
{.compatible = "ti,k2l"},
51+
{ /* end of list */ },
52+
};
53+
54+
static int __init keystone_pm_runtime_init(void)
55+
{
56+
struct device_node *np;
57+
58+
np = of_find_matching_node(NULL, of_keystone_table);
59+
if (!np)
60+
return 0;
61+
62+
pm_clk_add_notifier(&platform_bus_type, &platform_domain_notifier);
63+
64+
return 0;
65+
}
66+
3367
#ifdef CONFIG_ARM_LPAE
3468
static int keystone_platform_notifier(struct notifier_block *nb,
3569
unsigned long event, void *data)

arch/arm/mach-keystone/keystone.h

Lines changed: 0 additions & 16 deletions
This file was deleted.

arch/arm/mach-keystone/pm_domain.c

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)