From patchwork Thu Jun 10 12:21:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 457997 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19E45C48BDF for ; Thu, 10 Jun 2021 12:24:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EAC0D6128A for ; Thu, 10 Jun 2021 12:24:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230350AbhFJM0L (ORCPT ); Thu, 10 Jun 2021 08:26:11 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.84]:21848 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230130AbhFJM0L (ORCPT ); Thu, 10 Jun 2021 08:26:11 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623327846; cv=none; d=strato.com; s=strato-dkim-0002; b=oUX/M8odnIAnnw2D1doRgDiaPGppWg1mZI3ctPQNFB5WCBw4v9vcuVeSY+2Bxzqn6b vwsn1eFUxYIW5vC2u1Uj+OxDgXjAptNVLTb1n/os1oAGodE1VGQgAn7bwFBMaqcxzwy0 HIdjZqx4MF7XYzw7y23R/N7LOJ54fZNUbpfk3rPfIwTfz5z1pj5fLeU5+nIf1c286xS4 0h3HuAIN2asbmHUPmU167sn+NkX55ejAXKIdnMAj0K6JimOB7nK3KM6UZRVlRLVJsJoY Gg3k4yPiAezx5qOYOF7N+HWOrUWlDOVEqk+Qq04qKqX6Fo82Dfhu2cXGuP3tnIpbRXhf kMdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327846; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=N255HoRwbQK6GgNYri2591dhE/OLkqcb75P2f4BWQ3w=; b=a9mK3ozC3pTxjjN0XXbgYOVqs7e12IrChZ6lgGKWdckIfkBl1I7oxJhvds0jVaxzHA XMBePJUrIo55fi6/5iAOkp/6WY0fE3cTMeJLZMaK0+/JGaWxf2Ha2A0c71Ltjv4h6k8S 6jhW5gB5cfAuKKoHHwQusboQb1ZxaUaAx7gaQu0RHTYckRKdCexp26+DoT3itCisFAfc w/x6UuhoTQzd9pwZrYL0+DdanCOM4mawJL+cxAqRXjD4zJRBUvNDIYXpyXlqD0xFpIbI +FFKTobRt4X9f9RVRWSk7DOrLaTA+p8egGiz2t0kuQ1LQbRtYqFVvAzlL0swNQ4BO8Tm 9DnQ== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327846; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=N255HoRwbQK6GgNYri2591dhE/OLkqcb75P2f4BWQ3w=; b=mrx7uzURySm5jO1HQd7GxJ33XQm5GVNCHtcp2/9S9wz+26gs0b99HqzehRDxtZhds7 KV3+sGI/89lRtnjaNOSp5vA/bUPgBhwtFcyMIcFe5YM2cSWrS5of8SczOfH2+onlixUn k7PFvPS3pfA1qTmrZP/CIyhrFSEDvQRPqeQPHER4zsowZSfbFR4VKSgLo/T8oO4sUsez 5i1HLyLw/XdLCR2R1OSJ10cvkjvyBFw/FKt8I9UNaODM8EhS5V9UZBjaWq1C4oTNeZX/ NGfGEhRvAwe0lLZwXoTa9cr0j+inz04vacoaVpNBKGXXABvLbbRxTogk+RABhCn7tt10 aw4g== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA626NTAM6" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5ACO5tzs (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 10 Jun 2021 14:24:05 +0200 (CEST) From: Stephan Gerhold To: Jonathan Cameron Cc: Lars-Peter Clausen , Rob Herring , Linus Walleij , Peter Meerwald , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Bastien Nocera , Hans de Goede , Andy Shevchenko , ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH v2 1/9] iio: accel: bmc150: Fix bma222 scale unit Date: Thu, 10 Jun 2021 14:21:18 +0200 Message-Id: <20210610122126.50504-2-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210610122126.50504-1-stephan@gerhold.net> References: <20210610122126.50504-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org According to sysfs-bus-iio documentation the unit for accelerometer values after applying scale/offset should be m/s^2, not g, which explains why the scale values for the other variants in bmc150-accel do not match exactly the values given in the datasheet. To get the correct values, we need to multiply the BMA222 scale values by g = 9.80665 m/s^2. Fixes: a1a210bf29a1 ("iio: accel: bmc150-accel: Add support for BMA222") Reviewed-by: Linus Walleij Signed-off-by: Stephan Gerhold --- Added this patch in v2 to avoid conflicts later in case this should be backported to a stable kernel. --- drivers/iio/accel/bmc150-accel-core.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index a3d08d713362..a80ee0fdabc5 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -1145,11 +1145,12 @@ static const struct bmc150_accel_chip_info bmc150_accel_chip_info_tbl[] = { /* * The datasheet page 17 says: * 15.6, 31.3, 62.5 and 125 mg per LSB. + * IIO unit is m/s^2 so multiply by g = 9.80665 m/s^2. */ - .scale_table = { {156000, BMC150_ACCEL_DEF_RANGE_2G}, - {313000, BMC150_ACCEL_DEF_RANGE_4G}, - {625000, BMC150_ACCEL_DEF_RANGE_8G}, - {1250000, BMC150_ACCEL_DEF_RANGE_16G} }, + .scale_table = { {152984, BMC150_ACCEL_DEF_RANGE_2G}, + {306948, BMC150_ACCEL_DEF_RANGE_4G}, + {612916, BMC150_ACCEL_DEF_RANGE_8G}, + {1225831, BMC150_ACCEL_DEF_RANGE_16G} }, }, [bma222e] = { .name = "BMA222E", From patchwork Thu Jun 10 12:21:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 457996 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC92AC48BD1 for ; Thu, 10 Jun 2021 12:24:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC9766128A for ; Thu, 10 Jun 2021 12:24:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230343AbhFJM0P (ORCPT ); Thu, 10 Jun 2021 08:26:15 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.80]:26888 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230001AbhFJM0O (ORCPT ); Thu, 10 Jun 2021 08:26:14 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623327847; cv=none; d=strato.com; s=strato-dkim-0002; b=U9K/4NXhiz+KGL36ojsHxfk8bsrWDqAxOEYFETV6nQfLXlWB6nfJi/LqWl6+Yj3cKP zxu1DHjfTSaDzzq3PzkDdPOJMWtx/qmijTq4P2nNWvnjs7sEg9YRLb3CmZp1ADIN+3iL fknQIy0yOv/9/UpJ61W8j8l3nbyqhY0KhxqX3ihYc0i4yObJu4OrMbtOl/IVzeAWEDfS kvsVGYQbyRyYXCW+t/635Xnxn9dfqFKCGoXM5uli+bqztrQMEUhnefZHtdtKPv0DSkBB tF+RAe7yQniW967We+QznzFsj9e+pMecGeF8RsmiexmO41NahEMrjKyGl5U7doiaUUxq lvtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327847; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=Q3a2e6tWtMSAThjzKRoRF1YLXGRImqB6MZinCdGysEc=; b=mRGW90YggplPOrnSPQDgF+RUBhkfX0/tM11m52zOLi5KaWEqpynxdB4qgsFUbh9K8+ 80+/QM0eA0DAitY+PW79r5mEY8wxLumWDs8gaySKXFIzoTLBkI4/SM4AoD1jRnICRwJm 9KTp6U3pU3WCX0wQwvqysbUWL3W6ncFRTNaqCRxx1Q/6Wg003TMknGZ57jvrYgrlA+2L Lht9QxDPojKa39Tg88ptu7CwtG6gVPPRQsY7CE7whBRwHajB3hxXm7V4QUBTfez8oqW7 DUlSa16yKR9Qj68vQyc6fyMQnzsVj23x60Z95rec0yxoP48uLsc19VDemunN26FNTy/X ai7w== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327847; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=Q3a2e6tWtMSAThjzKRoRF1YLXGRImqB6MZinCdGysEc=; b=MLwf2EKGoGS4eQvMvOhZ+3ifTSxcKqmOgi/Q5qt4zbkd7pWjJ4qNAqKiNwagEYcFQG JLcaoOCM4THE43tKA/zWV9nl1mHUeIYw4WCqWtaZcOAo7XZojnzbTYutdV+X+BF9dv6C AX+J4NCttmAz3IMFZ6uHah2ku6xVPnCEuSUs+HDD86aRFwx9HqXwFoHNqUFAOyprUGPL C1QAFTQ4Snj8bsavF17cGGrvUFYdsm8f3egIJDHZ4ah2wDxS2G+jTR1RkPqwNBSPnVUP jve358FDhdka6WQhixI3gILZ8cx04SKfrNxmHfWtT1xWy1FTp5sXhudMCvKkjpeY3P3k xsSA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA626NTAM6" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5ACO6tzt (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 10 Jun 2021 14:24:06 +0200 (CEST) From: Stephan Gerhold To: Jonathan Cameron Cc: Lars-Peter Clausen , Rob Herring , Linus Walleij , Peter Meerwald , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Bastien Nocera , Hans de Goede , Andy Shevchenko , ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH v2 2/9] iio: accel: bmc150: Drop misleading/duplicate chip identifiers Date: Thu, 10 Jun 2021 14:21:19 +0200 Message-Id: <20210610122126.50504-3-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210610122126.50504-1-stephan@gerhold.net> References: <20210610122126.50504-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Commit 0ad4bf370176 ("iio:accel:bmc150-accel: Use the chip ID to detect sensor variant") stopped using the I2C/ACPI match data to look up the bmc150_accel_chip_info. However, the bmc150_accel_chip_info_tbl remained as-is, with multiple entries with the same chip_id (e.g. 0xFA for BMC150/BMI055/BMA255). This is redundant now because actually the driver will always select the first entry with a matching chip_id. So even if a device probes e.g. with BMA0255 it will end up using the chip_info for BMC150. And in general that's fine for now, the entries for BMC150/BMI055/BMA255 were exactly the same anyway (except for the name, which is replaced with the more accurate one later). But in this case it's misleading because it suggests that one should add even more entries with the same chip_id when adding support for new variants. Let's make that more clear by removing the enum with the chip identifiers entirely and instead have only one entry per chip_id. Note that we may need to bring back some mechanism to differentiate between different chips with the same chip_id in the future. For example, BMA250 (currently supported by the bma180 driver) has the same chip_id = 0x03 as BMA222 even though they have different channel sizes (8 bits vs 10 bits). But in any case, that mechanism would need to look quite different from what we have right now. Cc: Bastien Nocera Reviewed-by: Linus Walleij Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Stephan Gerhold --- Note: Andy's Reviewed-by: here applies only together with patch 4 ("iio: accel: bmc150: Sort all chip names alphabetically / by chip ID"). :) --- drivers/iio/accel/bmc150-accel-core.c | 34 ++++++--------------------- drivers/iio/accel/bmc150-accel-i2c.c | 30 +++++++++++------------ drivers/iio/accel/bmc150-accel-spi.c | 30 +++++++++++------------ drivers/iio/accel/bmc150-accel.h | 10 -------- 4 files changed, 37 insertions(+), 67 deletions(-) diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index a80ee0fdabc5..a0df704730ee 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -1097,28 +1097,8 @@ static const struct iio_chan_spec bma280_accel_channels[] = BMC150_ACCEL_CHANNELS(14); static const struct bmc150_accel_chip_info bmc150_accel_chip_info_tbl[] = { - [bmc150] = { - .name = "BMC150A", - .chip_id = 0xFA, - .channels = bmc150_accel_channels, - .num_channels = ARRAY_SIZE(bmc150_accel_channels), - .scale_table = { {9610, BMC150_ACCEL_DEF_RANGE_2G}, - {19122, BMC150_ACCEL_DEF_RANGE_4G}, - {38344, BMC150_ACCEL_DEF_RANGE_8G}, - {76590, BMC150_ACCEL_DEF_RANGE_16G} }, - }, - [bmi055] = { - .name = "BMI055A", - .chip_id = 0xFA, - .channels = bmc150_accel_channels, - .num_channels = ARRAY_SIZE(bmc150_accel_channels), - .scale_table = { {9610, BMC150_ACCEL_DEF_RANGE_2G}, - {19122, BMC150_ACCEL_DEF_RANGE_4G}, - {38344, BMC150_ACCEL_DEF_RANGE_8G}, - {76590, BMC150_ACCEL_DEF_RANGE_16G} }, - }, - [bma255] = { - .name = "BMA0255", + { + .name = "BMC150/BMI055/BMA255", .chip_id = 0xFA, .channels = bmc150_accel_channels, .num_channels = ARRAY_SIZE(bmc150_accel_channels), @@ -1127,7 +1107,7 @@ static const struct bmc150_accel_chip_info bmc150_accel_chip_info_tbl[] = { {38344, BMC150_ACCEL_DEF_RANGE_8G}, {76590, BMC150_ACCEL_DEF_RANGE_16G} }, }, - [bma250e] = { + { .name = "BMA250E", .chip_id = 0xF9, .channels = bma250e_accel_channels, @@ -1137,7 +1117,7 @@ static const struct bmc150_accel_chip_info bmc150_accel_chip_info_tbl[] = { {153277, BMC150_ACCEL_DEF_RANGE_8G}, {306457, BMC150_ACCEL_DEF_RANGE_16G} }, }, - [bma222] = { + { .name = "BMA222", .chip_id = 0x03, .channels = bma222e_accel_channels, @@ -1152,7 +1132,7 @@ static const struct bmc150_accel_chip_info bmc150_accel_chip_info_tbl[] = { {612916, BMC150_ACCEL_DEF_RANGE_8G}, {1225831, BMC150_ACCEL_DEF_RANGE_16G} }, }, - [bma222e] = { + { .name = "BMA222E", .chip_id = 0xF8, .channels = bma222e_accel_channels, @@ -1162,8 +1142,8 @@ static const struct bmc150_accel_chip_info bmc150_accel_chip_info_tbl[] = { {612915, BMC150_ACCEL_DEF_RANGE_8G}, {1225831, BMC150_ACCEL_DEF_RANGE_16G} }, }, - [bma280] = { - .name = "BMA0280", + { + .name = "BMA280", .chip_id = 0xFB, .channels = bma280_accel_channels, .num_channels = ARRAY_SIZE(bma280_accel_channels), diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c index d34dddb850d9..b8bda0dfb495 100644 --- a/drivers/iio/accel/bmc150-accel-i2c.c +++ b/drivers/iio/accel/bmc150-accel-i2c.c @@ -221,14 +221,14 @@ static int bmc150_accel_remove(struct i2c_client *client) } static const struct acpi_device_id bmc150_accel_acpi_match[] = { - {"BSBA0150", bmc150}, - {"BMC150A", bmc150}, - {"BMI055A", bmi055}, - {"BMA0255", bma255}, - {"BMA250E", bma250e}, - {"BMA222", bma222}, - {"BMA222E", bma222e}, - {"BMA0280", bma280}, + {"BSBA0150"}, + {"BMC150A"}, + {"BMI055A"}, + {"BMA0255"}, + {"BMA250E"}, + {"BMA222"}, + {"BMA222E"}, + {"BMA0280"}, {"BOSC0200"}, {"DUAL250E"}, { }, @@ -236,13 +236,13 @@ static const struct acpi_device_id bmc150_accel_acpi_match[] = { MODULE_DEVICE_TABLE(acpi, bmc150_accel_acpi_match); static const struct i2c_device_id bmc150_accel_id[] = { - {"bmc150_accel", bmc150}, - {"bmi055_accel", bmi055}, - {"bma255", bma255}, - {"bma250e", bma250e}, - {"bma222", bma222}, - {"bma222e", bma222e}, - {"bma280", bma280}, + {"bmc150_accel"}, + {"bmi055_accel"}, + {"bma255"}, + {"bma250e"}, + {"bma222"}, + {"bma222e"}, + {"bma280"}, {} }; diff --git a/drivers/iio/accel/bmc150-accel-spi.c b/drivers/iio/accel/bmc150-accel-spi.c index 74a8aee4f612..01b42fa6a015 100644 --- a/drivers/iio/accel/bmc150-accel-spi.c +++ b/drivers/iio/accel/bmc150-accel-spi.c @@ -34,26 +34,26 @@ static int bmc150_accel_remove(struct spi_device *spi) } static const struct acpi_device_id bmc150_accel_acpi_match[] = { - {"BSBA0150", bmc150}, - {"BMC150A", bmc150}, - {"BMI055A", bmi055}, - {"BMA0255", bma255}, - {"BMA250E", bma250e}, - {"BMA222", bma222}, - {"BMA222E", bma222e}, - {"BMA0280", bma280}, + {"BSBA0150"}, + {"BMC150A"}, + {"BMI055A"}, + {"BMA0255"}, + {"BMA250E"}, + {"BMA222"}, + {"BMA222E"}, + {"BMA0280"}, { }, }; MODULE_DEVICE_TABLE(acpi, bmc150_accel_acpi_match); static const struct spi_device_id bmc150_accel_id[] = { - {"bmc150_accel", bmc150}, - {"bmi055_accel", bmi055}, - {"bma255", bma255}, - {"bma250e", bma250e}, - {"bma222", bma222}, - {"bma222e", bma222e}, - {"bma280", bma280}, + {"bmc150_accel"}, + {"bmi055_accel"}, + {"bma255"}, + {"bma250e"}, + {"bma222"}, + {"bma222e"}, + {"bma280"}, {} }; MODULE_DEVICE_TABLE(spi, bmc150_accel_id); diff --git a/drivers/iio/accel/bmc150-accel.h b/drivers/iio/accel/bmc150-accel.h index d67d6ed6ae77..47121f070fe9 100644 --- a/drivers/iio/accel/bmc150-accel.h +++ b/drivers/iio/accel/bmc150-accel.h @@ -68,16 +68,6 @@ struct bmc150_accel_data { struct iio_mount_matrix orientation; }; -enum { - bmc150, - bmi055, - bma255, - bma250e, - bma222, - bma222e, - bma280, -}; - int bmc150_accel_core_probe(struct device *dev, struct regmap *regmap, int irq, const char *name, bool block_supported); int bmc150_accel_core_remove(struct device *dev); From patchwork Thu Jun 10 12:21:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 458723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24ED1C48BE0 for ; Thu, 10 Jun 2021 12:24:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08E57613BC for ; Thu, 10 Jun 2021 12:24:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230001AbhFJM0P (ORCPT ); Thu, 10 Jun 2021 08:26:15 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.81]:19039 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230248AbhFJM0P (ORCPT ); Thu, 10 Jun 2021 08:26:15 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623327847; cv=none; d=strato.com; s=strato-dkim-0002; b=Oz9Xgt5RWiYi2mzUK2wEGjZXyu4OM7W6+RORbOf8Wp9ey7maI/ryPMzUxoo5GQiVxR NF2ecoaGzF7E1+fgEd5AlileKakzAgvBlCx/VAfCsrW29tePDHWBFtQh/7C9Ug6WcTE6 GCN8+cU6DTv8W2ECj4apxpdkcCBgqI7vWoUy/S3sKDcTunlPKdvkgoiHnR/XgZNhLPHk KFA573kuri1EMP4OyVEHZHqlBrILh4a9BKlBhhCGEPSwBEDmXsjbLOUzNBdIYVDnhdN6 z9dM9Vdh3x9PEq4ZUczPhAQyyOCf1YFgvhglo9pNHGRimHZ73r+OVU4xGT4/mgANw+Eg ZX0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327847; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=A24UVyz140TpBvsuyBtwZejZRIcnrKYlIvJOfsBlnjQ=; b=bgrk1OQteF1P0499obcbuU0n+UKba4jjbLvqF6qEDrjcgePbo68uYKbvt/egawtbaM DsrF0HkK8EZfJFidpMdaIXQVOqp60mMPvloZkRsXJ+m2ftJbNuR0AaGwwiQ0RZ958dze zEYfYin8zNEksQmJVBIkQR0LZoOtWw4UISmes/eReAsFk3A7/pgleBlPKB+VZ0phm9BH idNcDUhVJsptxCLNyqc67anPfsSkwFOPARTrqTtJiGIKRNDqm24QPs7ea3YG30GO6erz e6g83htMe3F4DkN3wuVEORQbd8r+dIY2Kb4xKTORiSwDRau9E6AqHI/DB5rzseFPGRVL tlow== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327847; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=A24UVyz140TpBvsuyBtwZejZRIcnrKYlIvJOfsBlnjQ=; b=XACzzH/z02romuxLmUD2e3KycrSIDoJSfoCqhso4HiNWyGtNQGyvQ1b8IYNOPWSENd ZWV0LDCtIiRFcWDsT/YFjV4s+kkBQO431dwstrU3AuqCl6azX1ZMLI82Mfy35FehIvra RJMhrqqFrS05QQ+5/Rwxo6ImpX/tVlXekdNROKRXvcpqPXrfxMczBZ6sDNnJUjXJcax4 YW2oYzfz40DLaOiCoO7a+929lr9XLvd21hxOWnCUzqvmLuvUlocGVaA+aBA8G6EtSOgX 1KcwIglW1DGidJQo9qzvbVo3Iu8tkSE2Jj2EEf+tYvKPvwrXldxnRLNWc6BKH+qFzbaf No0g== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA626NTAM6" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5ACO7tzu (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 10 Jun 2021 14:24:07 +0200 (CEST) From: Stephan Gerhold To: Jonathan Cameron Cc: Lars-Peter Clausen , Rob Herring , Linus Walleij , Peter Meerwald , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Bastien Nocera , Hans de Goede , Andy Shevchenko , ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH v2 3/9] iio: accel: bmc150: Drop duplicated documentation of supported chips Date: Thu, 10 Jun 2021 14:21:20 +0200 Message-Id: <20210610122126.50504-4-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210610122126.50504-1-stephan@gerhold.net> References: <20210610122126.50504-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The chips supported by the bmc150-accel driver are clearly documented in Kconfig, in the bmc150_accel_chip_info_tbl as well as in all the device ID tables in the I2C/SPI drivers. It's easy to forget to update the lists in the file header. Drop those entirely to reduce the amount of changes required to add new chip variants. Signed-off-by: Stephan Gerhold --- New patch in v2. Originally I tried to reorder those too but then it caused conflicts in all my following patches so I'm not convinced it's worth to try and keep those up to date. --- drivers/iio/accel/bmc150-accel-core.c | 10 +--------- drivers/iio/accel/bmc150-accel-i2c.c | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index a0df704730ee..6fb025b4228f 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -1,14 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * 3-axis accelerometer driver supporting following Bosch-Sensortec chips: - * - BMC150 - * - BMI055 - * - BMA255 - * - BMA250E - * - BMA222 - * - BMA222E - * - BMA280 - * + * 3-axis accelerometer driver supporting many Bosch-Sensortec chips * Copyright (c) 2014, Intel Corporation. */ diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c index b8bda0dfb495..a0e2782580b7 100644 --- a/drivers/iio/accel/bmc150-accel-i2c.c +++ b/drivers/iio/accel/bmc150-accel-i2c.c @@ -1,14 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * 3-axis accelerometer driver supporting following I2C Bosch-Sensortec chips: - * - BMC150 - * - BMI055 - * - BMA255 - * - BMA250E - * - BMA222 - * - BMA222E - * - BMA280 - * + * 3-axis accelerometer driver supporting many I2C Bosch-Sensortec chips * Copyright (c) 2014, Intel Corporation. */ From patchwork Thu Jun 10 12:21:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 457995 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51ED4C48BDF for ; Thu, 10 Jun 2021 12:24:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3D7266128A for ; Thu, 10 Jun 2021 12:24:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230201AbhFJM0S (ORCPT ); Thu, 10 Jun 2021 08:26:18 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.84]:12430 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230247AbhFJM0P (ORCPT ); Thu, 10 Jun 2021 08:26:15 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623327848; cv=none; d=strato.com; s=strato-dkim-0002; b=du/vEM0BJUmObeD5qFiL9266QvTHKuzLW1lCzmwvRFVOxxuTBnjWVFbRbiPDFMMmR9 HKBQEoijPLHkqOofWu1koFnGWixlKe53b/cBAyBnM5S07708+l8I2GwgX58ygvBtq256 OrUhT3ySuPx8fbbgDFJEVpTnHUfC+i1cpfOB7h9cK9de/I0ZuT/BOj/G8m7yu0Aaskwb Z2AFyI13DZganEDj6XLVIDh+MujkfK9UAaBaziKtdcAT0eEQNXpIdnSwk6urZmfwhP6c nZOV88QheM4xKRD8TRrF3bg6tUHtqolzIqh/plhShh5/5NSyeE2yxeEiquh6zp7YqyKb b2Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327848; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=7ZnJWOKXF3bam85beD5D5WnhHWKhMFJvGQTO/dyDe5w=; b=C8q/MMax9vCpMOd7XdLm7b+rRky0MFGwR1SBIusOkba9J6wvKrtSqRZAFdHceVljBH LN3+OSozaKLekRpdBH4fY6a+gKxtZ30FHP/v5AaqzN6v6nZeRYD+eSumcFAQn/idZTgS nGK0uNG4r2w/teHphoBuqjJyX+ADtTFRXR/5JM1Nq8oQB/PA4xf9g+YfKb+2OMit21j/ 9eQbUsrbsmSmKm4HhLtlGkNSTifc2AtWwe4q+zAkpby30PharIvKHUZDUIbiPsS2Bk8E YxjqWFfqL4z/AtfiQQvkUmXQ82pVdt74ySkzIwmw0WMrjz4MHHfSH/gxRMdvNY4XNyzt LdyQ== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327848; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=7ZnJWOKXF3bam85beD5D5WnhHWKhMFJvGQTO/dyDe5w=; b=acF4Mq6im9xox4XgDiYu/tzRFO7tZxjtVhpKmCHVZh4XZNkFqvBbCdXZbyuHrfxCoD +qZ5T/UQzhtr+m5Y/XVhtx6N3SSbc1INOMMKl9Enqs0dIGzL9lqTtqMDr1S1NrQLHjwb 2bwzDYL7eHc8MDc1lnIqD88moSJ9ddmmzR5OfnM9rbtBAZZoKDyO1KdOVywLHF6nCBnD nJgtQuk/fnwm7iJaxjyUSJS9t5ZgUf0Wmjkz+5j6GEypUVElOnzNatEvYxdYucwzyeMU Mqy9NGAAmc0mJU9nCT/XrZvauQkKIjjGuNNxukXaTW+jzkNxQn62XIEGUB8AEbskbChr vUxA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA626NTAM6" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5ACO7tzv (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 10 Jun 2021 14:24:07 +0200 (CEST) From: Stephan Gerhold To: Jonathan Cameron Cc: Lars-Peter Clausen , Rob Herring , Linus Walleij , Peter Meerwald , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Bastien Nocera , Hans de Goede , Andy Shevchenko , ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH v2 4/9] iio: accel: bmc150: Sort all chip names alphabetically / by chip ID Date: Thu, 10 Jun 2021 14:21:21 +0200 Message-Id: <20210610122126.50504-5-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210610122126.50504-1-stephan@gerhold.net> References: <20210610122126.50504-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Right now all the device IDs are listed in seemingly random order, make this consistent by ordering those alphabetically. Also, order bmc150_accel_chip_info_tbl by chip ID for the same reason. Suggested-by: Andy Shevchenko Signed-off-by: Stephan Gerhold Reviewed-by: Andy Shevchenko --- New patch in v2. --- drivers/iio/accel/Kconfig | 4 +-- drivers/iio/accel/bmc150-accel-core.c | 40 +++++++++++++-------------- drivers/iio/accel/bmc150-accel-i2c.c | 26 ++++++++--------- drivers/iio/accel/bmc150-accel-spi.c | 18 ++++++------ 4 files changed, 44 insertions(+), 44 deletions(-) diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig index 17f6bdcf1db3..883aa8bc4340 100644 --- a/drivers/iio/accel/Kconfig +++ b/drivers/iio/accel/Kconfig @@ -143,9 +143,9 @@ config BMC150_ACCEL select BMC150_ACCEL_SPI if SPI help Say yes here to build support for the following Bosch accelerometers: - BMC150, BMI055, BMA250E, BMA222E, BMA255, BMA280. + BMA222, BMA222E, BMA250E, BMA255, BMA280, BMC150, BMI055. - This is a combo module with both accelerometer and magnetometer. + BMC150 is a combo module with both accelerometer and magnetometer. This driver is only implementing accelerometer part, which has its own address and register map. diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index 6fb025b4228f..1210a8b14a3c 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -1089,26 +1089,6 @@ static const struct iio_chan_spec bma280_accel_channels[] = BMC150_ACCEL_CHANNELS(14); static const struct bmc150_accel_chip_info bmc150_accel_chip_info_tbl[] = { - { - .name = "BMC150/BMI055/BMA255", - .chip_id = 0xFA, - .channels = bmc150_accel_channels, - .num_channels = ARRAY_SIZE(bmc150_accel_channels), - .scale_table = { {9610, BMC150_ACCEL_DEF_RANGE_2G}, - {19122, BMC150_ACCEL_DEF_RANGE_4G}, - {38344, BMC150_ACCEL_DEF_RANGE_8G}, - {76590, BMC150_ACCEL_DEF_RANGE_16G} }, - }, - { - .name = "BMA250E", - .chip_id = 0xF9, - .channels = bma250e_accel_channels, - .num_channels = ARRAY_SIZE(bma250e_accel_channels), - .scale_table = { {38344, BMC150_ACCEL_DEF_RANGE_2G}, - {76590, BMC150_ACCEL_DEF_RANGE_4G}, - {153277, BMC150_ACCEL_DEF_RANGE_8G}, - {306457, BMC150_ACCEL_DEF_RANGE_16G} }, - }, { .name = "BMA222", .chip_id = 0x03, @@ -1134,6 +1114,26 @@ static const struct bmc150_accel_chip_info bmc150_accel_chip_info_tbl[] = { {612915, BMC150_ACCEL_DEF_RANGE_8G}, {1225831, BMC150_ACCEL_DEF_RANGE_16G} }, }, + { + .name = "BMA250E", + .chip_id = 0xF9, + .channels = bma250e_accel_channels, + .num_channels = ARRAY_SIZE(bma250e_accel_channels), + .scale_table = { {38344, BMC150_ACCEL_DEF_RANGE_2G}, + {76590, BMC150_ACCEL_DEF_RANGE_4G}, + {153277, BMC150_ACCEL_DEF_RANGE_8G}, + {306457, BMC150_ACCEL_DEF_RANGE_16G} }, + }, + { + .name = "BMC150/BMI055/BMA255", + .chip_id = 0xFA, + .channels = bmc150_accel_channels, + .num_channels = ARRAY_SIZE(bmc150_accel_channels), + .scale_table = { {9610, BMC150_ACCEL_DEF_RANGE_2G}, + {19122, BMC150_ACCEL_DEF_RANGE_4G}, + {38344, BMC150_ACCEL_DEF_RANGE_8G}, + {76590, BMC150_ACCEL_DEF_RANGE_16G} }, + }, { .name = "BMA280", .chip_id = 0xFB, diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c index a0e2782580b7..7db436ddbdce 100644 --- a/drivers/iio/accel/bmc150-accel-i2c.c +++ b/drivers/iio/accel/bmc150-accel-i2c.c @@ -213,41 +213,41 @@ static int bmc150_accel_remove(struct i2c_client *client) } static const struct acpi_device_id bmc150_accel_acpi_match[] = { - {"BSBA0150"}, - {"BMC150A"}, - {"BMI055A"}, {"BMA0255"}, - {"BMA250E"}, + {"BMA0280"}, {"BMA222"}, {"BMA222E"}, - {"BMA0280"}, + {"BMA250E"}, + {"BMC150A"}, + {"BMI055A"}, {"BOSC0200"}, + {"BSBA0150"}, {"DUAL250E"}, { }, }; MODULE_DEVICE_TABLE(acpi, bmc150_accel_acpi_match); static const struct i2c_device_id bmc150_accel_id[] = { - {"bmc150_accel"}, - {"bmi055_accel"}, - {"bma255"}, - {"bma250e"}, {"bma222"}, {"bma222e"}, + {"bma250e"}, + {"bma255"}, {"bma280"}, + {"bmc150_accel"}, + {"bmi055_accel"}, {} }; MODULE_DEVICE_TABLE(i2c, bmc150_accel_id); static const struct of_device_id bmc150_accel_of_match[] = { - { .compatible = "bosch,bmc150_accel" }, - { .compatible = "bosch,bmi055_accel" }, - { .compatible = "bosch,bma255" }, - { .compatible = "bosch,bma250e" }, { .compatible = "bosch,bma222" }, { .compatible = "bosch,bma222e" }, + { .compatible = "bosch,bma250e" }, + { .compatible = "bosch,bma255" }, { .compatible = "bosch,bma280" }, + { .compatible = "bosch,bmc150_accel" }, + { .compatible = "bosch,bmi055_accel" }, { }, }; MODULE_DEVICE_TABLE(of, bmc150_accel_of_match); diff --git a/drivers/iio/accel/bmc150-accel-spi.c b/drivers/iio/accel/bmc150-accel-spi.c index 01b42fa6a015..dc884fa18ad0 100644 --- a/drivers/iio/accel/bmc150-accel-spi.c +++ b/drivers/iio/accel/bmc150-accel-spi.c @@ -34,26 +34,26 @@ static int bmc150_accel_remove(struct spi_device *spi) } static const struct acpi_device_id bmc150_accel_acpi_match[] = { - {"BSBA0150"}, - {"BMC150A"}, - {"BMI055A"}, {"BMA0255"}, - {"BMA250E"}, + {"BMA0280"}, {"BMA222"}, {"BMA222E"}, - {"BMA0280"}, + {"BMA250E"}, + {"BMC150A"}, + {"BMI055A"}, + {"BSBA0150"}, { }, }; MODULE_DEVICE_TABLE(acpi, bmc150_accel_acpi_match); static const struct spi_device_id bmc150_accel_id[] = { - {"bmc150_accel"}, - {"bmi055_accel"}, - {"bma255"}, - {"bma250e"}, {"bma222"}, {"bma222e"}, + {"bma250e"}, + {"bma255"}, {"bma280"}, + {"bmc150_accel"}, + {"bmi055_accel"}, {} }; MODULE_DEVICE_TABLE(spi, bmc150_accel_id); From patchwork Thu Jun 10 12:21:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 458722 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D332C48BE6 for ; Thu, 10 Jun 2021 12:24:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 36F7F613BC for ; Thu, 10 Jun 2021 12:24:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230346AbhFJM0T (ORCPT ); Thu, 10 Jun 2021 08:26:19 -0400 Received: from mo4-p03-ob.smtp.rzone.de ([81.169.146.174]:18874 "EHLO mo4-p03-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230304AbhFJM0R (ORCPT ); Thu, 10 Jun 2021 08:26:17 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623327848; cv=none; d=strato.com; s=strato-dkim-0002; b=VnY+r169OFGSFRHtxpraf/HCOWLfhCuNYOLSdOnNMb5+fzQbbvNeHRHSjiSzWLhFI9 xnqe9mbi8+GcO5xoOXzMqGLP+AmL+qKVU24sa4+DCurzhhvk5JO7LyXfSL91hs2WIfxs 5oFbNUunWldRgn1x/oyI6qDAouJCVVsOTfPHHxUCbRrje2rCWHGAYELXe6+1kRnY62lj v5gwnyjdghaNLopUtDxXu3yWLiBY/VHWLCifOQ7YQjMj/NNoEOrscIlMmTaCA6UO9tiC jXV9P7MY4ZsxscnTf1Lp5HiO9y187GQR6TN0k4+XgXhLVuqfoSt3w7TqimGZAz0hJ6yK 5clw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327848; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=mzhlFtT0uPEpgxtGsCZLk5RpPAfjBTETW3jiAJ+alHo=; b=bAS2uc9Mf/zP/m4kWJqYZ+ZJ2/sa6ZTe2VbE0xmxjPEVLa66p1/b/HEG61A/sJF1Nq v35/v/WfMxIoLXoZi7Zp5ZB7kCJgyM9uINz5xcqB/PR5vWl9T46YkP71y5O1HglpnKh5 W0JJipULwMdIdZhbVEwnRi0q9eQU1edov1B8GGgHNpW1ygRuUV8kMGHQ9GMG+jElMuU7 dQSXTAYOTV0hQuMCvp3iDvNjXcwmPnsjxT+jeL3Ltn+NuLHcNH1I3/I2ih1XwKRjOuLA 6BASKphgqIFI+poXk2zzl4TOXW9rJBq2QMLnovAIFdQFYxVm+dXjNmZFZzAE4l3uddfZ fZDg== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327848; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=mzhlFtT0uPEpgxtGsCZLk5RpPAfjBTETW3jiAJ+alHo=; b=XM7rBGd7ssFaduYITxxTvJfWla/kj2zyLs9Zcddm+dJKgCRe8G6ovb8Gwe155U8yTN HF1FdARiXA6Uo/IV8ci3rpne1r8qbBbC8phJU9ZrjrsaRA2ZaQbEiHMUZM0Gzx3ERxfB 1R/3d/EuFTXCgWGjndVTAMUOMb2TIOtj/SUDlTW4au8VMqJRaye7yvFRfywVliH5s+id hCvVYdykRSw9e0qB8TAHzb/oqk1rUyfy/BqgFVBDG2CbyVYDVS6uqkb0X0TabqVv/dHC VcEenO3Rz+qheF/Z/sHdxREd758ZqRTybC6MAAMyhyyk0vtf00I6hzyhgEYUg6L5wqqP YiLA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA626NTAM6" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5ACO8tzx (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 10 Jun 2021 14:24:08 +0200 (CEST) From: Stephan Gerhold To: Jonathan Cameron Cc: Lars-Peter Clausen , Rob Herring , Linus Walleij , Peter Meerwald , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Bastien Nocera , Hans de Goede , Andy Shevchenko , ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH v2 5/9] dt-bindings: iio: accel: bma255: Document bosch, bma253 Date: Thu, 10 Jun 2021 14:21:22 +0200 Message-Id: <20210610122126.50504-6-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210610122126.50504-1-stephan@gerhold.net> References: <20210610122126.50504-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org BMA253 is mostly like BMA255 that is already supported by the bmc150-accel driver. Document an extra bosch,bma253 compatible for it. Reviewed-by: Linus Walleij Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Stephan Gerhold --- Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml b/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml index c2efbb813ca2..8afb0fe8ef5c 100644 --- a/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml +++ b/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml @@ -18,6 +18,7 @@ properties: enum: - bosch,bmc150_accel - bosch,bmi055_accel + - bosch,bma253 - bosch,bma255 - bosch,bma250e - bosch,bma222 From patchwork Thu Jun 10 12:21:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 457994 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7A85C48BE0 for ; Thu, 10 Jun 2021 12:24:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 962B861403 for ; Thu, 10 Jun 2021 12:24:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230363AbhFJM0S (ORCPT ); Thu, 10 Jun 2021 08:26:18 -0400 Received: from mo4-p03-ob.smtp.rzone.de ([81.169.146.175]:33204 "EHLO mo4-p03-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230345AbhFJM0P (ORCPT ); Thu, 10 Jun 2021 08:26:15 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623327849; cv=none; d=strato.com; s=strato-dkim-0002; b=Nc7xTzU4f6vU7FjaLD0c5Xjf72E9RujPXyBumx2J1Jd2xIQwuQ8a+DQjGiirHSATzF gNVU4eMV8io0VzmdslcQC6CkZgEebbZyI7pHT5k1OYUnZQOVPzj+CLPCSIUF2fdyYQwT L+igcDMHOtYdIDglsGic5OuxV5eycdHMSNJ/hemjeiuV7iTu5/3ab2/bofqELGweUAoi CmXCelyMHs79GMK/E3mkHvDM505OHvhYUZbASlZ/CNJp8YvVDn50dSuDEizb3rnMdVkr toXvLYR+Bq2Ar7rLcS+dyTEKJitX+7Xw8WcHwNI9R1sVYgqV14dNt/JHoTBH0hoZxWcw F28w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327849; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=aiTLXr6+ZboJpByh7I+hIxTMyKJ2BLZOGqmxqkTxqzA=; b=J2I6sdyk2tlhedrClpvamapxyvspVQRZy+mr9NSmU/0F8V6lh38aUdQsUXeSMWTxXN 3+7W3zpIpQOoTlvr391ax5QRa7lQiVoXFhyP+0t01EeX2SJIzYmsT2DHQH8IGA8RhURI bADUNaIbUwPnKXyt1DrNbZfkOKRrbXn7Kiw08KEgm1HsM3y5bw3GawJYZGZdAVvVI1Y/ tEho1CprptSVIdKRpqhPZDHpmyqFgjeqF0Il2uZEb+Dp42tbWvYkWkjX58OlY86zkO18 mBfHFM2iRUzTX33/DsPVZnIwMzx9tvOXIlBmN1CC3RXmd+Jw8s8K5jmnUthO4/B9Uef9 3JMQ== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327849; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=aiTLXr6+ZboJpByh7I+hIxTMyKJ2BLZOGqmxqkTxqzA=; b=A8/hmhMnZnXWVZQcRM07ib29mBZzAgx2gy1PO/Gum7YfRxKa9rNChII/bGVJXMO0bw AlMNJcdlNegxazwp4fUq2+odpzxdZ9WMJoluesT5qyXsZ7x+h9FU7TKcrWO+eCGW/Mii roKMmVQKr/nrymxDJ8P5K5SWhiyxOK3JPc1aHFroP7P4pxlGUsnGm5UeppmYTYl1lYfM IY/1IizMnjdZYn7ToIdgJVub88q7cM7o8+6wcb2AEZftJEQn7thbMGEVK9eDLvoXHc4H SNrbMwPHkF3P/WIIjAF497Pvt6PCQYSSb9e01c1UolygbGu8WDR4WCNsD+A51MnJD+ta q0mw== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA626NTAM6" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5ACO9tzy (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 10 Jun 2021 14:24:09 +0200 (CEST) From: Stephan Gerhold To: Jonathan Cameron Cc: Lars-Peter Clausen , Rob Herring , Linus Walleij , Peter Meerwald , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Bastien Nocera , Hans de Goede , Andy Shevchenko , ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH v2 6/9] iio: accel: bmc150: Add device IDs for BMA253 Date: Thu, 10 Jun 2021 14:21:23 +0200 Message-Id: <20210610122126.50504-7-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210610122126.50504-1-stephan@gerhold.net> References: <20210610122126.50504-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org BMA253 is mostly like BMA255 and has exactly the same register layout as used by the bmc150-accel driver as far I can tell. Making it work is as simple as adding new device IDs for it since it has the same chip_id = 0xFA (250) as BMA255 and others. Reviewed-by: Linus Walleij Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Stephan Gerhold --- drivers/iio/accel/Kconfig | 2 +- drivers/iio/accel/bmc150-accel-core.c | 2 +- drivers/iio/accel/bmc150-accel-i2c.c | 2 ++ drivers/iio/accel/bmc150-accel-spi.c | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig index 883aa8bc4340..1cc01b2c5c92 100644 --- a/drivers/iio/accel/Kconfig +++ b/drivers/iio/accel/Kconfig @@ -143,7 +143,7 @@ config BMC150_ACCEL select BMC150_ACCEL_SPI if SPI help Say yes here to build support for the following Bosch accelerometers: - BMA222, BMA222E, BMA250E, BMA255, BMA280, BMC150, BMI055. + BMA222, BMA222E, BMA250E, BMA253, BMA255, BMA280, BMC150, BMI055. BMC150 is a combo module with both accelerometer and magnetometer. This driver is only implementing accelerometer part, which has diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index 1210a8b14a3c..ab41a8e18fa4 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -1125,7 +1125,7 @@ static const struct bmc150_accel_chip_info bmc150_accel_chip_info_tbl[] = { {306457, BMC150_ACCEL_DEF_RANGE_16G} }, }, { - .name = "BMC150/BMI055/BMA255", + .name = "BMC150/BMI055/BMA253/BMA255", .chip_id = 0xFA, .channels = bmc150_accel_channels, .num_channels = ARRAY_SIZE(bmc150_accel_channels), diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c index 7db436ddbdce..32ed07354a9a 100644 --- a/drivers/iio/accel/bmc150-accel-i2c.c +++ b/drivers/iio/accel/bmc150-accel-i2c.c @@ -231,6 +231,7 @@ static const struct i2c_device_id bmc150_accel_id[] = { {"bma222"}, {"bma222e"}, {"bma250e"}, + {"bma253"}, {"bma255"}, {"bma280"}, {"bmc150_accel"}, @@ -244,6 +245,7 @@ static const struct of_device_id bmc150_accel_of_match[] = { { .compatible = "bosch,bma222" }, { .compatible = "bosch,bma222e" }, { .compatible = "bosch,bma250e" }, + { .compatible = "bosch,bma253" }, { .compatible = "bosch,bma255" }, { .compatible = "bosch,bma280" }, { .compatible = "bosch,bmc150_accel" }, diff --git a/drivers/iio/accel/bmc150-accel-spi.c b/drivers/iio/accel/bmc150-accel-spi.c index dc884fa18ad0..54b8c9c8068b 100644 --- a/drivers/iio/accel/bmc150-accel-spi.c +++ b/drivers/iio/accel/bmc150-accel-spi.c @@ -50,6 +50,7 @@ static const struct spi_device_id bmc150_accel_id[] = { {"bma222"}, {"bma222e"}, {"bma250e"}, + {"bma253"}, {"bma255"}, {"bma280"}, {"bmc150_accel"}, From patchwork Thu Jun 10 12:21:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 457993 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F083C48BD1 for ; Thu, 10 Jun 2021 12:24:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3CD47613BC for ; Thu, 10 Jun 2021 12:24:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230304AbhFJM0V (ORCPT ); Thu, 10 Jun 2021 08:26:21 -0400 Received: from mo4-p03-ob.smtp.rzone.de ([85.215.255.102]:23376 "EHLO mo4-p03-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230349AbhFJM0S (ORCPT ); Thu, 10 Jun 2021 08:26:18 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623327850; cv=none; d=strato.com; s=strato-dkim-0002; b=ep9susx+/PpJdbTJletPsvOG/30zUTQRJm3E0Z2ziCjPsUml6oCsi0aw70+ZUEmKL/ BL1eKCzGDiPvMmlajOie5uM9jgwUwOW1sK5FmHkvLroPbt6oo8tCdi74EuXp8q2iGtcR 90YSVVo9a4yw4/RgTBlPFSVQ/x5jQn3n5Q4qUOZizYdjTNfGdYXUKeUpLL/8GjHcybtg WL+4PtVrky1ZJhSUBrnrrYp7XwnKWy5ocBX2792MqYzFxWFHCijCw5osFm8MXUUczMIU g09sJTpzBFaIbOTXqEHRcKmbFJav9FIWiKyfx4YunNcFgfcqXk+o0gvLEog+TaXNkGXB 8Iog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327850; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=Ua2/BS4Dn+Hn65dlmLRU/qcJr/7vqrYz9hLAbDHqQ9U=; b=jWPneeDwhtB0NG9SolRtjbY0xuq2c42L/3mKcFyhgO74UMuvkPYvEICWxb2+DmA8Sd 2B25XoUoaOVFXl/EMyOOprtFIdZiwUpCAL0hu5P+WrIFic2JT9cX6ktA+DlCnDQuGjmF DQInoIGdpVImb74bSXY7XwLIMiBn+Dq2xydQ5ARhEOTqYxuJzJA+p+v0uIiJqmC60hoZ i7nmZ96Rb+7d7awpbgOP6zuuLPwxUFlUJvm95AYFjCxCqEy98RtmCOXEyruKMKA4zE6w DXJ/i15OEQTQeHZKu5islUwhPiHmoWP8n0/bECf2/mXZhT3+yKwpAUPqZY8mRkWBpye8 43Xw== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327850; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=Ua2/BS4Dn+Hn65dlmLRU/qcJr/7vqrYz9hLAbDHqQ9U=; b=OssLrVehlriEUQM3RfTRPbHJJjCN02URqCz+lc7FnjS1IoZH5PwuQOXb1/4oQWBTj9 AZRUGnu8m1VlBOnq7uN+9vDZu8hWeMwd2Fy4m8Vt4idlY5tEyVc09JWdoW5sFFiiPg+K suE/PkiDuEBCvNuzKgU2kIxhRTCw83PBDy7JEPhpF86yehexbqMkG/5S2V9PdBsmiJo5 k4XzfPa6XzLW6dCGbBV/F4LEgTw7qk+uosrE1k8K6rtjdWmyxurkknivGd9n6X/j1PCZ RLFVDGdbtaVnAX2YFQqvGD8QokNtQreFHRFH2OLQWzwYGL2VM508FjJak55sWXMPrUWX l/iQ== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA626NTAM6" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5ACO9tzz (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 10 Jun 2021 14:24:09 +0200 (CEST) From: Stephan Gerhold To: Jonathan Cameron Cc: Lars-Peter Clausen , Rob Herring , Linus Walleij , Peter Meerwald , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Bastien Nocera , Hans de Goede , Andy Shevchenko , ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH v2 7/9] dt-bindings: iio: bma255: Allow multiple interrupts Date: Thu, 10 Jun 2021 14:21:24 +0200 Message-Id: <20210610122126.50504-8-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210610122126.50504-1-stephan@gerhold.net> References: <20210610122126.50504-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org BMA253 has two interrupt pins (INT1 and INT2) that can be configured independently. At the moment the bmc150-accel driver does not make use of them but it might be able to in the future, so it's useful to already specify all available interrupts in the device tree. Set maxItems: 2 for interrupts to allow specifying a second one. This is necessary as preparation to move the bosch,bma254 compatible from bosch,bma180.yaml to bosch,bma255.yaml since bma180 allows two interrupts, but BMA254 is better supported by the bmc150-accel driver. Reviewed-by: Linus Walleij Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Stephan Gerhold --- .../devicetree/bindings/iio/accel/bosch,bma255.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml b/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml index 8afb0fe8ef5c..65b299a5619b 100644 --- a/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml +++ b/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml @@ -32,7 +32,12 @@ properties: vddio-supply: true interrupts: - maxItems: 1 + minItems: 1 + maxItems: 2 + description: | + The first interrupt listed must be the one connected to the INT1 pin, + the second (optional) interrupt listed must be the one connected to the + INT2 pin (if available). mount-matrix: description: an optional 3x3 mounting rotation matrix. From patchwork Thu Jun 10 12:21:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 458721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D25A0C48BE8 for ; Thu, 10 Jun 2021 12:24:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB9D0613FF for ; Thu, 10 Jun 2021 12:24:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230364AbhFJM0U (ORCPT ); Thu, 10 Jun 2021 08:26:20 -0400 Received: from mo4-p03-ob.smtp.rzone.de ([81.169.146.174]:31998 "EHLO mo4-p03-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230348AbhFJM0R (ORCPT ); Thu, 10 Jun 2021 08:26:17 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623327850; cv=none; d=strato.com; s=strato-dkim-0002; b=Sw9SVVIz/Co98s2zQmNMR36y7vxUEAXsQG3Wyv9Z7uWG0h9xyKfCGjQv6cPtVTodWO FzhI4nYNiZp3dupWRKBUqhcp0ussOnRpsQ7iNUZK5M/qFqIxYQLHt2zugAKBBePM3eDG JWoR++TrFiA7Y+zw2Bn2757wFZela5cn+EMyLf2NjdREEK7iEfaaO/wGf8fwyav66KOe 6J8sgiF+0KtMVaW/4eBj+DaNan1me7miWRnU1qsiiFYzotABU13UUFI8Cu3c4xiPHOI2 MSzRriy/wF+LP8eg81KR9SI8P/TzSXbktpAHa5IbtcUemon4mN9TJyoorMR3tNorwhF4 ZUPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327850; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=0LZqEZalSY1FDC+j7IzIvkPWNykdyW/qSpAMgN5TeQI=; b=dfKhMSVpw8RtooqIICbFep4+fcyrVwtjDa4ZR/DxYjVQXahfluflGCurJhi1u15ldV 0R4Ta/vBOod/DtFgHInmSK7pwiGchtlG4sFmcL3n2TKXpOmdOh3/ld5r4lxjVJVxKexb /hF9nHh41/xi93Q7+zP4TY1ITy3cAa9dBtjErMOAveC+AUp6U7Kw4f4gOcP8jiSUckQB OZKDPnspFHOiQu/bdFamCz+uDibG/22a3zxjvroJfdRnOM/8PktUJT6ldb0Ca7gpvBm+ o7BcoBuFbyCnImbB88e89P/zHO5jAmZKoDsGTBF1mBQ2NQ6Zh+JaCRMgohFQH+s6vbyk pp1A== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327850; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=0LZqEZalSY1FDC+j7IzIvkPWNykdyW/qSpAMgN5TeQI=; b=tojkXfq+HtpvtoJpGAZPWIBW+vK+qx1xqfTlKNlajt2Vj08rF0K/GdbZAaC1tK58r1 hIrRU580xVcKKErSIurH0qnHqAncBj8h9XiDkBOyLaioVR9d/K0KtI2RGIwbKr+Fq03g c/M3wbebDx473AgNof5DLCHJXtFpnlnQh00bvlg4WOxA4EUQoNp8B3GwsWVTEib65wVX 6VvlVk/gkLXY6TviSGHyHIkzFW2uBagozpQoU2MGkevg5i0VTcQRxsLB4sYEGdd7ATZP 2Ay0l8avpyYlikpz8027xwGVE42Ta+flX09DmER8/Ws5VDVMlQe450ZLsRWCNa/6Xlig p5Fw== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA626NTAM6" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5ACOAu00 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 10 Jun 2021 14:24:10 +0200 (CEST) From: Stephan Gerhold To: Jonathan Cameron Cc: Lars-Peter Clausen , Rob Herring , Linus Walleij , Peter Meerwald , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Bastien Nocera , Hans de Goede , Andy Shevchenko , ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH v2 8/9] dt-bindings: iio: accel: bma180/bma255: Move bma254 to bma255 schema Date: Thu, 10 Jun 2021 14:21:25 +0200 Message-Id: <20210610122126.50504-9-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210610122126.50504-1-stephan@gerhold.net> References: <20210610122126.50504-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org BMA254 is very similar to BMA253/BMA255 which are both supported by the bmc150-accel driver. In general, there is quite some overlap between the bma180 and bmc150-accel driver, but the bmc150-accel driver has a few more features (e.g. motion trigger/interrupt). Let's move bma254 over to the bma255 schema (bmc150-accel driver). Reviewed-by: Linus Walleij Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Stephan Gerhold --- Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml | 3 +-- Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml b/Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml index 45b3abde298f..a7e84089cc3d 100644 --- a/Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml +++ b/Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml @@ -4,7 +4,7 @@ $id: http://devicetree.org/schemas/iio/accel/bosch,bma180.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Bosch BMA023 / BMA150/ BMA180 / BMA25x / SMB380 triaxial accelerometers +title: Bosch BMA023 / BMA150/ BMA180 / BMA250 / SMB380 triaxial accelerometers maintainers: - Jonathan Cameron @@ -21,7 +21,6 @@ properties: - bosch,bma150 - bosch,bma180 - bosch,bma250 - - bosch,bma254 - bosch,smb380 reg: diff --git a/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml b/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml index 65b299a5619b..e830d5295b92 100644 --- a/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml +++ b/Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml @@ -19,6 +19,7 @@ properties: - bosch,bmc150_accel - bosch,bmi055_accel - bosch,bma253 + - bosch,bma254 - bosch,bma255 - bosch,bma250e - bosch,bma222 From patchwork Thu Jun 10 12:21:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 458720 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC2F7C49EA3 for ; Thu, 10 Jun 2021 12:24:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8EF2D613FF for ; Thu, 10 Jun 2021 12:24:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230349AbhFJM0V (ORCPT ); Thu, 10 Jun 2021 08:26:21 -0400 Received: from mo4-p03-ob.smtp.rzone.de ([85.215.255.102]:27929 "EHLO mo4-p03-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230356AbhFJM0T (ORCPT ); Thu, 10 Jun 2021 08:26:19 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623327851; cv=none; d=strato.com; s=strato-dkim-0002; b=VtSdr6h/mV7GpBlElVE25nIVCu40N+x5GtiMt+UEYqe9tnQ+h8uF76AXRTIYuK7kJp n9cQ0aZ3N98e4n/ByDJJ76nOb0ySEWTvP9LisucdSTgftFs3OqLoWUNgn8GTaxqWS3P6 8BeaIPHjnk28Gv5vdBsqq1eXVTgc7ueFjb55wW7pP+iFxL1k4bte1FPWnBHBTkRhbc3m blC/blHucGjCs9JRzFejfzbV69KffIeu9xfv3ZrzpXG036vkv99DDwZq0wkToJJ/d4z7 rp+zV8Rtrbfqmm/Iewz4Q82Vx0+JoK30sChbEKUMk88dSJX6voaJMyl0qvdPeRmbKRgX MhsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327851; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=nLyhRr/B1UhznVALj7SzJoENWxh92Q1gj+F2tat8xls=; b=MKx7DrBblu1ZxpwlfOscOuEM8qkKxUUfmEI7I57UzQ/FfGPNV7Rguoj3lgCfmQK78C 3bDdyY7XPz9kSa9xl7xcif+NdNCJ/SwebKuqAFZTs8/Gi1k1jMMi+0bJ8E6pg3pFi/UM lIEhu1FoLCj2i5D+cn/t66PUSw1rcLN//x+IQOLD5K/oM2F/rUtQGlwpYbBMIrOvSLxi Y8297l84cAzNGMk8SvDMUxOzabljwHJZ2Vr7Gc6PfG+ExqP/KcMapCoFll6C/zFuEeRR 5uX1ShY5Vr/F1bTaLHwfDucjVHpo3SPMxfVO6CsrNw014LOaTXrtrESjyudE324Evtcp j5UQ== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623327851; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=nLyhRr/B1UhznVALj7SzJoENWxh92Q1gj+F2tat8xls=; b=QkhnwUr1jNbYWmVIlXHTQyyDC7u8cp2TERBN8kWtRaKFh1StL0vIcFKwNdnKprpoc7 QMFfE0auN1o+PJLEd1A30ZjWZeZ8Hcu7xGqUz7mhQkEpoxVE5gKyeMCerz99vvEUK2KD 5eHYkoNKJMhCePUN72AQKlgL7qbo8Xo2HV1rsPecHNLQ6QKFJSZ6Q3nXRDBCBU7ucnX6 C/7EoPttQd2X67lcOK5teOUMLb5KOikNDnRjDeG9X3YDw5eb9rV+12SLdahOjZ8g21eK XhYN0Z1UgJpc21G0gVzw/nWNzzBtp+y5Vymif+RXwo0LEM8KfkSAXzPSFKtTxgoaTDSp IAOQ== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA626NTAM6" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5ACOAu01 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 10 Jun 2021 14:24:10 +0200 (CEST) From: Stephan Gerhold To: Jonathan Cameron Cc: Lars-Peter Clausen , Rob Herring , Linus Walleij , Peter Meerwald , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, Bastien Nocera , Hans de Goede , Andy Shevchenko , ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH v2 9/9] iio: accel: bma180/bmc150: Move BMA254 to bmc150-accel driver Date: Thu, 10 Jun 2021 14:21:26 +0200 Message-Id: <20210610122126.50504-10-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210610122126.50504-1-stephan@gerhold.net> References: <20210610122126.50504-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Commit c1d1c4a62db5 ("iio: accel: bma180: BMA254 support") added BMA254 support to the bma180 driver and changed some naming to BMA25x to make it easier to add support for BMA253 and BMA255. Unfortunately, there is quite some overlap between the bma180 driver and the bmc150-accel driver. Back when the commit was made, the bmc150-accel driver actually already had support for BMA255, and adding support for BMA254 would have been as simple as adding a new compatible to bmc150-accel. The bmc150-accel driver is a bit better for BMA254 since it also supports the motion trigger/interrupt functionality. Fortunately, moving BMA254 support over to bmc150-accel is fairly simple because the drivers have compatible device tree bindings. Revert most of the changes for BMA254 support in bma180 and move BMA254 over to bmc150-accel. This has the following advantages: - Support for motion trigger/interrupt - Fix incorrect scale values (BMA254 currently uses the same as BMA250 but actually they're different because of 10 vs 12 bits data size) - Less code than before :) BMA250 could be potentially also moved but it's more complicated because its chip_id conflicts with the one for BMA222 in bmc150-accel. Perhaps there are also other register differences, I did not investigate further yet (and I have no way to test it). Cc: Peter Meerwald Reviewed-by: Linus Walleij Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Stephan Gerhold --- Changes in v2: Also drop BMA254 comment from file header in bma180.c Note that the similarity between bma180 and bmc150-accel has already caused a lot of confusion in the past. See e.g. [1] where Hans accidentally added BMA250E support to bma180 even though that was already supported in bmc150-accel. Having BMA250 in bma180 and BMA250E in bmc150-accel was also discussed before in [2] but for some reason back then the conclusion was that they are different enough to justify that. Also note that this patch only applies cleanly on top of the "iio: accel: bma180: Fix BMA25x bandwidth register values" patch [3] that I sent earlier, which is not present in togreg/testing at the moment (only in fixes-togreg). [1]: https://lore.kernel.org/linux-iio/20170606203538.15250-1-hdegoede@redhat.com/ [2]: https://lore.kernel.org/linux-iio/alpine.DEB.2.01.1408281111250.3259@pmeerw.net/ [3]: https://lore.kernel.org/linux-iio/20210526094408.34298-2-stephan@gerhold.net/ --- drivers/iio/accel/Kconfig | 6 +- drivers/iio/accel/bma180.c | 92 ++++----------------------- drivers/iio/accel/bmc150-accel-core.c | 2 +- drivers/iio/accel/bmc150-accel-i2c.c | 2 + 4 files changed, 18 insertions(+), 84 deletions(-) diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig index 1cc01b2c5c92..774fea333a18 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 BMA023/BMA1x0/BMA25x 3-Axis Accelerometer Driver" + tristate "Bosch BMA023/BMA1x0/BMA250 3-Axis Accelerometer Driver" depends on I2C && INPUT_BMA150=n select IIO_BUFFER select IIO_TRIGGERED_BUFFER help Say Y here if you want to build a driver for the Bosch BMA023, BMA150 - BMA180, SMB380, or BMA25x triaxial acceleration sensor. + BMA180, SMB380, or BMA250 triaxial acceleration sensor. To compile this driver as a module, choose M here: the module will be called bma180. @@ -143,7 +143,7 @@ config BMC150_ACCEL select BMC150_ACCEL_SPI if SPI help Say yes here to build support for the following Bosch accelerometers: - BMA222, BMA222E, BMA250E, BMA253, BMA255, BMA280, BMC150, BMI055. + BMA222, BMA222E, BMA250E, BMA253, BMA254, BMA255, BMA280, BMC150, BMI055. BMC150 is a combo module with both accelerometer and magnetometer. This driver is only implementing accelerometer part, which has diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c index e7c6b3096cb7..2edfcb4819b7 100644 --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c @@ -10,7 +10,6 @@ * BMA023/BMA150/SMB380: 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 */ #include @@ -38,7 +37,6 @@ enum chip_ids { BMA150, BMA180, BMA250, - BMA254, }; struct bma180_data; @@ -59,7 +57,6 @@ struct bma180_part_info { u8 scale_reg, scale_mask; 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, softreset_val; int (*chip_config)(struct bma180_data *data); @@ -112,7 +109,6 @@ struct bma180_part_info { #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 */ /* Chip power modes */ #define BMA180_LOW_POWER 0x03 @@ -134,24 +130,6 @@ struct bma180_part_info { #define BMA250_INT1_DATA_MASK BIT(0) #define BMA250_INT_RESET_MASK BIT(7) /* Reset pending interrupts */ -#define BMA254_RANGE_REG 0x0f -#define BMA254_BW_REG 0x10 -#define BMA254_POWER_REG 0x11 -#define BMA254_RESET_REG 0x14 -#define BMA254_INT_ENABLE_REG 0x17 -#define BMA254_INT_MAP_REG 0x1a -#define BMA254_INT_RESET_REG 0x21 - -#define BMA254_RANGE_MASK GENMASK(3, 0) /* Range of accel values */ -#define BMA254_BW_MASK GENMASK(4, 0) /* Accel bandwidth */ -#define BMA254_BW_OFFSET 8 -#define BMA254_SUSPEND_MASK BIT(7) /* chip will sleep */ -#define BMA254_LOWPOWER_MASK BIT(6) -#define BMA254_DATA_INTEN_MASK BIT(4) -#define BMA254_INT2_DATA_MASK BIT(7) -#define BMA254_INT1_DATA_MASK BIT(0) -#define BMA254_INT_RESET_MASK BIT(7) /* Reset pending interrupts */ - struct bma180_data { struct regulator *vdd_supply; struct regulator *vddio_supply; @@ -184,8 +162,8 @@ 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 }; -static int bma25x_bw_table[] = { 8, 16, 31, 63, 125, 250, 500, 1000 }; /* Hz */ -static int bma25x_scale_table[] = { 0, 0, 0, 38344, 0, 76590, 0, 0, 153180, 0, +static int bma250_bw_table[] = { 8, 16, 31, 63, 125, 250, 500, 1000 }; /* Hz */ +static int bma250_scale_table[] = { 0, 0, 0, 38344, 0, 76590, 0, 0, 153180, 0, 0, 0, 306458 }; static int bma180_get_data_reg(struct bma180_data *data, enum bma180_chan chan) @@ -432,7 +410,7 @@ static int bma180_chip_config(struct bma180_data *data) return ret; } -static int bma25x_chip_config(struct bma180_data *data) +static int bma250_chip_config(struct bma180_data *data) { int ret = bma180_chip_init(data); @@ -451,8 +429,7 @@ static int bma25x_chip_config(struct bma180_data *data) * This enables dataready interrupt on the INT1 pin * FIXME: support using the INT2 pin */ - ret = bma180_set_bits(data, data->part_info->int_map_reg, - data->part_info->int_enable_dataready_int1_mask, 1); + ret = bma180_set_bits(data, BMA250_INT_MAP_REG, BMA250_INT1_DATA_MASK, 1); if (ret) goto err; @@ -489,7 +466,7 @@ static void bma180_chip_disable(struct bma180_data *data) dev_err(&data->client->dev, "failed to disable the chip\n"); } -static void bma25x_chip_disable(struct bma180_data *data) +static void bma250_chip_disable(struct bma180_data *data) { if (bma180_set_new_data_intr_state(data, false)) goto err; @@ -775,14 +752,6 @@ static const struct iio_chan_spec bma250_channels[] = { IIO_CHAN_SOFT_TIMESTAMP(4), }; -static const struct iio_chan_spec bma254_channels[] = { - BMA180_ACC_CHANNEL(X, 12), - BMA180_ACC_CHANNEL(Y, 12), - BMA180_ACC_CHANNEL(Z, 12), - BMA180_TEMP_CHANNEL, - IIO_CHAN_SOFT_TIMESTAMP(4), -}; - static const struct bma180_part_info bma180_part_info[] = { [BMA023] = { .chip_id = BMA023_ID_REG_VAL, @@ -872,10 +841,10 @@ static const struct bma180_part_info bma180_part_info[] = { .chip_id = BMA250_ID_REG_VAL, .channels = bma250_channels, .num_channels = ARRAY_SIZE(bma250_channels), - .scale_table = bma25x_scale_table, - .num_scales = ARRAY_SIZE(bma25x_scale_table), - .bw_table = bma25x_bw_table, - .num_bw = ARRAY_SIZE(bma25x_bw_table), + .scale_table = bma250_scale_table, + .num_scales = ARRAY_SIZE(bma250_scale_table), + .bw_table = bma250_bw_table, + .num_bw = ARRAY_SIZE(bma250_bw_table), .temp_offset = 48, /* 0 LSB @ 24 degree C */ .int_reset_reg = BMA250_INT_RESET_REG, .int_reset_mask = BMA250_INT_RESET_MASK, @@ -891,42 +860,10 @@ static const struct bma180_part_info bma180_part_info[] = { .lowpower_val = 1, .int_enable_reg = BMA250_INT_ENABLE_REG, .int_enable_mask = BMA250_DATA_INTEN_MASK, - .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, - }, - [BMA254] = { - .chip_id = BMA254_ID_REG_VAL, - .channels = bma254_channels, - .num_channels = ARRAY_SIZE(bma254_channels), - .scale_table = bma25x_scale_table, - .num_scales = ARRAY_SIZE(bma25x_scale_table), - .bw_table = bma25x_bw_table, - .num_bw = ARRAY_SIZE(bma25x_bw_table), - .temp_offset = 46, /* 0 LSB @ 23 degree C */ - .int_reset_reg = BMA254_INT_RESET_REG, - .int_reset_mask = BMA254_INT_RESET_MASK, - .sleep_reg = BMA254_POWER_REG, - .sleep_mask = BMA254_SUSPEND_MASK, - .bw_reg = BMA254_BW_REG, - .bw_mask = BMA254_BW_MASK, - .bw_offset = BMA254_BW_OFFSET, - .scale_reg = BMA254_RANGE_REG, - .scale_mask = BMA254_RANGE_MASK, - .power_reg = BMA254_POWER_REG, - .power_mask = BMA254_LOWPOWER_MASK, - .lowpower_val = 1, - .int_enable_reg = BMA254_INT_ENABLE_REG, - .int_enable_mask = BMA254_DATA_INTEN_MASK, - .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, + .chip_config = bma250_chip_config, + .chip_disable = bma250_chip_disable, }, }; @@ -1166,7 +1103,6 @@ static const struct i2c_device_id bma180_ids[] = { { "bma150", BMA150 }, { "bma180", BMA180 }, { "bma250", BMA250 }, - { "bma254", BMA254 }, { "smb380", BMA150 }, { } }; @@ -1190,10 +1126,6 @@ static const struct of_device_id bma180_of_match[] = { .compatible = "bosch,bma250", .data = (void *)BMA250 }, - { - .compatible = "bosch,bma254", - .data = (void *)BMA254 - }, { .compatible = "bosch,smb380", .data = (void *)BMA150 @@ -1217,5 +1149,5 @@ module_i2c_driver(bma180_driver); MODULE_AUTHOR("Kravchenko Oleksandr "); MODULE_AUTHOR("Texas Instruments, Inc."); -MODULE_DESCRIPTION("Bosch BMA023/BMA1x0/BMA25x triaxial acceleration sensor"); +MODULE_DESCRIPTION("Bosch BMA023/BMA1x0/BMA250 triaxial acceleration sensor"); MODULE_LICENSE("GPL"); diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index ab41a8e18fa4..7c513b50572a 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -1125,7 +1125,7 @@ static const struct bmc150_accel_chip_info bmc150_accel_chip_info_tbl[] = { {306457, BMC150_ACCEL_DEF_RANGE_16G} }, }, { - .name = "BMC150/BMI055/BMA253/BMA255", + .name = "BMC150/BMI055/BMA253/BMA254/BMA255", .chip_id = 0xFA, .channels = bmc150_accel_channels, .num_channels = ARRAY_SIZE(bmc150_accel_channels), diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c index 32ed07354a9a..999495f0669d 100644 --- a/drivers/iio/accel/bmc150-accel-i2c.c +++ b/drivers/iio/accel/bmc150-accel-i2c.c @@ -232,6 +232,7 @@ static const struct i2c_device_id bmc150_accel_id[] = { {"bma222e"}, {"bma250e"}, {"bma253"}, + {"bma254"}, {"bma255"}, {"bma280"}, {"bmc150_accel"}, @@ -246,6 +247,7 @@ static const struct of_device_id bmc150_accel_of_match[] = { { .compatible = "bosch,bma222e" }, { .compatible = "bosch,bma250e" }, { .compatible = "bosch,bma253" }, + { .compatible = "bosch,bma254" }, { .compatible = "bosch,bma255" }, { .compatible = "bosch,bma280" }, { .compatible = "bosch,bmc150_accel" },