All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
To: Martin Kelly <mkelly@xevo.com>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Cc: Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH] iio: imu: inv_mpu6050: add comment about frequencies
Date: Tue, 22 May 2018 12:55:23 +0000	[thread overview]
Message-ID: <CY4PR1201MB0184CB717224AA426AF6E501C4940@CY4PR1201MB0184.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20180521184154.29548-1-mkelly@xevo.com>

Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>


From: Martin Kelly <mkelly@xevo.com>
Sent: Monday, May 21, 2018 20:41
To: linux-iio@vger.kernel.org
Cc: Jean-Baptiste Maneyrol; Jonathan Cameron; Martin Kelly
Subject: [PATCH] iio: imu: inv_mpu6050: add comment about frequencies

Although the driver allows frequencies between 4 and 1000 Hz, only the
frequencies advertised in the available frequencies file are backed
properly by a low-pass filter to prevent aliasing, so it's best to use
them. Since this is not obvious to the user, add a comment explaining
what's going on.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
---
=A0drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 9 ++++++++-
=A01 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/i=
nv_mpu6050/inv_mpu_core.c
index 43fba5f7532b..f9c0624505a2 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -798,7 +798,14 @@ static const struct iio_chan_spec inv_mpu_channels[] =
=3D {
=A0=A0=A0=A0=A0=A0=A0 INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_MPU6050_SC=
AN_ACCL_Z),
=A0};

-/* constant IIO attribute */
+/*
+ * The user can choose any frequency between INV_MPU6050_MIN_FIFO_RATE and
+ * INV_MPU6050_MAX_FIFO_RATE, but only these frequencies are matched by th=
e
+ * low-pass filter. Specifically, each of these sampling rates are about t=
wice
+ * the bandwidth of a corresponding low-pass filter, which should eliminat=
e
+ * aliasing following the Nyquist principle. By picking a frequency differ=
ent
+ * from these, the user risks aliasing effects.
+ */
=A0static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("10 20 50 100 200 500");
=A0static IIO_CONST_ATTR(in_anglvel_scale_available,
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 "0.000133090 0.000266181 0=
.000532362 0.001064724");
--
2.11.0

    =

  reply	other threads:[~2018-05-22 12:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-21 18:41 [PATCH] iio: imu: inv_mpu6050: add comment about frequencies Martin Kelly
2018-05-22 12:55 ` Jean-Baptiste Maneyrol [this message]
2018-05-22 17:33   ` 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=CY4PR1201MB0184CB717224AA426AF6E501C4940@CY4PR1201MB0184.namprd12.prod.outlook.com \
    --to=jmaneyrol@invensense.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=mkelly@xevo.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.