aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2018-02-22 17:00:25 -0500
committerTony Lindgren <tony@atomide.com>2018-02-26 17:16:11 -0500
commitef70b0bdeaf893dd6d9c3a8d05d9b65d395506c0 (patch)
treeeffa518b4c6aa995e55a9dfe04c7ad56f73e6702 /include/linux
parentdd57ac1e5c1c6dac90564c69e57d5ba4a132969e (diff)
bus: ti-sysc: Add support for platform data callbacks
We want to pass the device tree configuration for interconnect target modules from ti-sysc driver to the existing platform hwmod code. This allows us to first validate the dts data against the existing platform data before we start dropping the platform data in favor of device tree data. To do this, let's add platform data callbacks for PM runtime functions to call for the interconnect target modules if platform data is available. Note that as ti-sysc driver can rebind, omap_auxdata_lookup and related functions can no longer be __init. Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/platform_data/ti-sysc.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h
index 1be356330b96..4176cb90e195 100644
--- a/include/linux/platform_data/ti-sysc.h
+++ b/include/linux/platform_data/ti-sysc.h
@@ -16,6 +16,10 @@ enum ti_sysc_module_type {
16 TI_SYSC_OMAP4_USB_HOST_FS, 16 TI_SYSC_OMAP4_USB_HOST_FS,
17}; 17};
18 18
19struct ti_sysc_cookie {
20 void *data;
21};
22
19/** 23/**
20 * struct sysc_regbits - TI OCP_SYSCONFIG register field offsets 24 * struct sysc_regbits - TI OCP_SYSCONFIG register field offsets
21 * @midle_shift: Offset of the midle bit 25 * @midle_shift: Offset of the midle bit
@@ -83,4 +87,49 @@ struct sysc_config {
83 u32 quirks; 87 u32 quirks;
84}; 88};
85 89
90enum sysc_registers {
91 SYSC_REVISION,
92 SYSC_SYSCONFIG,
93 SYSC_SYSSTATUS,
94 SYSC_MAX_REGS,
95};
96
97/**
98 * struct ti_sysc_module_data - ti-sysc to hwmod translation data for a module
99 * @name: legacy "ti,hwmods" module name
100 * @module_pa: physical address of the interconnect target module
101 * @module_size: size of the interconnect target module
102 * @offsets: array of register offsets as listed in enum sysc_registers
103 * @nr_offsets: number of registers
104 * @cap: interconnect target module capabilities
105 * @cfg: interconnect target module configuration
106 *
107 * This data is enough to allocate a new struct omap_hwmod_class_sysconfig
108 * based on device tree data parsed by ti-sysc driver.
109 */
110struct ti_sysc_module_data {
111 const char *name;
112 u64 module_pa;
113 u32 module_size;
114 int *offsets;
115 int nr_offsets;
116 const struct sysc_capabilities *cap;
117 struct sysc_config *cfg;
118};
119
120struct device;
121
122struct ti_sysc_platform_data {
123 struct of_dev_auxdata *auxdata;
124 int (*init_module)(struct device *dev,
125 const struct ti_sysc_module_data *data,
126 struct ti_sysc_cookie *cookie);
127 int (*enable_module)(struct device *dev,
128 const struct ti_sysc_cookie *cookie);
129 int (*idle_module)(struct device *dev,
130 const struct ti_sysc_cookie *cookie);
131 int (*shutdown_module)(struct device *dev,
132 const struct ti_sysc_cookie *cookie);
133};
134
86#endif /* __TI_SYSC_DATA_H__ */ 135#endif /* __TI_SYSC_DATA_H__ */