aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSenthilvadivu Guruswamy <svadivu@ti.com>2011-05-03 12:18:07 +0800
committerRicardo Salveti de Araujo <ricardo.salveti@canonical.com>2011-05-16 22:42:10 -0300
commite9c997e03320db8b10d163800bccdee7a960ed13 (patch)
treef6b0a5a07c67625c1c6ad70476de4fcfb0c81080 /drivers
parentc746d7d197c7465beee81be183dc0b5c219b8e79 (diff)
downloadlinux-linaro-android-e9c997e03320db8b10d163800bccdee7a960ed13.tar.gz
OMAP2, 3: DSS2: DSI: create platform_driver, move init, exit to driver
Hwmod adaptation design requires each of the DSS HW IP to be a platform driver. So a platform_driver for DSI is created and init exit methods are moved from core.c to its driver probe,remove. pdev member has to be maintained by its own drivers. Also, vdds_dsi regulator handling is copied to dsi.c, since vdds_dsi regulator is needed by dpi_init() too. Board files are updated accordingly to add 2 instances of vdds_dsi regulator. DSI platform driver is registered from inside omap_dss_probe, in the order desired. Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com> Signed-off-by: Sumit Semwal <sumit.semwal@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/omap2/dss/dsi.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index e9b734ccb1a..97ad21bf7a2 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -309,6 +309,20 @@ static inline u32 dsi_read_reg(const struct dsi_reg idx)
return __raw_readl(dsi.base + idx.idx);
}
+static struct regulator *dsi_get_vdds_dsi(void)
+{
+ struct regulator *reg;
+
+ if (dsi.vdds_dsi_reg != NULL)
+ return dsi.vdds_dsi_reg;
+
+ reg = regulator_get(&dsi.pdev->dev, "vdds_dsi");
+ if (!IS_ERR(reg))
+ dsi.vdds_dsi_reg = reg;
+
+ return reg;
+}
+
void dsi_save_context(void)
{
@@ -3723,6 +3737,12 @@ static int dsi_init(struct platform_device *pdev)
DSSERR("request_irq failed\n");
goto err2;
}
+ dsi.vdds_dsi_reg = dsi_get_vdds_dsi();
+ if (IS_ERR(dsi.vdds_dsi_reg)) {
+ DSSERR("can't get VDDS_DSI regulator\n");
+ r = PTR_ERR(dsi.vdds_dsi_reg);
+ goto err2;
+ }
/* DSI VCs initialization */
for (i = 0; i < ARRAY_SIZE(dsi.vc); i++) {