From patchwork Thu Feb 6 10:31:00 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: 11368139 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B90A1398 for ; Thu, 6 Feb 2020 10:46:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 650CA21741 for ; Thu, 6 Feb 2020 10:46:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=invensense.com header.i=@invensense.com header.b="IpS8NpDc"; dkim=pass (1024-bit key) header.d=invensense.onmicrosoft.com header.i=@invensense.onmicrosoft.com header.b="kzl9nomj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728104AbgBFKqE (ORCPT ); Thu, 6 Feb 2020 05:46:04 -0500 Received: from mx0b-00328301.pphosted.com ([148.163.141.47]:11984 "EHLO mx0b-00328301.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726365AbgBFKqD (ORCPT ); Thu, 6 Feb 2020 05:46:03 -0500 X-Greylist: delayed 826 seconds by postgrey-1.27 at vger.kernel.org; Thu, 06 Feb 2020 05:46:01 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 016AWAJ5004840; Thu, 6 Feb 2020 02:32:11 -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=tjxnrRPjQ+A7GFLcsxMiyglUVkEQEcTyrM/9R+a8q0Q=; b=IpS8NpDcgIxUXYrzDlZVM+JDQgvec+YeytMSsHoiIq190VwCi12dft9uQ04DXupKOIL6 1QCQ5V9Hq0GyBYC3kHvV/4PvTAcBT6OcOGV5sLluQYneY0rzBcDgLxl18cZizMI4XcJD HuGxknK4sxX//1GdUs8jkjY/7qB0lTwcTeQOOxWKWgqlr6WBScwgLm+pX2kleZ20Uf8l GaywlyMiKSPskWS9EychW0c3hwLDGe5bOHKUvBmrSb3QjHSwkX7SKCZOY4HJf/u4dNTN yW9F8yMb0GCr6VeinqkfpQk/OfIVWjdg9/hs+XLOXpscsmi7A9l7WKlwjnwIyPAeKwxl uA== Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2108.outbound.protection.outlook.com [104.47.70.108]) by mx0b-00328301.pphosted.com with ESMTP id 2y0e4sg2cj-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Feb 2020 02:32:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nFUoi9lxeJi5sjYvLW40GQfQiZUJSDRJH894r0y14VIcMarZDKlZ5b84rSX+G/5Vs+K4BhUrf6zakNIY7gjSVHSXvBk0SoEHeAiZuj+I+WWQl7mfKlWMA9M8thvfzYCDnQaA4JAi+/c4CZIKfIgDN9djcFBPeu1K2aNJLC3/a71UylQlobfxx40pZTBs++w3OUG3IcvpouYgco1oRbmA9psLZkrps1LTuH1Cqb+SkmcpHy+IjIkgzrdFkzTr4Tew/0kYMrbtEe3+vXKs/JZPV6HRrYzJk7Frgyj/SgTZK/PQ2Qcy5AppVS140azdQUDdks+gegBEIEqDlNLHpCj6TA== 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=tjxnrRPjQ+A7GFLcsxMiyglUVkEQEcTyrM/9R+a8q0Q=; b=Sbfhymel8bbtiYsAOdR7myuJ3GLFuhqhjVuiXjjbaW0/MWrplJL/FR1S7N9fhjFpRJf3yACO56Q6/X7xhk3e4dIk26fnB9kle46IKjeRXeIKKvXV+l0ODpyKrIUPzX8KvyRbJ0NfN8MwPwXtn2KTj4j231tiMQcWpY81vdPdfCjN5/5Oz0wKY/QoRW3weexAJefKIxvYm8dh6l07wmfyMJQ+GbNROrgf59eSjzRG4uCr/aQVJk3Ih1N9yPa85kJMz2F+fNZrfmnPkMeVjlOHpVXQvGqjLjsqeHroIO/9DxaSH7CVMDZ2MLDCE8vhkJEEg/+UwwK6KpmeCJykk84uDA== 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=tjxnrRPjQ+A7GFLcsxMiyglUVkEQEcTyrM/9R+a8q0Q=; b=kzl9nomjA3+kbzKX5e/dMioOiTHMrOm8nPLEyPgqciznU4/hTpY3zPU3dqZ/F/guEJAqxtsymMUatIvCpB0Z7uyFmAHI9miafFhFqsxMfoNwsxwzKCHCTqN5BewmyO+Ts+Jmr/KquuXNPxfbQx3xhi/OgoHiiHXQVL0Zn9KQR+g= Received: from CH2PR12MB4181.namprd12.prod.outlook.com (20.180.6.144) by CH2PR12MB4085.namprd12.prod.outlook.com (20.180.16.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21; Thu, 6 Feb 2020 10:32:09 +0000 Received: from CH2PR12MB4181.namprd12.prod.outlook.com ([fe80::c057:8a13:530a:4340]) by CH2PR12MB4181.namprd12.prod.outlook.com ([fe80::c057:8a13:530a:4340%5]) with mapi id 15.20.2707.023; Thu, 6 Feb 2020 10:32: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 v2 1/6] iio: imu: inv_mpu6050: cleanup of/acpi support Date: Thu, 6 Feb 2020 11:31:00 +0100 Message-Id: <20200206103105.23666-2-jmaneyrol@invensense.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200206103105.23666-1-jmaneyrol@invensense.com> References: <20200206103105.23666-1-jmaneyrol@invensense.com> X-ClientProxiedBy: LO2P265CA0334.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::34) To CH2PR12MB4181.namprd12.prod.outlook.com (2603:10b6:610:a8::16) MIME-Version: 1.0 Received: from frgnb-12nlpn2.invcorp.invensense.com (77.157.193.39) by LO2P265CA0334.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21 via Frontend Transport; Thu, 6 Feb 2020 10:32:07 +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: d91429e7-1ecb-47b7-629c-08d7aaefd1ad X-MS-TrafficTypeDiagnostic: CH2PR12MB4085: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-Forefront-PRVS: 0305463112 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(39850400004)(396003)(366004)(136003)(376002)(199004)(189003)(478600001)(2616005)(956004)(86362001)(2906002)(26005)(5660300002)(186003)(16526019)(107886003)(6666004)(6486002)(1076003)(81156014)(8676002)(81166006)(4326008)(8936002)(36756003)(54906003)(52116002)(66476007)(316002)(66946007)(66556008)(7696005);DIR:OUT;SFP:1101;SCL:1;SRVR:CH2PR12MB4085;H:CH2PR12MB4181.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: JQYBeoOj5kFM7H9/IeIg2ELCuu2//0k1F07yJMHVohAE0iyruuouPPH4rYo+9/vG0aN6WO4FcvEmJe+06YoEStpRwYVhTipefcqaKri6QJ/Q/CHLOHL61s23OZPxzZRmv6NNVth1H+AvxYjJYzSh7RfB2jPdfdHhsORYoLIkTnQLfW49D9rs+NsZ00g9qMmw722UcUCumcW50NwOtFb7ktaO+qVO5aod6vgWJj6BCYnLEhdP7YcHg5757ZjONrCUh9N5BvvfbqSHGyAPGdrP3OdUJOHmayGUGKUu678yprNw9TYo8zmR1G2HfEM62k6hhhvuqhhQEpyyZDvafg6p9NGZv5b/3DpZKPD8hFSIA4XmKuGTK7GohReX4Vr7Kcq/kbHlJzBT2MIQRJKdbA8AYWP1BW6Sx1fOiU8A3wN/j8ZPZLYbfGyk89iTnL/FCYrg X-MS-Exchange-AntiSpam-MessageData: 6w1zWi8RKMJreeffSUAfZ0NgvCeLm/AzcgQYOifRAZLunnPO8wrsgrRH7viO7OStFO4la/9FzcqrHvlxdrl/1LWNofeb0TIk+PKuANzU1lRFKEUgcon2ANk41MjkxA+uHd9nB7l2BF0nNuVjjQ4NAg== X-OriginatorOrg: invensense.com X-MS-Exchange-CrossTenant-Network-Message-Id: d91429e7-1ecb-47b7-629c-08d7aaefd1ad X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2020 10:32:08.9952 (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: rTz+9yBRdp1vZnErg4ZJ60XtNo0bevytF+5+dBNPMqKCcQ9aXYPGxftMGGTlhTfNNPgmOuOokqzMf+57bDNQdQAXSo4nK2UZCWtbeikTLSw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4085 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-06_01:2020-02-06,2020-02-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 phishscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002060081 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Use device_get_match_data for using of and acpi tables. In spi support add missing mpu6515 and 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_i2c.c | 26 +++----------- drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 44 +++++++++++++++++++++-- 3 files changed, 50 insertions(+), 28 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_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c index f47a28b4be23..49e9aa777ba4 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "inv_mpu_iio.h" static const struct regmap_config inv_mpu_regmap_config = { @@ -54,20 +55,6 @@ static int inv_mpu6050_deselect_bypass(struct i2c_mux_core *muxc, u32 chan_id) return 0; } -static const char *inv_mpu_match_acpi_device(struct device *dev, - enum inv_devices *chip_id) -{ - const struct acpi_device_id *id; - - id = acpi_match_device(dev->driver->acpi_match_table, dev); - if (!id) - return NULL; - - *chip_id = (int)id->driver_data; - - return dev_name(dev); -} - static bool inv_mpu_i2c_aux_bus(struct device *dev) { struct inv_mpu6050_state *st = iio_priv(dev_get_drvdata(dev)); @@ -130,6 +117,7 @@ static int inv_mpu_magn_disable(struct iio_dev *indio_dev) static int inv_mpu_probe(struct i2c_client *client, const struct i2c_device_id *id) { + const void *match; struct inv_mpu6050_state *st; int result; enum inv_devices chip_type; @@ -140,18 +128,14 @@ static int inv_mpu_probe(struct i2c_client *client, I2C_FUNC_SMBUS_I2C_BLOCK)) return -EOPNOTSUPP; - if (client->dev.of_node) { - chip_type = (enum inv_devices) - of_device_get_match_data(&client->dev); + match = device_get_match_data(&client->dev); + if (match) { + chip_type = (enum inv_devices)match; name = client->name; } else if (id) { chip_type = (enum inv_devices) id->driver_data; name = id->name; - } else if (ACPI_HANDLE(&client->dev)) { - name = inv_mpu_match_acpi_device(&client->dev, &chip_type); - if (!name) - return -ENODEV; } else { return -ENOSYS; } diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c index ec102d5a5c77..834bfa8e8684 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c @@ -4,6 +4,8 @@ */ #include #include +#include +#include #include #include #include @@ -41,17 +43,18 @@ static int inv_mpu_i2c_disable(struct iio_dev *indio_dev) static int inv_mpu_probe(struct spi_device *spi) { + const void *match; struct regmap *regmap; const struct spi_device_id *spi_id; - const struct acpi_device_id *acpi_id; const char *name = NULL; enum inv_devices chip_type; if ((spi_id = spi_get_device_id(spi))) { chip_type = (enum inv_devices)spi_id->driver_data; name = spi_id->name; - } else if ((acpi_id = acpi_match_device(spi->dev.driver->acpi_match_table, &spi->dev))) { - chip_type = (enum inv_devices)acpi_id->driver_data; + } else if ((match = device_get_match_data(&spi->dev))) { + chip_type = (enum inv_devices)match; + name = dev_name(&spi->dev); } else { return -ENODEV; } @@ -74,6 +77,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 +87,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 +130,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 Thu Feb 6 10:31:01 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: 11368135 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62A7913A4 for ; Thu, 6 Feb 2020 10:46:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 25242214AF for ; Thu, 6 Feb 2020 10:46:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=invensense.com header.i=@invensense.com header.b="mS+75NEF"; dkim=pass (1024-bit key) header.d=invensense.onmicrosoft.com header.i=@invensense.onmicrosoft.com header.b="fkQfqfqT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728000AbgBFKqD (ORCPT ); Thu, 6 Feb 2020 05:46:03 -0500 Received: from mx0b-00328301.pphosted.com ([148.163.141.47]:11980 "EHLO mx0b-00328301.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727795AbgBFKqD (ORCPT ); Thu, 6 Feb 2020 05:46:03 -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 016AWAJ6004840; Thu, 6 Feb 2020 02:32:11 -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=fMujg3wtOusTzDXf8SvP5S50c2HsD7aK60QJvPr4Tjk=; b=mS+75NEFwIZT8pmKYwYTkkj1/dRQCBc1HXLLx9t9gbX1jqZGbxA2y4cLHxHk5YMCRw68 zoOMrPFjt3Qt9SkEy963JMAura0G3nZ3LqBReBxUx+XCahtib6kssSWEdkXaDZzWgI+k VsA5jCTfJzj++Z+nIzpH3+cE7J1VSNhdhJNwJLMf9jl18Gu4FING5hGxQVIRSiQBzcI/ UH0nF/qVQnzm29kJfjsVItdl+XDsOTMMLCrtG4Zqtv7+vEhjNoGgCw03hq4R8btaM/+L imzWhErLm6qrnpZ3jw2rVvPmFGqLswNOoavtHpWAkI8NwtM0eOd4sdVfwm5TFHNtRIPT LQ== Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2108.outbound.protection.outlook.com [104.47.70.108]) by mx0b-00328301.pphosted.com with ESMTP id 2y0e4sg2cj-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Feb 2020 02:32:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P4+xj1JcWV7WNYZ3DLtW2jLrHgCtM9gox2OB4B5cUbqQg3W/XWP0aHlznJZIpNtRckQBgreZvEs3L+ztEI0g6qN5+fPcAb+CKJQVdT3eK/NcIHBN++dgfnE/xzLy58R7zVUSRqMQq7DKcRLLIMIt0xOmXLh+mkdUdaOmDcIaQ5PjzVSz4WPG6fO2X7d5TWnKn8B1Nwau7/Z4wp4iI0GWTSXskh6iz6MNYhn1TTTlZwCkKyd0b48aBs4DdEUvMIzQMQ4eiSyy0Lm8/vt/68Ie+hjJF96fO6ffnXeYDowO0antf2X0PepLAfgLIFQbrvrWjpFoHW5599MwEHH2AMt7aA== 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=fMujg3wtOusTzDXf8SvP5S50c2HsD7aK60QJvPr4Tjk=; b=Aa8RVLs6k7sGT6BBZieBorfnjatxdF7IQ39DhHqv78sDG6rED2vW56xNPbKNZUdYvMJ0ApqtDIQVnAJBhtCg4+82793DZITDfdJShD+RkvyAwT48bc0Kv5PzIo8OZBuE7sr82Z7g6gJRqqi/UTo4r16+0CItims8oqWJ/K5pA1UBAEbZG6UKTziE5CEbyOSRn/dX4Pj48HaHAT4CvWspk9bK84vxfRsOXcGJx+LkVswL31WegQgnul7UIcXaSX7azaOtvvt6TW38gcoODnyp2DwXM8AGg0Obi5lhq6k9UNmT3rUGbQydZx/6kDxJp58Q0RIPYNE5ehOPK4nKg6cKWw== 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=fMujg3wtOusTzDXf8SvP5S50c2HsD7aK60QJvPr4Tjk=; b=fkQfqfqTmGHWsnHqZewXNDNWY25NHQYVMrwM33mL/3PFYunoHEV8V898yVpH88YM6/LBEyIKUdDGISOKI2abtWlHByGVrE++hzlsphNKCEkhmnNuqV738CfNONHea2w74gsEuKOFK5EV5pkHPjcq6kHb9Jui81McJPxOpR0PW6I= Received: from CH2PR12MB4181.namprd12.prod.outlook.com (20.180.6.144) by CH2PR12MB4085.namprd12.prod.outlook.com (20.180.16.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21; Thu, 6 Feb 2020 10:32:10 +0000 Received: from CH2PR12MB4181.namprd12.prod.outlook.com ([fe80::c057:8a13:530a:4340]) by CH2PR12MB4181.namprd12.prod.outlook.com ([fe80::c057:8a13:530a:4340%5]) with mapi id 15.20.2707.023; Thu, 6 Feb 2020 10:32:10 +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 v2 2/6] iio: imu: inv_mpu6050: add support of ICM20609 & ICM20689 Date: Thu, 6 Feb 2020 11:31:01 +0100 Message-Id: <20200206103105.23666-3-jmaneyrol@invensense.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200206103105.23666-1-jmaneyrol@invensense.com> References: <20200206103105.23666-1-jmaneyrol@invensense.com> X-ClientProxiedBy: LO2P265CA0334.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::34) To CH2PR12MB4181.namprd12.prod.outlook.com (2603:10b6:610:a8::16) MIME-Version: 1.0 Received: from frgnb-12nlpn2.invcorp.invensense.com (77.157.193.39) by LO2P265CA0334.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21 via Frontend Transport; Thu, 6 Feb 2020 10:32:09 +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: 29ab2fc4-0922-4b00-c147-08d7aaefd28a X-MS-TrafficTypeDiagnostic: CH2PR12MB4085: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 0305463112 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(39850400004)(396003)(366004)(136003)(376002)(199004)(189003)(478600001)(2616005)(956004)(86362001)(2906002)(26005)(5660300002)(186003)(16526019)(107886003)(6666004)(6486002)(1076003)(81156014)(8676002)(81166006)(4326008)(8936002)(36756003)(54906003)(52116002)(66476007)(316002)(66946007)(66556008)(7696005);DIR:OUT;SFP:1101;SCL:1;SRVR:CH2PR12MB4085;H:CH2PR12MB4181.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: lGLMcjwuNb1CG7HTVjr9eXvDEwDb0i4aXnPAwGH7lqGzj22OpKNfRH6yIZjg+D8MxjAEJG4ex13Cx2DCgHCRLXF3zguB/qrTvj9/Y1PcwsesX/XKVZQOy0zgcTKC6gfTZlf9FpIezeRDA3iPDwb+aW7N0VHmNamgkNMVNiwzxAQpBJghdOCYrtT8+O3uKZH8hN8vdCtMZtt2cf8Sk7mO3P5KGIzw1NPPVSivfzdTAUzr0zIIjKmjWapu75EdpyaZ93oQRB5fQEKRt5q+QH07G2rdigias0GWmfa+t1Jq7gcN1lUraEeLwja2ISbgAYohdSRU/h/3w3LeiQxId12YSV70SQWkdHgFXBVtyg76dH2BgVwPRXSHfYJdSMvZnDlriuWX3amEZWg2N53/mR+HR397zy/yQUodqE9PLIEJrmielpccA1OD5pDiF3QuGkjm X-MS-Exchange-AntiSpam-MessageData: p46MDQ6hlbe7U3hIewk8qDmivf2Nl/kPzuN54mRmHsEwG0XG3yR26A5TBdsT0KWyZV/PHNXIsbyOmfTY2rjFdF/rUvc8X50SF/Ug2orp5SBBziCYlxaF+rFkOuiYSQlP7j2QuIkVxhBDMXdICXBKDg== X-OriginatorOrg: invensense.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29ab2fc4-0922-4b00-c147-08d7aaefd28a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2020 10:32:10.4032 (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: rjZ6D7K4YZbK38dEszx2l3ueyR2rjxit76ciDzX3iaY1bSqFzaaM+hIV+1+JGM7OecVePYZ+pgo6+Elz6iiBQHZcvGwFk49uyWksooCHl3E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4085 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-06_01:2020-02-06,2020-02-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 phishscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002060081 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@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 49e9aa777ba4..dd054e21216a 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c @@ -61,6 +61,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; @@ -202,6 +204,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}, {} }; @@ -237,6 +241,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 834bfa8e8684..3803c40e7b24 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c @@ -81,6 +81,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}, {} }; @@ -112,6 +114,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 Thu Feb 6 10:31:02 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: 11368141 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D303413A4 for ; Thu, 6 Feb 2020 10:46:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A92BB214AF for ; Thu, 6 Feb 2020 10:46:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=invensense.com header.i=@invensense.com header.b="FFUxGfu1"; dkim=pass (1024-bit key) header.d=invensense.onmicrosoft.com header.i=@invensense.onmicrosoft.com header.b="SzqdV6JS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726365AbgBFKqE (ORCPT ); Thu, 6 Feb 2020 05:46:04 -0500 Received: from mx0b-00328301.pphosted.com ([148.163.141.47]:11966 "EHLO mx0b-00328301.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727806AbgBFKqD (ORCPT ); Thu, 6 Feb 2020 05:46:03 -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 016AWDf7004857; Thu, 6 Feb 2020 02:32:13 -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=x0dtKWMKOs0kliJ5jJrcKtZrPyTzlkl2yeAs7Yxhwrc=; b=FFUxGfu1otRIUnhHW5xRfEQenozbO6wxExDwMt1bvb7GHA0xlUkWGl6W6WnWXz2KIDH0 g8zhv/nnuB8XpeQ/kLqgL1qNlZGs/P/7+xCManHsKRiNngULdOeKmRbxxQ10p65qDPkQ tEF9A657BdOTbNTV9+8bE0FIf1jQGLLqCoIpxK7akdH5BEwzU8akf0IGMr0+q6183+QX xfF7acxfAA4x+cJESy3+2ylUlDe4lo+yMxs6+MvwMQlTw8MHH4cP1VDqplP5s/8e8Dp1 tlJjXv9xeIVRvmi6zVrDzyiKlxkLd/VKw7MrvuV4zIVrQCNW30M8sneiq3MbsfbvUIq9 5Q== Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2104.outbound.protection.outlook.com [104.47.70.104]) by mx0b-00328301.pphosted.com with ESMTP id 2y0e4sg2ck-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Feb 2020 02:32:13 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i8oj4t7pxtadPQGKEq0qu+rEC8tB8G/jmexZcdYVEXBAjDUO6t14KT/bAA2JbJ8COP6TouMQEubPi2X8zrGZOg+K/IZr2U58iiFuxnHJUB7Fn+Vy1trKxvg+vjHme6B2DZkDl/l4SsWyTqAttVEcLzPCxxKEjKGoGCvsNza+QWirS/O8BTLnbKAtQhS2DljdYn3jiJSzm2jdodSefvhlrF6eypCQGMVYe/R3WPz5N/TzF3lAWrx5H49kDWzKe3EXFEZWT1EEgmnEoLRTrTwumPVEYOifBQ43VWCpzHtrs0Fg/P4GfdpB+eInp0vYbIisFZTUwKPcZZhc60RSY6ybFA== 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=x0dtKWMKOs0kliJ5jJrcKtZrPyTzlkl2yeAs7Yxhwrc=; b=ZW+WdZ/mMdjZHlkYdZipNPcbCSJSgp6ljnlh6M3DHR1guG6bjAkDCQ+42+aPAZCa1qisauh0bISSsc4uA20ZEA+K9sIgd53zagWe92pg1L6C1kob2Ta39Hr3xZw0oEQCZvjvaxRDdn2DKmXyswIqfiqtG9mhjFgZyO6mYTYAda8F7ip+YQzraRqbMWqqH7ZeDHuCAyl+FPvH6MNXYiIQVntJEa+DaGbIqLCgeTBOMhh2Onr+mmlEkw/YyXfler26z7otWmzT6XZwQYwWsMO/aEbSwdOnwXPJMTapx9oCylqMWNA/QehIBpqapNmSw2lOxT4+ng3ENQNoh793MaKW1w== 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=x0dtKWMKOs0kliJ5jJrcKtZrPyTzlkl2yeAs7Yxhwrc=; b=SzqdV6JSaV8hXv6rYVfFvNdZxEtTKrtLVW5P8EgCNTuHx7iHkIe+fWrUqcV5YnaH0tnt/DhSwNpK2Z9O+m9LPwpEEBSbJlQ+N4+R6oVIab1OjkUSpEHR559AA4qGDMN70+hX2EKCUsRD4PhLfwsCxaBMzfHpAVo8CuESErVg+c4= Received: from CH2PR12MB4181.namprd12.prod.outlook.com (20.180.6.144) by CH2PR12MB4085.namprd12.prod.outlook.com (20.180.16.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21; Thu, 6 Feb 2020 10:32:11 +0000 Received: from CH2PR12MB4181.namprd12.prod.outlook.com ([fe80::c057:8a13:530a:4340]) by CH2PR12MB4181.namprd12.prod.outlook.com ([fe80::c057:8a13:530a:4340%5]) with mapi id 15.20.2707.023; Thu, 6 Feb 2020 10:32:11 +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 v2 3/6] iio: imu: inv_mpu6050: add support of IAM20680 Date: Thu, 6 Feb 2020 11:31:02 +0100 Message-Id: <20200206103105.23666-4-jmaneyrol@invensense.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200206103105.23666-1-jmaneyrol@invensense.com> References: <20200206103105.23666-1-jmaneyrol@invensense.com> X-ClientProxiedBy: LO2P265CA0334.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::34) To CH2PR12MB4181.namprd12.prod.outlook.com (2603:10b6:610:a8::16) MIME-Version: 1.0 Received: from frgnb-12nlpn2.invcorp.invensense.com (77.157.193.39) by LO2P265CA0334.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21 via Frontend Transport; Thu, 6 Feb 2020 10:32:10 +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: c7cf045b-9eb5-4f68-b469-08d7aaefd35e X-MS-TrafficTypeDiagnostic: CH2PR12MB4085: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 0305463112 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(39850400004)(396003)(366004)(136003)(376002)(199004)(189003)(478600001)(2616005)(956004)(86362001)(2906002)(26005)(5660300002)(186003)(16526019)(107886003)(6666004)(6486002)(1076003)(81156014)(8676002)(81166006)(4326008)(8936002)(36756003)(54906003)(52116002)(66476007)(316002)(66946007)(66556008)(7696005);DIR:OUT;SFP:1101;SCL:1;SRVR:CH2PR12MB4085;H:CH2PR12MB4181.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: uysBejAcXcFwreW/6h5JtrIonoe4DOrsAHmIZ3mgf0Cz3gOPQv91ItujUoVF26qDKlnMd7egH1Rht+/QZYLcKFTRa1u7VqXHNFQj87olkYgRINHmD4Gz0YuIZcy5eBbjq7CUPrtgrPlBFB+w2n2HUP331FNYwsfOGMT7yIMHqJjiwyG+omov2bAlI57qxgp/MG0W7X3hA4m+b9vX930fp8pNVZGj/D3HB7eCgSyjcC2MC6VP0YrMu0o34AWYq9UJSIYQFeQGsmiDT0/JT/KHBYCgExO3D64Petg0qhgkjB+fQthlVdGReOJychV6huYL2AGAERrMqXKYuIWbsSSNapEI3c7xRNOyutlaK1B8JFX/yQ6mrWyLuJSxj4L0xTKi8J0qrushWXNgzRosbwJP6+Hmjfl8WctrE3wN2jez5r466Po8rKZ1Y1yN1uOWdsKS X-MS-Exchange-AntiSpam-MessageData: Mr6Aj2W8pv8Ko0VU/3YoxWhfLmFUwkD2EBOcZuW3V4A34SmpNpObrwb4rTmH7d3AcqIl2AfYyyoJ0Mfzij/pO950PtJ7CvDbwbW5+0aq1inS+P7huftm/GIIT3NSfUTWE4qr3GjaT7lT+9AsEbz5bw== X-OriginatorOrg: invensense.com X-MS-Exchange-CrossTenant-Network-Message-Id: c7cf045b-9eb5-4f68-b469-08d7aaefd35e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2020 10:32:11.8161 (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: syjBr5t/FFM1DatJ5I3FcghbsLoBXA40fd7o5RLYI2UvmhmzhAp3DEOLcBDLIi0DUVVrICkCe5dTS6iXBqkj8311nsTKaJGTifH4NVgjOWQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4085 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-06_01:2020-02-06,2020-02-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 phishscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002060081 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Automotive certified IMU, similar to ICM20608. Signed-off-by: Jean-Baptiste Maneyrol --- drivers/iio/imu/inv_mpu6050/Kconfig | 4 ++-- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 8 ++++++++ drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | 6 ++++++ drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 2 ++ drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 5 +++++ 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/iio/imu/inv_mpu6050/Kconfig b/drivers/iio/imu/inv_mpu6050/Kconfig index e933db3a5a89..e65474a64675 100644 --- a/drivers/iio/imu/inv_mpu6050/Kconfig +++ b/drivers/iio/imu/inv_mpu6050/Kconfig @@ -16,7 +16,7 @@ config INV_MPU6050_I2C select REGMAP_I2C help This driver supports the Invensense MPU6050/9150, - MPU6500/6515/9250/9255, ICM20608/20609/20689 and ICM20602 + MPU6500/6515/9250/9255, ICM20608/20609/20689, ICM20602 and IAM20680 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/20609/20689 and ICM20602 + MPU6500/6515/9250/9255, ICM20608/20609/20689, ICM20602 and IAM20680 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 5fd57a1bee90..e8e6beef3f04 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -200,6 +200,14 @@ static const struct inv_mpu6050_hw hw_info[] = { .fifo_size = 1008, .temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE}, }, + { + .whoami = INV_IAM20680_WHOAMI_VALUE, + .name = "IAM20680", + .reg = ®_set_6500, + .config = &chip_config_6050, + .fifo_size = 512, + .temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE}, + }, }; int inv_mpu6050_switch_engine(struct inv_mpu6050_state *st, bool en, u32 mask) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c index dd054e21216a..cd0eeb5dc7f6 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c @@ -64,6 +64,7 @@ static bool inv_mpu_i2c_aux_bus(struct device *dev) case INV_ICM20609: case INV_ICM20689: case INV_ICM20602: + case INV_IAM20680: /* no i2c auxiliary bus on the chip */ return false; case INV_MPU9150: @@ -207,6 +208,7 @@ static const struct i2c_device_id inv_mpu_id[] = { {"icm20609", INV_ICM20609}, {"icm20689", INV_ICM20689}, {"icm20602", INV_ICM20602}, + {"iam20680", INV_IAM20680}, {} }; @@ -253,6 +255,10 @@ static const struct of_device_id inv_of_match[] = { .compatible = "invensense,icm20602", .data = (void *)INV_ICM20602 }, + { + .compatible = "invensense,iam20680", + .data = (void *)INV_IAM20680 + }, { } }; MODULE_DEVICE_TABLE(of, inv_of_match); diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h index 75b8903450eb..404c289f8c84 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h @@ -78,6 +78,7 @@ enum inv_devices { INV_ICM20609, INV_ICM20689, INV_ICM20602, + INV_IAM20680, INV_NUM_PARTS }; @@ -346,6 +347,7 @@ struct inv_mpu6050_state { #define INV_ICM20609_WHOAMI_VALUE 0xA6 #define INV_ICM20689_WHOAMI_VALUE 0x98 #define INV_ICM20602_WHOAMI_VALUE 0x12 +#define INV_IAM20680_WHOAMI_VALUE 0xA9 /* scan element definition for generic MPU6xxx devices */ enum inv_mpu6050_scan { diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c index 3803c40e7b24..393cec555be6 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c @@ -84,6 +84,7 @@ static const struct spi_device_id inv_mpu_id[] = { {"icm20609", INV_ICM20609}, {"icm20689", INV_ICM20689}, {"icm20602", INV_ICM20602}, + {"iam20680", INV_IAM20680}, {} }; @@ -126,6 +127,10 @@ static const struct of_device_id inv_of_match[] = { .compatible = "invensense,icm20602", .data = (void *)INV_ICM20602 }, + { + .compatible = "invensense,iam20680", + .data = (void *)INV_IAM20680 + }, { } }; MODULE_DEVICE_TABLE(of, inv_of_match); From patchwork Thu Feb 6 10:31:03 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: 11368133 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CCA211398 for ; Thu, 6 Feb 2020 10:46:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 932FE214AF for ; Thu, 6 Feb 2020 10:46:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=invensense.com header.i=@invensense.com header.b="n1ZY73rs"; dkim=pass (1024-bit key) header.d=invensense.onmicrosoft.com header.i=@invensense.onmicrosoft.com header.b="ZcQTvKdN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727398AbgBFKqD (ORCPT ); Thu, 6 Feb 2020 05:46:03 -0500 Received: from mx0b-00328301.pphosted.com ([148.163.141.47]:11982 "EHLO mx0b-00328301.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727778AbgBFKqC (ORCPT ); Thu, 6 Feb 2020 05:46:02 -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 016AWDf8004857; Thu, 6 Feb 2020 02:32:14 -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=xUCE5HVGNWcVChFybGfE6IedWcElePYitXKepV1nsm0=; b=n1ZY73rsQx2YMaY4NZd9kSFpOtMVuD6Y5ONHxLiVEex4zu5s+qXTsXOkneVBmXM01QVv t2cNg9xlScQ1daxboPfkZ00tYPZiFVrmgEUMYT+ZOHCUTmkD2UMS5uRFGDfa1X38+v3R weaW8tPQxsfuyNXu/xBw7tKI8R0Kti82oODdgn7Fsh4i/6K2Ud4EDuiVIpeuK/1gs6dF Y/2EoVOopPcF53RoDtVtPvkNVKnMW4rgquIHwYnGLqUWY79YT3HDYcx6Ooe6s8YjWw/+ nd/h5WTxawocW4KG0JWgETzeUb8Z16nlhEAmce3PnUsLFkt21oCVixyhtxtAFTA+xYQD lw== Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2107.outbound.protection.outlook.com [104.47.70.107]) by mx0b-00328301.pphosted.com with ESMTP id 2y0e4sg2cn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Feb 2020 02:32:14 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MDe/clUYeppdbbn59ISCcYuTejvJMdlT8uEhBgZLwPGT71QandbbcDqVo2iPOErvLPBOvCGZnd5Z7M3+2/XbDBaH7He+Ymf7ys9mnV6o76mjLAsJJvgSVeETxCuLp0UPMzxglSEaxPr3m4sH6Na4yIUY7MTNB5Vz70YTdtXhUS+yTNMWnvYPR+6VTVHO7BAy+Whcb1Jj+ypq++r4UY1oExoM0I7KbhDgrip8sWkQSCFQuymaAZdZWjYXMB+ZZZKC8PgPqDtHsUHW6nZ7K4xQbNECrHIwBH5IJ34FQkj8dYa8/Kx03Dw7StO/ZasK4ZGIfjZMHdEvVW/JQ1j2iT+fng== 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=xUCE5HVGNWcVChFybGfE6IedWcElePYitXKepV1nsm0=; b=Js9cY4rnblj5NnvLmx93Rq4kAtV3Ad5UX/6u6AW54WrcKPOpPdYOICn3A+m1/bJTFwOtWCj0wDfcyKC3MJqpFzyUa/CoLZ5Uu9HPnO4bBltKY+4xO+4GvtKkxL5NnI4ubKtkPqSv6rEvhGmbIja6/LypFaonB3mO1aZkOAIymBT8uIai8zOSUqyqhVxlFJu0f2kx6LbYR3a2dsrCCPUhXfR9TFbnG0hu0PjcRBJTMw02FUHmvu783d5AfWikEPR+U09Cn2FIESOSKKkuXFZ4jqUAaxGcpvI/1o2xYjNA6kTdi9cF0K8B8Re0rBhgnl7FRgWwiTRX/qNv4AMdwTDM+g== 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=xUCE5HVGNWcVChFybGfE6IedWcElePYitXKepV1nsm0=; b=ZcQTvKdNjgyfGU8XFfY4EDq31DpxwN6DoGJUa9mjN0PxDYDoRrpiephhKkvXHlRNU4IwmdRsvnSHPidB0FT+QhmT/zVC1vPeJm8E0L9jVvDYjj1dJqzNqSBeixdz+FrEsuauyIsG/dYKumB0YogJLEUy8U79Mn3seXdnFuJwPxw= Received: from CH2PR12MB4181.namprd12.prod.outlook.com (20.180.6.144) by CH2PR12MB4085.namprd12.prod.outlook.com (20.180.16.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21; Thu, 6 Feb 2020 10:32:13 +0000 Received: from CH2PR12MB4181.namprd12.prod.outlook.com ([fe80::c057:8a13:530a:4340]) by CH2PR12MB4181.namprd12.prod.outlook.com ([fe80::c057:8a13:530a:4340%5]) with mapi id 15.20.2707.023; Thu, 6 Feb 2020 10:32:13 +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 v2 4/6] iio: imu: inv_mpu6050: add support of ICM20690 Date: Thu, 6 Feb 2020 11:31:03 +0100 Message-Id: <20200206103105.23666-5-jmaneyrol@invensense.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200206103105.23666-1-jmaneyrol@invensense.com> References: <20200206103105.23666-1-jmaneyrol@invensense.com> X-ClientProxiedBy: LO2P265CA0334.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::34) To CH2PR12MB4181.namprd12.prod.outlook.com (2603:10b6:610:a8::16) MIME-Version: 1.0 Received: from frgnb-12nlpn2.invcorp.invensense.com (77.157.193.39) by LO2P265CA0334.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21 via Frontend Transport; Thu, 6 Feb 2020 10:32:12 +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: 230e20cf-a977-4f4a-364e-08d7aaefd437 X-MS-TrafficTypeDiagnostic: CH2PR12MB4085: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0305463112 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(39850400004)(396003)(366004)(136003)(376002)(199004)(189003)(478600001)(2616005)(956004)(86362001)(2906002)(26005)(5660300002)(186003)(16526019)(107886003)(6666004)(6486002)(1076003)(81156014)(8676002)(81166006)(4326008)(8936002)(36756003)(54906003)(52116002)(66476007)(316002)(66946007)(66556008)(7696005);DIR:OUT;SFP:1101;SCL:1;SRVR:CH2PR12MB4085;H:CH2PR12MB4181.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: lu+FuACfW/CB3uyrzeiC6HwPbY8hRMYg1fsP+UwXhnDyJQ36uIIuzqPUZ3yd0oSNPPqCEoM+SLGh0WQyyDg2vt/GUJjbRr39Ef5xi6/uU8iaSK01Lb+KNfsQumWBHbi78KIl5PKeDApOTLbAQ8JxSC90Glq1e0QLUiTg6x/j7CelCiHFcmPLnzajVbbjRa547TpWJsCuDv+mrqSdxjdJipgLkqTJyTkp1Vp00+e6LZ3+3ujCVZhHVMuuYBsBtPvPYR9ZFUnXpo/bOWH16meCxBmESZIvu3l/vtv5VK4iufqR3d7k5kjW5jBkoA3jiPfqKcG14vVRiShYKJrLOUU5O3koCgy1n8BVOmi4pGoN17Q/r7ZA5pv/cJotqKo+wrK3Oxxq6Whyqe+JZ+BCVz71UMbsv/vPQqiETim5Wy5eH+Z2y8Tw6Y3lb/DeKxE5/3Dp X-MS-Exchange-AntiSpam-MessageData: x9RfXJaXtQ6RyXwMqJlv4gixf4Cek8xYBxfwLT1ONuJl5M6GfmZW8Az+poWWELs5nTd/3aVuxMlIQBp56US3XN7G7qxfIXmZ394eawtTg5DR2Dyn9OTch9Fh6PlO4qvk9iKMsL0jZWoF+b6Kbbw7OA== X-OriginatorOrg: invensense.com X-MS-Exchange-CrossTenant-Network-Message-Id: 230e20cf-a977-4f4a-364e-08d7aaefd437 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2020 10:32:13.2031 (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: 5KoOkCkYUel1ia7kmOhphOluntehvQfu/VwXnR7ATDSxuWrY9d/bWM6WOEj7scmyoQEkDJrpD3BW85KENwIQJeIZQsek5IkPBXzeFU3P4zg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4085 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-06_01:2020-02-06,2020-02-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 phishscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002060081 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Same generation as ICM20602 but different registers. Signed-off-by: Jean-Baptiste Maneyrol --- drivers/iio/imu/inv_mpu6050/Kconfig | 8 ++--- drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 36 +++++++++++++++++++--- drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | 5 +++ drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 3 ++ drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c | 5 +++ 5 files changed, 48 insertions(+), 9 deletions(-) diff --git a/drivers/iio/imu/inv_mpu6050/Kconfig b/drivers/iio/imu/inv_mpu6050/Kconfig index e65474a64675..7137ea6f25db 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/20609/20689, ICM20602 and IAM20680 - motion tracking devices over I2C. + MPU6500/6515/9250/9255, ICM20608/20609/20689, ICM20602/ICM20690 and + IAM20680 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/20609/20689, ICM20602 and IAM20680 - motion tracking devices over SPI. + MPU6500/6515/9250/9255, ICM20608/20609/20689, ICM20602/ICM20690 and + IAM20680 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 e8e6beef3f04..9ecc667debbe 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -200,6 +200,14 @@ static const struct inv_mpu6050_hw hw_info[] = { .fifo_size = 1008, .temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE}, }, + { + .whoami = INV_ICM20690_WHOAMI_VALUE, + .name = "ICM20690", + .reg = ®_set_icm20602, + .config = &chip_config_6050, + .fifo_size = 1024, + .temp = {INV_ICM20608_TEMP_OFFSET, INV_ICM20608_TEMP_SCALE}, + }, { .whoami = INV_IAM20680_WHOAMI_VALUE, .name = "IAM20680", @@ -295,6 +303,25 @@ int inv_mpu6050_set_power_itg(struct inv_mpu6050_state *st, bool power_on) } EXPORT_SYMBOL_GPL(inv_mpu6050_set_power_itg); +static int inv_mpu6050_set_gyro_fsr(struct inv_mpu6050_state *st, + enum inv_mpu6050_fsr_e val) +{ + unsigned int gyro_shift; + u8 data; + + switch (st->chip_type) { + case INV_ICM20690: + gyro_shift = INV_ICM20690_GYRO_CONFIG_FSR_SHIFT; + break; + default: + gyro_shift = INV_MPU6050_GYRO_CONFIG_FSR_SHIFT; + break; + } + + data = val << gyro_shift; + return regmap_write(st->map, st->reg->gyro_config, data); +} + /** * inv_mpu6050_set_lpf_regs() - set low pass filter registers, chip dependent * @@ -318,6 +345,7 @@ static int inv_mpu6050_set_lpf_regs(struct inv_mpu6050_state *st, /* old chips, nothing to do */ return 0; case INV_ICM20689: + case INV_ICM20690: /* set FIFO size to maximum value */ val |= INV_ICM20689_BITS_FIFO_SIZE_MAX; break; @@ -346,8 +374,8 @@ static int inv_mpu6050_init_config(struct iio_dev *indio_dev) result = inv_mpu6050_set_power_itg(st, true); if (result) return result; - d = (INV_MPU6050_FSR_2000DPS << INV_MPU6050_GYRO_CONFIG_FSR_SHIFT); - result = regmap_write(st->map, st->reg->gyro_config, d); + + result = inv_mpu6050_set_gyro_fsr(st, INV_MPU6050_FSR_2000DPS); if (result) goto error_power_off; @@ -559,12 +587,10 @@ inv_mpu6050_read_raw(struct iio_dev *indio_dev, static int inv_mpu6050_write_gyro_scale(struct inv_mpu6050_state *st, int val) { int result, i; - u8 d; for (i = 0; i < ARRAY_SIZE(gyro_scale_6050); ++i) { if (gyro_scale_6050[i] == val) { - d = (i << INV_MPU6050_GYRO_CONFIG_FSR_SHIFT); - result = regmap_write(st->map, st->reg->gyro_config, d); + result = inv_mpu6050_set_gyro_fsr(st, i); if (result) return result; diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c index cd0eeb5dc7f6..1363d3776523 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c @@ -208,6 +208,7 @@ static const struct i2c_device_id inv_mpu_id[] = { {"icm20609", INV_ICM20609}, {"icm20689", INV_ICM20689}, {"icm20602", INV_ICM20602}, + {"icm20690", INV_ICM20690}, {"iam20680", INV_IAM20680}, {} }; @@ -255,6 +256,10 @@ static const struct of_device_id inv_of_match[] = { .compatible = "invensense,icm20602", .data = (void *)INV_ICM20602 }, + { + .compatible = "invensense,icm20690", + .data = (void *)INV_ICM20690 + }, { .compatible = "invensense,iam20680", .data = (void *)INV_IAM20680 diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h index 404c289f8c84..7ae614052210 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h @@ -78,6 +78,7 @@ enum inv_devices { INV_ICM20609, INV_ICM20689, INV_ICM20602, + INV_ICM20690, INV_IAM20680, INV_NUM_PARTS }; @@ -297,6 +298,7 @@ struct inv_mpu6050_state { #define INV_MPU6050_MAX_ACCL_FS_PARAM 3 #define INV_MPU6050_THREE_AXIS 3 #define INV_MPU6050_GYRO_CONFIG_FSR_SHIFT 3 +#define INV_ICM20690_GYRO_CONFIG_FSR_SHIFT 2 #define INV_MPU6050_ACCL_CONFIG_FSR_SHIFT 3 #define INV_MPU6500_TEMP_OFFSET 7011 @@ -347,6 +349,7 @@ struct inv_mpu6050_state { #define INV_ICM20609_WHOAMI_VALUE 0xA6 #define INV_ICM20689_WHOAMI_VALUE 0x98 #define INV_ICM20602_WHOAMI_VALUE 0x12 +#define INV_ICM20690_WHOAMI_VALUE 0x20 #define INV_IAM20680_WHOAMI_VALUE 0xA9 /* 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 393cec555be6..bc351dd58c53 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c @@ -84,6 +84,7 @@ static const struct spi_device_id inv_mpu_id[] = { {"icm20609", INV_ICM20609}, {"icm20689", INV_ICM20689}, {"icm20602", INV_ICM20602}, + {"icm20690", INV_ICM20690}, {"iam20680", INV_IAM20680}, {} }; @@ -127,6 +128,10 @@ static const struct of_device_id inv_of_match[] = { .compatible = "invensense,icm20602", .data = (void *)INV_ICM20602 }, + { + .compatible = "invensense,icm20690", + .data = (void *)INV_ICM20690 + }, { .compatible = "invensense,iam20680", .data = (void *)INV_IAM20680 From patchwork Thu Feb 6 10:31:04 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: 11368037 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9986892A for ; Thu, 6 Feb 2020 10:32:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6435C21775 for ; Thu, 6 Feb 2020 10:32:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=invensense.com header.i=@invensense.com header.b="hpYTby8j"; dkim=pass (1024-bit key) header.d=invensense.onmicrosoft.com header.i=@invensense.onmicrosoft.com header.b="jY7MUTC1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728513AbgBFKcV (ORCPT ); Thu, 6 Feb 2020 05:32:21 -0500 Received: from mx0a-00328301.pphosted.com ([148.163.145.46]:9444 "EHLO mx0a-00328301.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728484AbgBFKcU (ORCPT ); Thu, 6 Feb 2020 05:32:20 -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 016AHWnB021246; Thu, 6 Feb 2020 02:32:16 -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=hpYTby8j/ShxOiF7mJ2JArokl0AGQfO0xDktHOzPX/SdrMx9/4Dd6ZP8QJZv6WxaWCyu IiHGK0vRygWo+h8f6Kz+Qt9KZPMd76sOE1JPY6IV2AleqUlkkxAgtZoc+kAqib5TzSsL 504gPqKF5rDTy7uIO+xASSr6fTwfv7LoIFjc8ri/ROU4jv5wfUeNqc+duVveSiA9C8Sh iOhgpzQJjxKHq8Y3MADJ9eNFM1M0YY1tbhZaL5lfs0UfnV0gAuBgNcynDY+5wG4fMcH6 4Ou9OZUrh9fGkMxk0F5WZCRSGnGIBP/V9K1EfEwCLtPrRAxlEJGw/NfiF6UILyFiXILt +w== Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2102.outbound.protection.outlook.com [104.47.70.102]) by mx0a-00328301.pphosted.com with ESMTP id 2xyhqf0tb2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Feb 2020 02:32:16 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ErOMOu2H95G8Fa4j9D5t6Hdcfq1l2bZCSqFg9ZbC4xsdQepNHnkxJjwqF7CYwQXbzV3eFRKMe5ewJGALzwkrJ9FZLHEK7jmywHmjHUgFiHsM7uvUqcQJwOUp2ewg6/AXqzMHjJxjZgQfEEBqWEFmRS5S2CIiPdrzs+9c6RGNFvA7BwOiSHOoGFBBqta3x7BQD1uEC11aY4sePaxJpezdFWJx1G8v4bO0xEtKnRyTsg2YMJqHYXibVTWVBmptOmMeNd4tXgt40GjnXAph/j8lcF45K3UBcbLV1KrBvNsUYXu7R+77BYk3Qsy8WB6/fsW1Zc3iaSfdcuGUo1DE1p0Qpg== 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=PVJM2hPYtldc/DAAkjK9OQ1pzsHL8rBzZwii4iNf+rOgZzSq0+6YlOD680sM/sLv6O3pPvgCtWhUXYqF+PZd/D6JR/LT536HEmrOeEi46wM++3QuhSp0H1kjZpN6U6cgj9gr+JbL/VjgI9EOOoqtO3XuF89daLPKe+vAWJB7Kx3V9rsZJhj2POm3Jjk95yLXf5T80qZF77EYhVBiiqTuz45EcrnpHoMB13XZORsa/1jDvk/euCaPQJsLtFWU9rYuoIukB8C5stvIOveUbleKTtgtFnDv0e6frW/57gNxlpj2nnH0/bBA/as3tLgE79yU/Fe1+lGoWMOV3nJV8DgrWQ== 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=jY7MUTC1ZWRW9jt7sMMYNv4a/iqO9xcAnuygQbqqhYBwFj9jKD4gRp7MjcuQrGtVzU6y5KB+/INvQ5QEzaqWHmZ4yY/GKfa0ExZpsc0GdeFb/L02XN7L9lX3bZUY1nmsKn56FGJOHS7KsdUmMTjXYiSC0ReOD/RAkQt62kS6Ci0= Received: from CH2PR12MB4181.namprd12.prod.outlook.com (20.180.6.144) by CH2PR12MB4085.namprd12.prod.outlook.com (20.180.16.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21; Thu, 6 Feb 2020 10:32:14 +0000 Received: from CH2PR12MB4181.namprd12.prod.outlook.com ([fe80::c057:8a13:530a:4340]) by CH2PR12MB4181.namprd12.prod.outlook.com ([fe80::c057:8a13:530a:4340%5]) with mapi id 15.20.2707.023; Thu, 6 Feb 2020 10:32:14 +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 v2 5/6] iio: imu: inv_mpu6050: update LPF bandwidth settings Date: Thu, 6 Feb 2020 11:31:04 +0100 Message-Id: <20200206103105.23666-6-jmaneyrol@invensense.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200206103105.23666-1-jmaneyrol@invensense.com> References: <20200206103105.23666-1-jmaneyrol@invensense.com> X-ClientProxiedBy: LO2P265CA0334.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::34) To CH2PR12MB4181.namprd12.prod.outlook.com (2603:10b6:610:a8::16) MIME-Version: 1.0 Received: from frgnb-12nlpn2.invcorp.invensense.com (77.157.193.39) by LO2P265CA0334.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21 via Frontend Transport; Thu, 6 Feb 2020 10:32:13 +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: 84ea65a6-802d-41e7-d19a-08d7aaefd507 X-MS-TrafficTypeDiagnostic: CH2PR12MB4085: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-Forefront-PRVS: 0305463112 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(39850400004)(396003)(366004)(136003)(376002)(199004)(189003)(478600001)(2616005)(956004)(86362001)(2906002)(26005)(5660300002)(186003)(16526019)(107886003)(6666004)(6486002)(1076003)(81156014)(8676002)(81166006)(4326008)(8936002)(36756003)(54906003)(52116002)(66476007)(316002)(66946007)(66556008)(7696005);DIR:OUT;SFP:1101;SCL:1;SRVR:CH2PR12MB4085;H:CH2PR12MB4181.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: 6FTt9xHTsOEcv9LGwcf2mig9gqGy1Ju6seA7juk64j5rnxaDOGSq0hMI1+/EcqoVBwAMexDQ3wVbMr+v/hjrULMNToj2U9w54vV9MbvLj1YwJjSbFqy6apdW0zO0o6bkFl5PH60Qga2eyhVC8UoDUoLZWXvn4LdXLv6LMIV7LT9mcEe2BDzN9NyhMP3CsBXzEJd6r73z15/mx/MFKLP4aux9aTi8VX43uGXHBib8cKVGYUB1RHH48U4YcjaXPY6WCH0RftdkwOulRno7Rqeg2IDnkW9E4fLGtYENYZCslUaRiqZLbuOWp2NgoN1wk+MzujJXtb0HsxPW6zCSCbmsRrsR5lvDGPkMDx67EURi5dCmgUFxtugLQscJc+E6fxzHlsNG249wK9CbBjeHn/tHDWgvtU5DUQe4HzbkIkEa8U1o4wOC5rPWv5M6fK7dbVJN X-MS-Exchange-AntiSpam-MessageData: xMweit0YxkV4q2LEHGhC2re0tbMmjqXS+s75ee2JTKrpuO1SOhPtn4limI7O6nE0GIVLXQ8lXqkr6fdhLNcUhb1GgHIvPealXsT+QqwusKIZZWoVSWHwruXPPG4F3xqPyNr0MvjQN/tWDJcsqm1Fcg== X-OriginatorOrg: invensense.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84ea65a6-802d-41e7-d19a-08d7aaefd507 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2020 10:32:14.5713 (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: /9z4+LMLNpQoUs0zJnT4pQN0mhrdqN0TlqlAdkPKxfsvDpD2yhy2BlssAB17IY4lBpbjhVF7lVQw3fV6IbWuKopvSiW6jO7rcdtg0oyTOYs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4085 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-06_01:2020-02-06,2020-02-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 spamscore=0 malwarescore=0 impostorscore=0 mlxscore=0 suspectscore=0 phishscore=0 clxscore=1015 adultscore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002060080 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@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 }; From patchwork Thu Feb 6 10:31:05 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: 11368039 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E843C92A for ; Thu, 6 Feb 2020 10:32:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BD44E217BA for ; Thu, 6 Feb 2020 10:32:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=invensense.com header.i=@invensense.com header.b="q2nhwADN"; dkim=pass (1024-bit key) header.d=invensense.onmicrosoft.com header.i=@invensense.onmicrosoft.com header.b="guB+bKdT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728465AbgBFKcX (ORCPT ); Thu, 6 Feb 2020 05:32:23 -0500 Received: from mx0a-00328301.pphosted.com ([148.163.145.46]:11136 "EHLO mx0a-00328301.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728512AbgBFKcW (ORCPT ); Thu, 6 Feb 2020 05:32:22 -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 016AGhJh020601; Thu, 6 Feb 2020 02:32:17 -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=1xvdr2Ts39k1DirXZnoomdhUJEKx970MzI8Vk28DhTs=; b=q2nhwADNOckrycSkwahx2yv+8Ux0S8eeU0zI8yQtCKlbgT27nOZAu09fhm6qrGhM/V9w xzHRJvcScgErnMabIhOwau69vPNMHWGORMnPzMM12onInI+z07PNgTJX+eiuXW0g45CL cIqDHvhxMpQc57VJfCB1b2hMpwj3C/I7X3qvJYxjYIabL0JkaNtbP7DrRa4gq7q/fqIG Aivk4T5W0BBSz/076O1talUqMfSo33HnLT+EhL3SEuV81TutY9CpBCv67zN+R711kY8v Xei3fH8XiRg6EUSRj0pOYYZARKxDIQ4anGOIMdbzz/FmIF0ahxU82hxfE3BS1l9c0x7d 9Q== Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2108.outbound.protection.outlook.com [104.47.70.108]) by mx0a-00328301.pphosted.com with ESMTP id 2xyhqf0tb3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Feb 2020 02:32:17 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FALp71ILexMELJF3i6Cp6f2Xs0DnUmlNeJThGTeIil1CdgJ/8mxI/DdublW03IctV5TCd5M6l+I4R+SyHJNaQP7NkddUbjEpm67kJiCZ7eiIZfrJfWmXXufTFhqieku85WEUubpETrM+pLhM7aUsqV09X0XdKXnpg5kWs+DDbwDUlKosHCVXrlyebFMHWBP8Fku2AU7pNkaoR+z+1E/5bvtD3XCquCAYNhs1D1fES727JarWBrdPV0ZWyM/3fAHVkWRfY+l9DWK7i6AE0TXW++zs5iyR9n/uq4y/AFbtE8508KP7y2eRRLIqbsVFqI+F0r44ynq22oeT5b+3SYj8sw== 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=1xvdr2Ts39k1DirXZnoomdhUJEKx970MzI8Vk28DhTs=; b=iVGnsdPXPe5N/OFLDzpsqo8vz+qEr7wXIHabR0KQ/eJAyPeB16yUBsgWXt8CUfQGDmK6ycabJ2hD3DzB37XPjIK+faUJzLqZPWj7qA0TjnPi07gmOz06gkIkaZRTDnFiyPUN+n2WPbzefwCAaOcuNIVd6z4Ny2JhoT8EtTfkZs90GmjbVsJYknPlRe3aPh8354uIP6YpY3R7HnkAk/XeYwHjeH0VN78bkZx8+pT1Y6FDfuTytgqFu3ROF0/JaSW6yGrWRtLTytzYArc8CkbyzorwoGDMgfJ2B/tlX4AxD7XQX4krr5IM5mf2E4QXHLbcKCqn1yyQDKOzueiULI5TjQ== 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=1xvdr2Ts39k1DirXZnoomdhUJEKx970MzI8Vk28DhTs=; b=guB+bKdTkiHyOVrKIGU+jWr02a6i6DGOvj5otUzBrCaA8n0OP7ZaUVDTLVX3tvgbfK6L3OyURC44mTlvcQ+ujL1nbpnNpD2Dj2wt3AV0aSJvdmiOrAC4lj604hA+eIVwE6EWxvnkCdZdpuagA6VtKryup48tfaVUrw3vABQzwNw= Received: from CH2PR12MB4181.namprd12.prod.outlook.com (20.180.6.144) by CH2PR12MB4085.namprd12.prod.outlook.com (20.180.16.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21; Thu, 6 Feb 2020 10:32:16 +0000 Received: from CH2PR12MB4181.namprd12.prod.outlook.com ([fe80::c057:8a13:530a:4340]) by CH2PR12MB4181.namprd12.prod.outlook.com ([fe80::c057:8a13:530a:4340%5]) with mapi id 15.20.2707.023; Thu, 6 Feb 2020 10:32:16 +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 v2 6/6] dt-bindings: add description for new supported chips Date: Thu, 6 Feb 2020 11:31:05 +0100 Message-Id: <20200206103105.23666-7-jmaneyrol@invensense.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200206103105.23666-1-jmaneyrol@invensense.com> References: <20200206103105.23666-1-jmaneyrol@invensense.com> X-ClientProxiedBy: LO2P265CA0334.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::34) To CH2PR12MB4181.namprd12.prod.outlook.com (2603:10b6:610:a8::16) MIME-Version: 1.0 Received: from frgnb-12nlpn2.invcorp.invensense.com (77.157.193.39) by LO2P265CA0334.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21 via Frontend Transport; Thu, 6 Feb 2020 10:32:14 +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: b8604601-041e-49d5-86fe-08d7aaefd5dc X-MS-TrafficTypeDiagnostic: CH2PR12MB4085: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-Forefront-PRVS: 0305463112 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(39850400004)(396003)(366004)(136003)(376002)(199004)(189003)(966005)(478600001)(2616005)(956004)(86362001)(2906002)(26005)(5660300002)(186003)(16526019)(107886003)(6666004)(6486002)(1076003)(81156014)(8676002)(81166006)(4326008)(8936002)(36756003)(54906003)(52116002)(66476007)(316002)(66946007)(66556008)(7696005)(562404015);DIR:OUT;SFP:1101;SCL:1;SRVR:CH2PR12MB4085;H:CH2PR12MB4181.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: aZEng4Ag9sWFxlYaVbWDL2XoHwsw3J7/a8PdWsfXB2A5nUVDKWKhxOeS3DRWtwRRXtinv2/ORWyc9a7Z55DNhYeARf53ZuSfbtAColpYZ9ozJi85jZ/aYPcd3vOqi0pp5jduqmYlXz9rro9pBk8L59XdoYu9Csj4DNT40czC7B3evz/Vp4aLwuJOHFG2De1noY7FHhdEE2/4U6Dz9/OY5yiDWISDegh+O1eJqw/FiEwMj0Qepit8f4gSe4fPIludMsEmyVm8QKBzymoC08Z/1gaQHBlXHApKwGpVq5EjB0jYnBN203VcL6RzUcgZTmOqYP+PKLc2Boe3FqCfaV9fxJc1XBy1WE1IjAb3RZPHlGyQP4HlpzbHdxHzMa0ULxbFX+4Bx872/uRn7VYKyoBXwXgFSdRi9LCKYOcpJ1TvOT92gBWC24/IM94VA5O6Alfn0lURuX16biyG9djRvTc2BAvSbqpBLWtpFuYkdEfGvXUIdX3e+LNmFfos5TQg1GKTqZOwA9KrZ7kvNLH9eSSK0A3mFpVPK6qfwhIJEvDytvkq0k3X2JAXyt7cSoubD9ro X-MS-Exchange-AntiSpam-MessageData: hGt4/RbJDR1JZeQ2PY2vOUjdVIvoZ/nmSplcjf8QEQoX2gnywSB2OMFOF6PX1a/nPRlYHiLShDYNpTIWeGlhqjQyGANpB0xixw/BwKv1RTYe2GOdBTsuEXKS0sAvfdSIUBSAQtSCVfhnb76sgUFAWw== X-OriginatorOrg: invensense.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8604601-041e-49d5-86fe-08d7aaefd5dc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2020 10:32:16.0708 (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: +cyC2w7UMKscFzZa41Ogpz4RC6RVdNxfqi63SLqRFcrzMxNhcU26JOohMaSoXZSbV1oCLnYdCNtKHSOdWNVamBQf8uiy1OD1b6H+BC9sWco= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4085 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-06_01:2020-02-06,2020-02-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=782 spamscore=0 malwarescore=0 impostorscore=0 mlxscore=0 suspectscore=0 phishscore=0 clxscore=1015 adultscore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002060080 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Add missing mpu6000 and new icm20609, icm20689, icm20690, and iam20680. Signed-off-by: Jean-Baptiste Maneyrol --- Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt b/Documentation/devicetree/bindings/iio/imu/inv_mpu6050.txt index c5ee8a20af9f..f2f64749e818 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" @@ -11,7 +12,11 @@ Required properties: "invensense,mpu9250" "invensense,mpu9255" "invensense,icm20608" + "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 IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_RISING, IRQ_TYPE_LEVEL_LOW or