public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: Jiri Kosina <jikos@kernel.org>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	linux-input@vger.kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: hid-sensor-prox: Merge information from different channels
Date: Sun, 8 Dec 2024 16:38:51 +0000	[thread overview]
Message-ID: <20241208163851.41c47c3f@jic23-huawei> (raw)
In-Reply-To: <20241205-fix-hid-sensor-v1-1-9b789f39c220@chromium.org>

On Thu, 05 Dec 2024 12:59:20 +0000
Ricardo Ribalda <ribalda@chromium.org> wrote:

> The device only provides a single scale, frequency and hysteresis for
> all the channels. Fix the info_mask_* to match the reality of the
> device.
> 
> Without this patch:
> in_attention_scale
> in_attention_hysteresis
> in_attention_input
> in_attention_offset
> in_attention_sampling_frequency
> in_proximity_scale
> in_proximity_sampling_frequency
> in_proximity_offset
> in_proximity0_raw
> in_proximity_hysteresis
> 
> With this patch:
> hysteresis
> scale
> sampling_frequency
> in_attention_input
> in_attention_offset
> in_proximity0_offset
> in_proximity0_raw
> 
> Fixes: 596ef5cf654b ("iio: hid-sensor-prox: Add support for more channels")
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

whilst perhaps not ideal use of the ABI, what is there today is not wrong
as such.  If the ABI above was all introduce in the recent patch I might
be fine adjusting it as you suggestion. However it wasn't, in_proximity_scale
has been there a long time so this would be an ABI change.
Those are generally only ok if there is a bug.

Drivers are always allowed to provide finer granularity than necessary
so in this case I don't see this as a bug.

Jonathan


> ---
>  drivers/iio/light/hid-sensor-prox.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c
> index e8e7b2999b4c..f21d2da4c7f9 100644
> --- a/drivers/iio/light/hid-sensor-prox.c
> +++ b/drivers/iio/light/hid-sensor-prox.c
> @@ -49,9 +49,11 @@ static const u32 prox_sensitivity_addresses[] = {
>  #define PROX_CHANNEL(_is_proximity, _channel) \
>  	{\
>  		.type = _is_proximity ? IIO_PROXIMITY : IIO_ATTENTION,\
> -		.info_mask_separate = _is_proximity ? BIT(IIO_CHAN_INFO_RAW) :\
> -				      BIT(IIO_CHAN_INFO_PROCESSED),\
> -		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET) |\
> +		.info_mask_separate = \
> +		(_is_proximity ? BIT(IIO_CHAN_INFO_RAW) :\
> +				BIT(IIO_CHAN_INFO_PROCESSED)) |\
> +		BIT(IIO_CHAN_INFO_OFFSET),\
> +		.info_mask_shared_by_all = \
>  		BIT(IIO_CHAN_INFO_SCALE) |\
>  		BIT(IIO_CHAN_INFO_SAMP_FREQ) |\
>  		BIT(IIO_CHAN_INFO_HYSTERESIS),\
> 
> ---
> base-commit: 40384c840ea1944d7c5a392e8975ed088ecf0b37
> change-id: 20241203-fix-hid-sensor-62e1979ecd03
> 
> Best regards,


  reply	other threads:[~2024-12-08 16:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-05 12:59 [PATCH] iio: hid-sensor-prox: Merge information from different channels Ricardo Ribalda
2024-12-08 16:38 ` Jonathan Cameron [this message]
2024-12-08 20:09   ` Ricardo Ribalda
2024-12-11 18:40     ` Jonathan Cameron
2024-12-11 21:48       ` srinivas pandruvada

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=20241208163851.41c47c3f@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=jikos@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ribalda@chromium.org \
    --cc=srinivas.pandruvada@linux.intel.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