linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Ye Xiang <xiang.ye@intel.com>
Cc: jikos@kernel.org, srinivas.pandruvada@linux.intel.com,
	linux-input@vger.kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] iio: hid-sensor-als: Add relative hysteresis support
Date: Sat, 6 Feb 2021 16:52:34 +0000	[thread overview]
Message-ID: <20210206165234.26bf0421@archlinux> (raw)
In-Reply-To: <20210201074358.18435-3-xiang.ye@intel.com>

On Mon,  1 Feb 2021 15:43:57 +0800
Ye Xiang <xiang.ye@intel.com> wrote:

> Hid sensor als uses relative hysteresis, this patch adds the support.
> 
> Signed-off-by: Ye Xiang <xiang.ye@intel.com>

Looks good to me.

Jonathan

> ---
>  drivers/iio/light/hid-sensor-als.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
> index afcdb424bfb8..85c8a05b73cb 100644
> --- a/drivers/iio/light/hid-sensor-als.c
> +++ b/drivers/iio/light/hid-sensor-als.c
> @@ -54,7 +54,8 @@ static const struct iio_chan_spec als_channels[] = {
>  		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET) |
>  		BIT(IIO_CHAN_INFO_SCALE) |
>  		BIT(IIO_CHAN_INFO_SAMP_FREQ) |
> -		BIT(IIO_CHAN_INFO_HYSTERESIS),
> +		BIT(IIO_CHAN_INFO_HYSTERESIS) |
> +		BIT(IIO_CHAN_INFO_HYSTERESIS_RELATIVE),
>  		.scan_index = CHANNEL_SCAN_INDEX_INTENSITY,
>  	},
>  	{
> @@ -63,7 +64,8 @@ static const struct iio_chan_spec als_channels[] = {
>  		.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_OFFSET) |
>  		BIT(IIO_CHAN_INFO_SCALE) |
>  		BIT(IIO_CHAN_INFO_SAMP_FREQ) |
> -		BIT(IIO_CHAN_INFO_HYSTERESIS),
> +		BIT(IIO_CHAN_INFO_HYSTERESIS) |
> +		BIT(IIO_CHAN_INFO_HYSTERESIS_RELATIVE),
>  		.scan_index = CHANNEL_SCAN_INDEX_ILLUM,
>  	},
>  	IIO_CHAN_SOFT_TIMESTAMP(CHANNEL_SCAN_INDEX_TIMESTAMP)
> @@ -141,6 +143,10 @@ static int als_read_raw(struct iio_dev *indio_dev,
>  		ret_type = hid_sensor_read_raw_hyst_value(
>  				&als_state->common_attributes, val, val2);
>  		break;
> +	case IIO_CHAN_INFO_HYSTERESIS_RELATIVE:
> +		ret_type = hid_sensor_read_raw_hyst_rel_value(
> +				&als_state->common_attributes, val, val2);
> +		break;
>  	default:
>  		ret_type = -EINVAL;
>  		break;
> @@ -168,6 +174,10 @@ static int als_write_raw(struct iio_dev *indio_dev,
>  		ret = hid_sensor_write_raw_hyst_value(
>  				&als_state->common_attributes, val, val2);
>  		break;
> +	case IIO_CHAN_INFO_HYSTERESIS_RELATIVE:
> +		ret = hid_sensor_write_raw_hyst_rel_value(
> +				&als_state->common_attributes, val, val2);
> +		break;
>  	default:
>  		ret = -EINVAL;
>  	}


  reply	other threads:[~2021-02-06 16:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01  7:43 [PATCH 0/3] Add relative hysteresis support for hid sensors Ye Xiang
2021-02-01  7:43 ` [PATCH 1/3] iio: Add relative sensitivity support Ye Xiang
2021-02-06 16:51   ` Jonathan Cameron
2021-02-01  7:43 ` [PATCH 2/3] iio: hid-sensor-als: Add relative hysteresis support Ye Xiang
2021-02-06 16:52   ` Jonathan Cameron [this message]
2021-02-01  7:43 ` [PATCH 3/3] iio: Add relative hysteresis in ABI documentation Ye Xiang
2021-02-06 16:46   ` Jonathan Cameron

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=20210206165234.26bf0421@archlinux \
    --to=jic23@kernel.org \
    --cc=jikos@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=xiang.ye@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;
as well as URLs for NNTP newsgroup(s).