From patchwork Tue Jun 14 14:27:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 879122 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5EERRX6026043 for ; Tue, 14 Jun 2011 14:27:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751217Ab1FNO11 (ORCPT ); Tue, 14 Jun 2011 10:27:27 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]:59254 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864Ab1FNO10 (ORCPT ); Tue, 14 Jun 2011 10:27:26 -0400 Received: from axis700.grange (dslb-178-001-142-053.pools.arcor-ip.net [178.1.142.53]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MDW85-1QK5Sr0vM5-00HWbD; Tue, 14 Jun 2011 16:27:24 +0200 Received: by axis700.grange (Postfix, from userid 1000) id 15DB3189B84; Tue, 14 Jun 2011 16:27:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 11CB8189B83; Tue, 14 Jun 2011 16:27:23 +0200 (CEST) Date: Tue, 14 Jun 2011 16:27:22 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-fbdev@vger.kernel.org cc: linux-sh@vger.kernel.org, Magnus Damm Subject: [PATCH] fbdev: sh_mobile_hdmi: fix regression: statically enable RTPM Message-ID: MIME-Version: 1.0 X-Provags-ID: V02:K0:x/2Jo+3DvE/NZsOzURTLHUM74Saa0Q/bCPKew+3sF+p O2AK4DKog9ung47ns0KU5CQYwHsUjph2U6b2fcpwAu0ND2gyT5 +VdjzgvJXYxqlhUNmrJcSynoA0WPnXGaHG/qa61PspZHrF4ygY A8rYie43tJXnckruKS+Pk/nbXjQw3njVUG1RHM/o7Nr3kyCWTV MaEnkAP/q7cLRY2Zh2P6Zx1GQhSfdqh18UBzp3lRz8= Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 14 Jun 2011 14:27:28 +0000 (UTC) A recent modification to the runtime PM code on mach-shmobile made a wrong RTPM implementation in the sh_mobile_hdmi driver apparent, which broke HDMI hotplug detection support on ap4evb. This patch does not implement a proper dynamic RTPM support for sh_mobile_hdmi, instead it restores the previous working state by statically enabling it. A more power-efficient solution should be implemented for the next kernel version. Signed-off-by: Guennadi Liakhovetski --- drivers/video/sh_mobile_hdmi.c | 18 +++++------------- 1 files changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index 6ae40b6..7d54e2c 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) struct fb_info *info = hdmi->info; unsigned long parent_rate = 0, hdmi_rate; - /* A device has been plugged in */ - pm_runtime_get_sync(hdmi->dev); - ret = sh_hdmi_read_edid(hdmi, &hdmi_rate, &parent_rate); - if (ret < 0) { - pm_runtime_put(hdmi->dev); + if (ret < 0) goto out; - } hdmi->hp_state = HDMI_HOTPLUG_EDID_DONE; /* Reconfigure the clock */ ret = sh_hdmi_clk_configure(hdmi, hdmi_rate, parent_rate); - if (ret < 0) { - pm_runtime_put(hdmi->dev); + if (ret < 0) goto out; - } msleep(10); sh_hdmi_configure(hdmi); @@ -1191,7 +1184,6 @@ static void sh_hdmi_edid_work_fn(struct work_struct *work) fb_set_suspend(hdmi->info, 1); console_unlock(); - pm_runtime_put(hdmi->dev); } out: @@ -1312,7 +1304,7 @@ static int __init sh_hdmi_probe(struct platform_device *pdev) INIT_DELAYED_WORK(&hdmi->edid_work, sh_hdmi_edid_work_fn); pm_runtime_enable(&pdev->dev); - pm_runtime_resume(&pdev->dev); + pm_runtime_get_sync(&pdev->dev); /* Product and revision IDs are 0 in sh-mobile version */ 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) ecodec: free_irq(irq, hdmi); ereqirq: - pm_runtime_suspend(&pdev->dev); + pm_runtime_put(&pdev->dev); pm_runtime_disable(&pdev->dev); iounmap(hdmi->base); emap: @@ -1377,7 +1369,7 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev) free_irq(irq, hdmi); /* Wait for already scheduled work */ cancel_delayed_work_sync(&hdmi->edid_work); - pm_runtime_suspend(&pdev->dev); + pm_runtime_put(&pdev->dev); pm_runtime_disable(&pdev->dev); clk_disable(hdmi->hdmi_clk); clk_put(hdmi->hdmi_clk);