From: Sumit Semwal <sumit.semwal@ti.com>
To: tomi.valkeinen@ti.com, linux-omap@vger.kernel.org
Cc: Sumit Semwal <sumit.semwal@ti.com>,
Senthilvadivu Guruswamy <svadivu@ti.com>
Subject: [Patch v3 1/2] OMAP2PLUS:DSS2: add opt_clock_available in pdata
Date: Tue, 1 Mar 2011 14:12:13 +0530 [thread overview]
Message-ID: <1298968934-22697-2-git-send-email-sumit.semwal@ti.com> (raw)
In-Reply-To: <1298968934-22697-1-git-send-email-sumit.semwal@ti.com>
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>
---
arch/arm/mach-omap2/display.c | 22 ++++++++++++++++++++++
arch/arm/plat-omap/include/plat/display.h | 2 ++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 5ab6a74..6b1efc5 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[] = {
},
};
+/* oh_core is used for getting opt-clocks */
+static struct omap_hwmod *oh_core;
+
+static bool opt_clock_available(const char *clk_role)
+{
+ int i;
+
+ for (i = 0; i < oh_core->opt_clks_cnt; i++) {
+ if (!strcmp(oh_core->opt_clks[i].role, clk_role))
+ return true;
+ }
+ return false;
+}
+
int __init omap_display_init(struct omap_dss_board_info *board_data)
{
int r = 0;
@@ -73,9 +87,16 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
oh_count = ARRAY_SIZE(oh_name) - 2;
/* last 2 hwmod dev in oh_name are not available for omap3 */
+ /* opt_clks are always associated with dss hwmod */
+ oh_core = omap_hwmod_lookup("dss_core");
+ if (!oh_core) {
+ pr_err("Could not look up dss_core.\n");
+ return -ENODEV;
+ }
pdata.board_data = board_data;
pdata.board_data->get_last_off_on_transaction_id = NULL;
+ pdata.opt_clock_available = opt_clock_available;
for (i = 0; i < oh_count; i++) {
oh = omap_hwmod_lookup(oh_name[i]);
@@ -83,6 +104,7 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
pr_err("Could not look up %s\n", oh_name[i]);
return -ENODEV;
}
+
od = omap_device_build(dev_name[i], -1, oh, &pdata,
sizeof(struct omap_display_platform_data),
omap_dss_latency,
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h
index 2fb057e..4101bcd 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -240,6 +240,8 @@ static inline int omap_display_init(struct omap_dss_board_info *board_data)
struct omap_display_platform_data {
struct omap_dss_board_info *board_data;
/* TODO: Additional members to be added when PM is considered */
+
+ bool (*opt_clock_available)(const char *clk_role);
};
struct omap_video_timings {
--
1.7.1
next prev parent reply other threads:[~2011-03-01 8:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-01 8:42 [Patch v3 0/2] OMAP2PLUS:DSS2: use opt-clocks information from hwmod Sumit Semwal
2011-03-01 8:42 ` Sumit Semwal [this message]
2011-03-01 8:42 ` [Patch v3 2/2] OMAP2PLUS:DSS2: Use opt_clock_available from pdata Sumit Semwal
2011-03-01 16:26 ` [Patch v3 0/2] OMAP2PLUS:DSS2: use opt-clocks information from hwmod Tomi Valkeinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1298968934-22697-2-git-send-email-sumit.semwal@ti.com \
--to=sumit.semwal@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=svadivu@ti.com \
--cc=tomi.valkeinen@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.