linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Ricardo Neri <ricardo.neri@ti.com>
Cc: mythripk@ti.com, s-chereau@ti.com, x0055901@ti.com,
	vaibhav.bedia@ti.com, s-guiriec@ti.com, lrg@ti.com,
	peter.ujfalusi@ti.com, agraf@suse.de, research@ottomaneng.com,
	linux-omap@vger.kernel.org
Subject: Re: [PATCH 10/10] OMAPDSS: HDMI: Implement DSS driver interface for audio
Date: Mon, 23 Apr 2012 16:01:56 +0300	[thread overview]
Message-ID: <1335186116.1535.23.camel@lappy> (raw)
In-Reply-To: <1332974305-4578-11-git-send-email-ricardo.neri@ti.com>

[-- Attachment #1: Type: text/plain, Size: 3573 bytes --]

On Wed, 2012-03-28 at 16:38 -0600, Ricardo Neri wrote:
> Implement the DSS device driver audio support interface in the HDMI
> panel driver and generic driver. The implementation relies on the
> IP-specific functions that are defined at DSS probe time.
> 
> A HW-safe spinlock is used to protect the audio functions. This is because

What is a "HW-safe spinlock"?

> the audio functions may be called while holding a lock; in such case,
> the panel's driver mutex is not suitable. Functions should be used
> to set registers and should not wait for any other event.

Are you sure this is the only option? What lock is being held? While a
spinlock may be ok for now, quite often enabling/disabling things do not
happen immediately, and it's much easier to do the wait synchronously.

> Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
> ---
>  drivers/video/omap2/dss/dss.h        |    7 +++
>  drivers/video/omap2/dss/hdmi.c       |   33 +++++++++++++++
>  drivers/video/omap2/dss/hdmi_panel.c |   76 ++++++++++++++++++++++++++++++++++
>  3 files changed, 116 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
> index 32ff69f..fca4490 100644
> --- a/drivers/video/omap2/dss/dss.h
> +++ b/drivers/video/omap2/dss/dss.h
> @@ -520,6 +520,13 @@ int omapdss_hdmi_read_edid(u8 *buf, int len);
>  bool omapdss_hdmi_detect(void);
>  int hdmi_panel_init(void);
>  void hdmi_panel_exit(void);
> +#ifdef CONFIG_OMAP4_DSS_HDMI_AUDIO
> +int hdmi_audio_enable(bool enable);
> +int hdmi_audio_start(bool start);
> +bool hdmi_mode_has_audio(void);
> +int hdmi_audio_config(struct snd_aes_iec958 *iec,
> +		struct snd_cea_861_aud_if *aud_if);
> +#endif
>  
>  /* RFBI */
>  #ifdef CONFIG_OMAP2_DSS_RFBI
> diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
> index bd44891..880509d 100644
> --- a/drivers/video/omap2/dss/hdmi.c
> +++ b/drivers/video/omap2/dss/hdmi.c
> @@ -698,6 +698,39 @@ int hdmi_compute_acr(u32 sample_freq, u32 *n, u32 *cts)
>  
>  	return 0;
>  }
> +
> +int hdmi_audio_enable(bool enable)
> +{
> +	DSSDBG("audio_enable\n");
> +
> +	hdmi.ip_data.ops->audio_enable(&hdmi.ip_data, enable);

Shouldn't this, and the others below, return the value from the called
function, instead of always returning 0?

> +
> +	return 0;
> +}
> +
> +int hdmi_audio_start(bool start)
> +{
> +	DSSDBG("audio_enable\n");
> +
> +	hdmi.ip_data.ops->audio_start(&hdmi.ip_data, start);
> +
> +	return 0;
> +}
> +
> +bool hdmi_mode_has_audio(void)
> +{
> +	if (hdmi.ip_data.cfg.cm.mode == HDMI_HDMI)
> +		return true;
> +	else
> +		return false;
> +}
> +
> +int hdmi_audio_config(struct snd_aes_iec958 *iec,
> +		struct snd_cea_861_aud_if *aud_if)
> +{
> +	return hdmi.ip_data.ops->audio_config(&hdmi.ip_data, iec, aud_if);
> +}
> +
>  #endif
>  
>  /* HDMI HW IP initialisation */
> diff --git a/drivers/video/omap2/dss/hdmi_panel.c b/drivers/video/omap2/dss/hdmi_panel.c
> index 533d5dc..dac1ac2 100644
> --- a/drivers/video/omap2/dss/hdmi_panel.c
> +++ b/drivers/video/omap2/dss/hdmi_panel.c
> @@ -31,6 +31,10 @@
>  
>  static struct {
>  	struct mutex hdmi_lock;
> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
> +	/* protects calls to HDMI driver audio functionality */
> +	spinlock_t hdmi_sp_lock;

What does "sp" stand for? Spinlock? Perhaps a better name would be
"audio_lock", if it's audio specific. And probably no reason to prefix
it with "hdmi", as it's inside "hdmi" struct already.

 Tomi


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-04-23 13:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-28 22:38 [PATCH 00/10] OMAPDSS: HDMI: Prepare for OMAP5 and DSS dev driver audio support Ricardo Neri
2012-03-28 22:38 ` [PATCH 01/10] OMAPDSS: HDMI: Remove ASoC codec Ricardo Neri
2012-04-23 13:17   ` Tomi Valkeinen
2012-04-25  2:27     ` Ricardo Neri
2012-03-28 22:38 ` [PATCH 02/10] OMAPDSS: HDMI: OMAP4: Remove CEA-861 audio infoframe and IEC-60958 enums Ricardo Neri
2012-04-23 13:12   ` Tomi Valkeinen
2012-04-25  3:37     ` Ricardo Neri
2012-04-27  1:32       ` Ricardo Neri
2012-04-27  6:31         ` Tomi Valkeinen
2012-03-28 22:38 ` [PATCH 03/10] OMAPDSS: HDMI: OMAP4: Correcty typo in I2S definitions Ricardo Neri
2012-04-23 12:42   ` Tomi Valkeinen
2012-04-25  3:39     ` Ricardo Neri
2012-03-28 22:38 ` [PATCH 04/10] OMAPDSS: HDMI: OMAP4: Decouple wrapper enable and audio start Ricardo Neri
2012-03-28 22:38 ` [PATCH 05/10] OMAPDSS: HDMI: Decouple HDMI audio from ASoC Ricardo Neri
2012-04-23 13:25   ` Tomi Valkeinen
2012-04-25  3:44     ` Ricardo Neri
2012-03-28 22:38 ` [PATCH 06/10] OMAPDSS: HDMI: OMAP4: Expand configuration for IEC-60958 audio Ricardo Neri
2012-03-28 22:38 ` [PATCH 07/10] OMAPDSS: HDMI: Relocate N/CTS calculation Ricardo Neri
2012-03-28 22:38 ` [PATCH 08/10] OMAPDSS: HDMI: Add support for more audio sample rates in " Ricardo Neri
2012-03-28 22:38 ` [PATCH 09/10] OMAPDSS: HDMI: OMAP4: Add an audio configuration function Ricardo Neri
2012-03-28 22:38 ` [PATCH 10/10] OMAPDSS: HDMI: Implement DSS driver interface for audio Ricardo Neri
2012-04-23 13:01   ` Tomi Valkeinen [this message]
2012-04-25  4:48     ` Ricardo Neri
2012-04-25  6:19       ` Tomi Valkeinen
2012-04-25 23:01         ` Ricardo Neri
2012-04-26  7:31           ` Tomi Valkeinen

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=1335186116.1535.23.camel@lappy \
    --to=tomi.valkeinen@ti.com \
    --cc=agraf@suse.de \
    --cc=linux-omap@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=mythripk@ti.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=research@ottomaneng.com \
    --cc=ricardo.neri@ti.com \
    --cc=s-chereau@ti.com \
    --cc=s-guiriec@ti.com \
    --cc=vaibhav.bedia@ti.com \
    --cc=x0055901@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).