From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Cc: "Archit Taneja" <a0393947@ti.com>,
"Chandrabhanu Mahapatra" <cmahapatra@ti.com>,
"Raphaël Assénat" <raph@8d.com>,
"Tony Lindgren" <tony@atomide.com>,
"Tomi Valkeinen" <tomi.valkeinen@ti.com>
Subject: [PATCH 3/6] OMAPDSS: DISPC: use omapdss_version
Date: Fri, 28 Sep 2012 10:35:24 +0000 [thread overview]
Message-ID: <1348828527-13309-4-git-send-email-tomi.valkeinen@ti.com> (raw)
In-Reply-To: <1348828527-13309-1-git-send-email-tomi.valkeinen@ti.com>
Use omapdss_version in dispc.c to select the proper dispc features.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dispc.c | 41 ++++++++++++++++++++++++++-------------
1 file changed, 28 insertions(+), 13 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index a173a94..a5ab354 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -4040,29 +4040,44 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
.gfx_fifo_workaround = true,
};
-static int __init dispc_init_features(struct device *dev)
+static int __init dispc_init_features(struct platform_device *pdev)
{
+ struct omap_dss_board_info *pdata = pdev->dev.platform_data;
const struct dispc_features *src;
struct dispc_features *dst;
- dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL);
+ dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL);
if (!dst) {
- dev_err(dev, "Failed to allocate DISPC Features\n");
+ dev_err(&pdev->dev, "Failed to allocate DISPC Features\n");
return -ENOMEM;
}
- if (cpu_is_omap24xx()) {
+ switch (pdata->version) {
+ case OMAPDSS_VER_OMAP24xx:
src = &omap24xx_dispc_feats;
- } else if (cpu_is_omap34xx()) {
- if (omap_rev() < OMAP3430_REV_ES3_0)
- src = &omap34xx_rev1_0_dispc_feats;
- else
- src = &omap34xx_rev3_0_dispc_feats;
- } else if (cpu_is_omap44xx()) {
+ break;
+
+ case OMAPDSS_VER_OMAP34xx_ES1:
+ src = &omap34xx_rev1_0_dispc_feats;
+ break;
+
+ case OMAPDSS_VER_OMAP34xx_ES3:
+ case OMAPDSS_VER_OMAP3630:
+ case OMAPDSS_VER_AM35xx:
+ src = &omap34xx_rev3_0_dispc_feats;
+ break;
+
+ case OMAPDSS_VER_OMAP4430_ES1:
+ case OMAPDSS_VER_OMAP4430_ES2:
+ case OMAPDSS_VER_OMAP4:
src = &omap44xx_dispc_feats;
- } else if (soc_is_omap54xx()) {
+ break;
+
+ case OMAPDSS_VER_OMAP5:
src = &omap44xx_dispc_feats;
- } else {
+ break;
+
+ default:
return -ENODEV;
}
@@ -4082,7 +4097,7 @@ static int __init omap_dispchw_probe(struct platform_device *pdev)
dispc.pdev = pdev;
- r = dispc_init_features(&dispc.pdev->dev);
+ r = dispc_init_features(dispc.pdev);
if (r)
return r;
--
1.7.9.5
next prev parent reply other threads:[~2012-09-28 10:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-28 10:35 [PATCH 0/6] OMAPDSS: remove cpu_is_* calls Tomi Valkeinen
2012-09-28 10:35 ` [PATCH 1/6] OMAPDSS: add omapdss_version Tomi Valkeinen
2012-09-28 10:44 ` Tomi Valkeinen
2012-09-28 11:12 ` Archit Taneja
2012-09-28 11:07 ` Tomi Valkeinen
2012-09-28 10:35 ` [PATCH 2/6] OMAPDSS: use omapdss_version in dss_features.c Tomi Valkeinen
2012-09-28 10:35 ` Tomi Valkeinen [this message]
2012-09-28 10:35 ` [PATCH 4/6] OMAPDSS: DSS: use omapdss_version Tomi Valkeinen
2012-09-28 10:35 ` [PATCH 5/6] OMAPDSS: HDMI: " Tomi Valkeinen
2012-09-28 10:35 ` [PATCH 6/6] OMAPDSS: remove <plat/cpu.h> includes Tomi Valkeinen
2012-10-04 1:33 ` [PATCH 0/6] OMAPDSS: remove cpu_is_* calls Jingoo Han
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=1348828527-13309-4-git-send-email-tomi.valkeinen@ti.com \
--to=tomi.valkeinen@ti.com \
--cc=a0393947@ti.com \
--cc=cmahapatra@ti.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=raph@8d.com \
--cc=tony@atomide.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).