From patchwork Fri Jun 11 08:08:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 12315029 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,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 0C194C4743D for ; Fri, 11 Jun 2021 08:11:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E68B4610A5 for ; Fri, 11 Jun 2021 08:11:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230321AbhFKINw (ORCPT ); Fri, 11 Jun 2021 04:13:52 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.80]:34236 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230288AbhFKINw (ORCPT ); Fri, 11 Jun 2021 04:13:52 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623399109; cv=none; d=strato.com; s=strato-dkim-0002; b=hrrA/pwHqupDXYbKHPwmHFE515HDRNUQLQGiLiun8y2aF/kpCtw01qKb6xixgRa5t8 dT3wdWiU+29UPSWf/ODZtVSWF3DqVQXFzeg1jQWrpiuuW8bYhEZHI42ymi6yyjD7SHXG AHfc62Eez4f/7vojLa/tI2ijfS/0jSEksn3Fk/1Lqo/ZNkeQemis4lCNx+qF1pUSod7j LQ6fQsufUg283aQU2QRMMGKTiBdWsTAKcK++WeXGl2VrdXoUlFLcb1PiTsAUMUksxcCx OgE2jy6Pkbzi7zJQM7+4pkyYE769p/JesgJJ/WQ9uknIsiKcdgFngaz5moXd7HWc96ra EPIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399109; 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=BRL+zvS5YLo00apseEtDmXzWRZFmecKTjp2OjBtdFfa0CMNHA8rCxVu8bT+0aXGunp vSFZ+kqx+9viH8Tktq8f1GTh11cbVOzq9a7GvIP4pzVyzMxOzMtvcqJ4JqZmbAPGnOJu xr8LIyf/aOmwZEr81+8cVy6X354hE/987dJ7E1ctD8k/hvRUNhqkko2iodIt8wVF4XIP fD2/UBwR5LySj2VHykF+kBo8s0ep3lOYejenjtvqxgCNWmF+qynPnXIw/m3/7avOBBSV yHI/MS2mD8ATezph+I/R0kyG0w687pYZzGn0Bgd0xxvOtC7ZQUkocTz0BpB23ZFv9MJ8 22Ow== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399109; 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=GyhaRSF8ur9VQWtxOKwGRMA85R1qcfABVJpiF3FT+67tJp7vLwFAlNrz1AWMiWwfaZ rrPgpIepAeT3eY1oHYMXACISpoI2HqmuVLczsxNDjUfq3wIoqrMc2xuSmvBhl3IrYtx4 WSbQII05nFy3G6jU1TezFvZCc0nRHt1xPrWq1B55NR6ntAgZAuHwKHdB4sWEMbVTdfR+ 73KZxg4NWYTM6m5e529p8HZ4S34K4FeceCpvwnpm2gt5t8aNHkNSXurqYcGDj5o+70Dm XqPzub124WkalrcrouIr4wIMC9GTG3RA6yS4NWodyi0/dZyTL0aVo1s1mMiPuH2tHeuE gdzA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA6m6PrPw=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5B8Bm02d (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 11 Jun 2021 10:11:48 +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 v3 01/10] iio: accel: bmc150: Fix bma222 scale unit Date: Fri, 11 Jun 2021 10:08:54 +0200 Message-Id: <20210611080903.14384-2-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210611080903.14384-1-stephan@gerhold.net> References: <20210611080903.14384-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@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 Fri Jun 11 08:08:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 12315031 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,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 988F6C48BE6 for ; Fri, 11 Jun 2021 08:11:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76C0E610A5 for ; Fri, 11 Jun 2021 08:11:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230370AbhFKINx (ORCPT ); Fri, 11 Jun 2021 04:13:53 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.82]:14489 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbhFKINw (ORCPT ); Fri, 11 Jun 2021 04:13:52 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623399110; cv=none; d=strato.com; s=strato-dkim-0002; b=rJa0CXJtOpSU3lL0pYynb+ui++EASJ1G6AmKy0260etToyFvutnyoZaZF4zUS7uBXh J9gcTevKK1Sq6Azox6FB3TwhooJzc0zdsKp7l2OgHWWEZ164timtd/QSjW55nV19pfOd MlmoQg5KrjxroDv6EiLOairmLkqtmbHA0j5kwC0a16+pMy1T6GEvCJrIT6HQk4oC8u/U YvB40/AExeaNAznJA8nSZ9WQ3CPn74oL+TxrYwfyIUyJ0AEevVVCqpmTciQsIlspVLca Dytk4kbaTzwHR+nCm/LCWwJl00YSuwGQmkCLoUFfKqhJpEdTVE52mQKiFn43kZTzSruU NntQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399109; 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=XVO1Fa7dnQ7VmFIdDutm31MOJ1IonHZYQtHo+zuFpGo=; b=rKUhzoIaxmJBanuFKZUWjGpvtTbekcInLHmty4aYVv7Vh4UVSLeWJ3J7Qy97iJ25TH vOa5to0AxURw1BohGZM5yMBeTl5pl9HnGRaK4JT2iWANHqYpCbJ8+Xhr2nZMqNOzowtX DxXUH4VSj+ffrGfB1L9wj2SW+RLR0EWIpJHrDA2dbWdfEEVwcZ80cOtefv8peHn2znZI KzviYnZqk2goLdSbL+J0kd6elDJZjP4Vkf8372qct3EshMICwo30y7cCLlawJ91sNn6o YZJGOAx2fjH9q1BjtACYOHfuWdqT8k3iMwRpcBsW1eKq5Jf5kKMLfXyVWY303rL0Zbya qq3w== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399109; 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=XVO1Fa7dnQ7VmFIdDutm31MOJ1IonHZYQtHo+zuFpGo=; b=hzaE7+q1J1josNiE/mHK7Cmt6L8/UInr+uIPhqOjo1jEZqi0dprB9M0BX11v9XQ8Yh gpb7/AWMX8qYdZ/xlDTunQk8Ajfuc4DC+Wu74QmXUuvTjkt+KEYA+/NxmMBESXth4SvB L5VaO858V8rlVi0aDlUBxuHGUkWplXKjZbl1RgbozB5XDxPZhogmqayO86AzdvcFgBfo TkrEIFqad8eLbR1yARrjoqEkYHSwRXq3k8mw7vOcXrh/Bq1F559eY8OiOELNvia4odmS 92Bc7B9kDMzvIyBYsghBCt3kRiK3wkPLUyhTglpF+cc0mtBHglWmJo8zfYY27GVyhBtV wOQw== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA6m6PrPw=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5B8Bn02e (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 11 Jun 2021 10:11:49 +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 v3 02/10] iio: accel: bmc150: Clarify combo modules in Kconfig Date: Fri, 11 Jun 2021 10:08:55 +0200 Message-Id: <20210611080903.14384-3-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210611080903.14384-1-stephan@gerhold.net> References: <20210611080903.14384-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org The Kconfig option currently says that all Bosch accelerometers supported by the bmc150-accel driver are combo chips with both accelerometer and magnetometer. This is wrong: actually only BMC150 is such a combo. The BMA* variants only contain an accelerometer and the BMI055 actually is a accelerometer + gyroscope combo. Clarify this in the help text and also make the list of supported variants complete and sorted for consistency. Reviewed-by: Andy Shevchenko Signed-off-by: Stephan Gerhold --- New patch in v3 after discussion in [PATCH v2 4/9] iio: accel: bmc150: Sort all chip names alphabetically / by chip ID --- drivers/iio/accel/Kconfig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig index 17f6bdcf1db3..cbca6ab7da88 100644 --- a/drivers/iio/accel/Kconfig +++ b/drivers/iio/accel/Kconfig @@ -143,9 +143,12 @@ 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. + + Note that some of these are combo modules: + - BMC150: accelerometer and magnetometer + - BMI055: accelerometer and gyroscope - This is a combo module with both accelerometer and magnetometer. This driver is only implementing accelerometer part, which has its own address and register map. From patchwork Fri Jun 11 08:08:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 12315035 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,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 6E370C48BE0 for ; Fri, 11 Jun 2021 08:12:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59FF3610A5 for ; Fri, 11 Jun 2021 08:12:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230484AbhFKIN4 (ORCPT ); Fri, 11 Jun 2021 04:13:56 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.169]:9861 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230361AbhFKINy (ORCPT ); Fri, 11 Jun 2021 04:13:54 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623399110; cv=none; d=strato.com; s=strato-dkim-0002; b=Bi7D0hC47mnCGKuqVg7vgTlwI3Gh1/Xg8jdWwDLpYrlM/Fhwy6tX2buLZfXtRAajvS 1NtISo1Ci2sDmxiiwK1hjhWy0376WVHIXFWvUJ35bIBk2tA+83Oc+nE1TUhmqBfvnsk1 2vnU4x0y/IW5OhAU1Dne4/IXboJxJ5Idv7vAicJxYsWn9CqDeUYJjJscih7i6Hj02FvP PxtPSeYGWwUvqI4J5HLi43JtOjz8qiSv5seSwSYxFdJWsbxjYmeSpAMPrYzbtVu5JRsr VMZmB4RNsalSSrvEN66IPJUcjMtD/6WQGdR6jIjKYZpwJSPC5oWea9hpg6i5uciDrWY1 8gsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399110; 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=RnlciFqVhgy9BlHJjaLfId0CtxqVht5q2o9IZGHpHRI=; b=nmV6ynGCBWc6wJAn5w8HcVS5se62Ata2bL+kU1YbSTugVsWurj85ASaPgoFGHrrObf pXMksgqD+QhG2BTk2MVYJP70wRDdCc8KBRziMRTR1YPMHK0NR6gp/5B+nUwdw9+pI0N8 K4F5BOw0Hq1U0bb0VZEzrL6IeTrQvVEzLsbrgKiZSq8zDqJS53IVeB48RHMwmoThsfEe 5U8qAe3JCbEofrMsfH1Kw+b6c5QOQMpLnpxSYPpjelBdyf5+KYyq0WikfSbQM1NMCCf5 Ti6vT950CkgbjQ9Cp7AB9kSxtIcFoo1uuWf1jSTosmoJNIsV90AhK+n4vW7QCeyAJY8X J0og== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399110; 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=RnlciFqVhgy9BlHJjaLfId0CtxqVht5q2o9IZGHpHRI=; b=hYDoU0oTy4ihJeati2vABzd7MIpR2GlFpebrO5ylXJ+cqzlXISs5P3ltuXANxK0wwp WTX7ABM9GUeMh1NLE9ZpHbZCtMttkRumhD7TCpsYeXJJnu+neYULv5Q+5vdcOWUXwXGN uSzTVDaIyvkEfCD8nH0xX8HH+uZAyH9SO+3o5GrQVuDNtvC0JysWnnuC6l3Op55DZZ25 BV5gISlsKVTJqNd9bG2vD24itfecDtqwJjKk6zgC5iRse7m9a+4fMzpRbBVgzd86QIi2 IBiexijWsECObcDD6bfDHtqFEl5yfbI16xDM2Q2Llw076L23kys0SpD18L5ihKHZ9o7E cljQ== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA6m6PrPw=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5B8Bo02g (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 11 Jun 2021 10:11:50 +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 v3 03/10] iio: accel: bmc150: Drop misleading/duplicate chip identifiers Date: Fri, 11 Jun 2021 10:08:56 +0200 Message-Id: <20210611080903.14384-4-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210611080903.14384-1-stephan@gerhold.net> References: <20210611080903.14384-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@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 --- Changes in v3: Sort combined chip names in chip info table --- 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..9ecbd3769593 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 = "BMA255/BMC150/BMI055", .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 Fri Jun 11 08:08:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 12315039 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,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 1DE72C48BE5 for ; Fri, 11 Jun 2021 08:12:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC7BD613CA for ; Fri, 11 Jun 2021 08:12:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230417AbhFKIN5 (ORCPT ); Fri, 11 Jun 2021 04:13:57 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.170]:13323 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230303AbhFKINy (ORCPT ); Fri, 11 Jun 2021 04:13:54 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623399111; cv=none; d=strato.com; s=strato-dkim-0002; b=Ndm1+A433l7jmzVfIfc+7Xnlkj8bU6DaiIWyq98QbWdsCc3AudKXzWH+BtByYviBWC Fq3bGjJH+7WjhEC5h2ofm+hvMmLwSmQFxEzcoVOKcTQUbyFehmLy7rwhH5IKbH+uf6nj JvRCjVchXqckR3FtrRcfcoaTnCK1+t7EgK16p8j3U1Q7Drs6HoWx9Fp8cYSI2GMw5Jl0 NlRIHiVMBBTtNYCxj76/fQcE3bYprzzPTCPhsaTsU9bxJkGLie7VKdMpONNK9FlZX1NJ 3AN/XwXMg8S9vqIt5E4kD/i0e2bPP2A+DWl+HVPaLDFJBN5Oar2Z3rZ9WCBG+OplkEIk p9ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399111; 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=YsRVRxp+47703gIvv1C/lpKrQ3eC8Q5Wgd2GCgDRPm0=; b=LPI3OLZVdATQCqforqYE26WPcdNeppX4XJi5NpJBi9m3p2WMgyi5qJIJGi1T5gxvz4 gt2eQvUz7M0JMDRFVlZ98C/E1a7RCgUOyygDiXyKSJRGnyiAuWKAUttOS6zvdcCrJ1z0 FXl1UtmdgADGxnwpKpoThn3DoJVLHfD5osybi5zdwL47ppVdPnyziRHp7iTx80/NUucU FqEa3J39zvjUKymimlw/xegzkpSjOMQXoAlEBXiOPDDEtYQ7LeD2NE6O7ZV5lIBg8L6U h4kxf7AW0ibBr7TMA0Bb1ac8A1TdwmJ1O3L0W195PlEugYTjrQVixJDPi0GrWoDCHbVs 2sug== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399111; 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=YsRVRxp+47703gIvv1C/lpKrQ3eC8Q5Wgd2GCgDRPm0=; b=hUZzD4IjIiBG2hQOktTUkdcD5Y2evS9FjDq444LHMEv+wTJq7XLJoKmc7iTSkk1mjg jCR8nUzZUV7wDlt0WALrXaLKQ8KSJLJWcXG7FlAp54iHDuf0K6YZ4lbv9IBH2mriXYBg q7UMt15IFpIzgi35NA9EpiYmE8iXJoeh9sSeN1JeenVkft3CAkuwRqiGwBGcYGu7mj/m H1s0HVoX+LhthjyZ5TMtDThNQVq89h+lUgsQgaBHUcZiI3YGPOpZHTdBKfPBwgcaoBRb MfW0G6YO4Z3dDB1J4cUeWDi4KHr9wjdF/aNgJ/XxdDNXWDhjkeXQ+07sFVT+tTD4LZir MM3g== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA6m6PrPw=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5B8Bo02h (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 11 Jun 2021 10:11:50 +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 v3 04/10] iio: accel: bmc150: Drop duplicated documentation of supported chips Date: Fri, 11 Jun 2021 10:08:57 +0200 Message-Id: <20210611080903.14384-5-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210611080903.14384-1-stephan@gerhold.net> References: <20210611080903.14384-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@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. Reviewed-by: Andy Shevchenko Signed-off-by: Stephan Gerhold --- Changes in v3: Add Andy's Reviewed-by 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 9ecbd3769593..4b5caa89a3b4 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 Fri Jun 11 08:08:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 12315041 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,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 2EFB0C48BE6 for ; Fri, 11 Jun 2021 08:12:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1ADB8610A5 for ; Fri, 11 Jun 2021 08:12:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230514AbhFKIN6 (ORCPT ); Fri, 11 Jun 2021 04:13:58 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.82]:28596 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbhFKIN5 (ORCPT ); Fri, 11 Jun 2021 04:13:57 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623399111; cv=none; d=strato.com; s=strato-dkim-0002; b=tvjYSwy8Fppc1RHei25ymUUr4o8DzklDgOvOsgO9n31Wio0EYWY9prhNebtlLOYbLD VZ59yYSphCTR7l21Rd95WP52u9+mRa+T8y/jX3knlDVHsiwC3c2Pm922nVgWWIfp64RZ eGkBUdYJO+w7MIVZtMPJ/+TfLY2WwXuWFWqrs//44XyvN5xJBqGIEG1NfleBkTDylEa4 owbtxVqJb8W/cl7ySE4ko+e7ZeGz9xzQAN8LwXbNJGfsJV0SR+nmfDfaj3oJ11/mMH2E uFRxta71YTtiCQIxhZlgT+8sNbW86CmD2Li4Ep0WSJqaQbqeZ1IeJ/HadIxWMLqWjnMO 6hTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399111; 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=XXFAcqf96vwfcunpTEDutx/jVcWi6SrARU+yhy/f5ow=; b=NniuxQ5Mfw3vteJs037/b3tCrcxt4di0odlNruoDEFeWXRmGvM9VQy4Oi6KZ67KgKc GauiNWOMmOb3uerHJiPzmsnKrSgdBgpiL2rjoGebjqrUwv51xXGRdyfmV00WHqMkpDnY D/tHrW71KHR95Ly3DB2baDmXD8mq1nQCkE5UxF8hYEAwViuyEczh2ZlNNwlKHcA09w52 kCuHcCRB6timMLmBlrI7ur0AXKm0C6o7Qz+C8L4v/0aUk2ymWxOAzUGO0WUByxYZCdJ5 oFd1Shkou8LjekcYCqdyd1h173dWe3wqtA1p8r4GY01RoeyWc7JVEHg6gUmItHfbU8R2 yZzg== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399111; 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=XXFAcqf96vwfcunpTEDutx/jVcWi6SrARU+yhy/f5ow=; b=oeZko6JIobQvD6DhuNB+EuhIRM1APp9JBXBS5dS2GDBKYObR3byMNFmOd2pSv8ua1G CjYxuDfJRe3jgN4A1euycL84WvlZ1F3CSfLjkZybFziUXPP74EISYOr7g1W2uooxyBbA CixbpPFE+gIrT8USg7Q6cNhrsrN/9HVG7i06xDZ6mhLMSsRX2sVNfGT7MeyCZfRXBmnc RNidouiBczfktOW8pHZFprvwEs/3LV7BV2Lc5jsr3zcCTWEZAZ/B7C4U4lqjbJCUEUgQ PBzMVsc25NigayQ3qA3PZBr/+7xPKXLZOkxtd6nO+H549WOvpHplmNAFxFnDsE7o6mbM 6mSg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA6m6PrPw=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5B8Bp02j (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 11 Jun 2021 10:11:51 +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 v3 05/10] iio: accel: bmc150: Sort all chip names alphabetically / by chip ID Date: Fri, 11 Jun 2021 10:08:58 +0200 Message-Id: <20210611080903.14384-6-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210611080903.14384-1-stephan@gerhold.net> References: <20210611080903.14384-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@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 Reviewed-by: Andy Shevchenko Signed-off-by: Stephan Gerhold --- Changes in v3: Move Kconfig changes into extra patch to clarify which chips are combos New patch in v2. --- drivers/iio/accel/bmc150-accel-core.c | 40 +++++++++++++-------------- drivers/iio/accel/bmc150-accel-i2c.c | 26 ++++++++--------- drivers/iio/accel/bmc150-accel-spi.c | 18 ++++++------ 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index 4b5caa89a3b4..5a19676bcd2d 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 = "BMA255/BMC150/BMI055", - .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 = "BMA255/BMC150/BMI055", + .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 Fri Jun 11 08:08:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 12315037 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,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 5BF25C49360 for ; Fri, 11 Jun 2021 08:12:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 45567610A5 for ; Fri, 11 Jun 2021 08:12:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229480AbhFKIN6 (ORCPT ); Fri, 11 Jun 2021 04:13:58 -0400 Received: from mo4-p03-ob.smtp.rzone.de ([85.215.255.104]:36316 "EHLO mo4-p03-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230280AbhFKIN6 (ORCPT ); Fri, 11 Jun 2021 04:13:58 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623399112; cv=none; d=strato.com; s=strato-dkim-0002; b=eEonQJtfTPvaOpT4b3dcPpuo61oJgpLJF3jf8tmvFE7ptJ11ixvZQO+B2sIYr87ZNt dj8Ub2uZUBCWTb6UM9fBgsSQMBBbTWFNQ2Fw7nc43PejTll99vS/T+4DnSeP8xDqx26g Cr4MlfILLD0pNaKyKSdCXPghBPatV/xjrVRRQGUgR7+JdYwQbNeednxlH7AfCPU12dGP +VYLNHLp/jLgzjmxSixPSBpucvF00xZBhaE2IfMrV1JBsKj53p0W1jLGU0HvC8PwIIwt eQQi8tAiCWB5bmCMVd6mZ5Pnnmd/wqjbWX+6P9mrMkvwpXgaKHcv7uwmQGMN5yjLWaQY s/nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399112; 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=RbD3YhmKpVNTmVV7drwxwKOJhJCC3Fw+iwpS38RCL6nzIqw5gVzqlDIAgRCV0nzowH 2Wwv5wgSLaz3h4xwshEDOkCl8lPGQnsE8Br71qlv9FW6HDe3k3nUFo4RjiZDauIImAAx ho6Z+cGNIHUKjlq7odqfAmiGxqMyRD2ZspB6omiQd0vAuJjPtPFf9j/oZnYCLE5G9T1A XTFkrNk5qHb6FM87NOgwFZJB7Au+sqjzNgzd2/wfzCoaUXaejs93sW2Vcv0qJcI6uxRQ E61ZlU6VW0UR+UIkqD610qJAqNvZo1458AKCEt+yp6cgfS3SPGGTQ/wSrv/O2wxcJxLP 0Mww== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399112; 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=Fn/tioDmXK0mcc0fyDASjMc/HgeDWtYoUhKz6KzTLatO8L7NemRHvSL52NGE+5S94p BP2ydg8RGB2AeZiidm1kR4qMr7xDIjkUpcU3/56RCW9opI08eeSQ1tsVbsVLVmJD/Lyc eemev7sQ8RBm7SGr/lGF57y5Kq6v9ehvibNdSs+oQSmsa0tTZ45FsJtaD2OK9ZDlvalR PzHqp3sZbMQfj/gfIgxRGiphCxZ/IAs60B2OmP7pS070SHjrKr/OodkOva/oRqhl5H/V R279lOZ3oCpUFvHIXYxdxSnL9bsbEk4JkFZrtto2yoPOt+crbw25aU5H2FhJBT00lJ1l Njow== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA6m6PrPw=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5B8Bq02k (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 11 Jun 2021 10:11:52 +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 v3 06/10] dt-bindings: iio: accel: bma255: Document bosch,bma253 Date: Fri, 11 Jun 2021 10:08:59 +0200 Message-Id: <20210611080903.14384-7-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210611080903.14384-1-stephan@gerhold.net> References: <20210611080903.14384-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@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 Fri Jun 11 08:09:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 12315045 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,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 4AE74C49EA4 for ; Fri, 11 Jun 2021 08:12:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B47C610A5 for ; Fri, 11 Jun 2021 08:12:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230467AbhFKIN7 (ORCPT ); Fri, 11 Jun 2021 04:13:59 -0400 Received: from mo4-p03-ob.smtp.rzone.de ([85.215.255.104]:20649 "EHLO mo4-p03-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230407AbhFKIN6 (ORCPT ); Fri, 11 Jun 2021 04:13:58 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623399113; cv=none; d=strato.com; s=strato-dkim-0002; b=QYt/J3/eADVs5ukd6StvkJR4X2IUNfaJKWf2BbGCW938SMAi6UDKemKhqwHhz+X8Dq +Eud50IJyRNhNqRNfa/Ov7aJ4sw1jW0vTNTMd57r/VfnmxsjoaKu2HID/up/j/Bt7nLk r/YswLROaYbcRrl/gNQtWE8uD9Nj13k4jSlYKw5y8A8c3mXnxPA0lq2Cegdnr9i5t9SZ UchCKvv8b/YCzxPF+AQx3jcCXLfbkjbnJoflNu9ouLoeXeUOyBwxFkS993E2eeUbZ0IF tjI5GshoUnykg6Lqsz8qHKQtYxjSWDRe8LxagudXdn0gDjK8NgXXVj/V2ekWxND1rv+H lMpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399113; 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=fhT7wAdCwpMivbtOdh7u7EIUcVxiuK8pSs+eAlKgGtk=; b=GANja6mz9iU2FLr96ZMoFlQkbEVe166+MMCbVE3NRos4FpwazavBm7fhEPCdy4lHJx 3XxfNKzA3/7tGmglTFT4G9x76/7Ob8R0l2hyMw019C08qCWTYiEcOPv+1y1TI+CgUgHV j1cfRMBA49cNcBreZDupqncflYA+XdqrMtNIzh6ZUO+dzJy6hB5RGjk2n44mhEj9WKNe oCg2AAKdXsldX/qxTMibpBYMTE3ZPzjs1OQgrVhJfBWOJDcyUVjMqgnExycK421qEsKh jJMFVxOMjFzu818Fo/azr9sgEV6J+gAb0bl8UVJiAMrbxg1xN1L0iiR4QYa8J1V1063p ahYg== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399113; 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=fhT7wAdCwpMivbtOdh7u7EIUcVxiuK8pSs+eAlKgGtk=; b=UTO53wt9M+7H9yxxfSvoQt/KPOxH5YFzV2h6NuzoKNPKYgzC7D75jxjEKhwm649YxD H0B6tYsExB9XnDh1j0dVN3lNaaiitmaNyIwY0MsX5v4FXENnr2f2kjh4Y0GMJNYQru0p ddYnFvUXTUpOq7PWAqJV5e2ULFHrxhhhH82q398097igbawKk6sl0ws1Ibga/SXUFItP 6kb1c9J81lzH8E6cmLmg+UXhorPSQDb7HZs2ML8Hu4xcX6dpQHlZqSwjPL2DyqGPLYId YieCo1InSCT78p56PcYNVVAURgciX2VFQDhPY5STOao6DKbRm/Rpv8ABuPQ6f7LRnfTu mTjA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA6m6PrPw=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5B8Bq02l (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 11 Jun 2021 10:11:52 +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 v3 07/10] iio: accel: bmc150: Add device IDs for BMA253 Date: Fri, 11 Jun 2021 10:09:00 +0200 Message-Id: <20210611080903.14384-8-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210611080903.14384-1-stephan@gerhold.net> References: <20210611080903.14384-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@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 cbca6ab7da88..f8dc5403397d 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. Note that some of these are combo modules: - BMC150: accelerometer and magnetometer diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index 5a19676bcd2d..3faa3de0dd4d 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 = "BMA255/BMC150/BMI055", + .name = "BMA253/BMA255/BMC150/BMI055", .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 Fri Jun 11 08:09:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 12315043 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,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 C1F6EC49EA3 for ; Fri, 11 Jun 2021 08:12:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A34D9613AE for ; Fri, 11 Jun 2021 08:12:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230526AbhFKIN7 (ORCPT ); Fri, 11 Jun 2021 04:13:59 -0400 Received: from mo4-p03-ob.smtp.rzone.de ([81.169.146.174]:22908 "EHLO mo4-p03-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230467AbhFKIN6 (ORCPT ); Fri, 11 Jun 2021 04:13:58 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623399113; cv=none; d=strato.com; s=strato-dkim-0002; b=floXQWUM4W6xttGdwZF6fwXLAbrliRQpkHQxvhNKHFDhcylw6cFUCib772QWhs/O6g tOv70j/J4e5UuTv68Im6bhnzbxE6WeZBrr027U61/h1WonqGvIdUvzUBE1wTGLsD6oRt y7wxpA5EGkcoc/p94d8YPnhwUvY4g3Z0GrZIeBWBlcJYG1eBW67p2f7EAchOZVnjiMxC TLTeaqho5Cm8UqWB6kM/mfK1QGEqJTxEA3rvAJuP+Nit4GnU240zu//uM2kQiIImjy+A pG/jcrzmp43fJ9BjfPGTEKnJ6QH+5GT7Kf8QILRedxWHKmO3t1jBEXkKi0tnPtvaIZ94 vnkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399113; 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=dxABeggRN5fRDOX3Ew7I49I0k+VYou9lthUqAss5BZP46UaM5ogdmSykh/zQZuRjo3 I9Kf2hLsI9/l095VqBPs3GWOOKWab9rmMhb9wtbqQMNcITgoTchJegtpPnJeN+qvUMxT 27d0oMsRt+eiM9G5lZdDRMaGuHWl+uVJWGCL9Ii6JzLMIm7auD/RSu3ku5yeY9JmKTve 2kXOXGbggwL4hlIG3rIdLdIFTqSSh8oJUIGQLsEKfaz3DyxyCPLgYC5sNbl1+GVNALfe Ed0W+4tkCsGz7JfEkpZb+lNgdkJNp4rMTSvbR6u+9czzLFtiCOupjrirwEXOetIuM66b Nocw== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399113; 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=M5td5je8lpenBPsbXQb0DQBKfSj9fX+dIiFheZ6jfJIP/ACwBSzQDLdvfya5I3F36Q ej5PkcPoZOxY0KBh5NGBmCkfqEJaWw8l4LWQRhuxbbuhm8DeEL5s7JpQQ5mYrSg/CKEc b//BnM5F6HnxKrsGvwFoZ8YlB1TsllPk+q3EzjgknUrGulbjZt7rfPmlCBZagYQbUTuv a6oLhhCKx0BPdpsu/26AcAcuBs1u+GK6jTszjcmidycxJWgbnNwzWyQx8HLe1og+5gzD YqmLjyDfYc0LBtUdp7s7jXKA4fqKq+go//Qy/bYAgvWY/lKIWa5WvshF/Uk6iwCK6cDl bUiA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA6m6PrPw=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5B8Br02o (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 11 Jun 2021 10:11:53 +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 v3 08/10] dt-bindings: iio: bma255: Allow multiple interrupts Date: Fri, 11 Jun 2021 10:09:01 +0200 Message-Id: <20210611080903.14384-9-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210611080903.14384-1-stephan@gerhold.net> References: <20210611080903.14384-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@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 Fri Jun 11 08:09:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 12315047 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,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 9F3E5C49EA7 for ; Fri, 11 Jun 2021 08:12:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 85109610A5 for ; Fri, 11 Jun 2021 08:12:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230280AbhFKIOA (ORCPT ); Fri, 11 Jun 2021 04:14:00 -0400 Received: from mo4-p03-ob.smtp.rzone.de ([85.215.255.102]:20905 "EHLO mo4-p03-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230504AbhFKIN6 (ORCPT ); Fri, 11 Jun 2021 04:13:58 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623399114; cv=none; d=strato.com; s=strato-dkim-0002; b=pssHL5/7rPs9WxOAcMlggjM6fUybN51NsvIyWU8Hkx3sXhETzjRYf8y2Y6XlN1Yyde 2t4QQu1UKrc9V2ODeUZ1Z3FzF8s7PLgZuufrgr9H/pzyKkGi9iQzniCJsVP3jVWLUUUJ 50efmx2cYpUdRB3lRoMGGpIxwf22DL5dOKL/LK4ymm7kJl1tOAd5mssFTXkZfkQVkPaO nc72wNAyhr17aViAXaA30rQyJNTJ1skSW4lRSpil26ZUvurLaE9HFhi4hG+QJT5oGS5a nB9hVZDyrdU5tzSZYb26dw8+9lI7crHUGR2ryMfaBR7IGresCtZc9xEC9z2LZ0uPkTf8 prcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399114; 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=c0vVwAj2N5XC7LhN4UiLD4Zz9FgdFKX6g6BNsIwTYojd2vFA+PHUhmLLNYW3wGZBJZ acay6K4YPNYXfGqGtnU+kw7y0EhXeVwuJslKmix14S/hRE5XS+TOxm7jGzy7PXPdNuKV ANG81x7+2rfEsWEp9uUdxoEcnaakulFWMZvOGQgkCRuEf+gnOrdex+u6yNt9AEB82GP3 Wn9FJaAc/ZKA2Ul/GCAF0+ttmtSVkaBhVGJj+T6DdjkKwQWWEQWuaBbB4OvOWxca1eVD ACy1hZhn+Obfyi4EVjoa7WGcQ7SkuxxTXnZlM8nH1G2CScn9ZLuoIrOivi2Ht9k81Ytl FXsA== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399114; 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=QO+9p5Ft6gUrSJaIwz83mBl5tGkI2Fc4idx1nLDdsH+w4xx0OpMtEL1hXCHaAfw2lm mqXaa5G4iW1mkLTDYOPQNE3flo/3SRvhi37OYfZASI979tqLbkZeuNj6SK+v1u1hPcZy Aok4XM4WySHodkANWf6yCjdmi4Oax27ieHMP8DgH592I0zzgd50AXgIWsHcozCRFZB/0 eQZJ58tVqSSDCjtGCMFJlIPCoEPl8VUpoAMibL13/9v6s7Fohn7mFCSYlb+gu4xAJ7UK J+Ye+BeYoOfu1ZSoNvZq/4t6SSapoNaYuMlzZsL6brQk0VMoRWxtG18AqazfS3q7qREW cPSQ== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA6m6PrPw=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5B8Br02p (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 11 Jun 2021 10:11:53 +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 v3 09/10] dt-bindings: iio: accel: bma180/bma255: Move bma254 to bma255 schema Date: Fri, 11 Jun 2021 10:09:02 +0200 Message-Id: <20210611080903.14384-10-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210611080903.14384-1-stephan@gerhold.net> References: <20210611080903.14384-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@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 Fri Jun 11 08:09:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 12315049 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,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 00C32C4743D for ; Fri, 11 Jun 2021 08:12:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DD123610A5 for ; Fri, 11 Jun 2021 08:12:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230436AbhFKIOA (ORCPT ); Fri, 11 Jun 2021 04:14:00 -0400 Received: from mo4-p03-ob.smtp.rzone.de ([85.215.255.101]:35213 "EHLO mo4-p03-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230361AbhFKIN7 (ORCPT ); Fri, 11 Jun 2021 04:13:59 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1623399115; cv=none; d=strato.com; s=strato-dkim-0002; b=kV56mDmVGwTp88bYTKstcEL5ZbaWEODEqO1gkio+fimlUQrum75MCBV0FHKF47zmze xakhfTzSlXW0D+zS8hevWE4LP4GmCgAAYnpH9hqSKvzWPpT0livufoptccvuK8krx+th oBrevWe+X53L8vvti1/beFg9txBf3gefo+ndjkn00qYXTcvq4LbCPJNyDBTuNUMQ+rii MtwhZyBhDOTK7yJ8srE9/kyZQdT8pYPV0oinkkx8bYdGnQaex7qnxohPQZsgEAxuVg14 8R0QexfYQVjilfGRHimAcAMGM1VOBsFQ04bM+1l7V5uzvnGgqc7kxE4R5DT0PSah4mwY QevA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399115; 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=5f1hdzQy5P85V8PZSDgkI5XYeVMKai3VYkUNJNnmklI=; b=mqkjjd0mtyUzcQ4ZMQs+lpMcmKiwwkaYADepdyTV+0HQIc9GcF6uUw0bA80SzhwRdV KKaJk3yn9c7jJp1lL/gJUAfXdvmh/6Q254lOfnZ2aucff8PHnAZG/y7a2nyuW13Nl16P o5cZm/NgsvVGXFJCYjFMFNRq4Q1jRdgzFx+htdKKaJNaVjY7GRlLsZZG+vwMP2YMVGNc HyiHWv24jldx0gMPcU6zkEtJoEPFTUqgrAYmpzsdOvni1qDqEeVODgh9crDekgdO4d/E PNI2zRTi3qJTvDZFcMuXCJTuWP3SzLdBgex5qYWjR8NZ/8cXuXIPN9HrO/Jv4vtJqV3L Sjsg== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1623399115; 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=5f1hdzQy5P85V8PZSDgkI5XYeVMKai3VYkUNJNnmklI=; b=s9ZCAKmKE9QflLKrG34dC5hTqyJLDvAh46JS2L3lL+z8xeube7ii/PUAwfwlDhSWMn QdECOJW5gsnavf3J0Qvcnjrk1YMnv/0y2GZ9Z3xoJM4o8O9g+Zauv4eZwhaIHzdMVgwQ XGFpy+lmKfM90nzgg5JnXkzr0YBZ1mTRdOXaaF/mX8vvE1k3mQSNsHq2RJhSYXHYkhzg zK/212IlTUVUShnkvUXzE6n3fDolNuW/JsZXPMRcSmToYeq5+zShmN6tiZ1pTUCCEA8M oivo7yOQ/iJs2ThuFlQzLihYn1iL4YHCdkC5I1kSJx2gOYNtgGyUusTYUbPbexh4JKGK 4LBA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxA6m6PrPw=" X-RZG-CLASS-ID: mo00 Received: from droid.. by smtp.strato.de (RZmta 47.27.2 DYNA|AUTH) with ESMTPSA id y01375x5B8Bs02q (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 11 Jun 2021 10:11:54 +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 v3 10/10] iio: accel: bma180/bmc150: Move BMA254 to bmc150-accel driver Date: Fri, 11 Jun 2021 10:09:03 +0200 Message-Id: <20210611080903.14384-11-stephan@gerhold.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210611080903.14384-1-stephan@gerhold.net> References: <20210611080903.14384-1-stephan@gerhold.net> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@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 v3: Sort chip list in BMA180 Kconfig text 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 f8dc5403397d..0e56ace61103 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, BMA250 or SMB380 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. Note that some of these are combo modules: - BMC150: accelerometer and magnetometer 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 3faa3de0dd4d..43aecd4bf3a4 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 = "BMA253/BMA255/BMC150/BMI055", + .name = "BMA253/BMA254/BMA255/BMC150/BMI055", .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" },