From: Jonathan Cameron <jic23@kernel.org>
To: "Pandruvada, Srinivas" <srinivas.pandruvada@intel.com>,
"Song, Hongyan" <hongyan.song@intel.com>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: [PATCH] iio: hid-sensor-als: Add realtime data type parse support
Date: Sat, 5 Nov 2016 17:53:20 +0000 [thread overview]
Message-ID: <3ffbed3f-1e20-c1be-bb92-778da166bd68@kernel.org> (raw)
In-Reply-To: <1477874099.8025.51.camel@intel.com>
On 31/10/16 00:37, Pandruvada, Srinivas wrote:
> On Sun, 2016-10-30 at 16:26 +0000, Jonathan Cameron wrote:
>> On 28/10/16 02:20, Song Hongyan wrote:
>>>
>>> In parse report function it only support to parse absolute data
>>> type
>>> reported. Some platforms which report realtime data cannot be
>>> parsed,
>>> they will get "Invalid Argument" when try to get sensor data.
>>>
>>> Add realtime data type support to match different platforms.
>> I'm not 100% sure that rel stands for real time here...
>>
>> Relative percent? There is also a percent of range option though no
>> idea if any hardware actually uses that.
>>
>> Srinivas, could you take a look at this one as well.
> I asked Hongyan to post to mailing list to seek some opinion.
> The IIO ABI hysteresis is absolute value, but this will specify a
> relative value with percentage.
> I think we need a new ABI.
Agreed.
>
> Thanks,
> Srinivas
>
>
>>
>> thanks,
>>
>> Jonathan
>>>
>>>
>>> Signed-off-by: Song Hongyan <hongyan.song@intel.com>
>>> ---
>>> drivers/iio/light/hid-sensor-als.c | 11 +++++++++++
>>> include/linux/hid-sensor-ids.h | 1 +
>>> 2 files changed, 12 insertions(+)
>>>
>>> diff --git a/drivers/iio/light/hid-sensor-als.c
>>> b/drivers/iio/light/hid-sensor-als.c
>>> index 8bb1f90..3b3aa66 100644
>>> --- a/drivers/iio/light/hid-sensor-als.c
>>> +++ b/drivers/iio/light/hid-sensor-als.c
>>> @@ -252,6 +252,17 @@ 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_SENSITIVI
>>> TY_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/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 0x
>>> 200850
prev parent reply other threads:[~2016-11-05 17:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-28 1:20 [PATCH] iio: hid-sensor-als: Add realtime data type parse support Song Hongyan
2016-10-30 16:26 ` Jonathan Cameron
2016-10-31 0:37 ` Pandruvada, Srinivas
2016-11-05 17:53 ` 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=3ffbed3f-1e20-c1be-bb92-778da166bd68@kernel.org \
--to=jic23@kernel.org \
--cc=hongyan.song@intel.com \
--cc=linux-iio@vger.kernel.org \
--cc=srinivas.pandruvada@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 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.