From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: "Ooi, Joyce" <joyce.ooi@intel.com>,
Jiri Kosina <jikos@kernel.org>,
Jonathan Cameron <jic23@kernel.org>
Cc: Song Hongyan <hongyan.song@intel.com>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeer@pmeerw.net>,
linux-input@vger.kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org,
Kweh Hock Leong <hock.leong.kweh@intel.com>,
Ong Boon Leong <boon.leong.ong@intel.com>,
Lay Kuan Loon <kuan.loon.lay@intel.com>
Subject: Re: [PATCH] iio: light and pressure: change data fields for ambient light and pressure sensor
Date: Thu, 03 Nov 2016 06:35:44 -0700 [thread overview]
Message-ID: <1478180144.27477.3.camel@linux.intel.com> (raw)
In-Reply-To: <1478169814-24120-1-git-send-email-joyce.ooi@intel.com>
On Thu, 2016-11-03 at 18:43 +0800, Ooi, Joyce wrote:
> Sensitivity Percent Relative is added for ambient light sensor as it
> is
> used based on HID Sensor Usages specifications.
The same patch is submitted by Song Hongyan <hongyan.song@intel.com>
. We may need new IIO ABI to specify relative percent hyst.
Thanks,
Srinivas
>
> Other changes include adding HID_USAGE_SENSOR_LIGHT_ILLUM and
> HID_USAGE_SENSOR_ATMOSPHERIC_PRESSURE for ambient light and pressure
> sensor respectively to be in sync with HID Sensor Usages
> specifications.
>
> Signed-off-by: Ooi, Joyce <joyce.ooi@intel.com>
> ---
> drivers/iio/light/hid-sensor-als.c | 10 ++++++++++
> drivers/iio/pressure/hid-sensor-press.c | 10 ++++++++++
> include/linux/hid-sensor-ids.h | 1 +
> 3 files changed, 21 insertions(+)
>
> diff --git a/drivers/iio/light/hid-sensor-als.c
> b/drivers/iio/light/hid-sensor-als.c
> index 8bb1f90..6f3ca18 100644
> --- a/drivers/iio/light/hid-sensor-als.c
> +++ b/drivers/iio/light/hid-sensor-als.c
> @@ -252,6 +252,16 @@ static int als_parse_report(struct
> platform_device *pdev,
> st->common_attributes.sensitivity.index,
> st-
> >common_attributes.sensitivity.report_id);
> }
> + if (st->common_attributes.sensitivity.index < 0) {
> + sensor_hub_input_get_attribute_info(hsdev,
> + HID_FEATURE_REPORT, usage_id,
> + HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY
> _REL_PCT |
> + HID_USAGE_SENSOR_LIGHT_ILLUM,
> + &st->common_attributes.sensitivity);
> + dev_dbg(&pdev->dev, "Sensitivity index:report
> %d:%d\n",
> + st->common_attributes.sensitivity.index,
> + st-
> >common_attributes.sensitivity.report_id);
> + }
> return ret;
> }
>
> diff --git a/drivers/iio/pressure/hid-sensor-press.c
> b/drivers/iio/pressure/hid-sensor-press.c
> index 6848d8c..4cbbf88 100644
> --- a/drivers/iio/pressure/hid-sensor-press.c
> +++ b/drivers/iio/pressure/hid-sensor-press.c
> @@ -249,6 +249,16 @@ static int press_parse_report(struct
> platform_device *pdev,
> st->common_attributes.sensitivity.index,
> st-
> >common_attributes.sensitivity.report_id);
> }
> + if (st->common_attributes.sensitivity.index < 0) {
> + sensor_hub_input_get_attribute_info(hsdev,
> + HID_FEATURE_REPORT, usage_id,
> + HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY
> _ABS |
> + HID_USAGE_SENSOR_ATMOSPHERIC_PRESSURE,
> + &st->common_attributes.sensitivity);
> + dev_dbg(&pdev->dev, "Sensitivity index:report
> %d:%d\n",
> + st->common_attributes.sensitivity.index,
> + st-
> >common_attributes.sensitivity.report_id);
> + }
> return ret;
> }
>
> diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-
> sensor-ids.h
> index f2ee90a..755f5e2 100644
> --- a/include/linux/hid-sensor-ids.h
> +++ b/include/linux/hid-sensor-ids.h
> @@ -141,6 +141,7 @@
> /* Per data field properties */
> #define HID_USAGE_SENSOR_DATA_MOD_NONE
> 0x00
> #define HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS
> 0x1000
> +#define HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_REL_PCT
> 0xE000
>
> /* Power state enumerations */
> #define HID_USAGE_SENSOR_PROP_POWER_STATE_UNDEFINED_ENUM 0x20
> 0850
next prev parent reply other threads:[~2016-11-03 13:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-03 10:43 [PATCH] iio: light and pressure: change data fields for ambient light and pressure sensor Ooi, Joyce
2016-11-03 13:35 ` Srinivas Pandruvada [this message]
[not found] ` <1478180144.27477.3.camel-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-11-05 13:07 ` Jonathan Cameron
2016-11-05 13:07 ` 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=1478180144.27477.3.camel@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=boon.leong.ong@intel.com \
--cc=hock.leong.kweh@intel.com \
--cc=hongyan.song@intel.com \
--cc=jic23@kernel.org \
--cc=jikos@kernel.org \
--cc=joyce.ooi@intel.com \
--cc=knaack.h@gmx.de \
--cc=kuan.loon.lay@intel.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeer@pmeerw.net \
/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.