diff options
| author | Jilai Wang <jilaiw@codeaurora.org> | 2014-12-01 15:10:37 -0500 |
|---|---|---|
| committer | Rob Clark <robdclark@gmail.com> | 2014-12-18 14:32:15 -0500 |
| commit | e6d7a16f5ff7d048fbf4b4791825f5b91ebe21ab (patch) | |
| tree | bc0c82c1ddd3eca3504e05ab94a51bb647bb5764 | |
| parent | 8bc1fe92e15742985fcbd543df6954dae5f6b33e (diff) | |
drm/msm/hdmi: enable regulators before clocks to avoid warnings
HPD regulators need to be enabled before clocks, otherwise clock
driver will report warning.
Signed-off-by: Jilai Wang <jilaiw@codeaurora.org>
| -rw-r--r-- | drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c index fbebb0405d76..08eaee37a37f 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_connector.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_connector.c | |||
| @@ -141,6 +141,15 @@ static int hpd_enable(struct hdmi_connector *hdmi_connector) | |||
| 141 | uint32_t hpd_ctrl; | 141 | uint32_t hpd_ctrl; |
| 142 | int i, ret; | 142 | int i, ret; |
| 143 | 143 | ||
| 144 | for (i = 0; i < config->hpd_reg_cnt; i++) { | ||
| 145 | ret = regulator_enable(hdmi->hpd_regs[i]); | ||
| 146 | if (ret) { | ||
| 147 | dev_err(dev->dev, "failed to enable hpd regulator: %s (%d)\n", | ||
| 148 | config->hpd_reg_names[i], ret); | ||
| 149 | goto fail; | ||
| 150 | } | ||
| 151 | } | ||
| 152 | |||
| 144 | ret = gpio_config(hdmi, true); | 153 | ret = gpio_config(hdmi, true); |
| 145 | if (ret) { | 154 | if (ret) { |
| 146 | dev_err(dev->dev, "failed to configure GPIOs: %d\n", ret); | 155 | dev_err(dev->dev, "failed to configure GPIOs: %d\n", ret); |
| @@ -164,15 +173,6 @@ static int hpd_enable(struct hdmi_connector *hdmi_connector) | |||
| 164 | } | 173 | } |
| 165 | } | 174 | } |
| 166 | 175 | ||
| 167 | for (i = 0; i < config->hpd_reg_cnt; i++) { | ||
| 168 | ret = regulator_enable(hdmi->hpd_regs[i]); | ||
| 169 | if (ret) { | ||
| 170 | dev_err(dev->dev, "failed to enable hpd regulator: %s (%d)\n", | ||
| 171 | config->hpd_reg_names[i], ret); | ||
| 172 | goto fail; | ||
| 173 | } | ||
| 174 | } | ||
| 175 | |||
| 176 | hdmi_set_mode(hdmi, false); | 176 | hdmi_set_mode(hdmi, false); |
| 177 | phy->funcs->reset(phy); | 177 | phy->funcs->reset(phy); |
| 178 | hdmi_set_mode(hdmi, true); | 178 | hdmi_set_mode(hdmi, true); |
| @@ -200,7 +200,7 @@ fail: | |||
| 200 | return ret; | 200 | return ret; |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | static int hdp_disable(struct hdmi_connector *hdmi_connector) | 203 | static void hdp_disable(struct hdmi_connector *hdmi_connector) |
| 204 | { | 204 | { |
| 205 | struct hdmi *hdmi = hdmi_connector->hdmi; | 205 | struct hdmi *hdmi = hdmi_connector->hdmi; |
| 206 | const struct hdmi_platform_config *config = hdmi->config; | 206 | const struct hdmi_platform_config *config = hdmi->config; |
| @@ -212,28 +212,19 @@ static int hdp_disable(struct hdmi_connector *hdmi_connector) | |||
| 212 | 212 | ||
| 213 | hdmi_set_mode(hdmi, false); | 213 | hdmi_set_mode(hdmi, false); |
| 214 | 214 | ||
| 215 | for (i = 0; i < config->hpd_reg_cnt; i++) { | ||
| 216 | ret = regulator_disable(hdmi->hpd_regs[i]); | ||
| 217 | if (ret) { | ||
| 218 | dev_err(dev->dev, "failed to disable hpd regulator: %s (%d)\n", | ||
| 219 | config->hpd_reg_names[i], ret); | ||
| 220 | goto fail; | ||
| 221 | } | ||
| 222 | } | ||
| 223 | |||
| 224 | for (i = 0; i < config->hpd_clk_cnt; i++) | 215 | for (i = 0; i < config->hpd_clk_cnt; i++) |
| 225 | clk_disable_unprepare(hdmi->hpd_clks[i]); | 216 | clk_disable_unprepare(hdmi->hpd_clks[i]); |
| 226 | 217 | ||
| 227 | ret = gpio_config(hdmi, false); | 218 | ret = gpio_config(hdmi, false); |
| 228 | if (ret) { | 219 | if (ret) |
| 229 | dev_err(dev->dev, "failed to unconfigure GPIOs: %d\n", ret); | 220 | dev_warn(dev->dev, "failed to unconfigure GPIOs: %d\n", ret); |
| 230 | goto fail; | ||
| 231 | } | ||
| 232 | |||
| 233 | return 0; | ||
| 234 | 221 | ||
| 235 | fail: | 222 | for (i = 0; i < config->hpd_reg_cnt; i++) { |
| 236 | return ret; | 223 | ret = regulator_disable(hdmi->hpd_regs[i]); |
| 224 | if (ret) | ||
| 225 | dev_warn(dev->dev, "failed to disable hpd regulator: %s (%d)\n", | ||
| 226 | config->hpd_reg_names[i], ret); | ||
| 227 | } | ||
| 237 | } | 228 | } |
| 238 | 229 | ||
| 239 | static void | 230 | static void |
