devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
To: Jyri Sarha <jsarha-l0cyMroinI0@public.gmane.org>
Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	airlied-cv59FeDIM0c@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org,
	broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	liam.r.girdwood-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	peter.ujfalusi-l0cyMroinI0@public.gmane.org,
	tomi.valkeinen-l0cyMroinI0@public.gmane.org,
	moinejf-GANU6spQydw@public.gmane.org
Subject: Re: [PATCH RFC v3 6/7] drm/i2c: tda998x: Register ASoC HDMI codec for audio functionality
Date: Fri, 14 Aug 2015 11:06:16 +0100	[thread overview]
Message-ID: <20150814100616.GH7576@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1e8e3215caa932dab68de8576aee81f5e1008163.1439542916.git.jsarha-l0cyMroinI0@public.gmane.org>

On Fri, Aug 14, 2015 at 12:30:44PM +0300, Jyri Sarha wrote:
> +static int tda998x_write_aif(struct tda998x_priv *priv,
> +			     struct hdmi_audio_infoframe *cea)
> +{
> +	uint8_t buf[HDMI_INFOFRAME_SIZE(AUDIO)];
> +	int len;
> +
> +	len = hdmi_audio_infoframe_pack(cea, buf, sizeof(buf));
> +	if (len < 0) {
> +		dev_err(&priv->hdmi->dev,
> +			"Failed to pack audio infoframe: %d\n", len);
> +		return len;
> +	}
> +
> +	/* Write the audio information packet */
> +	tda998x_write_if(priv, DIP_IF_FLAGS_IF4, REG_IF4_HB0, buf, len);
> +	return 0;
> +}
> +

I have such a function already queued up, but I can't push it out at the
moment because of too many conflicts across all my DRM work.  I'm waiting
for after 4.3-rc1 before publishing anything from or accepting anything
else into DRM branches.

>  static void
>  tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode)
>  {
> @@ -670,19 +691,24 @@ static void tda998x_audio_mute(struct tda998x_priv *priv, bool on)
>  	}
>  }
>  
> -static void
> +static int
>  tda998x_configure_audio(struct tda998x_priv *priv,
> -		struct drm_display_mode *mode, struct tda998x_encoder_params *p)
> +			int mode_clock,
> +			int ena_ap,
> +			int dai_format,
> +			int sample_width,
> +			int sample_rate,
> +			const u8 *status)

I don't think this is an improvement.

> +static int tda998x_audio_get_eld(struct device *dev, uint8_t *buf, size_t len)
> +{
> +	struct tda998x_priv *priv = dev_get_drvdata(dev);
> +	struct drm_mode_config *config = &priv->encoder->dev->mode_config;
> +	struct drm_connector *connector;
> +	int ret = -ENODEV;
> +
> +	mutex_lock(&config.mutex);
> +	list_for_each_entry(connector, &config->connector_list, head) {
> +		if (priv->encoder == connector->encoder) {
> +			memcpy(buf, connector->eld, 
> +			       min(sizeof(connector->eld), len));
> +			ret = 0;
> +		}
> +	}
> +	mutex_unlock(&config.mutex);

Obviously untested.  Should be config->mutex.

But in any case, when I kill the DRM slave encoder code in here, this
becomes unnecessary.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-08-14 10:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-14  9:30 [PATCH RFC v3 0/7] Implement generic ASoC HDMI codec and use it in tda998x Jyri Sarha
2015-08-14  9:30 ` [PATCH RFC v3 1/7] drm/edid: add function to help find SADs, DO NOT MERGE Jyri Sarha
2015-08-14  9:30 ` [PATCH RFC v3 3/7] ASoC: hdmi-codec: Add hdmi-codec for external HDMI-encoders Jyri Sarha
2015-08-14  9:57   ` Russell King - ARM Linux
2015-08-17  6:50     ` Jyri Sarha
     [not found]   ` <ed41a6c0b594866c05e695cc066371d0e3862c7e.1439542916.git.jsarha-l0cyMroinI0@public.gmane.org>
2015-08-14 16:18     ` Mark Brown
2015-08-17  7:07       ` Jyri Sarha
2015-08-17 18:41         ` Mark Brown
2015-08-17 19:22           ` Jyri Sarha
2015-08-17  7:57       ` Jyri Sarha
2015-08-17 12:59         ` Jyri Sarha
2015-08-14  9:30 ` [PATCH RFC v3 5/7] drm/i2c: tda998x: Remove include/sound/tda998x.h and fix graph parsing Jyri Sarha
     [not found] ` <cover.1439542916.git.jsarha-l0cyMroinI0@public.gmane.org>
2015-08-14  9:30   ` [PATCH RFC v3 2/7] ASoC: hdmi: Remove obsolete dummy HDMI codec Jyri Sarha
     [not found]     ` <360a38c83ae2a24620da85b8496b745326d995de.1439542916.git.jsarha-l0cyMroinI0@public.gmane.org>
2015-08-14 16:10       ` Mark Brown
2015-08-17  7:00         ` Jyri Sarha
2015-08-17 18:46           ` Mark Brown
2015-08-14  9:30   ` [PATCH RFC v3 4/7] drm/i2c: tda998x: Add support of a DT graph of ports Jyri Sarha
2015-08-14  9:30   ` [PATCH RFC v3 6/7] drm/i2c: tda998x: Register ASoC HDMI codec for audio functionality Jyri Sarha
     [not found]     ` <1e8e3215caa932dab68de8576aee81f5e1008163.1439542916.git.jsarha-l0cyMroinI0@public.gmane.org>
2015-08-14 10:06       ` Russell King - ARM Linux [this message]
2015-08-17  7:25         ` Jyri Sarha
2015-08-14  9:30   ` [PATCH RFC v3 7/7] ARM: dts: am335x-boneblack: Add HDMI audio support Jyri Sarha

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=20150814100616.GH7576@n2100.arm.linux.org.uk \
    --to=linux-lfz/pmaqli7xmaaqvzeohq@public.gmane.org \
    --cc=airlied-cv59FeDIM0c@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=jsarha-l0cyMroinI0@public.gmane.org \
    --cc=liam.r.girdwood-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=moinejf-GANU6spQydw@public.gmane.org \
    --cc=peter.ujfalusi-l0cyMroinI0@public.gmane.org \
    --cc=tomi.valkeinen-l0cyMroinI0@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    /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).