From: Jean-Francois Moine <moinejf-GANU6spQydw@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Russell King - ARM Linux
<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
Dave Airlie <airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Andrew Jackson <Andrew.Jackson-5wv7dgnIgG8@public.gmane.org>,
Jyri Sarha <jsarha-l0cyMroinI0@public.gmane.org>,
Takashi Iwai <tiwai-l3A5Bk7waGM@public.gmane.org>,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v13 3/3] ASoC: tda998x: add a codec to the HDMI transmitter
Date: Tue, 28 Jul 2015 12:19:45 +0200 [thread overview]
Message-ID: <20150728121945.560f82a5@armhf> (raw)
In-Reply-To: <20150720180606.GL11162-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
On Mon, 20 Jul 2015 19:06:06 +0100
Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> On Fri, May 08, 2015 at 10:41:12AM +0200, Jean-Francois Moine wrote:
>
> > +
> > + if (!priv->is_hdmi_sink
> > + || !encoder->crtc)
> > + return NULL;
>
> That's weird indentation.
But the conditions are aligned... This sequence will be removed.
> > + list_for_each_entry(connector, &drm->mode_config.connector_list, head) {
> > + if (connector->encoder == encoder)
> > + return connector->eld;
> > + }
>
> What guarantees that connector->eld stays valid after it's returned?
You are right, the ELD content may change. I will use a pointer to a
stable content.
> > +struct tda998x_ops_s {
> > + u8 *(*get_eld)(struct device *dev);
>
> Why _ops_s - what does the _s mean? If it's sound perhaps it makes
> sense to spell it out so people aren't guessing.
I will remove it.
> > +int tda9998x_codec_register(struct device *dev,
> > + struct tda998x_audio_s *tda998x_audio_i,
> > + struct tda998x_ops_s *tda998x_ops);
> > +void tda9998x_codec_unregister(struct device *dev);
>
> I'd expect these to be internal to the DRM driver.
I don't see where. What is your idea?
> > +config SND_SOC_TDA998X
> > + def_tristate y
> > + select SND_PCM_ELD
> > + depends on DRM_I2C_NXP_TDA998X
> > +
>
> def_tristate y? Why?
The TDA998x CODEC is always generated when the DRM TDA998x is generated
and when audio is wanted.
Its type, built-in or module, depends on the TDA998x driver type.
> > +/* functions in tda998x_drv */
> > +static struct tda998x_ops_s *tda998x_ops;
>
> I'd expect this to be stored in the driver data rather than a static
> global, what if a system has two HDMI outputs?
Each TDA998x has only one HDMI output and there is only one driver.
I will put the pointer to the HDMI driver in the device private area.
> > +static int tda998x_codec_startup(struct snd_pcm_substream *substream,
> > + struct snd_soc_dai *dai)
> > +{
> > + struct snd_pcm_runtime *runtime = substream->runtime;
> > + u8 *eld;
> > +
> > + eld = tda998x_ops->get_eld(dai->dev);
> > + if (!eld)
> > + return -ENODEV;
> > + return snd_pcm_hw_constraint_eld(runtime, eld);
> > +}
>
> Do we really need a device specific mechanism for fishing the ELD out of
> the graphics code? I'd have expected this to be more generic.
I will put the ELD in the private data of the DRM driver.
> > +/* ask the HDMI transmitter to activate the audio input port */
> > +static int tda998x_codec_hw_params(struct snd_pcm_substream *substream,
> > + struct snd_pcm_hw_params *params,
> > + struct snd_soc_dai *dai)
> > +{
> > + return tda998x_ops->set_audio_input(dai->dev, dai->id,
> > + params_rate(params));
> > +}
>
> The set_audio_input() function doesn't appear to have anything that
> checks if the device is busy before enabling things, what happens if the
> user tries to switch between I2S and S/PDIF? It looks like only one DAI
> can be active at once.
Right. I will check this double streaming.
> > + for (i = 0, p_dai = dais; i < ndais ; i++, p_dai++) {
> > + memcpy(p_dai, &tda998x_dai_i2s, sizeof(*p_dai));
> > + p_dai->id = i;
> > + if (tda998x_audio->port_types[i] == AFMT_SPDIF) {
> > + p_dai->name = "spdif-hifi";
> > + p_dai->playback.stream_name = "HDMI SPDIF Playback";
> > + p_dai->playback.channels_max = 2;
> > + p_dai->playback.rate_min = 22050;
> > + }
> > + }
>
> It would be a bit clearer if the template were just a template and this
> copying initialised both I2S and S/PDIF specific settings.
OK, I will change this.
> > + return snd_soc_register_codec(dev,
> > + &tda998x_codec_drv,
> > + dais, ndais);
> > +}
> > +EXPORT_SYMBOL(tda9998x_codec_register);
>
> ASoC is all EXPORT_SYMBOL_GPL, you shouldn't reexport functionality with
> plain EXPORT_SYMBOL.
Sorry, bug of mine.
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
--
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
next prev parent reply other threads:[~2015-07-28 10:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-20 13:01 [PATCH v13 0/3] ASoC: tda998x: add a codec to the HDMI transmitter Jean-Francois Moine
[not found] ` <cover.1437397270.git.moinejf-GANU6spQydw@public.gmane.org>
2015-05-08 8:18 ` [PATCH v13 1/3] drm/i2c: tda998x: Add support of a DT graph of ports Jean-Francois Moine
2015-05-08 8:23 ` [PATCH v13 2/3] drm/i2c: tda998x: Change drvdata for audio extension Jean-Francois Moine
2015-05-08 8:41 ` [PATCH v13 3/3] ASoC: tda998x: add a codec to the HDMI transmitter Jean-Francois Moine
[not found] ` <e036c88aa945e72b40ec965c9358dacf564e79f2.1437397272.git.moinejf-GANU6spQydw@public.gmane.org>
2015-07-20 18:06 ` Mark Brown
[not found] ` <20150720180606.GL11162-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-07-28 10:19 ` Jean-Francois Moine [this message]
2015-07-28 10:24 ` Mark Brown
2015-07-28 13:23 ` Jean-Francois Moine
2015-07-28 13:53 ` Russell King - ARM Linux
2015-07-28 13:59 ` Takashi Iwai
[not found] ` <s5hio94tmb2.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
2015-07-28 14:18 ` Russell King - ARM Linux
[not found] ` <20150728135358.GK7557-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-07-28 14:39 ` Jean-Francois Moine
2015-07-28 15:06 ` Russell King - ARM Linux
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=20150728121945.560f82a5@armhf \
--to=moinejf-ganu6spqydw@public.gmane.org \
--cc=Andrew.Jackson-5wv7dgnIgG8@public.gmane.org \
--cc=airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jsarha-l0cyMroinI0@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=tiwai-l3A5Bk7waGM@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.