From patchwork Mon Jan 20 09:36:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Baptiste Maneyrol X-Patchwork-Id: 205536 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B135FC33CB7 for ; Mon, 20 Jan 2020 09:36:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88B7E207FD for ; Mon, 20 Jan 2020 09:36:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=invensense.com header.i=@invensense.com header.b="A09odEJu"; dkim=pass (1024-bit key) header.d=invensense.onmicrosoft.com header.i=@invensense.onmicrosoft.com header.b="W8VPi6vk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726607AbgATJgx (ORCPT ); Mon, 20 Jan 2020 04:36:53 -0500 Received: from mx0a-00328301.pphosted.com ([148.163.145.46]:5392 "EHLO mx0a-00328301.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725872AbgATJgw (ORCPT ); Mon, 20 Jan 2020 04:36:52 -0500 Received: from pps.filterd (m0156134.ppops.net [127.0.0.1]) by mx0a-00328301.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00K9Tq6R007127; Mon, 20 Jan 2020 01:36:48 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=invensense.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=pfpt1; bh=DrWVSr7Cs3DFBetOePiInj5YUVsHPg01H9tlrc3z8hM=; b=A09odEJuoLFB2tTBnZLKiyW0zUTrJkDfcQtd14lW6og54lgkEHoqV6A/pqvHDK38XcIm wQxHgZXv4EDIhV8ssPaC8FTBoIJxmj/fiOZdhHzZ2Pa7eTWe3VSko600iiKszvCtM7oq p19K6+R3n59bLcdQcv0QsHtfXmublThKgZf4oOQEGK2evS1CgiKuKfJ8v+05SGPUAcHP rTxt/UI+BncNGDZUyvIcvzdhWoKjCcTxH+97kPrSUAMWoWL6Ob5mTRhaFqLttsLSQFdU cE16Bw0mlXbwNVBN6NCIj4PKiLmwUjsWd6cx0wFdJ8eZtAKX9+n7yD7vo6jlhCxRJDEb tA== Received: from nam04-bn3-obe.outbound.protection.outlook.com (mail-bn3nam04lp2055.outbound.protection.outlook.com [104.47.46.55]) by mx0a-00328301.pphosted.com with ESMTP id 2xm1gqrmsx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Jan 2020 01:36:48 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EgFbtGMqaxoTi85+pnrFNesjpVWgO53p5TovXhMPr0eC5CBMe24lMe8SKTQk6miEFQChs9pmku7ER5H2nW5AdbbJcFXFLVVaMe6eOP+pFWTOk8l1nURmfG1PELiL1NSUxMcTukesMRwLEFnyqgqsPt1XtscuROApUWnp7J72fw6K5x47g2dqxjFXVrpDF6AaWOlHJTF2U8m6MTmA99VyQQeQHqzUDpSidQMXMBDfURriyZbePJ8H5uaDtibKEV0DTlBjTnKy/7ePD0z/L92vixfcBNl3tSKvmyGCYDsACsMHsyJIUJDyiUgZuDXCr4JMm4RM1cFV3AatGDBe9PDW0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DrWVSr7Cs3DFBetOePiInj5YUVsHPg01H9tlrc3z8hM=; b=Ce4qva6e05BKEzrStmluWZaDo5UINK9wHx8+sHAuircNV5kXPXnB4N/tjGjkvaY1nKH7HzAcmrsAPvPl2FsfBVL9LGX/Hv2g7z78NypW+mTu7rXlO707wquolMsOVLMJ+uSKXVzI5VeU4tXFEvLXMh1OtoWNZ4G1RWq/KlHFZavg1hged+g54X0REMB+d5cT7yk3shtjF7yJ15SrBmUTUJMpINOZqnJSLJbanDQntoGd5sVby42Yxzzhy9WE2vZXVVSNamPh+FYcjlTLMLpJ43Aim9xqxDt9UW5EdplDqeZw1ilywjlHUg2Mrl6NAYeUjje1vfXSbnabKKfHrg5rYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=invensense.com; dmarc=pass action=none header.from=invensense.com; dkim=pass header.d=invensense.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=invensense.onmicrosoft.com; s=selector2-invensense-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DrWVSr7Cs3DFBetOePiInj5YUVsHPg01H9tlrc3z8hM=; b=W8VPi6vkb7FC6B+jrKMfHl4K7l6Zw2AkjFeEqkYtIZi55r9Ds48+VL54UyvdrjFTijxElgkHpvvDbdOHwFN1uZYLwod1BibH5wSI27N6X7mMmanLnBxRPq+PmeJ9xNLTRfjT77/IAKqSVBAOkb8uz3K1LBbBTWDazZ5XELyqkFQ= Received: from MN2PR12MB3373.namprd12.prod.outlook.com (20.178.242.33) by MN2PR12MB3183.namprd12.prod.outlook.com (20.179.82.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.23; Mon, 20 Jan 2020 09:36:47 +0000 Received: from MN2PR12MB3373.namprd12.prod.outlook.com ([fe80::4028:892b:b405:59fa]) by MN2PR12MB3373.namprd12.prod.outlook.com ([fe80::4028:892b:b405:59fa%6]) with mapi id 15.20.2644.024; Mon, 20 Jan 2020 09:36:47 +0000 From: Jean-Baptiste Maneyrol To: Jonathan Cameron , linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Mark Rutland , Jean-Baptiste Maneyrol Subject: [PATCH 1/9] dt-bindings: iio: imu: inv_mpu6050: add missing entry for mpu6000 Date: Mon, 20 Jan 2020 10:36:12 +0100 Message-Id: <20200120093620.9681-2-jmaneyrol@invensense.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200120093620.9681-1-jmaneyrol@invensense.com> References: <20200120093620.9681-1-jmaneyrol@invensense.com> X-ClientProxiedBy: LO2P265CA0146.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::14) To MN2PR12MB3373.namprd12.prod.outlook.com (2603:10b6:208:c8::33) MIME-Version: 1.0 Received: from frgnb-12nlpn2.invcorp.invensense.com (77.157.193.39) by LO2P265CA0146.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Mon, 20 Jan 2020 09:36:44 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [77.157.193.39] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 072fb128-26c7-4879-3a6c-08d79d8c4463 X-MS-TrafficTypeDiagnostic: MN2PR12MB3183: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:374; X-Forefront-PRVS: 0288CD37D9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39840400004)(396003)(376002)(346002)(136003)(366004)(199004)(189003)(966005)(7696005)(52116002)(6666004)(8936002)(478600001)(186003)(16526019)(8676002)(86362001)(2906002)(26005)(316002)(81156014)(81166006)(54906003)(956004)(107886003)(2616005)(6486002)(1076003)(4744005)(66946007)(36756003)(5660300002)(66556008)(4326008)(66476007)(562404015); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR12MB3183; H:MN2PR12MB3373.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: invensense.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cjnOrl9vUajdPaPXPSngrT+epR5Avrct+7zhgT3JwvuEcsy9cMzl9UHJCSqkaQ6WFnewlGNSlCIAZnGcFG18SENnc45n3UweVg06pbGRRjH/p7pQBQ05x8sZfXar58HVzmqCFOro2+z+eLpn9lXkivNIo15/yjWAH9YsE+ADiXuh6TdqlOTlgjH1Xqy8KSK/ahftb6Yp8yPgu7JgurQzJKzCgTn2ue0TQT9IP7XXj5daetDR4YQMICDbJ//9TcqE3okxvHbwF+G7Ig3rrunCnsjoYF+1dctQH6tWZBQLWwxBKWE//cs9HXNqS3Mm6zrFZonRPVP1WILQSVPU0qDCw/4WfBC9sYmCXBQG2AGrScwE6QQvcwAkk3Xktx6idFE8OsC2TzOO63Untaoiik6Kd++wyl+gEbtqH4JVIipw/cC84xsP/FEqVv1U36ivZneyXMqKvS1qNJoaDwwOkyr8Jzxim9/AT0s1qgHJOHSxT+FDNSWntTBhbUrYHzVv3mKVgnb7pvHq2+2ffnD2wkX8pP418xwUWjGLEQeut/nk90+WfNfnFium7cXQ5/MuNROP X-OriginatorOrg: invensense.com X-MS-Exchange-CrossTenant-Network-Message-Id: 072fb128-26c7-4879-3a6c-08d79d8c4463 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2020 09:36:46.9767 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 462b3b3b-e42b-47ea-801a-f1581aac892d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: b0ZOYJ+DtFXzcdPZ1Q49kgFkUh/9gA0I4mAEnCxfrTRz/PznMDh8ECpFZQ80r1yF9mf24MglKRf/5YY3HM6TEXn+Ix1X0ZWDh0cg0Fez5i4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3183 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-01-20_01:2020-01-16,2020-01-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 bulkscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=883 lowpriorityscore=0 phishscore=0 suspectscore=0 impostorscore=0 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001200083 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org mpu6000 is spi only. Signed-off-by: Jean-Baptiste Maneyrol --- Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt b/Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt index c5ee8a20af9f..38483ea31fd4 100644 --- a/Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt +++ b/Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt @@ -4,6 +4,7 @@ http://www.invensense.com/mems/gyro/mpu6050.html Required properties: - compatible : should be one of + "invensense,mpu6000" "invensense,mpu6050" "invensense,mpu6500" "invensense,mpu6515" From patchwork Mon Jan 20 09:36:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Baptiste Maneyrol X-Patchwork-Id: 205532 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90E32C33CBA for ; Mon, 20 Jan 2020 09:47:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 63A882087E for ; Mon, 20 Jan 2020 09:47:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=invensense.com header.i=@invensense.com header.b="bFnIGnGT"; dkim=pass (1024-bit key) header.d=invensense.onmicrosoft.com header.i=@invensense.onmicrosoft.com header.b="kOZzVrqX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726621AbgATJrk (ORCPT ); Mon, 20 Jan 2020 04:47:40 -0500 Received: from mx0b-00328301.pphosted.com ([148.163.141.47]:33682 "EHLO mx0b-00328301.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726075AbgATJrk (ORCPT ); Mon, 20 Jan 2020 04:47:40 -0500 Received: from pps.filterd (m0156136.ppops.net [127.0.0.1]) by mx0b-00328301.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00K9TH3t026090; Mon, 20 Jan 2020 01:36:50 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=invensense.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=pfpt1; bh=/5hRh3bqV5FuP/EiZShBt80tAOVBpvt6lGTGyj/Is1U=; b=bFnIGnGTMt+N9MYOTf6EC9epBrVeTf8AxRhU7G7tkJZtRBwrc7UHMCEhXGh+vv9Jafm1 YWgR3vQe9arhrXXDdM0+DfSZgMdpHnd0pZL9LTKQZ+98SMkZCjDhc0fUhAU6oIiQEXb4 5A2krvXKufSWCxWlMiMzEzX7ICN0GPuiNsEGgXGnHneZ8DLfbzJxZVUekSn2K1IBG+mp B0AEAjMNFXfHQdDADXIo620pqhe6FnDqRguqxp6b5jG9PahJs938RzYliIFnX8ZpgotP ciuxct9SIvRM+Y8TkjNDUd+zbyslZG41kQk8Hy59DTH8EDHHrgOgChloMmtzZezmkJlj hA== Received: from nam04-bn3-obe.outbound.protection.outlook.com (mail-bn3nam04lp2052.outbound.protection.outlook.com [104.47.46.52]) by mx0b-00328301.pphosted.com with ESMTP id 2xkxuu0mxa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Jan 2020 01:36:49 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EzExk3b/rF6X0ELt9tGDFjTSUxqBYOm7bxMnrIhWN41jEvqpyLC55um/gMGuupqkH6yMmDJYEvj5tBT/6N6JZZCsp2PQPaoyqAOLwFEGXlC10KFR0fa/JhGwOsNYg0Pmd3O9sBwKLtBpazVXksQFb3U2JLXm4ElASBLcONOgkGFaYtFQBVcSbqmBatBqMgyL0ahSrrHsf+9hIFLvzeC+DLKs4jE6FpfR0NLTZ672MtGOjTA7ipHroI0OqsLdiPeXvQsUG3GqmY6bCbq3CdBsE2q+alJSoJfLJMDTWSy0tSf5JxAwgYPw5v88ufMDqekm0LNztVwmEa/BsdjQ98vT0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/5hRh3bqV5FuP/EiZShBt80tAOVBpvt6lGTGyj/Is1U=; b=aLzDbo1yveqRb559MAimjm+ekpxT1jGWyRyCaxCFkzvPZ4XLwngPIyO05g35NB/6PGio4zFbczQMPPI0rTfmM+EkSv0A3oKkD6sG/2yBiBCJbXqARTxtBURQa6JOL+LXAKwRZrFHiCWZ3+ZL5FeRWE0u3YKmvj2XsBTsIc+22hpG8lqXyvdBBWr9St2g7mU88x86hVSSTcQqylp+Qs680lFa/OTDpQ+zyUl3AzlmlglMP4pSvpkHvnqq5p1zxrw9aklxBj+6bQnmv/UAQA4c3uX8Ve21ywiIOTQw7YQhoVQvCCrfPGMyFndmcF+1WwBE8WlOb+oVLXP5iCuLw1ffJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=invensense.com; dmarc=pass action=none header.from=invensense.com; dkim=pass header.d=invensense.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=invensense.onmicrosoft.com; s=selector2-invensense-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/5hRh3bqV5FuP/EiZShBt80tAOVBpvt6lGTGyj/Is1U=; b=kOZzVrqXFEncTQ6J1X7sEH/HHZSikraBHXcRX3EknTfnBRB242De4IJmEEJ8Gl1z3JoyBK1/TiXQj79x3zMC1It+UvrmOXLdCbIgCO6xKalD6mQCEqoJfRd3C29e6F+R9VvpF0yzAvhZlmoHQZ7OjNWwsdFp2LHCQv7npdqYNjc= Received: from MN2PR12MB3373.namprd12.prod.outlook.com (20.178.242.33) by MN2PR12MB3183.namprd12.prod.outlook.com (20.179.82.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.23; Mon, 20 Jan 2020 09:36:49 +0000 Received: from MN2PR12MB3373.namprd12.prod.outlook.com ([fe80::4028:892b:b405:59fa]) by MN2PR12MB3373.namprd12.prod.outlook.com ([fe80::4028:892b:b405:59fa%6]) with mapi id 15.20.2644.024; Mon, 20 Jan 2020 09:36:49 +0000 From: Jean-Baptiste Maneyrol To: Jonathan Cameron , linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Mark Rutland , Jean-Baptiste Maneyrol Subject: [PATCH 2/9] iio: imu: inv_mpu6050: cleanup spi support Date: Mon, 20 Jan 2020 10:36:13 +0100 Message-Id: <20200120093620.9681-3-jmaneyrol@invensense.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200120093620.9681-1-jmaneyrol@invensense.com> References: <20200120093620.9681-1-jmaneyrol@invensense.com> X-ClientProxiedBy: LO2P265CA0146.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::14) To MN2PR12MB3373.namprd12.prod.outlook.com (2603:10b6:208:c8::33) MIME-Version: 1.0 Received: from frgnb-12nlpn2.invcorp.invensense.com (77.157.193.39) by LO2P265CA0146.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Mon, 20 Jan 2020 09:36:47 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [77.157.193.39] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: de6ac665-5dbe-4601-9f0b-08d79d8c4628 X-MS-TrafficTypeDiagnostic: MN2PR12MB3183: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-Forefront-PRVS: 0288CD37D9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39840400004)(396003)(376002)(346002)(136003)(366004)(199004)(189003)(7696005)(52116002)(6666004)(8936002)(478600001)(186003)(16526019)(8676002)(86362001)(2906002)(26005)(316002)(81156014)(81166006)(54906003)(956004)(107886003)(2616005)(6486002)(1076003)(66946007)(36756003)(5660300002)(66556008)(4326008)(66476007); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR12MB3183; H:MN2PR12MB3373.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: invensense.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b3P8OjdeHi7RJlw59ZcV6xhD5zACxx3FeytrY1J6bsAbzUWxIImF9JjB+nvUE3WQE7eoOsUf9qJUF0rm0iESdtHi7YugOvHuaobr0CCYp3sbwTtGq5detposdwlzwvx6PrnEpgd9pytz8ICmpBhFvZjJQ4oqbgXy5cC3zRa2gDQaPaSdlnApnFNgCBIeqTC9Y9QIXau65D1M/Vz3AP62dZmmjmqjAbPqW/sKEMtSFkgB1hAKPw/+3UW3XAeBwWtVe4P118+o0L8oJiuqp5UO599b0YFchNh30TJv8SHQ6osR7L/+Wjgoq3q/8k37HE1Qwj+NlIzSg3sP+F/4W0WOtoU/5P/UdtBb/xHVeuJ9+ke3Fr99SE/ymc4s2wd/M+YDYCzOMSJZRblMm7dcyIbkZn08agmcWHHBW5V7x57aosu/gsze2UXyTqHSlY5nDOnk X-OriginatorOrg: invensense.com X-MS-Exchange-CrossTenant-Network-Message-Id: de6ac665-5dbe-4601-9f0b-08d79d8c4628 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2020 09:36:49.7432 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 462b3b3b-e42b-47ea-801a-f1581aac892d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SZv/qM+9jtO9aFaGVTAmeZ6KWF4/m5CHfo/HQqdo6JWPDdKLWiZW7rrEaSzVzc9eLXxGcy/BgpdRibj1o8EgCLdqmhZg076IOppUjeWoATo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3183 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-01-20_01:2020-01-16,2020-01-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 adultscore=0 phishscore=0 spamscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001200083 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add missing mpu6515 support and add of match table. Reorganize Kconfig to display chips grouped by generations. Signed-off-by: Jean-Baptiste Maneyrol --- drivers/iio/imu/inv_mpu6050/Kconfig | 8 +++--- drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 35 +++++++++++++++++++++++ 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/drivers/iio/imu/inv_mpu6050/Kconfig b/drivers/iio/imu/inv_mpu6050/Kconfig index 017bc0fcc365..003134734646 100644 --- a/drivers/iio/imu/inv_mpu6050/Kconfig +++ b/drivers/iio/imu/inv_mpu6050/Kconfig @@ -15,8 +15,8 @@ config INV_MPU6050_I2C select INV_MPU6050_IIO select REGMAP_I2C help - This driver supports the Invensense MPU6050/6500/6515, - MPU9150/9250/9255 and ICM20608/20602 motion tracking devices + This driver supports the Invensense MPU6050/9150, + MPU6500/6515/9250/9255, ICM20608 and ICM20602 motion tracking devices over I2C. This driver can be built as a module. The module will be called inv-mpu6050-i2c. @@ -27,8 +27,8 @@ config INV_MPU6050_SPI select INV_MPU6050_IIO select REGMAP_SPI help - This driver supports the Invensense MPU6000/6500/6515, - MPU9250/9255 and ICM20608/20602 motion tracking devices + This driver supports the Invensense MPU6000, + MPU6500/6515/9250/9255, ICM20608 and ICM20602 motion tracking devices over SPI. This driver can be built as a module. The module will be called inv-mpu6050-spi. diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c index ec102d5a5c77..f7276f9d83fc 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c @@ -74,6 +74,7 @@ static int inv_mpu_probe(struct spi_device *spi) static const struct spi_device_id inv_mpu_id[] = { {"mpu6000", INV_MPU6000}, {"mpu6500", INV_MPU6500}, + {"mpu6515", INV_MPU6515}, {"mpu9250", INV_MPU9250}, {"mpu9255", INV_MPU9255}, {"icm20608", INV_ICM20608}, @@ -83,6 +84,39 @@ static const struct spi_device_id inv_mpu_id[] = { MODULE_DEVICE_TABLE(spi, inv_mpu_id); +static const struct of_device_id inv_of_match[] = { + { + .compatible = "invensense,mpu6000", + .data = (void *)INV_MPU6000 + }, + { + .compatible = "invensense,mpu6500", + .data = (void *)INV_MPU6500 + }, + { + .compatible = "invensense,mpu6515", + .data = (void *)INV_MPU6515 + }, + { + .compatible = "invensense,mpu9250", + .data = (void *)INV_MPU9250 + }, + { + .compatible = "invensense,mpu9255", + .data = (void *)INV_MPU9255 + }, + { + .compatible = "invensense,icm20608", + .data = (void *)INV_ICM20608 + }, + { + .compatible = "invensense,icm20602", + .data = (void *)INV_ICM20602 + }, + { } +}; +MODULE_DEVICE_TABLE(of, inv_of_match); + static const struct acpi_device_id inv_acpi_match[] = { {"INVN6000", INV_MPU6000}, { }, @@ -93,6 +127,7 @@ static struct spi_driver inv_mpu_driver = { .probe = inv_mpu_probe, .id_table = inv_mpu_id, .driver = { + .of_match_table = inv_of_match, .acpi_match_table = ACPI_PTR(inv_acpi_match), .name = "inv-mpu6000-spi", .pm = &inv_mpu_pmops, From patchwork Mon Jan 20 09:36:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Baptiste Maneyrol X-Patchwork-Id: 205533 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9928BC33CA1 for ; Mon, 20 Jan 2020 09:47:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6133F207FF for ; Mon, 20 Jan 2020 09:47:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=invensense.com header.i=@invensense.com header.b="UV1ZhKZG"; dkim=pass (1024-bit key) header.d=invensense.onmicrosoft.com header.i=@invensense.onmicrosoft.com header.b="NtTIjF/2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726451AbgATJrj (ORCPT ); Mon, 20 Jan 2020 04:47:39 -0500 Received: from mx0b-00328301.pphosted.com ([148.163.141.47]:32814 "EHLO mx0b-00328301.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbgATJrj (ORCPT ); Mon, 20 Jan 2020 04:47:39 -0500 X-Greylist: delayed 642 seconds by postgrey-1.27 at vger.kernel.org; Mon, 20 Jan 2020 04:47:37 EST Received: from pps.filterd (m0156136.ppops.net [127.0.0.1]) by mx0b-00328301.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00K9RdO7025311; Mon, 20 Jan 2020 01:36:53 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=invensense.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=pfpt1; bh=GE62sdKSX3LGUqRw6XwcVtitfaMeR56KCsErcKwEREY=; b=UV1ZhKZGL/GAXMgVBb3Pbda4wthczgg+zBQfscwXQw9hQ5yL5atPGNdGFgkOEHpVBG1f HXOLHeSt1K1Zw8e5PNSCXzo8dwhCTlYFK1SHzFb+Xr0TQCltLIVeio8sbIcD9s1OToe8 AxvJpKqBjt85FmTvO3wTfQAT1UerSesxk00PnGY5MzH6k28XRdb1UIE6IgpT9KQMHaGg f9vZk5k4S4CiukdT41saCZ5Q3E1JGCOdsZbz7NEzsQ/0Wx7pqoH51vKsh+Fqtkw21xhy TOC1URSS0fGaVdZXewXBgDyeuIcDw/R8JMtjlRMj/616GJRXoN4OOhA69gYc4j9Z0bFh 9g== Received: from nam04-bn3-obe.outbound.protection.outlook.com (mail-bn3nam04lp2053.outbound.protection.outlook.com [104.47.46.53]) by mx0b-00328301.pphosted.com with ESMTP id 2xkxuu0mxc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Jan 2020 01:36:53 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fke8yOs8eo9n1tXQPOOm6mGOn8geLKBPckh0lrwalwpcSPZU1bF7SzG9TR1iD3F36F1zW58TZE55C/k6fJhmEVI/ye4sWWwfkbMRBwD7DNI1wkeSMw0iqIG+g+NHzO7FeT0chiIBeOdmwbZjRMTCFSSk/msnOib5wUuVaI6JNAqz7ZGo8NOjElw28KeL0zTB1fxw/W9ihS5STO6H30pmwUokDgJI/VDZUhe6r36wsFTXvXavSgOcDruiBD4cJiYmpsouc5/kt+zlqN7JPPPh8nw6dXhj2kX6PiWR2RpkgH1SgFx3xQAcp8akrILU8cArbQiLL4innCkg7fEGkm0fjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GE62sdKSX3LGUqRw6XwcVtitfaMeR56KCsErcKwEREY=; b=aEFdko3gQxxs5+kOeApKvx65Q6tKMhmkO7XTh5PKbtt0UaGevp7JVAhWdVC3zq++x2aLCoiRW+6YOeCUba3X206yMEzZXWRQcDUL83I24G0/YgSdDehtnwHt0mrykvJXuGknlDhi/hc9lXGWuNCsCiOGrvqxLBistfH76lVOcPG41cVtnrmuerkywyH1YB7moq7cVZuWRBQxFKD3V0sEBQjl/05AtDFbsVHkP4h9xv7ws/DUzJ4YvOJTCMOz3Uv3Ypr5k4OvHFEuDXJfAwA2gEZiHuBRARAm0f7UtWqRT9a5bGK+TZ2jw00pC2IhsOSd8XmiTfKrI7hIT2MHyeLLiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=invensense.com; dmarc=pass action=none header.from=invensense.com; dkim=pass header.d=invensense.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=invensense.onmicrosoft.com; s=selector2-invensense-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GE62sdKSX3LGUqRw6XwcVtitfaMeR56KCsErcKwEREY=; b=NtTIjF/20zhNYGqkjjce1K9yK5UXkhCw2ejmHFNK06u/5Z7ZFV07TeW08cOUwcO8XpRgID/gVMeGzhWVurom6OuMtw9zOT5nU7xk9Rut5n0gXvyCLPewHEyCzRL8PIr4QzTscYvStysyPHiFHH6s8HujHDwM3a/wWLrxS5NE1K0= Received: from MN2PR12MB3373.namprd12.prod.outlook.com (20.178.242.33) by MN2PR12MB3183.namprd12.prod.outlook.com (20.179.82.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.23; Mon, 20 Jan 2020 09:36:52 +0000 Received: from MN2PR12MB3373.namprd12.prod.outlook.com ([fe80::4028:892b:b405:59fa]) by MN2PR12MB3373.namprd12.prod.outlook.com ([fe80::4028:892b:b405:59fa%6]) with mapi id 15.20.2644.024; Mon, 20 Jan 2020 09:36:52 +0000 From: Jean-Baptiste Maneyrol To: Jonathan Cameron , linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Mark Rutland , Jean-Baptiste Maneyrol Subject: [PATCH 3/9] iio: imu: inv_mpu6050: add support of ICM20609 & ICM20689 Date: Mon, 20 Jan 2020 10:36:14 +0100 Message-Id: <20200120093620.9681-4-jmaneyrol@invensense.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200120093620.9681-1-jmaneyrol@invensense.com> References: <20200120093620.9681-1-jmaneyrol@invensense.com> X-ClientProxiedBy: LO2P265CA0146.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::14) To MN2PR12MB3373.namprd12.prod.outlook.com (2603:10b6:208:c8::33) MIME-Version: 1.0 Received: from frgnb-12nlpn2.invcorp.invensense.com (77.157.193.39) by LO2P265CA0146.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Mon, 20 Jan 2020 09:36:50 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [77.157.193.39] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93f34402-ca0f-4b9f-6556-08d79d8c47cb X-MS-TrafficTypeDiagnostic: MN2PR12MB3183: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 0288CD37D9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39840400004)(396003)(376002)(346002)(136003)(366004)(199004)(189003)(7696005)(52116002)(6666004)(8936002)(478600001)(186003)(16526019)(8676002)(86362001)(2906002)(26005)(316002)(81156014)(81166006)(54906003)(956004)(107886003)(2616005)(6486002)(1076003)(66946007)(36756003)(5660300002)(66556008)(4326008)(66476007); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR12MB3183; H:MN2PR12MB3373.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: invensense.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jrZ22wBTl02MWlpL1e8ThClCnIAqYTmZ/tYM1gFsPYy331j+4855aPoOrS5ItnGY3R1h1nuiaWZubiz4CBLyfiizFAJ9rXS44qgx2IDj8u/hAc5JqfGiKgndRxzZiFoUkzSmQPQeA3csowh2y2bW1KmUQMe3jENFIYpFkr3KFMN58wTTByJDCeWlHDe4trg5/mg1MswButruPLPtuNvTUy51MQNPNLN1keRGzO/nuQNZqm+e7LvvIF5PrKFlXyyal161qkHYbQVOr3fCb5UFZultrscX3B+zq8hu2tgMRz6E1pppr06CKUsMGWkq092QMBfx8HQDbczl7+QNxdME2GvUaHf6xR9RkT4Cf23Bt2XF3vCzxSTzZ1MTiCd5ukd7x1LrznN5iRyZzox7Rte1z1ql3ScU2NZ6uz8+SqMlVQTyRmxXGSKTNiQ3v4JAQ1Zl X-OriginatorOrg: invensense.com X-MS-Exchange-CrossTenant-Network-Message-Id: 93f34402-ca0f-4b9f-6556-08d79d8c47cb X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2020 09:36:52.5007 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 462b3b3b-e42b-47ea-801a-f1581aac892d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 99bOXE45RY0P1GylR7z/Ew+oRSQY5OvPsqn+Gxqp3vXVyjXghHOxVkadEWy8Gbj+Ai7dsJzVqpPdIXAPRXtdz9zYFQ6xXKCD3tqOsc4O9UM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3183 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-01-20_01:2020-01-16,2020-01-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 adultscore=0 phishscore=0 spamscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001200083 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org They are similar to ICM20608 chip. Signed-off-by: Jean-Baptiste Maneyrol --- drivers/iio/imu/inv_mpu6050/Kconfig | 8 +++---- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 26 ++++++++++++++++++---- drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | 12 ++++++++++ drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 5 +++++ drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 10 +++++++++ 5 files changed, 53 insertions(+), 8 deletions(-) diff --git a/drivers/iio/imu/inv_mpu6050/Kconfig b/drivers/iio/imu/inv_mpu6050/Kconfig index 003134734646..e933db3a5a89 100644 --- a/drivers/iio/imu/inv_mpu6050/Kconfig +++ b/drivers/iio/imu/inv_mpu6050/Kconfig @@ -16,8 +16,8 @@ config INV_MPU6050_I2C select REGMAP_I2C help This driver supports the Invensense MPU6050/9150, - MPU6500/6515/9250/9255, ICM20608 and ICM20602 motion tracking devices - over I2C. + MPU6500/6515/9250/9255, ICM20608/20609/20689 and ICM20602 + motion tracking devices over I2C. This driver can be built as a module. The module will be called inv-mpu6050-i2c. @@ -28,7 +28,7 @@ config INV_MPU6050_SPI select REGMAP_SPI help This driver supports the Invensense MPU6000, - MPU6500/6515/9250/9255, ICM20608 and ICM20602 motion tracking devices - over SPI. + MPU6500/6515/9250/9255, ICM20608/20609/20689 and ICM20602 + motion tracking devices over SPI. This driver can be built as a module. The module will be called inv-mpu6050-spi. diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index 5096fc49012d..5fd57a1bee90 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -176,6 +176,22 @@ static const struct inv_mpu6050_hw hw_info[] = { .fifo_size = 512, .temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE}, }, + { + .whoami = INV_ICM20609_WHOAMI_VALUE, + .name = "ICM20609", + .reg = ®_set_6500, + .config = &chip_config_6050, + .fifo_size = 4 * 1024, + .temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE}, + }, + { + .whoami = INV_ICM20689_WHOAMI_VALUE, + .name = "ICM20689", + .reg = ®_set_6500, + .config = &chip_config_6050, + .fifo_size = 4 * 1024, + .temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE}, + }, { .whoami = INV_ICM20602_WHOAMI_VALUE, .name = "ICM20602", @@ -286,20 +302,22 @@ static int inv_mpu6050_set_lpf_regs(struct inv_mpu6050_state *st, if (result) return result; + /* set accel lpf */ switch (st->chip_type) { case INV_MPU6050: case INV_MPU6000: case INV_MPU9150: /* old chips, nothing to do */ - result = 0; + return 0; + case INV_ICM20689: + /* set FIFO size to maximum value */ + val |= INV_ICM20689_BITS_FIFO_SIZE_MAX; break; default: - /* set accel lpf */ - result = regmap_write(st->map, st->reg->accel_lpf, val); break; } - return result; + return regmap_write(st->map, st->reg->accel_lpf, val); } /** diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c index f47a28b4be23..c2b5621edadb 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c @@ -74,6 +74,8 @@ static bool inv_mpu_i2c_aux_bus(struct device *dev) switch (st->chip_type) { case INV_ICM20608: + case INV_ICM20609: + case INV_ICM20689: case INV_ICM20602: /* no i2c auxiliary bus on the chip */ return false; @@ -218,6 +220,8 @@ static const struct i2c_device_id inv_mpu_id[] = { {"mpu9250", INV_MPU9250}, {"mpu9255", INV_MPU9255}, {"icm20608", INV_ICM20608}, + {"icm20609", INV_ICM20609}, + {"icm20689", INV_ICM20689}, {"icm20602", INV_ICM20602}, {} }; @@ -253,6 +257,14 @@ static const struct of_device_id inv_of_match[] = { .compatible = "invensense,icm20608", .data = (void *)INV_ICM20608 }, + { + .compatible = "invensense,icm20609", + .data = (void *)INV_ICM20609 + }, + { + .compatible = "invensense,icm20689", + .data = (void *)INV_ICM20689 + }, { .compatible = "invensense,icm20602", .data = (void *)INV_ICM20602 diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h index 6158fca7f70e..75b8903450eb 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h @@ -75,6 +75,8 @@ enum inv_devices { INV_MPU9250, INV_MPU9255, INV_ICM20608, + INV_ICM20609, + INV_ICM20689, INV_ICM20602, INV_NUM_PARTS }; @@ -276,6 +278,7 @@ struct inv_mpu6050_state { /* mpu6500 registers */ #define INV_MPU6500_REG_ACCEL_CONFIG_2 0x1D +#define INV_ICM20689_BITS_FIFO_SIZE_MAX 0xC0 #define INV_MPU6500_REG_ACCEL_OFFSET 0x77 /* delay time in milliseconds */ @@ -340,6 +343,8 @@ struct inv_mpu6050_state { #define INV_MPU9255_WHOAMI_VALUE 0x73 #define INV_MPU6515_WHOAMI_VALUE 0x74 #define INV_ICM20608_WHOAMI_VALUE 0xAF +#define INV_ICM20609_WHOAMI_VALUE 0xA6 +#define INV_ICM20689_WHOAMI_VALUE 0x98 #define INV_ICM20602_WHOAMI_VALUE 0x12 /* scan element definition for generic MPU6xxx devices */ diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c index f7276f9d83fc..189df8bae7b4 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c @@ -78,6 +78,8 @@ static const struct spi_device_id inv_mpu_id[] = { {"mpu9250", INV_MPU9250}, {"mpu9255", INV_MPU9255}, {"icm20608", INV_ICM20608}, + {"icm20609", INV_ICM20609}, + {"icm20689", INV_ICM20689}, {"icm20602", INV_ICM20602}, {} }; @@ -109,6 +111,14 @@ static const struct of_device_id inv_of_match[] = { .compatible = "invensense,icm20608", .data = (void *)INV_ICM20608 }, + { + .compatible = "invensense,icm20609", + .data = (void *)INV_ICM20609 + }, + { + .compatible = "invensense,icm20689", + .data = (void *)INV_ICM20689 + }, { .compatible = "invensense,icm20602", .data = (void *)INV_ICM20602 From patchwork Mon Jan 20 09:36:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Baptiste Maneyrol X-Patchwork-Id: 205535 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B437C33CA1 for ; Mon, 20 Jan 2020 09:37:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 243582087F for ; Mon, 20 Jan 2020 09:37:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=invensense.com header.i=@invensense.com header.b="IGMSrBHd"; dkim=pass (1024-bit key) header.d=invensense.onmicrosoft.com header.i=@invensense.onmicrosoft.com header.b="Gv4F2ZIv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726621AbgATJhL (ORCPT ); Mon, 20 Jan 2020 04:37:11 -0500 Received: from mx0a-00328301.pphosted.com ([148.163.145.46]:19600 "EHLO mx0a-00328301.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbgATJhL (ORCPT ); Mon, 20 Jan 2020 04:37:11 -0500 Received: from pps.filterd (m0156134.ppops.net [127.0.0.1]) by mx0a-00328301.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00K9U2Wd008012; Mon, 20 Jan 2020 01:37:08 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=invensense.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=pfpt1; bh=lxiXpkkAhk+dUrLv0lIopBcAtL+TlIQf+SgDzyovQD8=; b=IGMSrBHdOi89vhe0V1tNSD+6fJYOObSRmCoilafY9gw2yIwIt5D31pAACJLza1bDj3BU x2ZRTjaTkugOUDWWGjtYK6PXjrKfpP82YaO5kLj/zOpxk9s87lsfvVVQPj8F61awnagO ihgVp5p2YZNd5nbMnsnpqkB03lJ8z19rJHSPKEgElzRmPf8KRCfB6l1jo6c9fE675GYY /JlVuOreY+bO5dnrGbEHrbRBdnZjhtQye6WFA9gyS8Dr2Hyn6aQo35/j+30j7nMDHtBh gh+F4AfMA/SlOMxp+rWx1DqObnAoSg8cPJF+EwZ3bMzUCBMUAQty+/5ibBoIYVvlplx8 QA== Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by mx0a-00328301.pphosted.com with ESMTP id 2xm1gqrmt9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Jan 2020 01:37:08 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZHqZm9XdEShRMOInWMda7fjlDS52psCjqksj2L4MWwmiVToiakzZBl0wjI7ZKtdZlTKMxwHVKs3PzmfhwQQhtsZM3SUjwDyRBRl+rlczniVCr6FXBEmYmgIcxiP2+wHwU1blbdAUsqVEeqpeLfAB63QdlKAc8jNmoeeeKenr22h3GC9Ccr9zMe0+YbCsddjYCLjI+zz2RfS4kKGhk+MdJg60tInsBsmIu2Xax9s0PvTJnrWCtj4yr5TSZkDmhEC0n2TOi6uceK4kCwbKDvhbnEuOtdFtjNEE5Kn0wM+tmiNaU0RI67Tdkp/FKDczLxS4/h1lxTcyO8tk2aI/fG5GuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lxiXpkkAhk+dUrLv0lIopBcAtL+TlIQf+SgDzyovQD8=; b=bLYkqgZzWzQAQRz2f+QkIkDiKv3D2MauHh9T2KfpTzPtUnApzNX2qMya0qE5rWNeYE6pT4j1RLVpqxyf0LnaYn4EgxonZBfplFKX7qC1uYccgjdSzjdUWSJFm9glYyFMzK4OYlJAgeZs8Ki5ZoxUHJCEJGwAZUSykPbyaa/FRAO1FFFUGAAYkTZG6S+0PK3cufFqT1jZtBnKWAOWbgE5FUwZtTVGRez4LAeaE0VSBEtVKBTdT5VvoffN/5N7oi0+loc8BzyD5r8Qy/bDEMaWS32KoZKNY3bBH2DotBZ3FHeO6V453ATW0i4kGYPr2e73cHAUyEYFh3zgfEBPZTIkkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=invensense.com; dmarc=pass action=none header.from=invensense.com; dkim=pass header.d=invensense.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=invensense.onmicrosoft.com; s=selector2-invensense-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lxiXpkkAhk+dUrLv0lIopBcAtL+TlIQf+SgDzyovQD8=; b=Gv4F2ZIv0/5sqJkuVbkl0qN1X0hlyNa0XF+wG5pUVqVWKvbeTGbBKzYHupfveTkCujnHsW+Tch4gLbY6vNZ6a2tgnWvQ4uMV8B6JZTzLARU5dhNGoZpghyS/Xj+iE5EjGjYd5zXoyNN25RNWaK5clH4g5V2Zho8omDezBx90l1A= Received: from MN2PR12MB3373.namprd12.prod.outlook.com (20.178.242.33) by MN2PR12MB4048.namprd12.prod.outlook.com (52.135.49.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Mon, 20 Jan 2020 09:37:06 +0000 Received: from MN2PR12MB3373.namprd12.prod.outlook.com ([fe80::4028:892b:b405:59fa]) by MN2PR12MB3373.namprd12.prod.outlook.com ([fe80::4028:892b:b405:59fa%6]) with mapi id 15.20.2644.024; Mon, 20 Jan 2020 09:37:06 +0000 From: Jean-Baptiste Maneyrol To: Jonathan Cameron , linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Mark Rutland , Jean-Baptiste Maneyrol Subject: [PATCH 8/9] dt-bindings: add description for icm20690 Date: Mon, 20 Jan 2020 10:36:19 +0100 Message-Id: <20200120093620.9681-9-jmaneyrol@invensense.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200120093620.9681-1-jmaneyrol@invensense.com> References: <20200120093620.9681-1-jmaneyrol@invensense.com> X-ClientProxiedBy: LO2P265CA0146.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::14) To MN2PR12MB3373.namprd12.prod.outlook.com (2603:10b6:208:c8::33) MIME-Version: 1.0 Received: from frgnb-12nlpn2.invcorp.invensense.com (77.157.193.39) by LO2P265CA0146.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Mon, 20 Jan 2020 09:37:03 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [77.157.193.39] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e6417c2a-0e50-4b1e-fa66-08d79d8c4fff X-MS-TrafficTypeDiagnostic: MN2PR12MB4048: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-Forefront-PRVS: 0288CD37D9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(396003)(39840400004)(376002)(136003)(366004)(189003)(199004)(66946007)(66476007)(66556008)(7696005)(52116002)(4744005)(86362001)(36756003)(107886003)(5660300002)(6666004)(2906002)(8676002)(81166006)(186003)(81156014)(54906003)(1076003)(8936002)(478600001)(4326008)(16526019)(316002)(956004)(2616005)(26005)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR12MB4048; H:MN2PR12MB3373.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: invensense.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8pJdKgGeVG69RJp5DjKu45azaV9xvbh13YlVUsCpyl1ql7fQGBqRB7DQoY57GH29k5q7MvzPdGQpwLJqgm61jpOOZgGBar6vjNunKDBQRI5LaJjjuY437DIfV4XGrv72VHgwuMJfYzBwujkBadMxIxv+LpBYPZudv+lc0LgrWZi1DwxTOeU8lBGsVnvtqWhFmAwP+Cd6dUU7Hs7vN44P9IwAjUBHYbagh+3TOEpW3tURzWNheyFsIH2RtlYYnITt28GGUngN1Gr53hlyMx8rvr4vgaxT4bWxtNazZQPqoXnShAHCZ3uBSPY5pM1hQfHUOQiZv6DXF2c3/q0JOk2s+QrTA7LQ1ZyQYh9XVnMmT9jMkmyi4hSFM3Q++Oe3DAB8bIkC7zNtYlKFUAjiuymoMdtylvEBh6Kt3iX9LhToriL/Z5yoDJguEsRqlLdWU/H6 X-OriginatorOrg: invensense.com X-MS-Exchange-CrossTenant-Network-Message-Id: e6417c2a-0e50-4b1e-fa66-08d79d8c4fff X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2020 09:37:06.2670 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 462b3b3b-e42b-47ea-801a-f1581aac892d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: m8O8T04/og/gAyGOx5+NzQpvdqJjd8RQ5LdE2U9kRk65U2oeIH+MQvknE6aiQfagN/3d+4dmUqwUCu7uFtdmUvrCjVK3j00tiQ128KXtJQY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4048 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-01-20_01:2020-01-16,2020-01-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 bulkscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=723 lowpriorityscore=0 phishscore=0 suspectscore=0 impostorscore=0 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001200083 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org New supported chip. Signed-off-by: Jean-Baptiste Maneyrol --- Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt b/Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt index 29cec46e27ec..f2f64749e818 100644 --- a/Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt +++ b/Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt @@ -15,6 +15,7 @@ Required properties: "invensense,icm20609" "invensense,icm20689" "invensense,icm20602" + "invensense,icm20690" "invensense,iam20680" - reg : the I2C address of the sensor - interrupts: interrupt mapping for IRQ. It should be configured with flags From patchwork Mon Jan 20 09:36:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Baptiste Maneyrol X-Patchwork-Id: 205534 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F792C33CBA for ; Mon, 20 Jan 2020 09:37:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 556AC20882 for ; Mon, 20 Jan 2020 09:37:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=invensense.com header.i=@invensense.com header.b="cXQdVDZQ"; dkim=pass (1024-bit key) header.d=invensense.onmicrosoft.com header.i=@invensense.onmicrosoft.com header.b="A0YQk2hn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726796AbgATJhO (ORCPT ); Mon, 20 Jan 2020 04:37:14 -0500 Received: from mx0a-00328301.pphosted.com ([148.163.145.46]:21236 "EHLO mx0a-00328301.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726642AbgATJhO (ORCPT ); Mon, 20 Jan 2020 04:37:14 -0500 Received: from pps.filterd (m0156134.ppops.net [127.0.0.1]) by mx0a-00328301.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00K9Tq6V007127; Mon, 20 Jan 2020 01:37:10 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=invensense.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=pfpt1; bh=rh+zaW5OdyfhzfHfWg/qF2BHGMCgbuAeMW82swuobGI=; b=cXQdVDZQuvUaPBpqNpNJZzhs6qEJV8mIk7T6hpCf49zhFEDTBaqK4+qJk6PWUa8LbOG/ gLTvigwDr/R/mZAVlHBXncQ2Oc1W+sPgDj6ph0ytSWxztntYfH1BtTHoG9Zy2Mnx4jnI 0Fv0kXVZfYL/ii/1e6QITr4cuiLx0MwkDshVhUI+17tJWvF7ibCHorCIHkiuQG8Y4tXa bLcy516N49xOPDDXQJ0dzMNfAfP/8Hhy7b0agC/tugboqbrFDiiShXgudjUrJwRaNsj+ tF1fPuelQKFb02puplTS93YtEmzHWcUdjrVFKSH1vcWz2XLc7RaXfCQpHH0mt2SBl5Ct yw== Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by mx0a-00328301.pphosted.com with ESMTP id 2xm1gqrmtb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Jan 2020 01:37:10 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RFYPzYBKHv9NNVIAYG3u3WvDpeSOF82acVVAwulf6FdragvJg2TGOtlSgETDOAAhv/MjwgOHuq1fLwDzRXzSIu92eDNOhGIiV8CjEwbpniGQuqVCE9qy9JRQwvuaiGnP9hkM2qhgfp7xyJotvxKmo4wLV5TQXmembJpEfVZupMtUb2CsOL+cWzYJdPOzkxeevplfz+Y0mVw4LzDr2fvTqlA66rPZZUCP11EslbBkUTnUt3TesEt2RgSAaCjayaqX6+aHinoC7wmGcwztFABkxzjBbO3EsQsCTGfU8tomYkAaLpYImXWG4Awl5Hl4yP0V/1ZB+XBBtWQfPDp3Qua+SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rh+zaW5OdyfhzfHfWg/qF2BHGMCgbuAeMW82swuobGI=; b=kjm5DiZsLWqDwoPMJD4G1d5T4G85QHySV40wWRtS4yniovA0SuPAWMhFuBdzibV7/uL/nA41br8pVZMMrZyOqkUUt6U5+xXkPcvJjNkAhRxXe6vyAAir9lkkGpsXdBNwWFZ360m8JSt787mEnxVjKJsy+bldnLobtMHv2XfnPuttW9gBSY8/z3ucvA8V/1mJBN74u0tjiuJq/UkrG7X27tkcZQbu9Ks4V4LpMziG19ttHZ416QN9t5oBrNcoG/3i7tGfP+uY61ZIxZQtFV9NIQAbszJRKc/3b5ASTGFI7QDCZQ6n/yQuSWgEM3vsaSedfK0aLWnoUUNqZxGW4+5I9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=invensense.com; dmarc=pass action=none header.from=invensense.com; dkim=pass header.d=invensense.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=invensense.onmicrosoft.com; s=selector2-invensense-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rh+zaW5OdyfhzfHfWg/qF2BHGMCgbuAeMW82swuobGI=; b=A0YQk2hnR8cHkVlwm3lx1ayqW+uvfiFSLCcqX6ILUKVG9go3vPtzmsbxaFEom0B5iBSdxcHDp2ECY5JctQbg85kIEGFVGFGO4tIFDKKw6Q8d7sMkhk3ThNJ3x3AbGIVjGVyGMl59Bk4ytza1CJFAI8+898RZXapuAsA7CkH+xwA= Received: from MN2PR12MB3373.namprd12.prod.outlook.com (20.178.242.33) by MN2PR12MB4048.namprd12.prod.outlook.com (52.135.49.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Mon, 20 Jan 2020 09:37:09 +0000 Received: from MN2PR12MB3373.namprd12.prod.outlook.com ([fe80::4028:892b:b405:59fa]) by MN2PR12MB3373.namprd12.prod.outlook.com ([fe80::4028:892b:b405:59fa%6]) with mapi id 15.20.2644.024; Mon, 20 Jan 2020 09:37:09 +0000 From: Jean-Baptiste Maneyrol To: Jonathan Cameron , linux-iio@vger.kernel.org, devicetree@vger.kernel.org Cc: Rob Herring , Mark Rutland , Jean-Baptiste Maneyrol Subject: [PATCH 9/9] iio: imu: inv_mpu6050: fix LPF bandwidth setting Date: Mon, 20 Jan 2020 10:36:20 +0100 Message-Id: <20200120093620.9681-10-jmaneyrol@invensense.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200120093620.9681-1-jmaneyrol@invensense.com> References: <20200120093620.9681-1-jmaneyrol@invensense.com> X-ClientProxiedBy: LO2P265CA0146.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::14) To MN2PR12MB3373.namprd12.prod.outlook.com (2603:10b6:208:c8::33) MIME-Version: 1.0 Received: from frgnb-12nlpn2.invcorp.invensense.com (77.157.193.39) by LO2P265CA0146.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Mon, 20 Jan 2020 09:37:06 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [77.157.193.39] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9645199c-f30f-4133-6994-08d79d8c51a6 X-MS-TrafficTypeDiagnostic: MN2PR12MB4048: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-Forefront-PRVS: 0288CD37D9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(396003)(39840400004)(376002)(136003)(366004)(189003)(199004)(66946007)(66476007)(66556008)(7696005)(52116002)(86362001)(36756003)(107886003)(5660300002)(6666004)(2906002)(8676002)(81166006)(186003)(81156014)(54906003)(1076003)(8936002)(478600001)(4326008)(16526019)(316002)(956004)(2616005)(26005)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR12MB4048; H:MN2PR12MB3373.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: invensense.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P17dr1aUavZcG3iaRTeH9Ew4beG27F1Va8pvp0KTwJKpKudSajfal43Pacn+ca9+Jpo3nMFJ/ZgJyfYM6PH6lKxumt/U5XdgxXEFRyro6aPHqIUQG6LIfSGZyAy58q0OF17UReTsKxOspkBl64aMQa3m1Cv5tWUbxh9TU4KM1OPvOAGtAUyh3DKuzE/j06Qeudjh26W5FooCX24EbczoSvQvBZt1Me2RWA19sN3MASrc/34JCQZhvoEujA3hDiVTH9iWN94SFKO4kduEOb01JIjXiJRtIoHaMJfaXqaLuFxjj/XbQff3o95tlrrassh4Q8qCJDbpQ8maQH8ZCaCIBt9mbQvAaW+PJY9kRvR6PjAJF1wcsTH/m1a6qvjbEW7eBlhThZPKiNLtKBUi12TyMwYSih5JcPKaepjL22BTNKud77cYYbniLWpIi9KDMAG1 X-OriginatorOrg: invensense.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9645199c-f30f-4133-6994-08d79d8c51a6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2020 09:37:08.9835 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 462b3b3b-e42b-47ea-801a-f1581aac892d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DILJM+ag6JV905LRKR7vAY8W7xp7Mb8rUgvi49hyICny211zlF/GqHpZhlXU9pCBObWNzrdBtV9WTIfFHKinhlGaqeO7QkjqV8iRzadq4c8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4048 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-01-20_01:2020-01-16,2020-01-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 bulkscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 suspectscore=0 impostorscore=0 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001200083 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org As every chip has some little variant in LPF bandwidth values, use common values that are working for all chips. Simplify the LPF setting function. Signed-off-by: Jean-Baptiste Maneyrol --- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 30 ++++++++++++---------- drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 10 ++++---- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index 9ecc667debbe..c4db9086775c 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -707,30 +707,32 @@ static int inv_mpu6050_write_raw(struct iio_dev *indio_dev, /** * inv_mpu6050_set_lpf() - set low pass filer based on fifo rate. * - * Based on the Nyquist principle, the sampling rate must - * exceed twice of the bandwidth of the signal, or there - * would be alising. This function basically search for the - * correct low pass parameters based on the fifo rate, e.g, - * sampling frequency. + * Based on the Nyquist principle, the bandwidth of the low + * pass filter must not exceed the signal sampling rate divided + * by 2, or there would be aliasing. + * This function basically search for the correct low pass + * parameters based on the fifo rate, e.g, sampling frequency. * * lpf is set automatically when setting sampling rate to avoid any aliases. */ static int inv_mpu6050_set_lpf(struct inv_mpu6050_state *st, int rate) { - static const int hz[] = {188, 98, 42, 20, 10, 5}; + static const int hz[] = {400, 200, 90, 40, 20, 10}; static const int d[] = { - INV_MPU6050_FILTER_188HZ, INV_MPU6050_FILTER_98HZ, - INV_MPU6050_FILTER_42HZ, INV_MPU6050_FILTER_20HZ, + INV_MPU6050_FILTER_200HZ, INV_MPU6050_FILTER_100HZ, + INV_MPU6050_FILTER_45HZ, INV_MPU6050_FILTER_20HZ, INV_MPU6050_FILTER_10HZ, INV_MPU6050_FILTER_5HZ }; - int i, h, result; + int i, result; u8 data; - h = (rate >> 1); - i = 0; - while ((h < hz[i]) && (i < ARRAY_SIZE(d) - 1)) - i++; - data = d[i]; + data = INV_MPU6050_FILTER_5HZ; + for (i = 0; i < ARRAY_SIZE(hz); ++i) { + if (rate >= hz[i]) { + data = d[i]; + break; + } + } result = inv_mpu6050_set_lpf_regs(st, data); if (result) return result; diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h index 7ae614052210..9a81098a8b4d 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h @@ -370,14 +370,14 @@ enum inv_mpu6050_scan { }; enum inv_mpu6050_filter_e { - INV_MPU6050_FILTER_256HZ_NOLPF2 = 0, - INV_MPU6050_FILTER_188HZ, - INV_MPU6050_FILTER_98HZ, - INV_MPU6050_FILTER_42HZ, + INV_MPU6050_FILTER_NOLPF2 = 0, + INV_MPU6050_FILTER_200HZ, + INV_MPU6050_FILTER_100HZ, + INV_MPU6050_FILTER_45HZ, INV_MPU6050_FILTER_20HZ, INV_MPU6050_FILTER_10HZ, INV_MPU6050_FILTER_5HZ, - INV_MPU6050_FILTER_2100HZ_NOLPF, + INV_MPU6050_FILTER_NOLPF, NUM_MPU6050_FILTER };