linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Archit Taneja <archit@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org,
	Ricardo Neri <ricardo.neri@ti.com>
Subject: Re: [PATCH 11/20] OMAPDSS: HDMI: split power_on/off to two parts
Date: Mon, 29 Oct 2012 10:26:37 +0000	[thread overview]
Message-ID: <508E570D.1000101@ti.com> (raw)
In-Reply-To: <1351070951-18616-12-git-send-email-tomi.valkeinen@ti.com>

On Wednesday 24 October 2012 02:59 PM, Tomi Valkeinen wrote:
> There's currently just one power-on function for HDMI, which enables the
> IP and the video output. When reading EDID or detecting if a monitor is
> connected, we don't need the video output.
>
> Enabling the video output for these operations is not a big problem in
> itself, but the quick enable/disable cycles caused by the operations
> seem to cause sync lost errors from time to time. Also, this makes it
> possible to read the EDID before the full video path has been set up.
>
> This patch splits the hdmi_power_on into two parts, hdmi_power_on_core
> and hdmi_power_on_full. The "full" version does what hdmi_power_on does
> currently, and hdmi_power_on_core only enables the core IP. Similar
> changes are made for power_off.
>
> Note that these don't allow the HDMI IP to be first enabled, and later
> enable the video output, but the HDMI IP will first need to be powered
> off before calling the full version. So this is rather limited
> implementation, but it fills the needs for reading EDID.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: Ricardo Neri <ricardo.neri@ti.com>
> ---
>   drivers/video/omap2/dss/hdmi.c |   75 ++++++++++++++++++++++++----------------
>   1 file changed, 46 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
> index c1c5488..50d5a10 100644
> --- a/drivers/video/omap2/dss/hdmi.c
> +++ b/drivers/video/omap2/dss/hdmi.c
> @@ -500,12 +500,9 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
>   	DSSDBG("range = %d sd = %d\n", pi->dcofreq, pi->regsd);
>   }
>
> -static int hdmi_power_on(struct omap_dss_device *dssdev)
> +static int hdmi_power_on_core(struct omap_dss_device *dssdev)
>   {
>   	int r;
> -	struct omap_video_timings *p;
> -	struct omap_overlay_manager *mgr = dssdev->output->manager;
> -	unsigned long phy;
>
>   	gpio_set_value(hdmi.ct_cp_hpd_gpio, 1);
>   	gpio_set_value(hdmi.ls_oe_gpio, 1);
> @@ -521,6 +518,46 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
>   	if (r)
>   		goto err_runtime_get;
>
> +	/* Make selection of HDMI in DSS */
> +	dss_select_hdmi_venc_clk_source(DSS_HDMI_M_PCLK);
> +
> +	/* Select the dispc clock source as PRCM clock, to ensure that it is not
> +	 * DSI PLL source as the clock selected by DSI PLL might not be
> +	 * sufficient for the resolution selected / that can be changed
> +	 * dynamically by user. This can be moved to single location , say
> +	 * Boardfile.
> +	 */
> +	dss_select_dispc_clk_source(dssdev->clocks.dispc.dispc_fclk_src);
> +
> +	return 0;
> +
> +err_runtime_get:
> +	regulator_disable(hdmi.vdda_hdmi_dac_reg);
> +err_vdac_enable:
> +	gpio_set_value(hdmi.ct_cp_hpd_gpio, 0);
> +	gpio_set_value(hdmi.ls_oe_gpio, 0);
> +	return r;
> +}
> +
> +static void hdmi_power_off_core(struct omap_dss_device *dssdev)
> +{
> +	hdmi_runtime_put();
> +	regulator_disable(hdmi.vdda_hdmi_dac_reg);
> +	gpio_set_value(hdmi.ct_cp_hpd_gpio, 0);
> +	gpio_set_value(hdmi.ls_oe_gpio, 0);

We might want to set the DISPC clock source back to DSS_FCK here. Just 
in case it was using something else. Having this still won't make things 
full proof, but probably slightly better.

Archit

  reply	other threads:[~2012-10-29 10:26 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24  9:28 [PATCH 00/20] OMAPDSS: Misc cleanups/fixes Tomi Valkeinen
2012-10-24  9:28 ` [PATCH 01/20] OMAPDSS: remove omap_dss_device's suspend/resume Tomi Valkeinen
2012-10-24  9:28 ` [PATCH 02/20] OMAPDSS: get the dss version from core pdev Tomi Valkeinen
2012-10-24  9:28 ` [PATCH 03/20] OMAPDSS: remove dispc_irq_handler declaration Tomi Valkeinen
2012-10-24  9:28 ` [PATCH 04/20] OMAPDSS: DISPC: fix dispc_mgr_lclk_rate for DIGIT output Tomi Valkeinen
2012-10-29  9:50   ` Archit Taneja
2012-10-29  9:56     ` Tomi Valkeinen
2012-10-24  9:28 ` [PATCH 05/20] OMAPDSS: remove initial display code from omapdss Tomi Valkeinen
2012-10-29 10:16   ` Archit Taneja
2012-10-29 10:25     ` Tomi Valkeinen
2012-10-29 10:48       ` Archit Taneja
2012-10-24  9:28 ` [PATCH 06/20] OMAPDSS: DISPC: use dss_feat_get_num_ovls() Tomi Valkeinen
2012-10-24  9:28 ` [PATCH 07/20] OMAPDSS: DISPC: rename dispc_mgr_enable/disable to _sync Tomi Valkeinen
2012-10-24  9:28 ` [PATCH 08/20] OMAPDSS: DISPC: make _enable_mgr_out public as "dispc_mgr_enable" Tomi Valkeinen
2012-10-24  9:29 ` [PATCH 09/20] OMAPDSS: add dispc_ovl_enabled() Tomi Valkeinen
2012-10-29 10:21   ` Archit Taneja
2012-10-29 10:28     ` Tomi Valkeinen
2012-10-24  9:29 ` [PATCH 10/20] OMAPDSS: DISPC: Add IRQ enable/status helpers Tomi Valkeinen
2012-10-24  9:29 ` [PATCH 11/20] OMAPDSS: HDMI: split power_on/off to two parts Tomi Valkeinen
2012-10-29 10:26   ` Archit Taneja [this message]
2012-10-29 10:30     ` Tomi Valkeinen
2012-10-24  9:29 ` [PATCH 12/20] OMAPDSS: HDMI: use core power on/off with edid & detect Tomi Valkeinen
2012-10-24  9:29 ` [PATCH 13/20] OMAPDSS: HDMI: add 1920x1200 video mode Tomi Valkeinen
2012-10-24  9:29 ` [PATCH 14/20] OMAPDSS: HDMI: make hdmi pclk check more permissive Tomi Valkeinen
2012-10-24  9:29 ` [PATCH 15/20] OMAPFB: remove use of extended edid block Tomi Valkeinen
2012-10-24  9:29 ` [PATCH 16/20] OMAPFB: improve mode selection from EDID Tomi Valkeinen
2012-10-24  9:29 ` [PATCH 17/20] OMAPDSS: fix DSI2 PLL clk names Tomi Valkeinen
2012-10-24  9:29 ` [PATCH 18/20] OMAPDSS: DISPC: fix loop in error handler Tomi Valkeinen
2012-10-24  9:29 ` [PATCH 19/20] OMAPDSS: DISPC: remove dssdev depependency from " Tomi Valkeinen
2012-10-29  7:24   ` Archit Taneja
2012-10-29  8:04     ` Tomi Valkeinen
2012-10-29 10:30       ` Archit Taneja
2012-10-24  9:29 ` [PATCH 20/20] OMAPDSS: split hdmi muxing function Tomi Valkeinen
2012-10-24 16:23   ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=508E570D.1000101@ti.com \
    --to=archit@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=ricardo.neri@ti.com \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).