aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-03-18 18:40:38 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-03-18 18:40:38 +0100
commitac9f31096bc5dc67f05de79ac4c537af12afde6f (patch)
tree31186d13a2fc0b5ab4504172a8794bd010ad7d1f /include
parentMerge branches 'pm-sleep', 'pm-domains' and 'pm-docs' (diff)
parentpowercap: DTPM: Fix spelling mistake "initialze" -> "initialize" (diff)
downloadlinux-dev-ac9f31096bc5dc67f05de79ac4c537af12afde6f.tar.xz
linux-dev-ac9f31096bc5dc67f05de79ac4c537af12afde6f.zip
Merge branch 'powercap'
Merge Dynamic Thermal Power Management (DTPM) changes for 5.18-rc1: - Add DTPM hierarchy description (Daniel Lezcano). - Change the locking scheme in DTPM (Daniel Lezcano). - Fix dtpm_cpu cleanup at exit time and missing virtual DTPM pointer release (Daniel Lezcano). - Make dtpm_node_callback[] static (kernel test robot). - Fix spelling mistake "initialze" -> "initialize" in dtpm_create_hierarchy() (Colin Ian King). * powercap: powercap: DTPM: Fix spelling mistake "initialze" -> "initialize" powercap: DTPM: dtpm_node_callback[] can be static dtpm/soc/rk3399: Add the ability to unload the module powercap/dtpm_cpu: Add exit function powercap/dtpm: Move the 'root' reset place powercap/dtpm: Destroy hierarchy function powercap/dtpm: Fixup kfree for virtual node powercap/dtpm_cpu: Reset per_cpu variable in the release function powercap/dtpm: Change locking scheme rockchip/soc/drivers: Add DTPM description for rk3399 powercap/drivers/dtpm: Add dtpm devfreq with energy model support powercap/drivers/dtpm: Add CPU DT initialization support powercap/drivers/dtpm: Add hierarchy creation powercap/drivers/dtpm: Convert the init table section to a simple array
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/vmlinux.lds.h11
-rw-r--r--include/linux/dtpm.h36
2 files changed, 18 insertions, 29 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 42f3866bca69..2a10db2f0bc5 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -321,16 +321,6 @@
#define THERMAL_TABLE(name)
#endif
-#ifdef CONFIG_DTPM
-#define DTPM_TABLE() \
- . = ALIGN(8); \
- __dtpm_table = .; \
- KEEP(*(__dtpm_table)) \
- __dtpm_table_end = .;
-#else
-#define DTPM_TABLE()
-#endif
-
#define KERNEL_DTB() \
STRUCT_ALIGN(); \
__dtb_start = .; \
@@ -723,7 +713,6 @@
ACPI_PROBE_TABLE(irqchip) \
ACPI_PROBE_TABLE(timer) \
THERMAL_TABLE(governor) \
- DTPM_TABLE() \
EARLYCON_TABLE() \
LSM_TABLE() \
EARLY_LSM_TABLE() \
diff --git a/include/linux/dtpm.h b/include/linux/dtpm.h
index d37e5d06a357..a4a13514b730 100644
--- a/include/linux/dtpm.h
+++ b/include/linux/dtpm.h
@@ -32,28 +32,25 @@ struct dtpm_ops {
void (*release)(struct dtpm *);
};
-typedef int (*dtpm_init_t)(void);
+struct device_node;
-struct dtpm_descr {
- dtpm_init_t init;
+struct dtpm_subsys_ops {
+ const char *name;
+ int (*init)(void);
+ void (*exit)(void);
+ int (*setup)(struct dtpm *, struct device_node *);
};
-/* Init section thermal table */
-extern struct dtpm_descr __dtpm_table[];
-extern struct dtpm_descr __dtpm_table_end[];
-
-#define DTPM_TABLE_ENTRY(name, __init) \
- static struct dtpm_descr __dtpm_table_entry_##name \
- __used __section("__dtpm_table") = { \
- .init = __init, \
- }
-
-#define DTPM_DECLARE(name, init) DTPM_TABLE_ENTRY(name, init)
+enum DTPM_NODE_TYPE {
+ DTPM_NODE_VIRTUAL = 0,
+ DTPM_NODE_DT,
+};
-#define for_each_dtpm_table(__dtpm) \
- for (__dtpm = __dtpm_table; \
- __dtpm < __dtpm_table_end; \
- __dtpm++)
+struct dtpm_node {
+ enum DTPM_NODE_TYPE type;
+ const char *name;
+ struct dtpm_node *parent;
+};
static inline struct dtpm *to_dtpm(struct powercap_zone *zone)
{
@@ -70,4 +67,7 @@ void dtpm_unregister(struct dtpm *dtpm);
int dtpm_register(const char *name, struct dtpm *dtpm, struct dtpm *parent);
+int dtpm_create_hierarchy(struct of_device_id *dtpm_match_table);
+
+void dtpm_destroy_hierarchy(void);
#endif