aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-28 05:54:03 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-10-16 06:43:58 -0400
commit84b4762302cda5c1b19a9628acc3ef90db948dff (patch)
treead13574bf4d6e5387351f31762b38182de2dce35
parent649514c65cdca0102093a0e85b587b3f5a8d8c42 (diff)
OMAPDSS: DISPC: use omapdss_version
Use omapdss_version in dispc.c to select the proper dispc features. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/dss/dispc.c41
1 files changed, 28 insertions, 13 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index b43477a5fae8..d30e5fa1864a 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -4042,29 +4042,44 @@ static const struct dispc_features omap44xx_dispc_feats __initconst = {
4042 .gfx_fifo_workaround = true, 4042 .gfx_fifo_workaround = true,
4043}; 4043};
4044 4044
4045static int __init dispc_init_features(struct device *dev) 4045static int __init dispc_init_features(struct platform_device *pdev)
4046{ 4046{
4047 struct omap_dss_board_info *pdata = pdev->dev.platform_data;
4047 const struct dispc_features *src; 4048 const struct dispc_features *src;
4048 struct dispc_features *dst; 4049 struct dispc_features *dst;
4049 4050
4050 dst = devm_kzalloc(dev, sizeof(*dst), GFP_KERNEL); 4051 dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL);
4051 if (!dst) { 4052 if (!dst) {
4052 dev_err(dev, "Failed to allocate DISPC Features\n"); 4053 dev_err(&pdev->dev, "Failed to allocate DISPC Features\n");
4053 return -ENOMEM; 4054 return -ENOMEM;
4054 } 4055 }
4055 4056
4056 if (cpu_is_omap24xx()) { 4057 switch (pdata->version) {
4058 case OMAPDSS_VER_OMAP24xx:
4057 src = &omap24xx_dispc_feats; 4059 src = &omap24xx_dispc_feats;
4058 } else if (cpu_is_omap34xx()) { 4060 break;
4059 if (omap_rev() < OMAP3430_REV_ES3_0) 4061
4060 src = &omap34xx_rev1_0_dispc_feats; 4062 case OMAPDSS_VER_OMAP34xx_ES1:
4061 else 4063 src = &omap34xx_rev1_0_dispc_feats;
4062 src = &omap34xx_rev3_0_dispc_feats; 4064 break;
4063 } else if (cpu_is_omap44xx()) { 4065
4066 case OMAPDSS_VER_OMAP34xx_ES3:
4067 case OMAPDSS_VER_OMAP3630:
4068 case OMAPDSS_VER_AM35xx:
4069 src = &omap34xx_rev3_0_dispc_feats;
4070 break;
4071
4072 case OMAPDSS_VER_OMAP4430_ES1:
4073 case OMAPDSS_VER_OMAP4430_ES2:
4074 case OMAPDSS_VER_OMAP4:
4064 src = &omap44xx_dispc_feats; 4075 src = &omap44xx_dispc_feats;
4065 } else if (soc_is_omap54xx()) { 4076 break;
4077
4078 case OMAPDSS_VER_OMAP5:
4066 src = &omap44xx_dispc_feats; 4079 src = &omap44xx_dispc_feats;
4067 } else { 4080 break;
4081
4082 default:
4068 return -ENODEV; 4083 return -ENODEV;
4069 } 4084 }
4070 4085
@@ -4084,7 +4099,7 @@ static int __init omap_dispchw_probe(struct platform_device *pdev)
4084 4099
4085 dispc.pdev = pdev; 4100 dispc.pdev = pdev;
4086 4101
4087 r = dispc_init_features(&dispc.pdev->dev); 4102 r = dispc_init_features(dispc.pdev);
4088 if (r) 4103 if (r)
4089 return r; 4104 return r;
4090 4105