devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jyri Sarha <jsarha-l0cyMroinI0@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	liam.r.girdwood-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org,
	moinejf-GANU6spQydw@public.gmane.org,
	peter.ujfalusi-l0cyMroinI0@public.gmane.org,
	bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org
Subject: Re: [alsa-devel] [PATCH 2/2] ASoC: simple-card: Add support for samplerate and samplewidth constraints
Date: Tue, 3 Mar 2015 14:00:31 +0200	[thread overview]
Message-ID: <54F5A25F.6090904@ti.com> (raw)
In-Reply-To: <20150303113041.GM21293-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>

On 03/03/2015 01:30 PM, Mark Brown wrote:
> On Tue, Mar 03, 2015 at 12:09:14PM +0200, Jyri Sarha wrote:
>> On 03/02/2015 09:58 PM, Lars-Peter Clausen wrote:
>
>>> Can you include a description why this is needed and how and when it is
>>> supposed to be used?
>
>> Would this addition do:
>> ------------------------------------------------------------
>> These constraints help to disable the sample-format and sample-rate
>> combinations that do not properly work on a specific HW.
>> ------------------------------------------------------------
>
> Not entirely...
>
>> The reason why we need these is coming from limitations in McASP clock
>> generation. With a simple divider one can only produce certain bit-clocks.
>> With those bit-clocks we can only play/capture some sample-rate and
>> sample-width combinations accurately.
>
>> The McASP driver could try to set the constraints automatically. However,
>> since the constraint code can not select sample-width and sample-rate
>> combinations there is a compromise to be made between them. Making such
>> compromises automatically does not usually work that well.
>
> ...this is more the point.  Perhaps the constraints language needs
> improvement here?
>

Improving constraint functionality would certainly help, however the way 
that code works is beyond my understanding and I do not believe such an 
improvement would be coming from anybody else any time soon either.

>> In our case these properties could of course be added to McASP driver, but
>> then again I would expect that there is a wider need for this kind of
>> functionality. And it may not always be clear if either end of the link
>> alone is responsible for less than perfect operation.
>
> The trouble with this sort of interface is that it's a quick and dirty
> way for people to bodge around things rather than actually fixing them
> properly.  Of course sometimes fixing things properly is really hard and
> that means we want a temporary bodge but having to put them in DT is
> really unfortunate.
>

I agree with that. However, the simple-card binding goes already now 
quite a bit beyond just describing the hardware. The binding for 
instance decides the configuration that is going to be used over the 
dai-link. These constraints could be seen as an extension to that 
configuration.

I am wondering if there would be some better way to select the dai-link 
configuration than writing it to DT or creating a custom machine driver 
for each setup.

But about this patch. Should I just give it up, or would you be willing 
to apply it if I improve the description more and add a warning against 
using these properties to work around driver bugs to the binding document?

Best regards,
Jyri
--
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-03-03 12:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-02 14:14 [PATCH 0/2] simple-card: Add samplerate and samplewidth constraints Jyri Sarha
     [not found] ` <cover.1425303942.git.jsarha-l0cyMroinI0@public.gmane.org>
2015-03-02 14:14   ` [PATCH 1/2] ASoC: simple-card: Remove trailing whitespace Jyri Sarha
     [not found]     ` <c7817be105a96bcbf71202c5497982f59a45a8eb.1425303942.git.jsarha-l0cyMroinI0@public.gmane.org>
2015-03-03 15:34       ` Mark Brown
2015-03-02 14:14   ` [PATCH 2/2] ASoC: simple-card: Add support for samplerate and samplewidth constraints Jyri Sarha
     [not found]     ` <9d01aa0d0bf48d8b41d5086a7e6c9ec08c2b9c48.1425303942.git.jsarha-l0cyMroinI0@public.gmane.org>
2015-03-02 19:35       ` [alsa-devel] " Pierre-Louis Bossart
2015-03-03 10:01         ` Jyri Sarha
2015-03-02 19:58       ` [alsa-devel] " Lars-Peter Clausen
2015-03-03 10:09         ` Jyri Sarha
     [not found]           ` <54F5884A.1090702-l0cyMroinI0@public.gmane.org>
2015-03-03 11:30             ` [alsa-devel] " Mark Brown
     [not found]               ` <20150303113041.GM21293-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-03-03 12:00                 ` Jyri Sarha [this message]
2015-03-03 15:31                   ` Lars-Peter Clausen
2015-03-04  7:48                     ` Jyri Sarha
2015-03-10 15:25                       ` Jyri Sarha
2015-03-03 15:34                   ` Mark Brown
2015-03-04  7:56                     ` Jyri Sarha
2015-03-04 18:42                       ` Mark Brown

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=54F5A25F.6090904@ti.com \
    --to=jsarha-l0cymroini0@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=kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org \
    --cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
    --cc=liam.r.girdwood-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=moinejf-GANU6spQydw@public.gmane.org \
    --cc=peter.ujfalusi-l0cyMroinI0@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).