aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_hwmod_common_data.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2017-12-15 12:41:05 -0500
committerTony Lindgren <tony@atomide.com>2017-12-21 10:28:54 -0500
commit49a0a3d805df3b7b4f8a04db6dbf55aa36fd762c (patch)
treefa107287f9d83dfa994e90658c18dee1b9f46fe3 /arch/arm/mach-omap2/omap_hwmod_common_data.c
parentbf80705222987ea4c75d75af2c404373765b77c6 (diff)
bus: ti-sysc: Make omap_hwmod_sysc_fields into sysc_regbits platform data
We want to be able to configure hwmod sysc data from ti-sysc driver using platform data callbacks. So let's make struct omap_hwmod_sysc_fields into struct sysc_data and have it available for both ti-sysc driver and hwmod code. Note that we can make it use s8 instead of u8 as the hwmod code uses the feature flags to check for this field. However, for ti-sysc we can use -ENODEV to indicate a feature is not supported in the hardware and can simplify the code that way. And let's add also emufree_shift as the dts files will be describing the hardware for the SYSCONFIG register capbilities mask. Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod_common_data.c')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_common_data.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.c b/arch/arm/mach-omap2/omap_hwmod_common_data.c
index 4fb5fcacdf1d..77c0b7618ea2 100644
--- a/arch/arm/mach-omap2/omap_hwmod_common_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_common_data.c
@@ -16,6 +16,9 @@
16 * data and their integration with other OMAP modules and Linux. 16 * data and their integration with other OMAP modules and Linux.
17 */ 17 */
18 18
19#include <linux/types.h>
20#include <linux/platform_data/ti-sysc.h>
21
19#include "omap_hwmod.h" 22#include "omap_hwmod.h"
20 23
21#include "omap_hwmod_common_data.h" 24#include "omap_hwmod_common_data.h"
@@ -27,7 +30,7 @@
27 * if the device ip is compliant with the original PRCM protocol 30 * if the device ip is compliant with the original PRCM protocol
28 * defined for OMAP2420. 31 * defined for OMAP2420.
29 */ 32 */
30struct omap_hwmod_sysc_fields omap_hwmod_sysc_type1 = { 33struct sysc_regbits omap_hwmod_sysc_type1 = {
31 .midle_shift = SYSC_TYPE1_MIDLEMODE_SHIFT, 34 .midle_shift = SYSC_TYPE1_MIDLEMODE_SHIFT,
32 .clkact_shift = SYSC_TYPE1_CLOCKACTIVITY_SHIFT, 35 .clkact_shift = SYSC_TYPE1_CLOCKACTIVITY_SHIFT,
33 .sidle_shift = SYSC_TYPE1_SIDLEMODE_SHIFT, 36 .sidle_shift = SYSC_TYPE1_SIDLEMODE_SHIFT,
@@ -43,7 +46,7 @@ struct omap_hwmod_sysc_fields omap_hwmod_sysc_type1 = {
43 * device ip is compliant with the new PRCM protocol defined for new 46 * device ip is compliant with the new PRCM protocol defined for new
44 * OMAP4 IPs. 47 * OMAP4 IPs.
45 */ 48 */
46struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2 = { 49struct sysc_regbits omap_hwmod_sysc_type2 = {
47 .midle_shift = SYSC_TYPE2_MIDLEMODE_SHIFT, 50 .midle_shift = SYSC_TYPE2_MIDLEMODE_SHIFT,
48 .sidle_shift = SYSC_TYPE2_SIDLEMODE_SHIFT, 51 .sidle_shift = SYSC_TYPE2_SIDLEMODE_SHIFT,
49 .srst_shift = SYSC_TYPE2_SOFTRESET_SHIFT, 52 .srst_shift = SYSC_TYPE2_SOFTRESET_SHIFT,
@@ -54,7 +57,7 @@ struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2 = {
54 * struct omap_hwmod_sysc_type3 - TYPE3 sysconfig scheme. 57 * struct omap_hwmod_sysc_type3 - TYPE3 sysconfig scheme.
55 * Used by some IPs on AM33xx 58 * Used by some IPs on AM33xx
56 */ 59 */
57struct omap_hwmod_sysc_fields omap_hwmod_sysc_type3 = { 60struct sysc_regbits omap_hwmod_sysc_type3 = {
58 .midle_shift = SYSC_TYPE3_MIDLEMODE_SHIFT, 61 .midle_shift = SYSC_TYPE3_MIDLEMODE_SHIFT,
59 .sidle_shift = SYSC_TYPE3_SIDLEMODE_SHIFT, 62 .sidle_shift = SYSC_TYPE3_SIDLEMODE_SHIFT,
60}; 63};
@@ -64,32 +67,32 @@ struct omap_dss_dispc_dev_attr omap2_3_dss_dispc_dev_attr = {
64 .has_framedonetv_irq = 0 67 .has_framedonetv_irq = 0
65}; 68};
66 69
67struct omap_hwmod_sysc_fields omap34xx_sr_sysc_fields = { 70struct sysc_regbits omap34xx_sr_sysc_fields = {
68 .clkact_shift = 20, 71 .clkact_shift = 20,
69}; 72};
70 73
71struct omap_hwmod_sysc_fields omap36xx_sr_sysc_fields = { 74struct sysc_regbits omap36xx_sr_sysc_fields = {
72 .sidle_shift = 24, 75 .sidle_shift = 24,
73 .enwkup_shift = 26, 76 .enwkup_shift = 26,
74}; 77};
75 78
76struct omap_hwmod_sysc_fields omap3_sham_sysc_fields = { 79struct sysc_regbits omap3_sham_sysc_fields = {
77 .sidle_shift = 4, 80 .sidle_shift = 4,
78 .srst_shift = 1, 81 .srst_shift = 1,
79 .autoidle_shift = 0, 82 .autoidle_shift = 0,
80}; 83};
81 84
82struct omap_hwmod_sysc_fields omap3xxx_aes_sysc_fields = { 85struct sysc_regbits omap3xxx_aes_sysc_fields = {
83 .sidle_shift = 6, 86 .sidle_shift = 6,
84 .srst_shift = 1, 87 .srst_shift = 1,
85 .autoidle_shift = 0, 88 .autoidle_shift = 0,
86}; 89};
87 90
88struct omap_hwmod_sysc_fields omap_hwmod_sysc_type_mcasp = { 91struct sysc_regbits omap_hwmod_sysc_type_mcasp = {
89 .sidle_shift = 0, 92 .sidle_shift = 0,
90}; 93};
91 94
92struct omap_hwmod_sysc_fields omap_hwmod_sysc_type_usb_host_fs = { 95struct sysc_regbits omap_hwmod_sysc_type_usb_host_fs = {
93 .midle_shift = 4, 96 .midle_shift = 4,
94 .sidle_shift = 2, 97 .sidle_shift = 2,
95 .srst_shift = 1, 98 .srst_shift = 1,