aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSenthilvadivu Guruswamy <svadivu@ti.com>2011-05-03 12:18:04 +0800
committerRicardo Salveti de Araujo <ricardo.salveti@canonical.com>2011-05-16 22:42:10 -0300
commitc746d7d197c7465beee81be183dc0b5c219b8e79 (patch)
treecbfa57974e8f51c206292a46ce07fdc0493be8b5 /drivers
parentcdd03ee2179d2fa438a98281a441a77fa72771dd (diff)
downloadlinux-linaro-android-c746d7d197c7465beee81be183dc0b5c219b8e79.tar.gz
OMAP2, 3: DSS2: VENC: 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 VENC 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, venc_vdda_dac reading is moved to venc.c. VENC 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/venc.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 8e35a5bae42..618b051278a 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -305,6 +305,17 @@ static inline u32 venc_read_reg(int idx)
return l;
}
+static struct regulator *venc_get_vdda_dac(void)
+{
+ struct regulator *reg;
+
+ reg = regulator_get(&venc.pdev->dev, "vdda_dac");
+ if (!IS_ERR(reg))
+ venc.vdda_dac_reg = reg;
+
+ return reg;
+}
+
static void venc_write_config(const struct venc_config *config)
{
DSSDBG("write venc conf\n");
@@ -736,10 +747,17 @@ static int omap_venchw_probe(struct platform_device *pdev)
return -ENOMEM;
}
+ venc.vdda_dac_reg = venc_get_vdda_dac();
+ if (IS_ERR(venc.vdda_dac_reg)) {
+ iounmap(venc.base);
+ DSSERR("can't get VDDA_DAC regulator\n");
+ return PTR_ERR(venc.vdda_dac_reg);
+ }
+
venc_enable_clocks(1);
rev_id = (u8)(venc_read_reg(VENC_REV_ID) & 0xff);
- dev_dbg(&pdev->dev, "OMAP VENC rev %d\n", rev_id);
+ printk(KERN_INFO "OMAP VENC rev %d\n", rev_id);
venc_enable_clocks(0);