From patchwork Sun May 3 17:22:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11524687 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 DB79017EF for ; Sun, 3 May 2020 17:22:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CDA8F20707 for ; Sun, 3 May 2020 17:22:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728956AbgECRWf (ORCPT ); Sun, 3 May 2020 13:22:35 -0400 Received: from mail-bn8nam11olkn2103.outbound.protection.outlook.com ([40.92.20.103]:15713 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728859AbgECRWe (ORCPT ); Sun, 3 May 2020 13:22:34 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TaTVBbCQCZQ/UluBFD3tUoiqWT0FIOlWVGeaZtkiG2KC8ZRC4GevY0RjZzW1wgKwVjhPTi8yUoFv11Q1hZmQM1FQWe1KIU59xDVhEZTG5ao4iuEWvQRMxvDrsoBI8qP6KuC+TYiLo6d3hvXZ3EoP7gr317kz9EOAOGObpOV+6Dtc/N8amj53sWaKtova5sWHtWT9dM3IIksGR3nXpYtiSeKvbpYv683wGk2L+fuvwKAyKur4Xy/eZ80NldoG8hEIS4+6mQJ7BpWD2FLJBrXlPfI/++8lzj0uG26gsGshpXDuWVYaHw31eaU1JB1lj62vfE32sgd5zSyWPdh8eRE5wA== 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=+Zg7hWnyZ3sczViwoZ3XmKapDRxnqFPiiZZBMPIGPP8=; b=V+tE/CLNMEaGL34EFYT4ihot5oymeNHQ061K5xzczWkYfp4CLaXxroV6gFalcc6HuPDR75Bzhjkqmtlzz8uvgyEWOG0nFtLbqIzo3+MfVcctF6ZNdu6f4L9fqPyRsjIPWAfKLTo5b58beFLOQgs7AL6a92Dg1wyKhjmiFPxo/Xn8S2Rv1+WoRFJq+0Sru4UFEQYbFYuiQeeVBms22JgZNxQJsKp3g5mwBGLCgu+YD+eGUkpvJpR3EH7HP0KOVZ5YZRHa2eh9NvxTPRE4Q/pyNRlN28SUG9ECBvdF2X737L2a6pbZNRL112P8rB9o+q3ftc2Qv7msd/w9g23fgLFZLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from BN8NAM11FT054.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::4b) by BN8NAM11HT242.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Sun, 3 May 2020 17:22:31 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4b::42) by BN8NAM11FT054.mail.protection.outlook.com (2a01:111:e400:fc4b::358) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Sun, 3 May 2020 17:22:31 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:52407124F5FB3A0DE75FD3A7822DCF576D9602F7250260A99C5F6BB28F704DEF;UpperCasedChecksum:BA5470450F066D5C6274061998A62520D44BCB43776413EBA7DCF79654863469;SizeAsReceived:8013;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2958.029; Sun, 3 May 2020 17:22:31 +0000 From: Jonathan Bakker To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, linus.walleij@linaro.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, tglx@linutronix.de, linux-input@vger.kernel.org Cc: Jonathan Bakker Subject: [PATCH 1/5] iio: accel: bma180: Prepare for different reset values Date: Sun, 3 May 2020 10:22:02 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200503172206.13782-1-xc-racer2@live.ca> References: <20200503172206.13782-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR14CA0047.namprd14.prod.outlook.com (2603:10b6:300:12b::33) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200503172206.13782-2-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb68:9c00:8067:f823:1e15:7520) by MWHPR14CA0047.namprd14.prod.outlook.com (2603:10b6:300:12b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Sun, 3 May 2020 17:22:29 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200503172206.13782-2-xc-racer2@live.ca> X-TMN: [yYJxKkMlbnAAcPdvhqIh1O/8lKc7kvoWdLPS5yFM6GdNLtVXxwduIbIm2UetqEe+] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: b7b704f2-e107-49fb-42da-08d7ef868fac X-MS-TrafficTypeDiagnostic: BN8NAM11HT242: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m2S3PfxwJVD3CT+FG4+Y8TDTo6iPCXP9uLmFz7d7c/qpbW8eGlygSrl5Ep825ryAwvvnDe76VIdfNGqlAprq8U8ZuM5oAIdlMaUTs0Yv3mHAx7euOXFSBaFx1NzFUy3VwNet8oCYF6p4WpJoHoDFdfau62ZMKCwEQzBj3evd4Kg+du0W1EXIgZWUObvY7N52t/pCZ/s1/mr5qvoDj/vwpQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: PgtAowJkEQiKcs61bpo+Pgzu+IfvCUd0TVQhQqzTpVJdN6XR6PTiK7Jlyv7gc///9hBxAK0r4/C550sGdSg6TkQhPJjFOua8agIZlADJDk07CT+X67xq/E6cFZREI08DLPtEt7idkh9KB7XvLjh/AKKsJG1bWESNlni/5gxumg6/avqPexSwXDrr+bdjFwLmn/PHB+/W3vXoDlAx4NNH2A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7b704f2-e107-49fb-42da-08d7ef868fac X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2020 17:22:31.6049 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM11HT242 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Some variants of the bma180 (eg bma023) have different reset values. In preparation for adding support for them, factor out the reset value into the chip specific data. Signed-off-by: Jonathan Bakker Reviewed-by: Linus Walleij --- drivers/iio/accel/bma180.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c index fcd91d5f05fd..75440dd83ec4 100644 --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c @@ -57,7 +57,7 @@ struct bma180_part_info { u8 power_reg, power_mask, lowpower_val; u8 int_enable_reg, int_enable_mask; u8 int_map_reg, int_enable_dataready_int1_mask; - u8 softreset_reg; + u8 softreset_reg, softreset_val; int (*chip_config)(struct bma180_data *data); void (*chip_disable)(struct bma180_data *data); @@ -319,7 +319,8 @@ static int bma180_set_pmode(struct bma180_data *data, bool mode) static int bma180_soft_reset(struct bma180_data *data) { int ret = i2c_smbus_write_byte_data(data->client, - data->part_info->softreset_reg, BMA180_RESET_VAL); + data->part_info->softreset_reg, + data->part_info->softreset_val); if (ret) dev_err(&data->client->dev, "failed to reset the chip\n"); @@ -693,6 +694,7 @@ static const struct bma180_part_info bma180_part_info[] = { .int_enable_reg = BMA180_CTRL_REG3, .int_enable_mask = BMA180_NEW_DATA_INT, .softreset_reg = BMA180_RESET, + .softreset_val = BMA180_RESET_VAL, .chip_config = bma180_chip_config, .chip_disable = bma180_chip_disable, }, @@ -721,6 +723,7 @@ static const struct bma180_part_info bma180_part_info[] = { .int_map_reg = BMA250_INT_MAP_REG, .int_enable_dataready_int1_mask = BMA250_INT1_DATA_MASK, .softreset_reg = BMA250_RESET_REG, + .softreset_val = BMA180_RESET_VAL, .chip_config = bma25x_chip_config, .chip_disable = bma25x_chip_disable, }, @@ -749,6 +752,7 @@ static const struct bma180_part_info bma180_part_info[] = { .int_map_reg = BMA254_INT_MAP_REG, .int_enable_dataready_int1_mask = BMA254_INT1_DATA_MASK, .softreset_reg = BMA254_RESET_REG, + .softreset_val = BMA180_RESET_VAL, .chip_config = bma25x_chip_config, .chip_disable = bma25x_chip_disable, }, From patchwork Sun May 3 17:22:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11524681 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 E31F592A for ; Sun, 3 May 2020 17:22:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D55CD20707 for ; Sun, 3 May 2020 17:22:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728859AbgECRWh (ORCPT ); Sun, 3 May 2020 13:22:37 -0400 Received: from mail-co1nam11olkn2082.outbound.protection.outlook.com ([40.92.18.82]:50144 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728972AbgECRWg (ORCPT ); Sun, 3 May 2020 13:22:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dllw1WswjjvpbavJLzMPokIMuNh0VZuCbXGj1cmaFXf18worAbfYSDYGvT0kPNOhP/Yd4T7hRRkscH6ZX5mTouCRJrof/Jxmhy0oDyGm1IO/QD7uQ3TRKlGP92zFd/7/Dku+LIiyKQF2FMCUgPUJlTzVe1pfSJhTM8Q/uHOGye4cXQ2sAVjxz6Wd+zkp6F+3SZBBBscky/xlOs7K5WvY0CDJYMyWTltCufYVqPgjWitpmiuyLpCpsDLmA+XA4EU7wUUoU3FitiAUqWy3JLhLQ4T25dsSSs08/IhuxHdATf4UMIjEDS5Zyqm7CybBlZzyrgyGzQxws/CAnTokYRfSPw== 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=1CwtF6yiqmMqpX0VvocSY1c7abRgjEMhLeX9M4FKKjM=; b=UpSDpkv2fe5ufCrHUVL0Hf2QKDbSb/tmZ8nxO2GmS7J0kSgJri1UArqQe2wj1J9or4ZCcY+N6RmalrN8PtYYf1CsZdTT4k3y5xPCJSkTcIGOHedD/zLkSeBW3bPhnV8K8luRznURxlsUXFIT1e0pA76AjCjKgkt34yvhwVE/BWgZ2dAFw9YB71lUH2orgYuws1cKrhtJKHoWU0A/BuIj99OBkevqrN4duTwogSVS6KDzMMM4TF6YLTFwEwukllw6h/eT90nzuu9d4nNc9p9QWH33mCtDxk4PbDQ9SbeSb1zqAbplyULSgmkEAzclGku5YlojSFFL26tOYj6k5r42lQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from BN8NAM11FT054.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::4f) by BN8NAM11HT127.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::227) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Sun, 3 May 2020 17:22:34 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4b::42) by BN8NAM11FT054.mail.protection.outlook.com (2a01:111:e400:fc4b::358) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Sun, 3 May 2020 17:22:34 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:AF6AA87CDE98DBE31D0ED6C021AA15DFC57E9B9BB3602DE9C2EA63B55C66342C;UpperCasedChecksum:C12BE145610A5E5D5CC53EC0F7F6455E2913F2206759C36D1FB97D875BB561D8;SizeAsReceived:8016;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2958.029; Sun, 3 May 2020 17:22:33 +0000 From: Jonathan Bakker To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, linus.walleij@linaro.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, tglx@linutronix.de, linux-input@vger.kernel.org Cc: Jonathan Bakker Subject: [PATCH 2/5] input: misc: bma150: Conditionally disable bma023 support Date: Sun, 3 May 2020 10:22:03 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200503172206.13782-1-xc-racer2@live.ca> References: <20200503172206.13782-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR14CA0047.namprd14.prod.outlook.com (2603:10b6:300:12b::33) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200503172206.13782-3-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb68:9c00:8067:f823:1e15:7520) by MWHPR14CA0047.namprd14.prod.outlook.com (2603:10b6:300:12b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Sun, 3 May 2020 17:22:31 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200503172206.13782-3-xc-racer2@live.ca> X-TMN: [TMGz84Okmwm9LuUwfInmLInOyR8fQWzABHdnweiK0zDrBbzd+hDGW4HjnR+lS/4y] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: f9949e8e-d872-40c5-5dbc-08d7ef869102 X-MS-TrafficTypeDiagnostic: BN8NAM11HT127: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4VxYjZYTQ1oZd2ZNkAi9DNgTp+q+9Fj3k6zeF15Hkr/8119AU0d/NMBTuWd0qv3DMQr04bfBmP1bcfw9N+V2kaUOKagW8GFKW4PyF/adoID1wIv/eBxXiRkhsaKmwcPKTeKlDwqsVGzyiFZbCitavE/IzD32SqCHvOrOBE2Q7O9PzCKFUnSsqgfH7gNrm08RLE8URHOLmixaC2ozktwgrw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: BqwGL9yShmYtTBpxsd3twwlATT9KUhnY9jCJczVcxUBxqCEe9oDrAJWu16gTxsPaLjq7LWdXRaaEvar+C1zQFs/NTheWWTv1RD6YZM/mUrTYWcNp1wwwmR+zP2oFrgV8WnSwVsM1qQSI/E9zBDaJfzg6GRQXX9cteOEuf0NfHKbFVKHjyDCmrXWsoQk6tlzVY/GREvfwKJ/revhrvxEdow== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9949e8e-d872-40c5-5dbc-08d7ef869102 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2020 17:22:33.8479 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM11HT127 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The bma180 IIO driver has been extended for support for bma023. However, this could cause conflicts with this driver. Since some setups may depend upon the evdev setup, disable support in this driver for the bma023 only when the IIO driver is being built. Signed-off-by: Jonathan Bakker --- drivers/input/misc/bma150.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/input/misc/bma150.c b/drivers/input/misc/bma150.c index a9d984da95f3..5d3f8b05b316 100644 --- a/drivers/input/misc/bma150.c +++ b/drivers/input/misc/bma150.c @@ -541,7 +541,10 @@ static UNIVERSAL_DEV_PM_OPS(bma150_pm, bma150_suspend, bma150_resume, NULL); static const struct i2c_device_id bma150_id[] = { { "bma150", 0 }, { "smb380", 0 }, + /* Prefer the IIO-based driver for bma023 if enabled */ +#if !IS_ENABLED(CONFIG_BMA180) { "bma023", 0 }, +#endif { } }; From patchwork Sun May 3 17:22:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11524677 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 157521668 for ; Sun, 3 May 2020 17:22:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 003AB2071C for ; Sun, 3 May 2020 17:22:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729019AbgECRWj (ORCPT ); Sun, 3 May 2020 13:22:39 -0400 Received: from mail-bn8nam11olkn2042.outbound.protection.outlook.com ([40.92.20.42]:57057 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729017AbgECRWi (ORCPT ); Sun, 3 May 2020 13:22:38 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HVZp4ZIUCj1+vREFuzWK+AH4j+sx9awQ0ytv6Nkd58yMMQuwQns1BeYKB84OSZQ5H9z5xuvujKj0d8c4rPV8M7/2sNXjgQ0qnQApAAScUifaPENNjaOGHDBBZd5LRu3pLXi+/12jzGlXAoPZes7O9uJKgZ4nAIWiomONKoFAShPs2vU+/psTsROgRSoaSRPTdwkf4bUgYLzG+SWUZL8r+edDCDnnCUEF5tcRcqMmKO6XV1JhfGUFwC5i9oiZZ1hUBGAKQEIE8l1I33O8D2pDJBqJUMwcxfLLto2yCrBmNCS13uGS6slNpXclJfgZwK4NXL5s0iToL4urhfLuJimF+A== 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=IPNZ3Ud7Np307HILwUMB3QGtjDwJj2u3qprKFyJumjw=; b=LPtruzXjpqqlvNPVYle53ayYZXHebKtgcqEJkjkn7PH1VC6ZoHeg9ms3CwZdxHMeUVEvhws6n2rVQ1Z6l+PKoqxvnsr+jcdvAkxfdKQ4DzxbeyEFO2VhGSBXHZFS30r1ZI+YmTUopHAN/8oH6fRFDJs6J63yxC8JkMrQ+FwfUlapdOaC45QqDlayCj1MFIDHgUS68/yMDyw+VqpzLQBVbdkX6wZAsYbaphcQUpM8/YnQYsPwTUmw3V+tPL8XmenfWykqKGrA0DuOGFiM0G0qsrtKWpV6EzJtuma4McRUhATwHCwLWZ0sb59WrAH9xi/fONxVe0aGTR91K0PKFuPWrQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from BN8NAM11FT054.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::50) by BN8NAM11HT043.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::380) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Sun, 3 May 2020 17:22:36 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4b::42) by BN8NAM11FT054.mail.protection.outlook.com (2a01:111:e400:fc4b::358) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Sun, 3 May 2020 17:22:36 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:A477503DADCB2B6AA6B3C54AC9DBBB8BE6710F418E899DC9358484ADDF276CF5;UpperCasedChecksum:2508AAB308A08505E9D1FB16F4E4008AFFB1BCCED208FCC599BB489E632C5F8D;SizeAsReceived:8014;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2958.029; Sun, 3 May 2020 17:22:36 +0000 From: Jonathan Bakker To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, linus.walleij@linaro.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, tglx@linutronix.de, linux-input@vger.kernel.org Cc: Jonathan Bakker Subject: [PATCH 3/5] dt-bindings: iio: accel: Add bma023 compatible to bma180 Date: Sun, 3 May 2020 10:22:04 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200503172206.13782-1-xc-racer2@live.ca> References: <20200503172206.13782-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR14CA0047.namprd14.prod.outlook.com (2603:10b6:300:12b::33) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200503172206.13782-4-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb68:9c00:8067:f823:1e15:7520) by MWHPR14CA0047.namprd14.prod.outlook.com (2603:10b6:300:12b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Sun, 3 May 2020 17:22:34 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200503172206.13782-4-xc-racer2@live.ca> X-TMN: [wm7OSSp0tZOupPR5H66RTs7aVsMHOIxc+h6rkamvy6mMX4E5TOVYLrvBYK22+2gr] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: a28f686b-0ba6-4f76-b101-08d7ef869259 X-MS-TrafficTypeDiagnostic: BN8NAM11HT043: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fkI0Hukk9Ilff+k8ahHzUV/RIEd/wtBlTSWJSe11HUC4jWZVgydfx8Ntsr3nAlVW1J0/+UuA9PZVhfdYAyy+nxJBUqI7dz7jAye71hB9A7kXKGwVrr+49AsEVJd7BPscOdWYo0xAQIt6Iw66R82fWL7x6Bo2tzKvW+df4MAy+WehqfqAfwaBFgSubsd9e25nMbQdDKARB0cfwnp8aYN2fQPjrvYQKUwxnAiruB482Yiyg7Y+N9R3zpRHkMY31jEs X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: /burLea5ria6AOkUY0Ct6bh3d+KHgVl/KEn+QvXiJHxBNmYfQ2N1LttcmbZDhb/Mlt/odSBi7dOwUE/mgL32d0J9N7ZSmLfc1OcIUu3oKvhhxrumFU9Qkqb2EoH3CpIaAR7i5dI+rU9dXVDjHZwfb+bMbHgDGc15Rz56anja7KQOZ5eyGgfcZhJGln0KVsDcvT8fJakYmBF5/qRLlinVHw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a28f686b-0ba6-4f76-b101-08d7ef869259 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2020 17:22:36.1409 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM11HT043 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The bma023 is in the same family as the bma180 and support is being added to the bma180 IIO driver for it. Signed-off-by: Jonathan Bakker Reviewed-by: Linus Walleij Acked-by: Rob Herring --- Documentation/devicetree/bindings/iio/accel/bma180.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/iio/accel/bma180.txt b/Documentation/devicetree/bindings/iio/accel/bma180.txt index f53237270b32..48bec35f452a 100644 --- a/Documentation/devicetree/bindings/iio/accel/bma180.txt +++ b/Documentation/devicetree/bindings/iio/accel/bma180.txt @@ -1,4 +1,4 @@ -* Bosch BMA180 / BMA25x triaxial acceleration sensor +* Bosch BMA023 / BMA180 / BMA25x triaxial acceleration sensor http://omapworld.com/BMA180_111_1002839.pdf http://ae-bst.resource.bosch.com/media/products/dokumente/bma250/bst-bma250-ds002-05.pdf @@ -6,6 +6,7 @@ http://ae-bst.resource.bosch.com/media/products/dokumente/bma250/bst-bma250-ds00 Required properties: - compatible : should be one of: + "bosch,bma023" "bosch,bma180" "bosch,bma250" "bosch,bma254" From patchwork Sun May 3 17:22:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11524667 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 99C3792A for ; Sun, 3 May 2020 17:22:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 89BF7206D9 for ; Sun, 3 May 2020 17:22:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729037AbgECRWm (ORCPT ); Sun, 3 May 2020 13:22:42 -0400 Received: from mail-dm6nam11olkn2090.outbound.protection.outlook.com ([40.92.19.90]:60384 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729024AbgECRWl (ORCPT ); Sun, 3 May 2020 13:22:41 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AHGLTs9MXFfIWyThKlYuf9v6sn44rqgdVW+V+eL1ZXehDZjvSrAE9o5n+l6kqt0VvCwuSJ1pwqCJ/m4QSGLFR5EZykHZB9DwYgjEL4sBeYYBklDnDXjeOP1Cbu0NZnj+7QentvEN0098CwCGdo1FrEcyI/zzHzBxwU9eIZnqyT79B8FuO2os05VtlCwtzgQK7uc3+f2wq+xCatds2oNCNGWiAv2Tv9O7olGlhVISnVKmZuaYwthdCWUtOuDSnnES2HJNbTBkf4mv4lrJDL20xGU3H5yYMFsQoTosZt/izoR1Y6D0gN20ypfIjAGPoWEL1DI8wPujDCttC0sHKFr9qQ== 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=9eRxWgh7LKcjtFr5w4VvhR7gwYQN68bC1s2l8MuETE8=; b=lomPgSNWUGFj4NaR/U44nRt5QGni80M6CClgkRrcNUbg0TpKZjPD7kYHd5l3/NGDPbq7vGb5/fty9YPbzC4Z79Ia+nb8ZFOnKvm5/s2YXO7HF0tWGctP4mC9ZXQge/pp3ycBJvs4pKTOnk5wpcPaVDtBbavzmegzpYfXoxUMhwpvV4EvOYfUmqWGxiyam6AlSOlX/uhtGg5e2IgRpGfcO3lEdKGAbGZ3URR8hbFqrUfjbSAkhKQVjKB15HYje2jjb6z2jT6fW9npCvTqKc58FizD/jI2pTrSFUInSYv2NBDQicpM85yPWTC8Pg29dSWZXriSi7sA605d1R0bvQGAbg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from BN8NAM11FT054.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::4c) by BN8NAM11HT050.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::177) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Sun, 3 May 2020 17:22:38 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4b::42) by BN8NAM11FT054.mail.protection.outlook.com (2a01:111:e400:fc4b::358) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Sun, 3 May 2020 17:22:38 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:CCA0B2BBF4270DE7710937906A791CE11FA4BE0660D53D0770BD574DA042BF7D;UpperCasedChecksum:1C0F01E0B3F65744F25782ABB286EDC601B4B1A66B46D2EEE782924FD37CC8B4;SizeAsReceived:8017;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2958.029; Sun, 3 May 2020 17:22:38 +0000 From: Jonathan Bakker To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, linus.walleij@linaro.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, tglx@linutronix.de, linux-input@vger.kernel.org Cc: Jonathan Bakker Subject: [PATCH 4/5] dt-bindings: iio: accel: Add required regulators to bma180 Date: Sun, 3 May 2020 10:22:05 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200503172206.13782-1-xc-racer2@live.ca> References: <20200503172206.13782-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR14CA0047.namprd14.prod.outlook.com (2603:10b6:300:12b::33) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200503172206.13782-5-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb68:9c00:8067:f823:1e15:7520) by MWHPR14CA0047.namprd14.prod.outlook.com (2603:10b6:300:12b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Sun, 3 May 2020 17:22:36 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200503172206.13782-5-xc-racer2@live.ca> X-TMN: [hjaUikFZWNubrA/C41NkCidd0DAwbksf3UHSDNhzzT56t0Q1ZoryHAwkSHdDZwu0] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: a9a4080f-6f69-4ed3-8f23-08d7ef8693b0 X-MS-TrafficTypeDiagnostic: BN8NAM11HT050: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GqhL8/X6dgfc8xVnmjCsbZXy8CtnAxp3YfLRRAhevioBNRRzNxKPjgi6cMuu7b0GXPrgyZYu3bantF80v4v0OhQc1D2KMdms5yCilnhwTWvnhXX/7cy/U5WItyp6cjlKkFmOa3bfUQPI7nwNWLfzBW34zdJQqjQLXUk9J/MnztZSpUvIEGgZu8pOUcgOgs52bREhU/F8NnFjwSM9kaAsNQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: RCmwKfly+V7JVxVGZGxYC/cOMePMKZbpsiRzezT//BiVftGGr7QOdqywrWXMG1C1210XhlwL4Ti+XP+K8mN+fxRhtdbMdXAfMaH8Cp10qtJXNcLHSyD++rVQ4Q0ktbRGVhQ7bSkiq8s7Tt4Y9cZ4QQRvrAWuy0yfhui5hpa5OaCpfgZaZP/DucLvRaVwv+JOpQFdPYvszo09CJ/ytOWb4Q== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9a4080f-6f69-4ed3-8f23-08d7ef8693b0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2020 17:22:38.3900 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM11HT050 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The bma180 and related chips should have two registers attached to them. The IIO driver currently uses them, document them here as well. Signed-off-by: Jonathan Bakker Reviewed-by: Linus Walleij Acked-by: Rob Herring --- Documentation/devicetree/bindings/iio/accel/bma180.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/accel/bma180.txt b/Documentation/devicetree/bindings/iio/accel/bma180.txt index 48bec35f452a..af34f4fe410d 100644 --- a/Documentation/devicetree/bindings/iio/accel/bma180.txt +++ b/Documentation/devicetree/bindings/iio/accel/bma180.txt @@ -11,6 +11,8 @@ Required properties: "bosch,bma250" "bosch,bma254" - reg : the I2C address of the sensor + - vdd-supply : regulator phandle connected to the VDD pin + - vddio-supply : regulator phandle connected to the VDDIO pin Optional properties: From patchwork Sun May 3 17:22:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Bakker X-Patchwork-Id: 11524673 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 C07A492A for ; Sun, 3 May 2020 17:22:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A899F20707 for ; Sun, 3 May 2020 17:22:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729043AbgECRWp (ORCPT ); Sun, 3 May 2020 13:22:45 -0400 Received: from mail-co1nam11olkn2023.outbound.protection.outlook.com ([40.92.18.23]:5344 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729034AbgECRWo (ORCPT ); Sun, 3 May 2020 13:22:44 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YAjj+TuaxCM5FW0RhJM2aVH6SOH1iIRovSnxVb4iQ+wspPMrTtubSFbeH/wR7BWh64kOPpQ53rnnOmArxAjyJDAHjHK6hjvMIKcI4tr6VEqM5reV/Dm3MwZv5UVzhi1gBrdv+jFCMXkHis7rjUEkQDaLp1cOgE4tWIcxogQJRIlthJ4VzuM+3aXDqYn3lpLU23UAUeBvaCUnd15R1sUE+okx7s3/GLGxQdj5OHuFlJQ/X4fJbGcFngwdt3qGPKonpNGEHil5eu8NtndnF+Zf3kRIUAvlIPuSeu7PkeADwgKX1ar5MqwpK8QwG121XUMi37Olm/X7HvePpT7z/VWcHg== 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=4/MmYOPjg/1mqAt/4g5mblgPnyuJfrphEqjq3uD8EZ4=; b=gZtk58OeWAxvpXyBUKlKwbkr+J24HhzZbaKkzpcLI3D1QgOXu3KFqlFin61Tax8zw0jrX6NWkrsoj8EMOdIpChm/zTYTHbdxWBVIgO1Bz/KnhGJ+sOp8zAUpoJCOUjtAi5Thl6uxeOs7Afel+HjYPVNfxjMzwBkXA2i+aGC1mNP+0Re25HwIs+4CvjR0p5v4Gi5kYRK3bb+y/YP6DS30SWO4M/15TAesRnPTb2TOujhH+yky0PtCFNqDLYW4ZD0KWMmeFNcezEKIcyOoSEfCwZfwQqQ8imSsuUHNL079bxQFXi7Cxmt5Agc9Hjm1843Sr7TFoVR5QijsYrQk5bvZwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=live.ca; dmarc=pass action=none header.from=live.ca; dkim=pass header.d=live.ca; arc=none Received: from BN8NAM11FT054.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::50) by BN8NAM11HT193.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4b::377) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Sun, 3 May 2020 17:22:40 +0000 Received: from BN6PR04MB0660.namprd04.prod.outlook.com (2a01:111:e400:fc4b::42) by BN8NAM11FT054.mail.protection.outlook.com (2a01:111:e400:fc4b::358) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Sun, 3 May 2020 17:22:40 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:D2239007F86E46457BEF9BBC2D387467E9F4266C299FB20647FB256916119525;UpperCasedChecksum:05B4ECECBBE3DF41BE2A2F588B333F9EFBBFE54EA0A936305870A3197A774360;SizeAsReceived:8002;Count:50 Received: from BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc]) by BN6PR04MB0660.namprd04.prod.outlook.com ([fe80::ad10:4127:4bc8:76fc%6]) with mapi id 15.20.2958.029; Sun, 3 May 2020 17:22:40 +0000 From: Jonathan Bakker To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, robh+dt@kernel.org, linus.walleij@linaro.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, tglx@linutronix.de, linux-input@vger.kernel.org Cc: Jonathan Bakker Subject: [PATCH 5/5] iio: accel: bma180: Add support for bma023 Date: Sun, 3 May 2020 10:22:06 -0700 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200503172206.13782-1-xc-racer2@live.ca> References: <20200503172206.13782-1-xc-racer2@live.ca> X-ClientProxiedBy: MWHPR14CA0047.namprd14.prod.outlook.com (2603:10b6:300:12b::33) To BN6PR04MB0660.namprd04.prod.outlook.com (2603:10b6:404:d9::21) X-Microsoft-Original-Message-ID: <20200503172206.13782-6-xc-racer2@live.ca> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from jon-hp-6570b.telus (2001:569:fb68:9c00:8067:f823:1e15:7520) by MWHPR14CA0047.namprd14.prod.outlook.com (2603:10b6:300:12b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Sun, 3 May 2020 17:22:38 +0000 X-Mailer: git-send-email 2.20.1 X-Microsoft-Original-Message-ID: <20200503172206.13782-6-xc-racer2@live.ca> X-TMN: [9Gw8yqnRbLq4Ijkx+rI4zEJGhtzHfOnHAbhn0iNMf3v0D3KhQGKQb0LXxYKaJUXc] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 4103f88c-8019-4c35-eae8-08d7ef86950c X-MS-TrafficTypeDiagnostic: BN8NAM11HT193: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 98574t5Wt+Kkl3T4/67J4WpR1vewEY+iv0UlroZvRZX19sUC+iAdYuv8ANXnieToIM+0kZicbYx91AOABruhex4gxY1MdEJJopvxxCWv2Fk/5dnCL0oP4Fn/zWz/MKBQeumjv31oKuUhvOOGGLZC3hKSttGec1LXNepNVmfmrRh19pHb+UPbXI1l5C64WdlOfMwHmDUXJvTJV3v2EGJqjg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR04MB0660.namprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: faaY1zTEENQ71EsLYt/fqufX+uFJ5H6WmiJv1LIEAMvhso5dyAeAyUyrxi72FYTp4EXaZRCxGmZux7t+bG5aw1htsOjLrQoun8cP2/Go6J3ZsRBMe8Yi4YbNiWPlFgibibWz1qwqP0sbvLaAAb4reSz0emjtnZqPlTBEc9spJFBOMp77JW65p2q/wypTuv7NEn2u8wJBOtj7yeOEJm+TiQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4103f88c-8019-4c35-eae8-08d7ef86950c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2020 17:22:40.6690 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM11HT193 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The bma023 chip is similar enough to the bma180 and bma25x that the same driver can support all of them. The biggest differences are the lack of a temperature channel and no low power but still working mode. The bma150 is a close relative of the bma023, but it does have a temperature channel so support is not added for it. Signed-off-by: Jonathan Bakker Reviewed-by: Linus Walleij --- drivers/iio/accel/Kconfig | 6 +- drivers/iio/accel/bma180.c | 123 +++++++++++++++++++++++++++++++++++-- 2 files changed, 122 insertions(+), 7 deletions(-) diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig index 5d91a6dda894..4699113f19d9 100644 --- a/drivers/iio/accel/Kconfig +++ b/drivers/iio/accel/Kconfig @@ -89,13 +89,13 @@ config ADXL372_I2C module will be called adxl372_i2c. config BMA180 - tristate "Bosch BMA180/BMA25x 3-Axis Accelerometer Driver" + tristate "Bosch BMA023/BMA180/BMA25x 3-Axis Accelerometer Driver" depends on I2C select IIO_BUFFER select IIO_TRIGGERED_BUFFER help - Say Y here if you want to build a driver for the Bosch BMA180 or - BMA25x triaxial acceleration sensor. + Say Y here if you want to build a driver for the Bosch BMA023, BMA180 + or BMA25x triaxial acceleration sensor. To compile this driver as a module, choose M here: the module will be called bma180. diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c index 75440dd83ec4..19d4f174a890 100644 --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c @@ -7,6 +7,7 @@ * Support for BMA250 (c) Peter Meerwald * * SPI is not supported by driver + * BMA023: 7-bit I2C slave address 0x38 * BMA180: 7-bit I2C slave address 0x40 or 0x41 * BMA250: 7-bit I2C slave address 0x18 or 0x19 * BMA254: 7-bit I2C slave address 0x18 or 0x19 @@ -33,6 +34,7 @@ #define BMA180_IRQ_NAME "bma180_event" enum chip_ids { + BMA023, BMA180, BMA250, BMA254, @@ -64,6 +66,18 @@ struct bma180_part_info { }; /* Register set */ +#define BMA023_CTRL_REG0 0x0a +#define BMA023_CTRL_REG1 0x0b +#define BMA023_CTRL_REG2 0x14 +#define BMA023_CTRL_REG3 0x15 + +#define BMA023_RANGE_MASK GENMASK(4, 3) /* Range of accel values */ +#define BMA023_BW_MASK GENMASK(2, 0) /* Accel bandwidth */ +#define BMA023_SLEEP BIT(0) +#define BMA023_INT_RESET_MASK BIT(6) +#define BMA023_NEW_DATA_INT BIT(5) /* Intr every new accel data is ready */ +#define BMA023_RESET_VAL BIT(1) + #define BMA180_CHIP_ID 0x00 /* Need to distinguish BMA180 from other */ #define BMA180_ACC_X_LSB 0x02 /* First of 6 registers of accel data */ #define BMA180_TEMP 0x08 @@ -94,6 +108,7 @@ struct bma180_part_info { /* We have to write this value in reset register to do soft reset */ #define BMA180_RESET_VAL 0xb6 +#define BMA023_ID_REG_VAL 0x02 #define BMA180_ID_REG_VAL 0x03 #define BMA250_ID_REG_VAL 0x03 #define BMA254_ID_REG_VAL 0xfa /* 250 decimal */ @@ -156,6 +171,9 @@ enum bma180_chan { TEMP }; +static int bma023_bw_table[] = { 25, 50, 100, 190, 375, 750, 1500 }; /* Hz */ +static int bma023_scale_table[] = { 2452, 4903, 9709, }; + static int bma180_bw_table[] = { 10, 20, 40, 75, 150, 300 }; /* Hz */ static int bma180_scale_table[] = { 1275, 1863, 2452, 3727, 4903, 9709, 19417 }; @@ -350,17 +368,37 @@ static int bma180_chip_init(struct bma180_data *data) */ msleep(20); - ret = bma180_set_new_data_intr_state(data, false); + return bma180_set_new_data_intr_state(data, false); +} + +static int bma023_chip_config(struct bma180_data *data) +{ + int ret = bma180_chip_init(data); + if (ret) - return ret; + goto err; + + ret = bma180_set_bw(data, 50); /* 50 Hz */ + if (ret) + goto err; + ret = bma180_set_scale(data, 2452); /* 2 G */ + if (ret) + goto err; - return bma180_set_pmode(data, false); + return 0; + +err: + dev_err(&data->client->dev, "failed to config the chip\n"); + return ret; } static int bma180_chip_config(struct bma180_data *data) { int ret = bma180_chip_init(data); + if (ret) + goto err; + ret = bma180_set_pmode(data, false); if (ret) goto err; ret = bma180_set_bits(data, BMA180_CTRL_REG0, BMA180_DIS_WAKE_UP, 1); @@ -390,6 +428,9 @@ static int bma25x_chip_config(struct bma180_data *data) { int ret = bma180_chip_init(data); + if (ret) + goto err; + ret = bma180_set_pmode(data, false); if (ret) goto err; ret = bma180_set_bw(data, 16); /* 16 Hz */ @@ -414,6 +455,17 @@ static int bma25x_chip_config(struct bma180_data *data) return ret; } +static void bma023_chip_disable(struct bma180_data *data) +{ + if (bma180_set_sleep_state(data, true)) + goto err; + + return; + +err: + dev_err(&data->client->dev, "failed to disable the chip\n"); +} + static void bma180_chip_disable(struct bma180_data *data) { if (bma180_set_new_data_intr_state(data, false)) @@ -610,6 +662,11 @@ static const struct iio_enum bma180_power_mode_enum = { .set = bma180_set_power_mode, }; +static const struct iio_chan_spec_ext_info bma023_ext_info[] = { + IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, bma180_accel_get_mount_matrix), + { } +}; + static const struct iio_chan_spec_ext_info bma180_ext_info[] = { IIO_ENUM("power_mode", true, &bma180_power_mode_enum), IIO_ENUM_AVAILABLE("power_mode", &bma180_power_mode_enum), @@ -617,6 +674,23 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = { { } }; +#define BMA023_ACC_CHANNEL(_axis, _bits) { \ + .type = IIO_ACCEL, \ + .modified = 1, \ + .channel2 = IIO_MOD_##_axis, \ + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) | \ + BIT(IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY), \ + .scan_index = AXIS_##_axis, \ + .scan_type = { \ + .sign = 's', \ + .realbits = _bits, \ + .storagebits = 16, \ + .shift = 16 - _bits, \ + }, \ + .ext_info = bma023_ext_info, \ +} + #define BMA180_ACC_CHANNEL(_axis, _bits) { \ .type = IIO_ACCEL, \ .modified = 1, \ @@ -646,6 +720,13 @@ static const struct iio_chan_spec_ext_info bma180_ext_info[] = { }, \ } +static const struct iio_chan_spec bma023_channels[] = { + BMA023_ACC_CHANNEL(X, 10), + BMA023_ACC_CHANNEL(Y, 10), + BMA023_ACC_CHANNEL(Z, 10), + IIO_CHAN_SOFT_TIMESTAMP(4), +}; + static const struct iio_chan_spec bma180_channels[] = { BMA180_ACC_CHANNEL(X, 14), BMA180_ACC_CHANNEL(Y, 14), @@ -671,6 +752,35 @@ static const struct iio_chan_spec bma254_channels[] = { }; static const struct bma180_part_info bma180_part_info[] = { + [BMA023] = { + .chip_id = BMA023_ID_REG_VAL, + .channels = bma023_channels, + .num_channels = ARRAY_SIZE(bma023_channels), + .scale_table = bma023_scale_table, + .num_scales = ARRAY_SIZE(bma023_scale_table), + .bw_table = bma023_bw_table, + .num_bw = ARRAY_SIZE(bma023_bw_table), + /* No temperature channel */ + .center_temp = 0, + .int_reset_reg = BMA023_CTRL_REG0, + .int_reset_mask = BMA023_INT_RESET_MASK, + .sleep_reg = BMA023_CTRL_REG0, + .sleep_mask = BMA023_SLEEP, + .bw_reg = BMA023_CTRL_REG2, + .bw_mask = BMA023_BW_MASK, + .scale_reg = BMA023_CTRL_REG2, + .scale_mask = BMA023_RANGE_MASK, + /* No power mode on bma023 */ + .power_reg = 0, + .power_mask = 0, + .lowpower_val = 0, + .int_enable_reg = BMA023_CTRL_REG3, + .int_enable_mask = BMA023_NEW_DATA_INT, + .softreset_reg = BMA023_CTRL_REG0, + .softreset_val = BMA023_RESET_VAL, + .chip_config = bma023_chip_config, + .chip_disable = bma023_chip_disable, + }, [BMA180] = { .chip_id = BMA180_ID_REG_VAL, .channels = bma180_channels, @@ -994,6 +1104,7 @@ static SIMPLE_DEV_PM_OPS(bma180_pm_ops, bma180_suspend, bma180_resume); #endif static const struct i2c_device_id bma180_ids[] = { + { "bma023", BMA023 }, { "bma180", BMA180 }, { "bma250", BMA250 }, { "bma254", BMA254 }, @@ -1003,6 +1114,10 @@ static const struct i2c_device_id bma180_ids[] = { MODULE_DEVICE_TABLE(i2c, bma180_ids); static const struct of_device_id bma180_of_match[] = { + { + .compatible = "bosch,bma023", + .data = (void *)BMA023 + }, { .compatible = "bosch,bma180", .data = (void *)BMA180 @@ -1034,5 +1149,5 @@ module_i2c_driver(bma180_driver); MODULE_AUTHOR("Kravchenko Oleksandr "); MODULE_AUTHOR("Texas Instruments, Inc."); -MODULE_DESCRIPTION("Bosch BMA180/BMA25x triaxial acceleration sensor"); +MODULE_DESCRIPTION("Bosch BMA023/BMA180/BMA25x triaxial acceleration sensor"); MODULE_LICENSE("GPL");