diff options
| -rw-r--r-- | drivers/video/omap2/dss/sdi.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c index 3de3c1e559aa..ee07a3cc22ef 100644 --- a/drivers/video/omap2/dss/sdi.c +++ b/drivers/video/omap2/dss/sdi.c | |||
| @@ -23,13 +23,16 @@ | |||
| 23 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
| 24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
| 25 | #include <linux/err.h> | 25 | #include <linux/err.h> |
| 26 | #include <linux/regulator/consumer.h> | ||
| 26 | 27 | ||
| 27 | #include <plat/display.h> | 28 | #include <plat/display.h> |
| 29 | #include <plat/cpu.h> | ||
| 28 | #include "dss.h" | 30 | #include "dss.h" |
| 29 | 31 | ||
| 30 | static struct { | 32 | static struct { |
| 31 | bool skip_init; | 33 | bool skip_init; |
| 32 | bool update_enabled; | 34 | bool update_enabled; |
| 35 | struct regulator *vdds_sdi_reg; | ||
| 33 | } sdi; | 36 | } sdi; |
| 34 | 37 | ||
| 35 | static void sdi_basic_init(void) | 38 | static void sdi_basic_init(void) |
| @@ -57,6 +60,10 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) | |||
| 57 | goto err0; | 60 | goto err0; |
| 58 | } | 61 | } |
| 59 | 62 | ||
| 63 | r = regulator_enable(sdi.vdds_sdi_reg); | ||
| 64 | if (r) | ||
| 65 | goto err1; | ||
| 66 | |||
| 60 | /* In case of skip_init sdi_init has already enabled the clocks */ | 67 | /* In case of skip_init sdi_init has already enabled the clocks */ |
| 61 | if (!sdi.skip_init) | 68 | if (!sdi.skip_init) |
| 62 | dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1); | 69 | dss_clk_enable(DSS_CLK_ICK | DSS_CLK_FCK1); |
| @@ -120,6 +127,7 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) | |||
| 120 | return 0; | 127 | return 0; |
| 121 | err2: | 128 | err2: |
| 122 | dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); | 129 | dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); |
| 130 | regulator_disable(sdi.vdds_sdi_reg); | ||
| 123 | err1: | 131 | err1: |
| 124 | omap_dss_stop_device(dssdev); | 132 | omap_dss_stop_device(dssdev); |
| 125 | err0: | 133 | err0: |
| @@ -135,6 +143,8 @@ void omapdss_sdi_display_disable(struct omap_dss_device *dssdev) | |||
| 135 | 143 | ||
| 136 | dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); | 144 | dss_clk_disable(DSS_CLK_ICK | DSS_CLK_FCK1); |
| 137 | 145 | ||
| 146 | regulator_disable(sdi.vdds_sdi_reg); | ||
| 147 | |||
| 138 | omap_dss_stop_device(dssdev); | 148 | omap_dss_stop_device(dssdev); |
| 139 | } | 149 | } |
| 140 | EXPORT_SYMBOL(omapdss_sdi_display_disable); | 150 | EXPORT_SYMBOL(omapdss_sdi_display_disable); |
| @@ -151,6 +161,11 @@ int sdi_init(bool skip_init) | |||
| 151 | /* we store this for first display enable, then clear it */ | 161 | /* we store this for first display enable, then clear it */ |
| 152 | sdi.skip_init = skip_init; | 162 | sdi.skip_init = skip_init; |
| 153 | 163 | ||
| 164 | sdi.vdds_sdi_reg = dss_get_vdds_sdi(); | ||
| 165 | if (IS_ERR(sdi.vdds_sdi_reg)) { | ||
| 166 | DSSERR("can't get VDDS_SDI regulator\n"); | ||
| 167 | return PTR_ERR(sdi.vdds_sdi_reg); | ||
| 168 | } | ||
| 154 | /* | 169 | /* |
| 155 | * Enable clocks already here, otherwise there would be a toggle | 170 | * Enable clocks already here, otherwise there would be a toggle |
| 156 | * of them until sdi_display_enable is called. | 171 | * of them until sdi_display_enable is called. |
