From patchwork Mon May 21 18:41:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kelly X-Patchwork-Id: 10416191 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4A8546053B for ; Mon, 21 May 2018 18:42:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38B09289EE for ; Mon, 21 May 2018 18:42:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 377B128A1F; Mon, 21 May 2018 18:42:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF93F289F0 for ; Mon, 21 May 2018 18:42:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750977AbeEUSmJ (ORCPT ); Mon, 21 May 2018 14:42:09 -0400 Received: from mail-sn1nam01on0050.outbound.protection.outlook.com ([104.47.32.50]:60551 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750923AbeEUSmI (ORCPT ); Mon, 21 May 2018 14:42:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uievolution.onmicrosoft.com; s=selector1-xevo-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BQtvxoU+WFwM3I+DHQ9KrGQYymnk0ZuwBt59SzUC2nc=; b=ARTOGwbitJAeIU7iPZ8Ig8WpJzhxjUm8ZBb3Nz9Tp7iscPP2y5zWZceACI6CTF+BIMfpiCVfc+OFN8Y457JbqJkxfTtuldkq640BpvcOZJnf1AbPf8K8eIpmYVEy6KvDSd79sjpJy3L5ScwLsoFU92ujM59oYKOtyv+woSuazPk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=mkelly@xevo.com; Received: from localhost.localdomain (97.113.238.55) by SN6PR0102MB3424.prod.exchangelabs.com (2603:10b6:805:3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Mon, 21 May 2018 18:42:06 +0000 From: Martin Kelly To: linux-iio@vger.kernel.org Cc: Jean-Baptiste Maneyrol , Jonathan Cameron , Martin Kelly Subject: [PATCH] iio: imu: inv_mpu6050: add comment about frequencies Date: Mon, 21 May 2018 11:41:54 -0700 Message-Id: <20180521184154.29548-1-mkelly@xevo.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-Originating-IP: [97.113.238.55] X-ClientProxiedBy: MWHPR14CA0022.namprd14.prod.outlook.com (2603:10b6:300:ae::32) To SN6PR0102MB3424.prod.exchangelabs.com (2603:10b6:805:3::13) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:SN6PR0102MB3424; X-Microsoft-Exchange-Diagnostics: 1; SN6PR0102MB3424; 3:HjW32UCmfXIezJ3oLcI0TX9Fw0Zi+FyM0upcOCur9LJJaKnoGIb2KM2TJyM6+NOMSQLEqn2MuRpQeW9G1sn7vucVqkSi2wb3HO7F1PEW7ccA7QsdT4E4cJqseV4xPejnW9Oa9vBa4TzxhyA8IWqn9rH1LTZcRE8yE6v5DeHq8c34HKQoWjaW1oGv50YTteUOtcm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OR1dcQBfAWp/YTAUtbHsFskldpELjOmjeH8lzVKiPI4voLI5j0JohZ7VlE3Ckh76s0QPhxbzWh6niPXxl2iyY3tUZxZhxl51qQlTsRSqaCgvnILTWYGPgJTOvYSszq8OfR6TldRPerOpUvilWXOSWWud9Cf; 4:pK0xeBZnbXgf+44EycE3/SyubEoAoeg/PgP0X4McRNMQuvIx6hcMAoecgJrrjDZwyvLTacnQ/0LioCsnRzdvO5GCNiri160FElNWPr4Br+5tfTVOONf0tpCIuWyRTubl78x8TjFL83Gpt20KkhtMyfIHdnv75JbhWNwKtckxA0ZdlOL7IG4IpP3S1UUPXYtAnacMzLecO69mYcUWpNaXweNyTKYVA6/3OcgaeF4/UncI/g8LLtY4Bx7fqVv5eeANNVCggQC2U6/fELKYnIMOFA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:SN6PR0102MB3424; BCL:0; PCL:0; RULEID:; SRVR:SN6PR0102MB3424; X-Forefront-PRVS: 06793E740F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(39840400004)(366004)(346002)(376002)(39380400002)(199004)(189003)(26005)(956004)(1076002)(476003)(105586002)(106356001)(86362001)(7736002)(1857600001)(36756003)(486006)(6486002)(16526019)(186003)(2616005)(6116002)(3846002)(2906002)(54906003)(8936002)(50226002)(478600001)(305945005)(5660300001)(47776003)(107886003)(68736007)(6506007)(25786009)(48376002)(2361001)(2351001)(59450400001)(51416003)(386003)(4326008)(81166006)(16586007)(50466002)(52116002)(6512007)(53936002)(81156014)(66066001)(316002)(97736004)(8676002)(6666003)(6916009); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR0102MB3424; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: xevo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN6PR0102MB3424; 23:eXvxYnFkEPnh8r8jqVNEKjVHhdbLFx0SIZs073J?= =?us-ascii?Q?qPIZQAN4xfrBDlhv77l9rcTuNVSbnYc6qgQ+ZzLJKW5Llh67L3pnNWLSKr9t?= =?us-ascii?Q?hWhTd8da/NWGvm/BfBdDXarTZKvEnJOX/cTFU4sSEBYOonqp/qD8pEy5IYqR?= =?us-ascii?Q?DLxAh7I2/TO/mGL8die6jprVinkcEk46U4C8h2f8/PtipyNKYGQ1211Myu+4?= =?us-ascii?Q?szbBBnieFqsndw99rhAYLJNvMzCZnFsyJpfa4kpp0BzbFozaX8qiOETmUspZ?= =?us-ascii?Q?uGQUiXAXI13TYnxOcXbDMcEYSdr/4CMtzKXvsAjB7FaAU341e09GnUaAWS9A?= =?us-ascii?Q?nMh0vOMxS0/gv3bkd91tA6WA79E37Ecf9Q4Tm45o3WWh/4WamAYMNj3Zsen5?= =?us-ascii?Q?9Cp0MZh9Kpv6iYZfXdmkXuCq4mxZ1fCHtORka1Qjvzkffy4Hpvf3OQTQ3DZ6?= =?us-ascii?Q?A4XHidJpCgFx6XobLZZ0B4USew9usFEgHwRQBIN5wEEVYdqZCk/xtQwdFZjt?= =?us-ascii?Q?VXNFi9hou8CIJYCDSCkRlL3vQp2Coj70EJ2aOwflPHYQb5iSNKVJQ+0kGuo4?= =?us-ascii?Q?/UhDqYa+1XKvseA2zEJvUfuYtniOP9ng2j+qXo7FH6tIOTi/pEsOPK+iZKMF?= =?us-ascii?Q?Y3gfXYcgyb+sSgYIh3BYNJAQCWWQiqnTieVXDdMnfGAKUPiPapQyEdb74O7g?= =?us-ascii?Q?Y6YbMORH2uv69W7xUaDSVjLyYmLtFKnp9bZvcdYdW7r7XzvOqRZ9mTZNUNRv?= =?us-ascii?Q?GB/tbyVuYV4bK5eYlqSpg+wA/dSzc3dcDHUeY1wL+mBdAjxpZ5nA0TZ+UTSL?= =?us-ascii?Q?XQ6f6uk7gFxn5NV/cgitMyqhHu7ynSEk+ryx4TZXO7NYqoQ0FKbi8pjES25I?= =?us-ascii?Q?oPKJTLKN9Zg7HFTo0GOu4PALkS62wH6NeaIAVJAq4DXFZuNmfHwbpPrYOzoF?= =?us-ascii?Q?X00p+fY6qgwT7fzfyFlKm6Etv20WV7FOm8hT/QDlqjcRtGaXPDoAHQntBua/?= =?us-ascii?Q?9Qnpwg33NCqfbgb81YURG2zsFjhYzuqLsh1rHMITOfH2cFE2BBZf8gtzPiHx?= =?us-ascii?Q?776keo4dOt5sdxPZaGacKoyZ0+L3+ins4TOAzMHBPLqhBUuz01H9izAn7eFm?= =?us-ascii?Q?REOHyMdVhFaY4Ncj8z5GiF/PgXrHUDJJxujwxF8fkbxH9OqGN/fyqlEj0Rl0?= =?us-ascii?Q?8kuRomRe8MA1Q3UtbLLcf0TXJ/qnbu656PltouzJhVp0himax6JRfXAYS/js?= =?us-ascii?Q?ZW3nFCBofvvphmVHCeteAEmQiE1iVHDpMrZbneuX2QQyILVDZoS9HQYDC46k?= =?us-ascii?Q?AzQ=3D=3D?= X-Microsoft-Antispam-Message-Info: Kori0Q1b42q4NLnnsoNAt/DDOxFeecsa8Bi2gZcBbwrjIBL+XYhyTBPFQ58SsFoOG8VvuTTUtbsBbCHoKxSrW7LcFgZc03J2WvE6y1Havaudh6OuHAlEjsYfTXKu3Q7EKAvUjivjypYviSESVRU2EXrY1ET3+inFrxuklGB7nv4vyn/5fGjTEO4gBjA6DMid X-Microsoft-Exchange-Diagnostics: 1; SN6PR0102MB3424; 6:oSTx7IZDsfXuwY31P87vVFO8p3jGGLxKIHEni2gr/mt0wiyjeQyxAUGUbdq9kyJJyP1brJPdHZPAGI3T4TeQIe2jKmSeKuNqGB/Ws072X+MvLkeN7f+O3MSbRarOeNeSRlKhumJxM0B3R6Z3Bm3hYxKsgYmTHQO/kNgwtzOfCOb09mbBK9iTB2ZAacCeCMQ6nwWJykhgYAas4LdwqKarD+f0IAoTntfDJVBsnzTDs1NZKDToU673gKWSuNSwLWHnCmE9gg29YUg6P7eq8lOnvceFPEVaM31UKIBJnpFhlHhEh1P8tpMEWy5/2WjnVpX31+fSZBn3EKCbyX7JnxxpGUmb6V9fBeLMQDOLhA74V5AaovnATn3GZCd24lebwzNbfONvBUSTGWxqxVtL5YodVWahtY1FIMXT/yLb37pgiCdmFogE6psqFwvbygEFDnBjxzEPtX4UlgdLTGuD2cftsQ==; 5:nqGFKK3BdTCTQeoWcyNI9BFcKOGtE184y5l/uApvxtdRJpm+xiiU6vouaFaLJZCquNGu6RdfZ3vmQX7mrQKMgURzRcprGf+oozDkRM+i7C4VNrwmSn1syWbKSJcHb61Vw1iagkcdfviFJQ3HEpsMhhzJ2C1kncn0FGutiRMh2L0=; 24:t7ml7bcseDIsf1ukDgeOxHC7ZqMcwB46XZKdWUDcshweeZ+tn5yBd/Sh00HP97ry00gpDUy7fZiBT/89T2NifyiD+YdX8A9GW1cg8Yu/9lg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN6PR0102MB3424; 7:3TfwntdG467Hkz7URNtJqdo5LHDwwDH/jLM/PM04ZQ9a8hHAV9ZqP9KCiQIgqOzY0eYQWmM1t0xKkKMHmty32ZDTHYwDPh6TYkOThCifcFT5ieCL54X/mlxRP3JHEAdzU9WrHiBdO776g0imxOgVdmrrKj8SCQF8ApH9bgWW/yHP291/Z4NEqOKlv6grQ6d0LeL6Eh+9N9qB/RapC8k060LluQotydpZnoiIhJ99KoRJc/a/AQjK9IJ+xfvhnyCl X-MS-Office365-Filtering-Correlation-Id: fda734da-61b2-42d1-c161-08d5bf4a8db9 X-OriginatorOrg: xevo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2018 18:42:06.5914 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fda734da-61b2-42d1-c161-08d5bf4a8db9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e0a7ca1f-2458-4cd6-a7c7-d733c07495ab X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR0102MB3424 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_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[] = { INV_MPU6050_CHAN(IIO_ACCEL, IIO_MOD_Z, INV_MPU6050_SCAN_ACCL_Z), }; -/* 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 the + * low-pass filter. Specifically, each of these sampling rates are about twice + * the bandwidth of a corresponding low-pass filter, which should eliminate + * aliasing following the Nyquist principle. By picking a frequency different + * from these, the user risks aliasing effects. + */ static IIO_CONST_ATTR_SAMP_FREQ_AVAIL("10 20 50 100 200 500"); static IIO_CONST_ATTR(in_anglvel_scale_available, "0.000133090 0.000266181 0.000532362 0.001064724");