From: Jean-Francois Moine <moinejf@free.fr>
To: Mark Brown <broonie@kernel.org>
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
Russell King - ARM Linux <linux@arm.linux.org.uk>,
Takashi Iwai <tiwai@suse.de>,
Andrew Jackson <Andrew.Jackson@arm.com>,
Jyri Sarha <jsarha@ti.com>, Dave Airlie <airlied@gmail.com>
Subject: Re: [PATCH v13 3/3] ASoC: tda998x: add a codec to the HDMI transmitter
Date: Tue, 28 Jul 2015 15:23:29 +0200 [thread overview]
Message-ID: <20150728152329.02668865@armhf> (raw)
In-Reply-To: <20150728102410.GD11162@sirena.org.uk>
On Tue, 28 Jul 2015 11:24:10 +0100
Mark Brown <broonie@kernel.org> wrote:
> On Tue, Jul 28, 2015 at 12:19:45PM +0200, Jean-Francois Moine wrote:
> > Mark Brown <broonie@kernel.org> wrote:
>
> > > > +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?
>
> What I said above - put them in the DRM driver. They're just
> registering a device IIRC.
There is no CODEC device. The HDMI device supports both audio and video.
> > > > +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.
>
> Just make this like any other driver with no default specified.
If I understand correctly, you want that the user might choose to use
the HDMI for video only and to have audio by some other mean.
No problem.
> > > > +/* 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.
>
> Someone might put two chips on the board.
The pointer was from the tda998x codec to the tda998x driver.
There might be any number of chips on the board.
> > > > +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.
>
> That's not the issue here - the issue is that the need to get the ELD
> out of the video subsystem is not specific to this driver, it's pretty
> common and something that it seems we should factor out.
Yes, but how?
The EDID arrives in the DRM connector when video starts. The built ELD
may be stored either in the connector itself (default), in the encoder
(TDA998x device) or in some DRM/encoder/connector private data.
On the audio side, the CODEC is supported by a driver which is either a
CODEC driver (as in the dummy HDMI codec) or the DRM encoder (TDA998x
device).
You may note that, in DRM, there is no relation between the encoder and
the connector except at video startup time, and no relation between the
DRM connector and the audio CODEC (no CODEC information is returned on
CODEC creation and the CODEC has no private data).
I tried many solutions to solve this problem, and the one of may latest
patchset (v14) seems the simpleset: set the audio/video common part at
the beginning of the TDA998x (HDMI) private data.
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next prev parent reply other threads:[~2015-07-28 13:23 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
2015-07-28 10:24 ` Mark Brown
2015-07-28 13:23 ` Jean-Francois Moine [this message]
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=20150728152329.02668865@armhf \
--to=moinejf@free.fr \
--cc=Andrew.Jackson@arm.com \
--cc=airlied@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jsarha@ti.com \
--cc=linux@arm.linux.org.uk \
--cc=tiwai@suse.de \
/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