aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/sh_mobile_hdmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/sh_mobile_hdmi.c')
-rw-r--r--drivers/video/sh_mobile_hdmi.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
index 6ae40b630dc9..7d54e2c612f7 100644
--- a/drivers/video/sh_mobile_hdmi.c
+++ b/drivers/video/sh_mobile_hdmi.c
@@ -1127,23 +1127,16 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
1127 struct fb_info *info = hdmi->info; 1127 struct fb_info *info = hdmi->info;
1128 unsigned long parent_rate = 0, hdmi_rate; 1128 unsigned long parent_rate = 0, hdmi_rate;
1129 1129
1130 /* A device has been plugged in */
1131 pm_runtime_get_sync(hdmi->dev);
1132
1133 ret = sh_hdmi_read_edid(hdmi, &hdmi_rate, &parent_rate); 1130 ret = sh_hdmi_read_edid(hdmi, &hdmi_rate, &parent_rate);
1134 if (ret < 0) { 1131 if (ret < 0)
1135 pm_runtime_put(hdmi->dev);
1136 goto out; 1132 goto out;
1137 }
1138 1133
1139 hdmi->hp_state = HDMI_HOTPLUG_EDID_DONE; 1134 hdmi->hp_state = HDMI_HOTPLUG_EDID_DONE;
1140 1135
1141 /* Reconfigure the clock */ 1136 /* Reconfigure the clock */
1142 ret = sh_hdmi_clk_configure(hdmi, hdmi_rate, parent_rate); 1137 ret = sh_hdmi_clk_configure(hdmi, hdmi_rate, parent_rate);
1143 if (ret < 0) { 1138 if (ret < 0)
1144 pm_runtime_put(hdmi->dev);
1145 goto out; 1139 goto out;
1146 }
1147 1140
1148 msleep(10); 1141 msleep(10);
1149 sh_hdmi_configure(hdmi); 1142 sh_hdmi_configure(hdmi);
@@ -1191,7 +1184,6 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work)
1191 fb_set_suspend(hdmi->info, 1); 1184 fb_set_suspend(hdmi->info, 1);
1192 1185
1193 console_unlock(); 1186 console_unlock();
1194 pm_runtime_put(hdmi->dev);
1195 } 1187 }
1196 1188
1197out: 1189out:
@@ -1312,7 +1304,7 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
1312 INIT_DELAYED_WORK(&hdmi->edid_work, sh_hdmi_edid_work_fn); 1304 INIT_DELAYED_WORK(&hdmi->edid_work, sh_hdmi_edid_work_fn);
1313 1305
1314 pm_runtime_enable(&pdev->dev); 1306 pm_runtime_enable(&pdev->dev);
1315 pm_runtime_resume(&pdev->dev); 1307 pm_runtime_get_sync(&pdev->dev);
1316 1308
1317 /* Product and revision IDs are 0 in sh-mobile version */ 1309 /* Product and revision IDs are 0 in sh-mobile version */
1318 dev_info(&pdev->dev, "Detected HDMI controller 0x%x:0x%x\n", 1310 dev_info(&pdev->dev, "Detected HDMI controller 0x%x:0x%x\n",
@@ -1340,7 +1332,7 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
1340ecodec: 1332ecodec:
1341 free_irq(irq, hdmi); 1333 free_irq(irq, hdmi);
1342ereqirq: 1334ereqirq:
1343 pm_runtime_suspend(&pdev->dev); 1335 pm_runtime_put(&pdev->dev);
1344 pm_runtime_disable(&pdev->dev); 1336 pm_runtime_disable(&pdev->dev);
1345 iounmap(hdmi->base); 1337 iounmap(hdmi->base);
1346emap: 1338emap:
@@ -1377,7 +1369,7 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev)
1377 free_irq(irq, hdmi); 1369 free_irq(irq, hdmi);
1378 /* Wait for already scheduled work */ 1370 /* Wait for already scheduled work */
1379 cancel_delayed_work_sync(&hdmi->edid_work); 1371 cancel_delayed_work_sync(&hdmi->edid_work);
1380 pm_runtime_suspend(&pdev->dev); 1372 pm_runtime_put(&pdev->dev);
1381 pm_runtime_disable(&pdev->dev); 1373 pm_runtime_disable(&pdev->dev);
1382 clk_disable(hdmi->hdmi_clk); 1374 clk_disable(hdmi->hdmi_clk);
1383 clk_put(hdmi->hdmi_clk); 1375 clk_put(hdmi->hdmi_clk);