[alsa-devel] [PATCH] ASoC:kirkwood: Don't raise an error when no DAI format
Jean-Francois Moine
moinejf at free.fr
Wed Oct 1 10:59:39 CEST 2014
On Tue, 30 Sep 2014 19:19:10 +0100
Mark Brown <broonie at kernel.org> wrote:
> On Sun, Sep 28, 2014 at 06:05:50PM +0200, Jean-Francois Moine wrote:
> > Russell King - ARM Linux <linux at arm.linux.org.uk> wrote:
> > > On Sun, Sep 28, 2014 at 04:19:27PM +0200, Jean-Francois Moine wrote:
>
> > > > This patch prevents the controller to raise an error when
> > > > the DT audio card definition by the simple card contains the PCM
> > > > format of one CPU DAI only.
>
> > > I think this is a silly idea - why should every driver have additional code
> > > to detect when it's called to do thing. Why doesn't the simple card code
> > > always pass the required format?
>
> > > Looking at other drivers, no one else does this; they all appear to require
> > > the proper format to be specified.
>
> > > What some drivers do (eg, omap-mcbsp.c) is to block set_fmt when the
> > > DAI is already in use - setting a flag "configured" in hw_params, and
> > > clearing it in shutdown. Maybe following this will solve your problem.
>
> > > In any case, random drivers doing stuff differently without reason is
> > > really not a good idea.
>
> > As the simple card is done, the audio hardware definitions of the
> > platform and all the CPU DAIS are always set in the audio controller.
>
> > When the PCM format is globally defined (platform), the function
> > set_fmt() is called for all CPU DAIs (then, twice for the kirkwood
> > controller) with the same value. The DT is:
>
> ...
>
> > The PCM format may also be defined per DAI link. The following DT works
> > the same as setting globally the format, i.e. there are two calls to
> > set_fmt() with 'i2s':
>
> > The problem appears when the format is defined in only one DAI link:
>
> > Then, audio does not work.
>
> So this is still a generic rather than driver issue and should be solved
> outside of the driver - exactly the same issue is going to apply to any
> other device with a similar shared configuration. We could either say
> that the DT is buggy here or we could say that the generic card ought to
> assume that if only one link specifies a format then it should use that
> format for other links if possible (since clearly the user doesn't care
> what it chooses).
The 'daifmt' of the callback function set_fmt (snd_soc_dai_set_fmt)
contains 4 parts:
- the physical format,
- the clock gating,
- the signal inversions,
- the master clock definitions.
As the value '0' is not used in the physical format nor in the master
clock, this value would have say 'don't change', permitting the
parameters to be set independently.
But, as you and Russell say 'no', I will let the format definition at
the platform level in the DT. Setting twice the hardware registers is
not a problem.
Thanks.
> Please also try to use subject lines matching the style for the
> subsystem. You've been working with upstream for a while, you really
> ought to be familiar with this sort of basic process stuff.
Sorry.
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
More information about the Alsa-devel
mailing list