public inbox for linux-input@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>,
	Benjamin Tissoires <bentiss@kernel.org>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Harvey Yang <chenghaoyang@google.com>,
	linux-input@vger.kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/5] iio: hid-sensor-prox: Add support for more channels
Date: Mon, 28 Oct 2024 20:29:34 +0000	[thread overview]
Message-ID: <20241028202934.3894a141@jic23-huawei> (raw)
In-Reply-To: <20241028-hpd-v2-5-18f6e79154d7@chromium.org>

On Mon, 28 Oct 2024 10:12:25 +0000
Ricardo Ribalda <ribalda@chromium.org> wrote:

> Egis620 supports 3 channels: presense, proximity and attention.
> 
> Modify the driver so it can read those channels as well.
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Hi Ricardo, one comment inline that I'm fine fixing up if nothing else
comes up. 

Given this series is introducing a new channel type, I'd like to leave
it on the list for a little while to see if there are any comments on that
definition beyond the one I had...

Jonathan

> ---
>  drivers/iio/light/hid-sensor-prox.c | 171 ++++++++++++++++++++----------------
>  1 file changed, 95 insertions(+), 76 deletions(-)
> 
> diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c
> index 0f12a8a83790..e6f81d40a492 100644
> --- a/drivers/iio/light/hid-sensor-prox.c
> +++ b/drivers/iio/light/hid-sensor-prox.c
> @@ -13,16 +13,31 @@
>  #include <linux/iio/buffer.h>
>  #include "../common/hid-sensors/hid-sensor-trigger.h"
>  
> -#define CHANNEL_SCAN_INDEX_PRESENCE 0
> +static const u32 prox_usage_ids[] = {
> +	HID_USAGE_SENSOR_HUMAN_PRESENCE,
> +	HID_USAGE_SENSOR_HUMAN_PROXIMITY,
> +	HID_USAGE_SENSOR_HUMAN_ATTENTION,
> +};
> +#define MAX_CHANNELS ARRAY_SIZE(prox_usage_ids)
> +
> +enum {
> +	HID_HUMAN_PRESENCE,
> +	HID_HUMAN_PROXIMITY,
> +	HID_HUMAN_ATTENTION,
> +};
>  
>  struct prox_state {
>  	struct hid_sensor_hub_callbacks callbacks;
>  	struct hid_sensor_common common_attributes;
> -	struct hid_sensor_hub_attribute_info prox_attr;
> -	u32 human_presence;
> +	struct hid_sensor_hub_attribute_info prox_attr[MAX_CHANNELS];
> +	struct iio_chan_spec channels[MAX_CHANNELS];
> +	u32 channel2usage[MAX_CHANNELS];
> +	u32 human_presence[MAX_CHANNELS];
>  	int scale_pre_decml;
>  	int scale_post_decml;
>  	int scale_precision;
> +	unsigned long scan_mask[2]; // One entry plus one terminator.
Really trivial, but in IIO and most of the kernel comment are still
'c style' /* One entry plus one terminator */

> +	int num_channels;
>  };
>  
>  static const u32 prox_sensitivity_addresses[] = {
> @@ -30,18 +45,23 @@ static const u32 prox_sensitivity_addresses[] = {
>  	HID_USAGE_SENSOR_DATA_PRESENCE,
>  };

> 


      reply	other threads:[~2024-10-28 20:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28 10:12 [PATCH v2 0/5] iio: hid-sensors-prox: Add support for more channels Ricardo Ribalda
2024-10-28 10:12 ` [PATCH v2 1/5] iio: hid-sensors: Add proximity and attention IDs Ricardo Ribalda
2024-10-28 10:12 ` [PATCH v2 2/5] iio: hid-sensors-prox: Factor-in hid_sensor_push_data Ricardo Ribalda
2024-10-28 10:12 ` [PATCH v2 3/5] iio: Add channel type for attention Ricardo Ribalda
2024-10-28 20:34   ` Jonathan Cameron
2024-10-29 12:20     ` Ricardo Ribalda
2024-10-29 14:38       ` Jonathan Cameron
2024-10-29 22:26         ` David Lechner
2024-10-30 16:50           ` Jonathan Cameron
2024-10-28 10:12 ` [PATCH v2 4/5] iio: hid-sensors-prox: Make proximity channel indexed Ricardo Ribalda
2024-10-28 10:12 ` [PATCH v2 5/5] iio: hid-sensor-prox: Add support for more channels Ricardo Ribalda
2024-10-28 20:29   ` 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=20241028202934.3894a141@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=bentiss@kernel.org \
    --cc=chenghaoyang@google.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