All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaud Pouliquen <arnaud.pouliquen@st.com>
To: Jonathan Cameron <jic23@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Olivier MOYSAN <olivier.moysan@st.com>,
	"kernel@stlinux.com" <kernel@stlinux.com>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Alexandre TORGUE <alexandre.torgue@st.com>
Subject: Re: [PATCH v3 07/11] IIO: consumer: allow to set buffer sizes
Date: Mon, 20 Mar 2017 12:30:48 +0100	[thread overview]
Message-ID: <b2715233-63e7-4c9d-49fc-ad6ca8be0d75@st.com> (raw)
In-Reply-To: <951c19fa-d3b8-f4cd-cac1-64e3b8d1cf01@kernel.org>



On 03/19/2017 11:44 PM, Jonathan Cameron wrote:
> On 17/03/17 14:08, Arnaud Pouliquen wrote:
>> Add iio consumer API to set buffer size and watermark according
>> to sysfs API.
>>
>> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
> Hmm. Not keen on the length one.  Setting a requested watermark
> is fair enough.  There is no actually buffer in these cases though
> so setting it's length is downright odd..
Length and watermark are configurable from user land through sysfs.
Seems to me logic to also propose it in inkern API...
But I can clean length , no problem.

> 
> Guess this is part of the hacks we need to clean up by doing
> the dma buffer consumer stuff right...
Yes all is linked :-).

> 
> Jonathan
>> ---
>>  drivers/iio/buffer/industrialio-buffer-cb.c | 12 ++++++++++++
>>  include/linux/iio/consumer.h                | 13 +++++++++++++
>>  2 files changed, 25 insertions(+)
>>
>> diff --git a/drivers/iio/buffer/industrialio-buffer-cb.c b/drivers/iio/buffer/industrialio-buffer-cb.c
>> index b8f550e..43c066a 100644
>> --- a/drivers/iio/buffer/industrialio-buffer-cb.c
>> +++ b/drivers/iio/buffer/industrialio-buffer-cb.c
>> @@ -103,6 +103,18 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
>>  }
>>  EXPORT_SYMBOL_GPL(iio_channel_get_all_cb);
>>  
>> +int iio_channel_cb_set_buffer_params(struct iio_cb_buffer *cb_buff,
>> +				      size_t length, size_t watermark)
>> +{
>> +	if (!length || length < watermark)
>> +		return -EINVAL;
>> +	cb_buff->buffer.watermark = watermark;
>> +	cb_buff->buffer.length = length;
>> +
>> +	return 0;
>> +}
>> +EXPORT_SYMBOL_GPL(iio_channel_start_all_cb);
>> +
>>  int iio_channel_start_all_cb(struct iio_cb_buffer *cb_buff)
>>  {
>>  	return iio_update_buffers(cb_buff->indio_dev, &cb_buff->buffer,
>> diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
>> index cb44771..0f6e94d 100644
>> --- a/include/linux/iio/consumer.h
>> +++ b/include/linux/iio/consumer.h
>> @@ -134,6 +134,19 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
>>  						       void *private),
>>  					     void *private);
>>  /**
>> + * iio_channel_cb_set_buffer_size() - set the buffer length.
>> + * @cb_buffer:		The callback buffer from whom we want the channel
>> + *			information.
>> + * @length: buffer length in bytes
>> + * @watermark: buffer watermark in bytes
>> + *
>> + * This function allows to configure the buffer length. The watermark if
>> + * forced to half of the buffer.
>> + */
>> +int iio_channel_cb_set_buffer_params(struct iio_cb_buffer *cb_buffer,
>> +				     size_t length, size_t watermark);
>> +
>> +/**
>>   * iio_channel_release_all_cb() - release and unregister the callback.
>>   * @cb_buffer:		The callback buffer that was allocated.
>>   */
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

WARNING: multiple messages have this Message-ID (diff)
From: Arnaud Pouliquen <arnaud.pouliquen@st.com>
To: Jonathan Cameron <jic23@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"kernel@stlinux.com" <kernel@stlinux.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre TORGUE <alexandre.torgue@st.com>,
	Olivier MOYSAN <olivier.moysan@st.com>
Subject: Re: [PATCH v3 07/11] IIO: consumer: allow to set buffer sizes
Date: Mon, 20 Mar 2017 12:30:48 +0100	[thread overview]
Message-ID: <b2715233-63e7-4c9d-49fc-ad6ca8be0d75@st.com> (raw)
In-Reply-To: <951c19fa-d3b8-f4cd-cac1-64e3b8d1cf01@kernel.org>



On 03/19/2017 11:44 PM, Jonathan Cameron wrote:
> On 17/03/17 14:08, Arnaud Pouliquen wrote:
>> Add iio consumer API to set buffer size and watermark according
>> to sysfs API.
>>
>> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
> Hmm. Not keen on the length one.  Setting a requested watermark
> is fair enough.  There is no actually buffer in these cases though
> so setting it's length is downright odd..
Length and watermark are configurable from user land through sysfs.
Seems to me logic to also propose it in inkern API...
But I can clean length , no problem.

> 
> Guess this is part of the hacks we need to clean up by doing
> the dma buffer consumer stuff right...
Yes all is linked :-).

> 
> Jonathan
>> ---
>>  drivers/iio/buffer/industrialio-buffer-cb.c | 12 ++++++++++++
>>  include/linux/iio/consumer.h                | 13 +++++++++++++
>>  2 files changed, 25 insertions(+)
>>
>> diff --git a/drivers/iio/buffer/industrialio-buffer-cb.c b/drivers/iio/buffer/industrialio-buffer-cb.c
>> index b8f550e..43c066a 100644
>> --- a/drivers/iio/buffer/industrialio-buffer-cb.c
>> +++ b/drivers/iio/buffer/industrialio-buffer-cb.c
>> @@ -103,6 +103,18 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
>>  }
>>  EXPORT_SYMBOL_GPL(iio_channel_get_all_cb);
>>  
>> +int iio_channel_cb_set_buffer_params(struct iio_cb_buffer *cb_buff,
>> +				      size_t length, size_t watermark)
>> +{
>> +	if (!length || length < watermark)
>> +		return -EINVAL;
>> +	cb_buff->buffer.watermark = watermark;
>> +	cb_buff->buffer.length = length;
>> +
>> +	return 0;
>> +}
>> +EXPORT_SYMBOL_GPL(iio_channel_start_all_cb);
>> +
>>  int iio_channel_start_all_cb(struct iio_cb_buffer *cb_buff)
>>  {
>>  	return iio_update_buffers(cb_buff->indio_dev, &cb_buff->buffer,
>> diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
>> index cb44771..0f6e94d 100644
>> --- a/include/linux/iio/consumer.h
>> +++ b/include/linux/iio/consumer.h
>> @@ -134,6 +134,19 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
>>  						       void *private),
>>  					     void *private);
>>  /**
>> + * iio_channel_cb_set_buffer_size() - set the buffer length.
>> + * @cb_buffer:		The callback buffer from whom we want the channel
>> + *			information.
>> + * @length: buffer length in bytes
>> + * @watermark: buffer watermark in bytes
>> + *
>> + * This function allows to configure the buffer length. The watermark if
>> + * forced to half of the buffer.
>> + */
>> +int iio_channel_cb_set_buffer_params(struct iio_cb_buffer *cb_buffer,
>> +				     size_t length, size_t watermark);
>> +
>> +/**
>>   * iio_channel_release_all_cb() - release and unregister the callback.
>>   * @cb_buffer:		The callback buffer that was allocated.
>>   */
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

WARNING: multiple messages have this Message-ID (diff)
From: arnaud.pouliquen@st.com (Arnaud Pouliquen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 07/11] IIO: consumer: allow to set buffer sizes
Date: Mon, 20 Mar 2017 12:30:48 +0100	[thread overview]
Message-ID: <b2715233-63e7-4c9d-49fc-ad6ca8be0d75@st.com> (raw)
In-Reply-To: <951c19fa-d3b8-f4cd-cac1-64e3b8d1cf01@kernel.org>



On 03/19/2017 11:44 PM, Jonathan Cameron wrote:
> On 17/03/17 14:08, Arnaud Pouliquen wrote:
>> Add iio consumer API to set buffer size and watermark according
>> to sysfs API.
>>
>> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
> Hmm. Not keen on the length one.  Setting a requested watermark
> is fair enough.  There is no actually buffer in these cases though
> so setting it's length is downright odd..
Length and watermark are configurable from user land through sysfs.
Seems to me logic to also propose it in inkern API...
But I can clean length , no problem.

> 
> Guess this is part of the hacks we need to clean up by doing
> the dma buffer consumer stuff right...
Yes all is linked :-).

> 
> Jonathan
>> ---
>>  drivers/iio/buffer/industrialio-buffer-cb.c | 12 ++++++++++++
>>  include/linux/iio/consumer.h                | 13 +++++++++++++
>>  2 files changed, 25 insertions(+)
>>
>> diff --git a/drivers/iio/buffer/industrialio-buffer-cb.c b/drivers/iio/buffer/industrialio-buffer-cb.c
>> index b8f550e..43c066a 100644
>> --- a/drivers/iio/buffer/industrialio-buffer-cb.c
>> +++ b/drivers/iio/buffer/industrialio-buffer-cb.c
>> @@ -103,6 +103,18 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
>>  }
>>  EXPORT_SYMBOL_GPL(iio_channel_get_all_cb);
>>  
>> +int iio_channel_cb_set_buffer_params(struct iio_cb_buffer *cb_buff,
>> +				      size_t length, size_t watermark)
>> +{
>> +	if (!length || length < watermark)
>> +		return -EINVAL;
>> +	cb_buff->buffer.watermark = watermark;
>> +	cb_buff->buffer.length = length;
>> +
>> +	return 0;
>> +}
>> +EXPORT_SYMBOL_GPL(iio_channel_start_all_cb);
>> +
>>  int iio_channel_start_all_cb(struct iio_cb_buffer *cb_buff)
>>  {
>>  	return iio_update_buffers(cb_buff->indio_dev, &cb_buff->buffer,
>> diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
>> index cb44771..0f6e94d 100644
>> --- a/include/linux/iio/consumer.h
>> +++ b/include/linux/iio/consumer.h
>> @@ -134,6 +134,19 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
>>  						       void *private),
>>  					     void *private);
>>  /**
>> + * iio_channel_cb_set_buffer_size() - set the buffer length.
>> + * @cb_buffer:		The callback buffer from whom we want the channel
>> + *			information.
>> + * @length: buffer length in bytes
>> + * @watermark: buffer watermark in bytes
>> + *
>> + * This function allows to configure the buffer length. The watermark if
>> + * forced to half of the buffer.
>> + */
>> +int iio_channel_cb_set_buffer_params(struct iio_cb_buffer *cb_buffer,
>> +				     size_t length, size_t watermark);
>> +
>> +/**
>>   * iio_channel_release_all_cb() - release and unregister the callback.
>>   * @cb_buffer:		The callback buffer that was allocated.
>>   */
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2017-03-20 11:30 UTC|newest]

Thread overview: 109+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-17 14:08 [PATCH v3 00/11] Add STM32 DFSDM support Arnaud Pouliquen
2017-03-17 14:08 ` Arnaud Pouliquen
2017-03-17 14:08 ` Arnaud Pouliquen
2017-03-17 14:08 ` [PATCH v3 01/11] iio: Add hardware consumer support Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-20  7:48   ` Peter Meerwald-Stadler
2017-06-06 10:15   ` Arnaud Pouliquen
2017-06-06 10:15     ` Arnaud Pouliquen
2017-06-06 10:15     ` Arnaud Pouliquen
2017-09-11  9:01     ` Arnaud Pouliquen
2017-09-11  9:01       ` Arnaud Pouliquen
2017-09-11  9:01       ` Arnaud Pouliquen
2017-03-17 14:08 ` [PATCH v3 02/11] IIO: Add DT bindings for sigma delta adc modulator Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
     [not found]   ` <1489759704-30217-3-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-03-24 14:21     ` Rob Herring
2017-03-24 14:21       ` Rob Herring
2017-03-24 14:21       ` Rob Herring
2017-03-17 14:08 ` [PATCH v3 03/11] IIO: ADC: add sigma delta modulator support Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-20  6:24   ` [alsa-devel] " kbuild test robot
2017-03-20  6:24     ` kbuild test robot
2017-03-20  6:24     ` kbuild test robot
2017-03-20  6:51   ` kbuild test robot
2017-03-20  6:51     ` kbuild test robot
2017-03-20  6:51     ` kbuild test robot
2017-03-17 14:08 ` [PATCH v3 04/11] IIO: add DT bindings for stm32 DFSDM filter Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-24 14:37   ` Rob Herring
2017-03-24 14:37     ` Rob Herring
2017-03-24 14:37     ` Rob Herring
2017-03-17 14:08 ` [PATCH v3 05/11] IIO: ADC: add stm32 DFSDM support for Sigma delta ADC Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
     [not found]   ` <1489759704-30217-6-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-03-19 22:25     ` Jonathan Cameron
2017-03-19 22:25       ` Jonathan Cameron
2017-03-19 22:25       ` Jonathan Cameron
2017-03-20 11:24       ` Arnaud Pouliquen
2017-03-20 11:24         ` Arnaud Pouliquen
2017-03-20 11:24         ` Arnaud Pouliquen
2017-03-25 15:53         ` Jonathan Cameron
2017-03-25 15:53           ` Jonathan Cameron
2017-03-25 15:53           ` Jonathan Cameron
2017-03-20  7:22     ` [alsa-devel] " kbuild test robot
2017-03-20  7:22       ` kbuild test robot
2017-03-20  8:04     ` kbuild test robot
2017-03-20  8:04       ` kbuild test robot
2017-03-20  8:04       ` kbuild test robot
2017-03-17 14:08 ` [PATCH v3 06/11] IIO: ADC: add stm32 DFSDM support for PDM microphone Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
     [not found]   ` <1489759704-30217-7-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-03-19 22:38     ` Jonathan Cameron
2017-03-19 22:38       ` Jonathan Cameron
2017-03-19 22:38       ` Jonathan Cameron
2017-03-20 11:29       ` Arnaud Pouliquen
2017-03-20 11:29         ` Arnaud Pouliquen
2017-03-20 11:29         ` Arnaud Pouliquen
2017-03-25 15:59         ` Jonathan Cameron
2017-03-25 15:59           ` Jonathan Cameron
2017-03-25 15:59           ` Jonathan Cameron
2017-03-28  7:45           ` Arnaud Pouliquen
2017-03-28  7:45             ` Arnaud Pouliquen
2017-03-28  7:45             ` Arnaud Pouliquen
2017-03-17 14:08 ` [PATCH v3 07/11] IIO: consumer: allow to set buffer sizes Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
     [not found]   ` <1489759704-30217-8-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-03-19 22:44     ` Jonathan Cameron
2017-03-19 22:44       ` Jonathan Cameron
2017-03-19 22:44       ` Jonathan Cameron
2017-03-20 11:30       ` Arnaud Pouliquen [this message]
2017-03-20 11:30         ` Arnaud Pouliquen
2017-03-20 11:30         ` Arnaud Pouliquen
2017-03-25 16:01         ` Jonathan Cameron
2017-03-25 16:01           ` Jonathan Cameron
2017-03-25 16:01           ` Jonathan Cameron
2017-03-20  6:22     ` [alsa-devel] " kbuild test robot
2017-03-20  6:22       ` kbuild test robot
2017-03-20  6:22       ` kbuild test robot
2017-03-20  8:08   ` Peter Meerwald-Stadler
2017-03-17 14:08 ` [PATCH v3 08/11] ASoC: Add bindings for DMIC codec driver Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-24 14:46   ` Rob Herring
2017-03-24 14:46     ` Rob Herring
2017-03-24 14:46     ` Rob Herring
2017-03-27 11:59     ` Mark Brown
2017-03-27 11:59       ` Mark Brown
2017-03-27 11:59       ` Mark Brown
2017-03-17 14:08 ` [PATCH v3 09/11] ASoC: codec: add DT support in dmic codec Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08 ` [PATCH v3 10/11] ASoC: add bindings for stm32 DFSDM filter Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-24 14:52   ` Rob Herring
2017-03-24 14:52     ` Rob Herring
2017-03-24 14:52     ` Rob Herring
2017-03-29 12:42     ` Arnaud Pouliquen
2017-03-29 12:42       ` Arnaud Pouliquen
2017-03-29 12:42       ` Arnaud Pouliquen
2017-03-17 14:08 ` [PATCH v3 11/11] ASoC: stm32: add DFSDM DAI support Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 14:08   ` Arnaud Pouliquen
2017-03-17 16:36 ` [PATCH v3 00/11] Add STM32 DFSDM support Arnaud Pouliquen
2017-03-17 16:36   ` Arnaud Pouliquen
2017-03-17 16:36   ` Arnaud Pouliquen

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=b2715233-63e7-4c9d-49fc-ad6ca8be0d75@st.com \
    --to=arnaud.pouliquen@st.com \
    --cc=alexandre.torgue@st.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=kernel@stlinux.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=olivier.moysan@st.com \
    --cc=perex@perex.cz \
    --cc=pmeerw@pmeerw.net \
    --cc=robh+dt@kernel.org \
    --cc=tiwai@suse.com \
    /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.