1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
From 5c06f74553d932aee9cba73ca2620a16f1bb610e Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Date: Thu, 28 May 2009 17:01:35 +0300
Subject: [PATCH 090/146] DSS2: VENC: venc uses regulator framework
Venc needs vdda_dac regulator
---
drivers/video/omap2/dss/venc.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index a83d170..d06dc38 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -32,6 +32,7 @@
#include <linux/string.h>
#include <linux/seq_file.h>
#include <linux/platform_device.h>
+#include <linux/regulator/consumer.h>
#include <mach/display.h>
#include <mach/cpu.h>
@@ -291,6 +292,7 @@ static struct {
void __iomem *base;
struct mutex venc_lock;
u32 wss_data;
+ struct regulator *vdda_dac_reg;
} venc;
static inline void venc_write_reg(int idx, u32 val)
@@ -480,6 +482,13 @@ int venc_init(struct platform_device *pdev)
return -ENOMEM;
}
+ venc.vdda_dac_reg = regulator_get(&pdev->dev, "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);
@@ -496,6 +505,8 @@ void venc_exit(void)
{
omap_dss_unregister_driver(&venc_driver);
+ regulator_put(venc.vdda_dac_reg);
+
iounmap(venc.base);
}
@@ -521,6 +532,8 @@ static void venc_power_on(struct omap_dss_device *dssdev)
dispc_set_digit_size(dssdev->panel.timings.x_res,
dssdev->panel.timings.y_res/2);
+ regulator_enable(venc.vdda_dac_reg);
+
if (dssdev->platform_enable)
dssdev->platform_enable(dssdev);
@@ -537,6 +550,8 @@ static void venc_power_off(struct omap_dss_device *dssdev)
if (dssdev->platform_disable)
dssdev->platform_disable(dssdev);
+ regulator_disable(venc.vdda_dac_reg);
+
venc_enable_clocks(0);
}
--
1.6.2.4
|