devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Arnaud Pouliquen <arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Hartmut Knaack <knaack.h-Mmb7MZpHnFY@public.gmane.org>,
	Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>,
	Peter Meerwald-Stadler
	<pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>,
	Jaroslav Kysela <perex-/Fr2/VpizcU@public.gmane.org>,
	Takashi Iwai <tiwai-IBi9RG/b67k@public.gmane.org>,
	Liam Girdwood <lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	kernel-F5mvAk5X5gdBDgjK7y7TUQ@public.gmane.org,
	Maxime Coquelin
	<mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Alexandre Torgue <alexandre.torgue-qxv4g6HH51o@public.gmane.org>,
	olivier moysan <olivier.moysan-qxv4g6HH51o@public.gmane.org>
Subject: Re: [RFC v2 5/7] ASoC: stm32: add DFSDM DAI support
Date: Sun, 19 Feb 2017 14:56:05 +0000	[thread overview]
Message-ID: <a9cf136c-2c8c-eafc-d175-4977c7ea4925@kernel.org> (raw)
In-Reply-To: <20170214174534.35ytbpax75mxcayg-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>

On 14/02/17 17:45, Mark Brown wrote:
> On Mon, Feb 13, 2017 at 05:38:27PM +0100, Arnaud Pouliquen wrote:
> 
> This looks basically fine as a system specific driver but as some of the
> comments in here say there's bits of it could perhaps be genericised but
> I'm not sure we need to do that right now.  I'm not sure the abstraction
> is exactly comfortable but having another bit of hardware doing a bridge
> to IIO might be the best way to figure out something better.
Agreed.  To an extent we are fishing around in the dark at the moment.
Lets wait until we have a few more cases of similar hardware before trying
too much generalization.  This is acting as a good exploration of what
is needed.

Ideally Lars might upstream some of the other bits he has in his tree
to do with DSP processing on ADC streams and that might provide us with
more clues on generality (at least at the lowest layers)
(Apparently he's busy - though he always makes that excuse :)
Joking aside, the exploration Analog and in particular Lars does around
pushing the limits of how things interact is always useful!)

> 
>> +	.period_bytes_min = 40, /* 8 khz 5 ms */
>> +	.period_bytes_max = 4 * PAGE_SIZE,
>> +	.buffer_bytes_max = 16 * PAGE_SIZE
> 
> What's the physical minimum period limit?  The comment makes this sound
> like it's just made up.
> 
>> +	unsigned int shift = 24 -priv->max_scaling;
>> +	
> 
> Missing space after -.
> 
>> +	dev_dbg(dai->dev, "%s: enter\n", __func__);
>> +	return 0;
>> +	return snd_pcm_hw_constraint_list(substream->runtime, 0,
>> +					  SNDRV_PCM_HW_PARAM_RATE,
>> +					  &priv->rates_const);
> 
> Looks like debug changes got left in?
> 
>> +static int stm32_adfsdm_set_sysclk(struct snd_soc_dai *dai, int clk_id,
>> +				   unsigned int freq, int dir)
>> +{
>> +	struct stm32_adfsdm_priv *priv = snd_soc_dai_get_drvdata(dai);
>> +	struct stm32_adfsdm_pdata *pdata = priv->pdata;
>> +
>> +	dev_dbg(dai->dev, "%s: enter for dai %d\n", __func__, dai->id);
>> +	if (dir == SND_SOC_CLOCK_IN) {
>> +		pdata->ops->set_sysclk(pdata->adc, freq);
>> +		priv->dmic_clk = freq;
>> +	}
>> +
>> +	/* Determine supported rate which depends on SPI/manchester clock */
>> +	return stm32_adfsdm_get_supported_rates(dai, &priv->rates_const.mask);
> 
> Since the DAI is unidirectional it doesn't matter but obviously if it
> weren't then the fact that getting the supported rates involves setting
> the hwparams means this could become disruptive.  If we're going to
> genericise this to be a more general IIO/ASoC bridge that could matter.
> 
>> +static int stm32_adfsdm_dai_remove(struct snd_soc_dai *dai)
>> +{
>> +	dev_dbg(dai->dev, "%s: enter for dai %d\n", __func__, dai->id);
>> +
>> +	return 0;
>> +}
> 
> Remove empty functions, though in this case I think you want to add
> something to disconnect the XRUN callback just in order to be sure it
> can't be mistakenly called.
> 

  parent reply	other threads:[~2017-02-19 14:56 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13 16:38 [RFC v2 0/7] Add STM32 DFSDM support Arnaud Pouliquen
2017-02-13 16:38 ` [RFC v2 1/7] iio: Add hardware consumer support Arnaud Pouliquen
     [not found]   ` <1487003909-11710-2-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-02-19 14:13     ` Jonathan Cameron
2017-02-13 16:38 ` [RFC v2 2/7] IIO: Add bindings for simple sigma delta adc Arnaud Pouliquen
2017-02-22 15:17   ` Rob Herring
2017-02-27 11:15     ` Arnaud Pouliquen
2017-03-05 11:04       ` Jonathan Cameron
2017-02-13 16:38 ` [RFC v2 3/7] IIO: ADC: add sigma delta modulator support Arnaud Pouliquen
     [not found]   ` <1487003909-11710-4-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-02-19 14:20     ` Jonathan Cameron
2017-02-13 16:38 ` [RFC v2 4/7] ASoC: dmaengine_pcm: add copy support Arnaud Pouliquen
2017-02-14 17:16   ` Mark Brown
2017-02-15 13:59     ` Arnaud Pouliquen
     [not found]       ` <40633f7c-a2ac-1658-cc9d-b30eaff8a95a-qxv4g6HH51o@public.gmane.org>
2017-02-15 14:53         ` Mark Brown
2017-02-15 15:46           ` Arnaud Pouliquen
     [not found]             ` <338f8db7-2077-626f-986b-b4e3df40469c-qxv4g6HH51o@public.gmane.org>
2017-02-16 20:14               ` Mark Brown
2017-02-27  9:05                 ` Arnaud Pouliquen
2017-02-13 16:38 ` [RFC v2 5/7] ASoC: stm32: add DFSDM DAI support Arnaud Pouliquen
     [not found]   ` <1487003909-11710-6-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-02-13 18:13     ` Peter Meerwald-Stadler
     [not found]       ` <alpine.DEB.2.02.1702131906350.25127-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
2017-02-14 11:09         ` Arnaud Pouliquen
     [not found]           ` <c381a9a2-5dff-af9a-eeb0-8fd1a74f448e-qxv4g6HH51o@public.gmane.org>
2017-02-14 12:57             ` Peter Meerwald-Stadler
2017-02-14 17:45     ` Mark Brown
2017-02-15 16:39       ` Arnaud Pouliquen
     [not found]         ` <9b875a75-294a-2f59-5830-cc0f6b3b62c7-qxv4g6HH51o@public.gmane.org>
2017-02-15 16:53           ` Mark Brown
     [not found]       ` <20170214174534.35ytbpax75mxcayg-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2017-02-19 14:56         ` Jonathan Cameron [this message]
2017-02-27 10:31           ` Arnaud Pouliquen
     [not found]             ` <84f330ab-48a2-6e0b-ab95-6aab5b34c241-qxv4g6HH51o@public.gmane.org>
2017-03-05 10:55               ` Jonathan Cameron
2017-02-13 16:38 ` [RFC v2 6/7] IIO: add bindings for stm32 DFSDM filter Arnaud Pouliquen
     [not found]   ` <1487003909-11710-7-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-02-13 18:05     ` Peter Meerwald-Stadler
2017-02-22 16:42     ` Rob Herring
2017-02-27 14:07       ` Arnaud Pouliquen
2017-02-19 15:00   ` Jonathan Cameron
2017-02-27 10:47     ` Arnaud Pouliquen
     [not found]       ` <7fbfc694-3685-ec90-6292-5a5157a8a0d2-qxv4g6HH51o@public.gmane.org>
2017-03-05 11:00         ` Jonathan Cameron
2017-02-13 16:38 ` [RFC v2 7/7] IIO: ADC: add stm32 DFSDM support Arnaud Pouliquen
2017-02-19 14:46   ` Jonathan Cameron
2017-02-27 10:09     ` Arnaud Pouliquen
     [not found]       ` <fe86eca5-5dca-efb3-45d2-46e193f60dc9-qxv4g6HH51o@public.gmane.org>
2017-03-05 10:55         ` Jonathan Cameron

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=a9cf136c-2c8c-eafc-d175-4977c7ea4925@kernel.org \
    --to=jic23-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=alexandre.torgue-qxv4g6HH51o@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=arnaud.pouliquen-qxv4g6HH51o@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kernel-F5mvAk5X5gdBDgjK7y7TUQ@public.gmane.org \
    --cc=knaack.h-Mmb7MZpHnFY@public.gmane.org \
    --cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
    --cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=olivier.moysan-qxv4g6HH51o@public.gmane.org \
    --cc=perex-/Fr2/VpizcU@public.gmane.org \
    --cc=pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=tiwai-IBi9RG/b67k@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).