linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Antoniu Miclaus <antoniu.miclaus@analog.com>
Cc: <jic23@kernel.org>, <linux-iio@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] iio: expose shared parameter in IIO_ENUM_AVAILABLE
Date: Thu, 18 Nov 2021 18:08:51 +0000	[thread overview]
Message-ID: <20211118180851.00001693@Huawei.com> (raw)
In-Reply-To: <20211118141709.64450-1-antoniu.miclaus@analog.com>

On Thu, 18 Nov 2021 16:17:09 +0200
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:

> The shared parameter should be configurable based on its usage, and not
> constrained to IIO_SHARED_BY_TYPE.
> 
> This patch aims to improve the flexibility in using the
> IIO_ENUM_AVAILABLE define and avoid redefining custom iio enums that
> expose the shared parameter.
> 
> An example is the ad5766.c driver where IIO_ENUM_AVAILABLE_SHARED was
> defined in order to achieve `shared` parameter customization.
> 
> The current state of the IIO_ENUM_AVAILABLE implementation will imply
> similar redefinitions each time a driver will require access to the
> `shared` parameter. An example would be admv1013 driver which will
> require custom device attribute for the frequency translation  modes:
> Quadrature I/Q mode and Intermediate frequency mode.
> 
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>

I'm fine with the change subject to comments below,

Jonathan

> ---
>  drivers/iio/accel/bma180.c                |  2 +-
>  drivers/iio/accel/mma9553.c               |  2 +-
>  drivers/iio/adc/ad7192.c                  |  2 +-
>  drivers/iio/adc/hi8435.c                  |  2 +-
>  drivers/iio/dac/ad5064.c                  |  4 ++--
>  drivers/iio/dac/ad5380.c                  |  2 +-
>  drivers/iio/dac/ad5446.c                  |  2 +-
>  drivers/iio/dac/ad5504.c                  |  2 +-
>  drivers/iio/dac/ad5624r_spi.c             |  2 +-
>  drivers/iio/dac/ad5686.c                  |  2 +-
>  drivers/iio/dac/ad5766.c                  | 13 ++-----------
>  drivers/iio/dac/ad5791.c                  |  2 +-
>  drivers/iio/dac/max5821.c                 |  2 +-
>  drivers/iio/dac/mcp4725.c                 |  8 ++++----
>  drivers/iio/dac/stm32-dac.c               |  2 +-
>  drivers/iio/dac/ti-dac082s085.c           |  2 +-
>  drivers/iio/dac/ti-dac5571.c              |  2 +-
>  drivers/iio/dac/ti-dac7311.c              |  2 +-
>  drivers/iio/magnetometer/hmc5843_core.c   |  4 ++--
>  drivers/iio/trigger/stm32-timer-trigger.c |  4 ++--
>  include/linux/iio/iio.h                   |  5 +++--
>  21 files changed, 30 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
> index 2edfcb4819b7..09496f358ad9 100644
> --- a/drivers/iio/accel/bma180.c
> +++ b/drivers/iio/accel/bma180.c
> @@ -658,7 +658,7 @@ static const struct iio_chan_spec_ext_info bma023_ext_info[] = {
>  
>  static const struct iio_chan_spec_ext_info bma180_ext_info[] = {
>  	IIO_ENUM("power_mode", IIO_SHARED_BY_TYPE, &bma180_power_mode_enum),
> -	IIO_ENUM_AVAILABLE("power_mode", &bma180_power_mode_enum),
> +	IIO_ENUM_AVAILABLE("power_mode", IIO_SHARED_BY_TYPE, &bma180_power_mode_enum),
>  	IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, bma180_accel_get_mount_matrix),
>  	{ }
>  };
> diff --git a/drivers/iio/accel/mma9553.c b/drivers/iio/accel/mma9553.c
> index ba3ecb3b57dc..0570ab1cc064 100644
> --- a/drivers/iio/accel/mma9553.c
> +++ b/drivers/iio/accel/mma9553.c
> @@ -917,7 +917,7 @@ static const struct iio_enum mma9553_calibgender_enum = {
>  
>  static const struct iio_chan_spec_ext_info mma9553_ext_info[] = {
>  	IIO_ENUM("calibgender", IIO_SHARED_BY_TYPE, &mma9553_calibgender_enum),
> -	IIO_ENUM_AVAILABLE("calibgender", &mma9553_calibgender_enum),
> +	IIO_ENUM_AVAILABLE("calibgender", IIO_SHARED_BY_TYPE, &mma9553_calibgender_enum),
>  	{},
>  };
>  
> diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c
> index 2121a812b0c3..7cb1bd3ea375 100644
> --- a/drivers/iio/adc/ad7192.c
> +++ b/drivers/iio/adc/ad7192.c
> @@ -257,7 +257,7 @@ static const struct iio_chan_spec_ext_info ad7192_calibsys_ext_info[] = {
>  	},
>  	IIO_ENUM("sys_calibration_mode", IIO_SEPARATE,
>  		 &ad7192_syscalib_mode_enum),
> -	IIO_ENUM_AVAILABLE("sys_calibration_mode", &ad7192_syscalib_mode_enum),
> +	IIO_ENUM_AVAILABLE("sys_calibration_mode", IIO_SHARED_BY_TYPE, &ad7192_syscalib_mode_enum),

Please wrap the lines to 80 chars unless strong reason not to do so.


> diff --git a/drivers/iio/magnetometer/hmc5843_core.c b/drivers/iio/magnetometer/hmc5843_core.c
> index f08726bf5ec3..4364d7fa066e 100644
> --- a/drivers/iio/magnetometer/hmc5843_core.c
> +++ b/drivers/iio/magnetometer/hmc5843_core.c
> @@ -246,7 +246,7 @@ static const struct iio_enum hmc5843_meas_conf_enum = {
>  
>  static const struct iio_chan_spec_ext_info hmc5843_ext_info[] = {
>  	IIO_ENUM("meas_conf", IIO_SHARED_BY_TYPE, &hmc5843_meas_conf_enum),
> -	IIO_ENUM_AVAILABLE("meas_conf", &hmc5843_meas_conf_enum),
> +	IIO_ENUM_AVAILABLE("meas_conf", IIO_SHARED_BY_TYPE, &hmc5843_meas_conf_enum),
>  	IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, hmc5843_get_mount_matrix),
>  	{ }
>  };
> @@ -261,7 +261,7 @@ static const struct iio_enum hmc5983_meas_conf_enum = {
>  static const struct iio_chan_spec_ext_info hmc5983_ext_info[] = {
>  	IIO_ENUM("meas_conf", IIO_SHARED_BY_TYPE, &hmc5983_meas_conf_enum),
>  	IIO_ENUM_AVAILABLE("meas_conf", &hmc5983_meas_conf_enum),
> -	IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, hmc5843_get_mount_matrix),
> +	IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, IIO_SHARED_BY_TYPE, hmc5843_get_mount_matrix),
Wrong macro.  (I cheated on this as 0-day already spotted it :)

>
Thanks,

Jonathan

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      parent reply	other threads:[~2021-11-18 18:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18 14:17 [PATCH] iio: expose shared parameter in IIO_ENUM_AVAILABLE Antoniu Miclaus
2021-11-18 17:40 ` kernel test robot
2021-11-18 18:06 ` kernel test robot
2021-11-18 18:08 ` Jonathan Cameron [this message]

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=20211118180851.00001693@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=antoniu.miclaus@analog.com \
    --cc=jic23@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.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 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).