From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: 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>,
Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@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,
Maxime Coquelin
<mcoquelin.stm32-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Alexandre Torgue <alexandre.torgue-qxv4g6HH51o@public.gmane.org>
Subject: Re: [PATCH v7 04/13] IIO: inkern: API for manipulating channel attributes
Date: Sun, 10 Dec 2017 17:53:25 +0000 [thread overview]
Message-ID: <20171210175325.5c0771a9@archlinux> (raw)
In-Reply-To: <1512744566-13233-5-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
On Fri, 8 Dec 2017 15:49:17 +0100
Arnaud Pouliquen <arnaud.pouliquen-qxv4g6HH51o@public.gmane.org> wrote:
> Extend the inkern API with functions for reading and writing
> attribute of iio channels.
>
> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
One nitpick inline. If you aren't rerolling can get sorted
whilst applying the series.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
> V6 to V7 update:
> - Move iio_chan_info_enum from iio.h to types.h.
>
> drivers/iio/inkern.c | 18 +++++++++++++-----
> include/linux/iio/consumer.h | 26 ++++++++++++++++++++++++++
> include/linux/iio/iio.h | 28 ----------------------------
> include/linux/iio/types.h | 28 ++++++++++++++++++++++++++++
> 4 files changed, 67 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
> index 069defc..f2e7824 100644
> --- a/drivers/iio/inkern.c
> +++ b/drivers/iio/inkern.c
> @@ -664,9 +664,8 @@ int iio_convert_raw_to_processed(struct iio_channel *chan, int raw,
> }
> EXPORT_SYMBOL_GPL(iio_convert_raw_to_processed);
>
> -static int iio_read_channel_attribute(struct iio_channel *chan,
> - int *val, int *val2,
> - enum iio_chan_info_enum attribute)
> +int iio_read_channel_attribute(struct iio_channel *chan, int *val, int *val2,
> + enum iio_chan_info_enum attribute)
> {
> int ret;
>
> @@ -682,6 +681,8 @@ static int iio_read_channel_attribute(struct iio_channel *chan,
>
> return ret;
> }
> +EXPORT_SYMBOL_GPL(iio_read_channel_attribute);
> +
Nitpick if you are rerolling the series. Don't need the extra line here.
>
> int iio_read_channel_offset(struct iio_channel *chan, int *val, int *val2)
> {
> @@ -850,7 +851,8 @@ static int iio_channel_write(struct iio_channel *chan, int val, int val2,
> chan->channel, val, val2, info);
> }
>
> -int iio_write_channel_raw(struct iio_channel *chan, int val)
> +int iio_write_channel_attribute(struct iio_channel *chan, int val, int val2,
> + enum iio_chan_info_enum attribute)
> {
> int ret;
>
> @@ -860,12 +862,18 @@ int iio_write_channel_raw(struct iio_channel *chan, int val)
> goto err_unlock;
> }
>
> - ret = iio_channel_write(chan, val, 0, IIO_CHAN_INFO_RAW);
> + ret = iio_channel_write(chan, val, val2, attribute);
> err_unlock:
> mutex_unlock(&chan->indio_dev->info_exist_lock);
>
> return ret;
> }
> +EXPORT_SYMBOL_GPL(iio_write_channel_attribute);
> +
> +int iio_write_channel_raw(struct iio_channel *chan, int val)
> +{
> + return iio_write_channel_attribute(chan, val, 0, IIO_CHAN_INFO_RAW);
> +}
> EXPORT_SYMBOL_GPL(iio_write_channel_raw);
>
> unsigned int iio_get_channel_ext_info_count(struct iio_channel *chan)
> diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
> index 5e347a9..2017f35 100644
> --- a/include/linux/iio/consumer.h
> +++ b/include/linux/iio/consumer.h
> @@ -216,6 +216,32 @@ int iio_read_channel_average_raw(struct iio_channel *chan, int *val);
> int iio_read_channel_processed(struct iio_channel *chan, int *val);
>
> /**
> + * iio_write_channel_attribute() - Write values to the device attribute.
> + * @chan: The channel being queried.
> + * @val: Value being written.
> + * @val2: Value being written.val2 use depends on attribute type.
> + * @attribute: info attribute to be read.
> + *
> + * Returns an error code or 0.
> + */
> +int iio_write_channel_attribute(struct iio_channel *chan, int val,
> + int val2, enum iio_chan_info_enum attribute);
> +
> +/**
> + * iio_read_channel_attribute() - Read values from the device attribute.
> + * @chan: The channel being queried.
> + * @val: Value being written.
> + * @val2: Value being written.Val2 use depends on attribute type.
> + * @attribute: info attribute to be written.
> + *
> + * Returns an error code if failed. Else returns a description of what is in val
> + * and val2, such as IIO_VAL_INT_PLUS_MICRO telling us we have a value of val
> + * + val2/1e6
> + */
> +int iio_read_channel_attribute(struct iio_channel *chan, int *val,
> + int *val2, enum iio_chan_info_enum attribute);
> +
> +/**
> * iio_write_channel_raw() - write to a given channel
> * @chan: The channel being queried.
> * @val: Value being written.
> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index c380daa..007caf7 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -20,34 +20,6 @@
> * Currently assumes nano seconds.
> */
>
> -enum iio_chan_info_enum {
> - IIO_CHAN_INFO_RAW = 0,
> - IIO_CHAN_INFO_PROCESSED,
> - IIO_CHAN_INFO_SCALE,
> - IIO_CHAN_INFO_OFFSET,
> - IIO_CHAN_INFO_CALIBSCALE,
> - IIO_CHAN_INFO_CALIBBIAS,
> - IIO_CHAN_INFO_PEAK,
> - IIO_CHAN_INFO_PEAK_SCALE,
> - IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW,
> - IIO_CHAN_INFO_AVERAGE_RAW,
> - IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY,
> - IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY,
> - IIO_CHAN_INFO_SAMP_FREQ,
> - IIO_CHAN_INFO_FREQUENCY,
> - IIO_CHAN_INFO_PHASE,
> - IIO_CHAN_INFO_HARDWAREGAIN,
> - IIO_CHAN_INFO_HYSTERESIS,
> - IIO_CHAN_INFO_INT_TIME,
> - IIO_CHAN_INFO_ENABLE,
> - IIO_CHAN_INFO_CALIBHEIGHT,
> - IIO_CHAN_INFO_CALIBWEIGHT,
> - IIO_CHAN_INFO_DEBOUNCE_COUNT,
> - IIO_CHAN_INFO_DEBOUNCE_TIME,
> - IIO_CHAN_INFO_CALIBEMISSIVITY,
> - IIO_CHAN_INFO_OVERSAMPLING_RATIO,
> -};
> -
> enum iio_shared_by {
> IIO_SEPARATE,
> IIO_SHARED_BY_TYPE,
> diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
> index 2aa7b63..6eb3d683 100644
> --- a/include/linux/iio/types.h
> +++ b/include/linux/iio/types.h
> @@ -34,4 +34,32 @@ enum iio_available_type {
> IIO_AVAIL_RANGE,
> };
>
> +enum iio_chan_info_enum {
> + IIO_CHAN_INFO_RAW = 0,
> + IIO_CHAN_INFO_PROCESSED,
> + IIO_CHAN_INFO_SCALE,
> + IIO_CHAN_INFO_OFFSET,
> + IIO_CHAN_INFO_CALIBSCALE,
> + IIO_CHAN_INFO_CALIBBIAS,
> + IIO_CHAN_INFO_PEAK,
> + IIO_CHAN_INFO_PEAK_SCALE,
> + IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW,
> + IIO_CHAN_INFO_AVERAGE_RAW,
> + IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY,
> + IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY,
> + IIO_CHAN_INFO_SAMP_FREQ,
> + IIO_CHAN_INFO_FREQUENCY,
> + IIO_CHAN_INFO_PHASE,
> + IIO_CHAN_INFO_HARDWAREGAIN,
> + IIO_CHAN_INFO_HYSTERESIS,
> + IIO_CHAN_INFO_INT_TIME,
> + IIO_CHAN_INFO_ENABLE,
> + IIO_CHAN_INFO_CALIBHEIGHT,
> + IIO_CHAN_INFO_CALIBWEIGHT,
> + IIO_CHAN_INFO_DEBOUNCE_COUNT,
> + IIO_CHAN_INFO_DEBOUNCE_TIME,
> + IIO_CHAN_INFO_CALIBEMISSIVITY,
> + IIO_CHAN_INFO_OVERSAMPLING_RATIO,
> +};
> +
> #endif /* _IIO_TYPES_H_ */
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23@kernel.org>
To: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Cc: 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>, <devicetree@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-iio@vger.kernel.org>, <alsa-devel@alsa-project.org>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@st.com>
Subject: Re: [PATCH v7 04/13] IIO: inkern: API for manipulating channel attributes
Date: Sun, 10 Dec 2017 17:53:25 +0000 [thread overview]
Message-ID: <20171210175325.5c0771a9@archlinux> (raw)
In-Reply-To: <1512744566-13233-5-git-send-email-arnaud.pouliquen@st.com>
On Fri, 8 Dec 2017 15:49:17 +0100
Arnaud Pouliquen <arnaud.pouliquen@st.com> wrote:
> Extend the inkern API with functions for reading and writing
> attribute of iio channels.
>
> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
One nitpick inline. If you aren't rerolling can get sorted
whilst applying the series.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> V6 to V7 update:
> - Move iio_chan_info_enum from iio.h to types.h.
>
> drivers/iio/inkern.c | 18 +++++++++++++-----
> include/linux/iio/consumer.h | 26 ++++++++++++++++++++++++++
> include/linux/iio/iio.h | 28 ----------------------------
> include/linux/iio/types.h | 28 ++++++++++++++++++++++++++++
> 4 files changed, 67 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
> index 069defc..f2e7824 100644
> --- a/drivers/iio/inkern.c
> +++ b/drivers/iio/inkern.c
> @@ -664,9 +664,8 @@ int iio_convert_raw_to_processed(struct iio_channel *chan, int raw,
> }
> EXPORT_SYMBOL_GPL(iio_convert_raw_to_processed);
>
> -static int iio_read_channel_attribute(struct iio_channel *chan,
> - int *val, int *val2,
> - enum iio_chan_info_enum attribute)
> +int iio_read_channel_attribute(struct iio_channel *chan, int *val, int *val2,
> + enum iio_chan_info_enum attribute)
> {
> int ret;
>
> @@ -682,6 +681,8 @@ static int iio_read_channel_attribute(struct iio_channel *chan,
>
> return ret;
> }
> +EXPORT_SYMBOL_GPL(iio_read_channel_attribute);
> +
Nitpick if you are rerolling the series. Don't need the extra line here.
>
> int iio_read_channel_offset(struct iio_channel *chan, int *val, int *val2)
> {
> @@ -850,7 +851,8 @@ static int iio_channel_write(struct iio_channel *chan, int val, int val2,
> chan->channel, val, val2, info);
> }
>
> -int iio_write_channel_raw(struct iio_channel *chan, int val)
> +int iio_write_channel_attribute(struct iio_channel *chan, int val, int val2,
> + enum iio_chan_info_enum attribute)
> {
> int ret;
>
> @@ -860,12 +862,18 @@ int iio_write_channel_raw(struct iio_channel *chan, int val)
> goto err_unlock;
> }
>
> - ret = iio_channel_write(chan, val, 0, IIO_CHAN_INFO_RAW);
> + ret = iio_channel_write(chan, val, val2, attribute);
> err_unlock:
> mutex_unlock(&chan->indio_dev->info_exist_lock);
>
> return ret;
> }
> +EXPORT_SYMBOL_GPL(iio_write_channel_attribute);
> +
> +int iio_write_channel_raw(struct iio_channel *chan, int val)
> +{
> + return iio_write_channel_attribute(chan, val, 0, IIO_CHAN_INFO_RAW);
> +}
> EXPORT_SYMBOL_GPL(iio_write_channel_raw);
>
> unsigned int iio_get_channel_ext_info_count(struct iio_channel *chan)
> diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
> index 5e347a9..2017f35 100644
> --- a/include/linux/iio/consumer.h
> +++ b/include/linux/iio/consumer.h
> @@ -216,6 +216,32 @@ int iio_read_channel_average_raw(struct iio_channel *chan, int *val);
> int iio_read_channel_processed(struct iio_channel *chan, int *val);
>
> /**
> + * iio_write_channel_attribute() - Write values to the device attribute.
> + * @chan: The channel being queried.
> + * @val: Value being written.
> + * @val2: Value being written.val2 use depends on attribute type.
> + * @attribute: info attribute to be read.
> + *
> + * Returns an error code or 0.
> + */
> +int iio_write_channel_attribute(struct iio_channel *chan, int val,
> + int val2, enum iio_chan_info_enum attribute);
> +
> +/**
> + * iio_read_channel_attribute() - Read values from the device attribute.
> + * @chan: The channel being queried.
> + * @val: Value being written.
> + * @val2: Value being written.Val2 use depends on attribute type.
> + * @attribute: info attribute to be written.
> + *
> + * Returns an error code if failed. Else returns a description of what is in val
> + * and val2, such as IIO_VAL_INT_PLUS_MICRO telling us we have a value of val
> + * + val2/1e6
> + */
> +int iio_read_channel_attribute(struct iio_channel *chan, int *val,
> + int *val2, enum iio_chan_info_enum attribute);
> +
> +/**
> * iio_write_channel_raw() - write to a given channel
> * @chan: The channel being queried.
> * @val: Value being written.
> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index c380daa..007caf7 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -20,34 +20,6 @@
> * Currently assumes nano seconds.
> */
>
> -enum iio_chan_info_enum {
> - IIO_CHAN_INFO_RAW = 0,
> - IIO_CHAN_INFO_PROCESSED,
> - IIO_CHAN_INFO_SCALE,
> - IIO_CHAN_INFO_OFFSET,
> - IIO_CHAN_INFO_CALIBSCALE,
> - IIO_CHAN_INFO_CALIBBIAS,
> - IIO_CHAN_INFO_PEAK,
> - IIO_CHAN_INFO_PEAK_SCALE,
> - IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW,
> - IIO_CHAN_INFO_AVERAGE_RAW,
> - IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY,
> - IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY,
> - IIO_CHAN_INFO_SAMP_FREQ,
> - IIO_CHAN_INFO_FREQUENCY,
> - IIO_CHAN_INFO_PHASE,
> - IIO_CHAN_INFO_HARDWAREGAIN,
> - IIO_CHAN_INFO_HYSTERESIS,
> - IIO_CHAN_INFO_INT_TIME,
> - IIO_CHAN_INFO_ENABLE,
> - IIO_CHAN_INFO_CALIBHEIGHT,
> - IIO_CHAN_INFO_CALIBWEIGHT,
> - IIO_CHAN_INFO_DEBOUNCE_COUNT,
> - IIO_CHAN_INFO_DEBOUNCE_TIME,
> - IIO_CHAN_INFO_CALIBEMISSIVITY,
> - IIO_CHAN_INFO_OVERSAMPLING_RATIO,
> -};
> -
> enum iio_shared_by {
> IIO_SEPARATE,
> IIO_SHARED_BY_TYPE,
> diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
> index 2aa7b63..6eb3d683 100644
> --- a/include/linux/iio/types.h
> +++ b/include/linux/iio/types.h
> @@ -34,4 +34,32 @@ enum iio_available_type {
> IIO_AVAIL_RANGE,
> };
>
> +enum iio_chan_info_enum {
> + IIO_CHAN_INFO_RAW = 0,
> + IIO_CHAN_INFO_PROCESSED,
> + IIO_CHAN_INFO_SCALE,
> + IIO_CHAN_INFO_OFFSET,
> + IIO_CHAN_INFO_CALIBSCALE,
> + IIO_CHAN_INFO_CALIBBIAS,
> + IIO_CHAN_INFO_PEAK,
> + IIO_CHAN_INFO_PEAK_SCALE,
> + IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW,
> + IIO_CHAN_INFO_AVERAGE_RAW,
> + IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY,
> + IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY,
> + IIO_CHAN_INFO_SAMP_FREQ,
> + IIO_CHAN_INFO_FREQUENCY,
> + IIO_CHAN_INFO_PHASE,
> + IIO_CHAN_INFO_HARDWAREGAIN,
> + IIO_CHAN_INFO_HYSTERESIS,
> + IIO_CHAN_INFO_INT_TIME,
> + IIO_CHAN_INFO_ENABLE,
> + IIO_CHAN_INFO_CALIBHEIGHT,
> + IIO_CHAN_INFO_CALIBWEIGHT,
> + IIO_CHAN_INFO_DEBOUNCE_COUNT,
> + IIO_CHAN_INFO_DEBOUNCE_TIME,
> + IIO_CHAN_INFO_CALIBEMISSIVITY,
> + IIO_CHAN_INFO_OVERSAMPLING_RATIO,
> +};
> +
> #endif /* _IIO_TYPES_H_ */
WARNING: multiple messages have this Message-ID (diff)
From: jic23@kernel.org (Jonathan Cameron)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 04/13] IIO: inkern: API for manipulating channel attributes
Date: Sun, 10 Dec 2017 17:53:25 +0000 [thread overview]
Message-ID: <20171210175325.5c0771a9@archlinux> (raw)
In-Reply-To: <1512744566-13233-5-git-send-email-arnaud.pouliquen@st.com>
On Fri, 8 Dec 2017 15:49:17 +0100
Arnaud Pouliquen <arnaud.pouliquen@st.com> wrote:
> Extend the inkern API with functions for reading and writing
> attribute of iio channels.
>
> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
One nitpick inline. If you aren't rerolling can get sorted
whilst applying the series.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> V6 to V7 update:
> - Move iio_chan_info_enum from iio.h to types.h.
>
> drivers/iio/inkern.c | 18 +++++++++++++-----
> include/linux/iio/consumer.h | 26 ++++++++++++++++++++++++++
> include/linux/iio/iio.h | 28 ----------------------------
> include/linux/iio/types.h | 28 ++++++++++++++++++++++++++++
> 4 files changed, 67 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
> index 069defc..f2e7824 100644
> --- a/drivers/iio/inkern.c
> +++ b/drivers/iio/inkern.c
> @@ -664,9 +664,8 @@ int iio_convert_raw_to_processed(struct iio_channel *chan, int raw,
> }
> EXPORT_SYMBOL_GPL(iio_convert_raw_to_processed);
>
> -static int iio_read_channel_attribute(struct iio_channel *chan,
> - int *val, int *val2,
> - enum iio_chan_info_enum attribute)
> +int iio_read_channel_attribute(struct iio_channel *chan, int *val, int *val2,
> + enum iio_chan_info_enum attribute)
> {
> int ret;
>
> @@ -682,6 +681,8 @@ static int iio_read_channel_attribute(struct iio_channel *chan,
>
> return ret;
> }
> +EXPORT_SYMBOL_GPL(iio_read_channel_attribute);
> +
Nitpick if you are rerolling the series. Don't need the extra line here.
>
> int iio_read_channel_offset(struct iio_channel *chan, int *val, int *val2)
> {
> @@ -850,7 +851,8 @@ static int iio_channel_write(struct iio_channel *chan, int val, int val2,
> chan->channel, val, val2, info);
> }
>
> -int iio_write_channel_raw(struct iio_channel *chan, int val)
> +int iio_write_channel_attribute(struct iio_channel *chan, int val, int val2,
> + enum iio_chan_info_enum attribute)
> {
> int ret;
>
> @@ -860,12 +862,18 @@ int iio_write_channel_raw(struct iio_channel *chan, int val)
> goto err_unlock;
> }
>
> - ret = iio_channel_write(chan, val, 0, IIO_CHAN_INFO_RAW);
> + ret = iio_channel_write(chan, val, val2, attribute);
> err_unlock:
> mutex_unlock(&chan->indio_dev->info_exist_lock);
>
> return ret;
> }
> +EXPORT_SYMBOL_GPL(iio_write_channel_attribute);
> +
> +int iio_write_channel_raw(struct iio_channel *chan, int val)
> +{
> + return iio_write_channel_attribute(chan, val, 0, IIO_CHAN_INFO_RAW);
> +}
> EXPORT_SYMBOL_GPL(iio_write_channel_raw);
>
> unsigned int iio_get_channel_ext_info_count(struct iio_channel *chan)
> diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
> index 5e347a9..2017f35 100644
> --- a/include/linux/iio/consumer.h
> +++ b/include/linux/iio/consumer.h
> @@ -216,6 +216,32 @@ int iio_read_channel_average_raw(struct iio_channel *chan, int *val);
> int iio_read_channel_processed(struct iio_channel *chan, int *val);
>
> /**
> + * iio_write_channel_attribute() - Write values to the device attribute.
> + * @chan: The channel being queried.
> + * @val: Value being written.
> + * @val2: Value being written.val2 use depends on attribute type.
> + * @attribute: info attribute to be read.
> + *
> + * Returns an error code or 0.
> + */
> +int iio_write_channel_attribute(struct iio_channel *chan, int val,
> + int val2, enum iio_chan_info_enum attribute);
> +
> +/**
> + * iio_read_channel_attribute() - Read values from the device attribute.
> + * @chan: The channel being queried.
> + * @val: Value being written.
> + * @val2: Value being written.Val2 use depends on attribute type.
> + * @attribute: info attribute to be written.
> + *
> + * Returns an error code if failed. Else returns a description of what is in val
> + * and val2, such as IIO_VAL_INT_PLUS_MICRO telling us we have a value of val
> + * + val2/1e6
> + */
> +int iio_read_channel_attribute(struct iio_channel *chan, int *val,
> + int *val2, enum iio_chan_info_enum attribute);
> +
> +/**
> * iio_write_channel_raw() - write to a given channel
> * @chan: The channel being queried.
> * @val: Value being written.
> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index c380daa..007caf7 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -20,34 +20,6 @@
> * Currently assumes nano seconds.
> */
>
> -enum iio_chan_info_enum {
> - IIO_CHAN_INFO_RAW = 0,
> - IIO_CHAN_INFO_PROCESSED,
> - IIO_CHAN_INFO_SCALE,
> - IIO_CHAN_INFO_OFFSET,
> - IIO_CHAN_INFO_CALIBSCALE,
> - IIO_CHAN_INFO_CALIBBIAS,
> - IIO_CHAN_INFO_PEAK,
> - IIO_CHAN_INFO_PEAK_SCALE,
> - IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW,
> - IIO_CHAN_INFO_AVERAGE_RAW,
> - IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY,
> - IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY,
> - IIO_CHAN_INFO_SAMP_FREQ,
> - IIO_CHAN_INFO_FREQUENCY,
> - IIO_CHAN_INFO_PHASE,
> - IIO_CHAN_INFO_HARDWAREGAIN,
> - IIO_CHAN_INFO_HYSTERESIS,
> - IIO_CHAN_INFO_INT_TIME,
> - IIO_CHAN_INFO_ENABLE,
> - IIO_CHAN_INFO_CALIBHEIGHT,
> - IIO_CHAN_INFO_CALIBWEIGHT,
> - IIO_CHAN_INFO_DEBOUNCE_COUNT,
> - IIO_CHAN_INFO_DEBOUNCE_TIME,
> - IIO_CHAN_INFO_CALIBEMISSIVITY,
> - IIO_CHAN_INFO_OVERSAMPLING_RATIO,
> -};
> -
> enum iio_shared_by {
> IIO_SEPARATE,
> IIO_SHARED_BY_TYPE,
> diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
> index 2aa7b63..6eb3d683 100644
> --- a/include/linux/iio/types.h
> +++ b/include/linux/iio/types.h
> @@ -34,4 +34,32 @@ enum iio_available_type {
> IIO_AVAIL_RANGE,
> };
>
> +enum iio_chan_info_enum {
> + IIO_CHAN_INFO_RAW = 0,
> + IIO_CHAN_INFO_PROCESSED,
> + IIO_CHAN_INFO_SCALE,
> + IIO_CHAN_INFO_OFFSET,
> + IIO_CHAN_INFO_CALIBSCALE,
> + IIO_CHAN_INFO_CALIBBIAS,
> + IIO_CHAN_INFO_PEAK,
> + IIO_CHAN_INFO_PEAK_SCALE,
> + IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW,
> + IIO_CHAN_INFO_AVERAGE_RAW,
> + IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY,
> + IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY,
> + IIO_CHAN_INFO_SAMP_FREQ,
> + IIO_CHAN_INFO_FREQUENCY,
> + IIO_CHAN_INFO_PHASE,
> + IIO_CHAN_INFO_HARDWAREGAIN,
> + IIO_CHAN_INFO_HYSTERESIS,
> + IIO_CHAN_INFO_INT_TIME,
> + IIO_CHAN_INFO_ENABLE,
> + IIO_CHAN_INFO_CALIBHEIGHT,
> + IIO_CHAN_INFO_CALIBWEIGHT,
> + IIO_CHAN_INFO_DEBOUNCE_COUNT,
> + IIO_CHAN_INFO_DEBOUNCE_TIME,
> + IIO_CHAN_INFO_CALIBEMISSIVITY,
> + IIO_CHAN_INFO_OVERSAMPLING_RATIO,
> +};
> +
> #endif /* _IIO_TYPES_H_ */
next prev parent reply other threads:[~2017-12-10 17:53 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-08 14:49 [PATCH v7 00/13] Add STM32 DFSDM support Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` [PATCH v7 01/13] iio: Add hardware consumer buffer support Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
[not found] ` <1512744566-13233-2-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2018-01-10 11:13 ` Applied "iio: Add hardware consumer buffer support" to the asoc tree Mark Brown
2018-01-10 11:13 ` Mark Brown
2018-01-10 11:13 ` Mark Brown
2017-12-08 14:49 ` [PATCH v7 02/13] docs: driver-api: add iio hw consumer section Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` [PATCH v7 03/13] IIO: hw_consumer: add devm_iio_hw_consumer_alloc Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
[not found] ` <1512744566-13233-1-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-12-08 14:49 ` [PATCH v7 04/13] IIO: inkern: API for manipulating channel attributes Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
[not found] ` <1512744566-13233-5-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-12-10 17:53 ` Jonathan Cameron [this message]
2017-12-10 17:53 ` Jonathan Cameron
2017-12-10 17:53 ` Jonathan Cameron
2017-12-08 14:49 ` [PATCH v7 08/13] IIO: ADC: add stm32 DFSDM core support Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
[not found] ` <1512744566-13233-9-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2018-01-10 11:13 ` Applied "IIO: ADC: add stm32 DFSDM core support" to the asoc tree Mark Brown
2018-01-10 11:13 ` Mark Brown
2018-01-10 11:13 ` Mark Brown
2017-12-08 14:49 ` [PATCH v7 09/13] IIO: ADC: add STM32 DFSDM sigma delta ADC support Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
[not found] ` <1512744566-13233-10-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2018-01-10 11:13 ` Applied "IIO: ADC: add STM32 DFSDM sigma delta ADC support" to the asoc tree Mark Brown
2018-01-10 11:13 ` Mark Brown
2018-01-10 11:13 ` Mark Brown
2017-12-08 14:49 ` [PATCH v7 10/13] IIO: ADC: add stm32 DFSDM support for PDM microphone Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
[not found] ` <1512744566-13233-11-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-12-10 18:14 ` Jonathan Cameron
2017-12-10 18:14 ` Jonathan Cameron
2017-12-10 18:14 ` Jonathan Cameron
2017-12-08 14:49 ` [PATCH v7 11/13] IIO: consumer: allow to set buffer sizes Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` [PATCH v7 12/13] ASoC: add bindings for stm32 DFSDM filter Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
[not found] ` <1512744566-13233-13-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2018-01-10 11:12 ` Applied "ASoC: add bindings for stm32 DFSDM filter" to the asoc tree Mark Brown
2018-01-10 11:12 ` Mark Brown
2018-01-10 11:12 ` Mark Brown
2017-12-08 14:49 ` [PATCH v7 13/13] ASoC: stm32: add DFSDM DAI support Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
[not found] ` <1512744566-13233-14-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2017-12-10 18:18 ` Jonathan Cameron
2017-12-10 18:18 ` Jonathan Cameron
2017-12-10 18:18 ` Jonathan Cameron
2017-12-08 14:49 ` [PATCH v7 05/13] IIO: Add DT bindings for sigma delta adc modulator Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` [PATCH v7 06/13] IIO: ADC: add sigma delta modulator support Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
[not found] ` <1512744566-13233-7-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2018-01-10 11:13 ` Applied "IIO: ADC: add sigma delta modulator support" to the asoc tree Mark Brown
2018-01-10 11:13 ` Mark Brown
2018-01-10 11:13 ` Mark Brown
2017-12-08 14:49 ` [PATCH v7 07/13] IIO: add DT bindings for stm32 DFSDM filter Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
2017-12-08 14:49 ` Arnaud Pouliquen
[not found] ` <1512744566-13233-8-git-send-email-arnaud.pouliquen-qxv4g6HH51o@public.gmane.org>
2018-01-10 11:13 ` Applied "IIO: add DT bindings for stm32 DFSDM filter" to the asoc tree Mark Brown
2018-01-10 11:13 ` Mark Brown
2018-01-10 11:13 ` 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=20171210175325.5c0771a9@archlinux \
--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=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=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 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.