summaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dispc.c
diff options
context:
space:
mode:
authorSenthilvadivu Guruswamy <svadivu@ti.com>2011-01-24 06:22:04 +0000
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-03-11 15:46:21 +0200
commitea9da36a304eed585fc5ef89c0f1c460eca61b48 (patch)
treeb1e14d36fc7c25f845677c6d3249311d0304cd09 /drivers/video/omap2/dss/dispc.c
parenta06b62f8004bd95c132fa312e8593c9a10f466ec (diff)
OMAP2,3: DSS2: Use platform device to get baseaddr
DSS, DISPC, DSI, RFBI, VENC baseaddr can be obtained from platform_get_resource(). This API in turn picks the right silicon baseaddr from the hwmod database. So hardcoding of base addr could be removed. Reviewed-by: Paul Walmsley <paul@pwsan.com> Reviewed-by: Kevin Hilman <khilman@ti.com> Tested-by: Kevin Hilman <khilman@ti.com> Signed-off-by: Sumit Semwal <sumit.semwal@ti.com> Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/dispc.c')
-rw-r--r--drivers/video/omap2/dss/dispc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 032e5dd19e0..96e37f8e75d 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -42,8 +42,6 @@
#include "dss_features.h"
/* DISPC */
-#define DISPC_BASE 0x48050400
-
#define DISPC_SZ_REGS SZ_4K
struct dispc_reg { u16 idx; };
@@ -3324,6 +3322,8 @@ int dispc_setup_plane(enum omap_plane plane,
static int omap_dispchw_probe(struct platform_device *pdev)
{
u32 rev;
+ struct resource *dispc_mem;
+
dispc.pdev = pdev;
spin_lock_init(&dispc.irq_lock);
@@ -3335,7 +3335,12 @@ static int omap_dispchw_probe(struct platform_device *pdev)
INIT_WORK(&dispc.error_work, dispc_error_worker);
- dispc.base = ioremap(DISPC_BASE, DISPC_SZ_REGS);
+ dispc_mem = platform_get_resource(dispc.pdev, IORESOURCE_MEM, 0);
+ if (!dispc_mem) {
+ DSSERR("can't get IORESOURCE_MEM DISPC\n");
+ return -EINVAL;
+ }
+ dispc.base = ioremap(dispc_mem->start, resource_size(dispc_mem));
if (!dispc.base) {
DSSERR("can't ioremap DISPC\n");
return -ENOMEM;