All of lore.kernel.org
 help / color / mirror / Atom feed
* Acceleration units and mma8452 driver
@ 2014-07-11 10:16 Martin Fuzzey
  2014-07-11 11:31 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Fuzzey @ 2014-07-11 10:16 UTC (permalink / raw)
  To: linux-iio

Hi all,

I'm new to iio and have a question on acceleration units.

Documentation/ABI/testing/sysfs-bus-iio states "after application of 
scale and offset are m/s^2"

However the mma8452 driver, when in 2G full scale mode provides a scale 
factor of 0.000977

/sys/bus/iio/devices/iio:device0# cat in_accel_scale
0.000977

Full scale positive raw value (12 bits) is 2047 so that gives 2G 
(0.000977 * 2047)

So this driver seems to be using G as units rather than m/s^2.

Am I misunderstanding or is this a driver or doc bug?

Regards,

Martin



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Acceleration units and mma8452 driver
  2014-07-11 10:16 Acceleration units and mma8452 driver Martin Fuzzey
@ 2014-07-11 11:31 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2014-07-11 11:31 UTC (permalink / raw)
  To: Martin Fuzzey, linux-iio



On July 11, 2014 11:16:03 AM GMT+01:00, Martin Fuzzey <mfuzzey@parkeon.com> wrote:
>Hi all,
>
>I'm new to iio and have a question on acceleration units.
>
>Documentation/ABI/testing/sysfs-bus-iio states "after application of 
>scale and offset are m/s^2"
>
>However the mma8452 driver, when in 2G full scale mode provides a scale
>
>factor of 0.000977
>
>/sys/bus/iio/devices/iio:device0# cat in_accel_scale
>0.000977
>
>Full scale positive raw value (12 bits) is 2047 so that gives 2G 
>(0.000977 * 2047)
>
>So this driver seems to be using G as units rather than m/s^2.
>
>Am I misunderstanding or is this a driver or doc bug?
>
Driver bug. Good catch. Do you want to prepare a patch?

Thanks

Jonathan

>Regards,
>
>Martin
>
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-11 11:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-11 10:16 Acceleration units and mma8452 driver Martin Fuzzey
2014-07-11 11:31 ` Jonathan Cameron

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.