All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: hid-sensors: Fix unit conversion
Date: Mon, 05 May 2014 11:01:06 +0100	[thread overview]
Message-ID: <53676162.8090903@kernel.org> (raw)
In-Reply-To: <1399251720-8158-1-git-send-email-srinivas.pandruvada@linux.intel.com>

On 05/05/14 02:02, Srinivas Pandruvada wrote:
> When no units are specified the default units are milli-gauss. So
> need to divide by 1000 to get iio default of Gauss.
> Similarly the default units conversion from degrees to radians.
>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Seeing as I hadn't pushed the patch this is fixing out to the togreg branch
of kernel.org yet, I've applied this as a fixup patch to
4500173cd9abbf3dc8f48a5caca783cd4debe288 iio: hid-sensors: Convert units and exponent

> ---
>   drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 4 ++--
>   1 file changed, 2 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 29185a0..3729646 100644
> --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> @@ -44,10 +44,10 @@ struct {
>   	{HID_USAGE_SENSOR_GYRO_3D,
>   		HID_USAGE_SENSOR_UNITS_DEGREES_PER_SECOND, 0, 17453},
>
> -	{HID_USAGE_SENSOR_COMPASS_3D, 0, 1000, 0},
> +	{HID_USAGE_SENSOR_COMPASS_3D, 0, 0, 1000},
>   	{HID_USAGE_SENSOR_COMPASS_3D, HID_USAGE_SENSOR_UNITS_GAUSS, 1, 0},
>
> -	{HID_USAGE_SENSOR_INCLINOMETER_3D, 0, 17453, 0},
> +	{HID_USAGE_SENSOR_INCLINOMETER_3D, 0, 0, 17453},
>   	{HID_USAGE_SENSOR_INCLINOMETER_3D,
>   		HID_USAGE_SENSOR_UNITS_DEGREES, 0, 17453},
>   	{HID_USAGE_SENSOR_INCLINOMETER_3D,
>


      reply	other threads:[~2014-05-05  9:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-05  1:02 [PATCH] iio: hid-sensors: Fix unit conversion Srinivas Pandruvada
2014-05-05 10:01 ` 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=53676162.8090903@kernel.org \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.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 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.