From: Jonathan Cameron <jic23@kernel.org>
To: Archana Patni <archana.patni@linux.intel.com>
Cc: jkosina@suse.cz, linux-iio@vger.kernel.org,
srinivas.pandruvada@intel.com,
Archana Patni <archana.patni@intel.com>,
Subramony Sesha <subramony.sesha@intel.com>
Subject: Re: [PATCH] iio: hid-sensors: Set default unit of measure for report interval
Date: Sat, 10 May 2014 11:45:45 +0100 [thread overview]
Message-ID: <536E0359.1060206@kernel.org> (raw)
In-Reply-To: <1399556169-10922-1-git-send-email-archana.patni@linux.intel.com>
On 08/05/14 14:36, Archana Patni wrote:
> For PROP_REPORT_INTERVAL, the spec does not mandate the presence
> of the report interval unit in the feature report and expects the
> default unit of measure to be used as milliseconds.
>
> Currently, when the unit is not present, it gets set as zero leading
> to issues in sampling frequency.
>
> This patch sets the unit of measure to the default unit if it
> is not defined by firmware.
>
> Signed-off-by: Archana Patni <archana.patni@intel.com>
> Signed-off-by: Subramony Sesha <subramony.sesha@intel.com>
> Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@intel.com>
Applied to the togreg branch of iio.git
Thanks,
> ---
> .../iio/common/hid-sensors/hid-sensor-attributes.c | 17 +++++++++++++++--
> 1 file changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> index 75b5473..55047af 100644
> --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> @@ -209,15 +209,28 @@ int hid_sensor_write_raw_hyst_value(struct hid_sensor_common *st,
> }
> EXPORT_SYMBOL(hid_sensor_write_raw_hyst_value);
>
> -int hid_sensor_parse_common_attributes(struct hid_sensor_hub_device *hsdev,
> +int hid_sensor_get_reporting_interval(struct hid_sensor_hub_device *hsdev,
> u32 usage_id,
> struct hid_sensor_common *st)
> {
> -
> sensor_hub_input_get_attribute_info(hsdev,
> HID_FEATURE_REPORT, usage_id,
> HID_USAGE_SENSOR_PROP_REPORT_INTERVAL,
> &st->poll);
> + /* Default unit of measure is milliseconds */
> + if (st->poll.units == 0)
> + st->poll.units = HID_USAGE_SENSOR_UNITS_MILLISECOND;
> + return 0;
> +
> +}
> +
> +int hid_sensor_parse_common_attributes(struct hid_sensor_hub_device *hsdev,
> + u32 usage_id,
> + struct hid_sensor_common *st)
> +{
> +
> +
> + hid_sensor_get_reporting_interval(hsdev, usage_id, st);
>
> sensor_hub_input_get_attribute_info(hsdev,
> HID_FEATURE_REPORT, usage_id,
>
prev parent reply other threads:[~2014-05-10 10:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 13:36 [PATCH] iio: hid-sensors: Set default unit of measure for report interval Archana Patni
2014-05-10 10:45 ` 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=536E0359.1060206@kernel.org \
--to=jic23@kernel.org \
--cc=archana.patni@intel.com \
--cc=archana.patni@linux.intel.com \
--cc=jkosina@suse.cz \
--cc=linux-iio@vger.kernel.org \
--cc=srinivas.pandruvada@intel.com \
--cc=subramony.sesha@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.