diff options
author | Semwal, Sumit <sumit.semwal@ti.com> | 2011-03-01 03:42:13 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-03-11 08:46:26 -0500 |
commit | fd4b34f60736a20c5acd81cbb3083a0c60ae058e (patch) | |
tree | f1ad8b71aae0336de1e68727f795df8f20872ac8 /arch/arm/mach-omap2/display.c | |
parent | 4b6b7fa2d3677d1d86780c73fe2284147713e3b1 (diff) |
OMAP2PLUS:DSS2: add opt_clock_available in pdata
Provide a function in pdata to allow dss submodules to check if a given
clock is available on a platform as an optional clock.
Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
(based on implementation from Senthil)
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/display.c')
-rw-r--r-- | arch/arm/mach-omap2/display.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 16d0db6718ae..256d23fb79ab 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c | |||
@@ -42,6 +42,20 @@ static struct omap_device_pm_latency omap_dss_latency[] = { | |||
42 | }, | 42 | }, |
43 | }; | 43 | }; |
44 | 44 | ||
45 | /* oh_core is used for getting opt-clocks */ | ||
46 | static struct omap_hwmod *oh_core; | ||
47 | |||
48 | static bool opt_clock_available(const char *clk_role) | ||
49 | { | ||
50 | int i; | ||
51 | |||
52 | for (i = 0; i < oh_core->opt_clks_cnt; i++) { | ||
53 | if (!strcmp(oh_core->opt_clks[i].role, clk_role)) | ||
54 | return true; | ||
55 | } | ||
56 | return false; | ||
57 | } | ||
58 | |||
45 | int __init omap_display_init(struct omap_dss_board_info *board_data) | 59 | int __init omap_display_init(struct omap_dss_board_info *board_data) |
46 | { | 60 | { |
47 | int r = 0; | 61 | int r = 0; |
@@ -74,9 +88,16 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) | |||
74 | oh_count = ARRAY_SIZE(oh_name) - 2; | 88 | oh_count = ARRAY_SIZE(oh_name) - 2; |
75 | /* last 2 hwmod dev in oh_name are not available for omap3 */ | 89 | /* last 2 hwmod dev in oh_name are not available for omap3 */ |
76 | 90 | ||
91 | /* opt_clks are always associated with dss hwmod */ | ||
92 | oh_core = omap_hwmod_lookup("dss_core"); | ||
93 | if (!oh_core) { | ||
94 | pr_err("Could not look up dss_core.\n"); | ||
95 | return -ENODEV; | ||
96 | } | ||
77 | 97 | ||
78 | pdata.board_data = board_data; | 98 | pdata.board_data = board_data; |
79 | pdata.board_data->get_last_off_on_transaction_id = NULL; | 99 | pdata.board_data->get_last_off_on_transaction_id = NULL; |
100 | pdata.opt_clock_available = opt_clock_available; | ||
80 | 101 | ||
81 | for (i = 0; i < oh_count; i++) { | 102 | for (i = 0; i < oh_count; i++) { |
82 | oh = omap_hwmod_lookup(oh_name[i]); | 103 | oh = omap_hwmod_lookup(oh_name[i]); |
@@ -84,6 +105,7 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) | |||
84 | pr_err("Could not look up %s\n", oh_name[i]); | 105 | pr_err("Could not look up %s\n", oh_name[i]); |
85 | return -ENODEV; | 106 | return -ENODEV; |
86 | } | 107 | } |
108 | |||
87 | od = omap_device_build(dev_name[i], -1, oh, &pdata, | 109 | od = omap_device_build(dev_name[i], -1, oh, &pdata, |
88 | sizeof(struct omap_display_platform_data), | 110 | sizeof(struct omap_display_platform_data), |
89 | omap_dss_latency, | 111 | omap_dss_latency, |