From patchwork Sun Oct 27 17:20:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Weiss X-Patchwork-Id: 13852701 Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ED392C859; Sun, 27 Oct 2024 17:21:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730049708; cv=none; b=ob6tqhMcxcWLDTIcW7tUxgDCkNZQVwDLfVmgderPxG2ondrkNi64aAEXtNJD18LYnK+yU7a2JxuhZfgP1DQWXQy7AtoL7VS9+XpuU/DigCCCNZ6fgesHF6RCoS4NXBre5Ve9I3fTyifRdq4qbcOcDe0JPNDlOHSK/vflSHch288= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730049708; c=relaxed/simple; bh=+QdGcc72XmgoJtLUqz1tpZ2gAv0BfhZKj6uMIcLS/aw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=EvNA/ZEBhzeBBHWZXeetKqH4cb1SDNkvvubdZ2/52gALc3qYepm9NWp6CPrKHPYDsOOP/Xhw4IemP7+NK1hXdPMUB62DPtO3J+nsxwpfZkxd9jWZC8hhoBMee1lAEGQnGh9gchafhe18PZFPsFQWOQ4/tkCFlIMwvtQiawV3Wv0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=justinweiss.com; spf=pass smtp.mailfrom=justinweiss.com; dkim=pass (2048-bit key) header.d=justinweiss.com header.i=@justinweiss.com header.b=sAtW7H56; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=FQUeQ+8L; arc=none smtp.client-ip=202.12.124.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=justinweiss.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=justinweiss.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=justinweiss.com header.i=@justinweiss.com header.b="sAtW7H56"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="FQUeQ+8L" Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id 0DD0E114007F; Sun, 27 Oct 2024 13:21:43 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Sun, 27 Oct 2024 13:21:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=justinweiss.com; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to; s=fm2; t=1730049702; x=1730136102; bh=yOpK+TjSYM 0F/8RnI16GiZns9duRSi5QdM3eOBUUnrs=; b=sAtW7H56AQ9mo6Iuno3XoeIade 2eIPba6PsD4rKxFLtaswUqfTQI9Vk0JJtnKpeEm1iuVdRCrYCopKhTG3Li518oij D9MhpYUvoE1d03RYgF17dC9/XxCbRmG0IE8KTPa1LPcwRDeJe3GK55Ham5SZUhfO ERicFxCE8UpzZU2hHRl+9wbQl+JLMJTmrGCCduYvA7U8fUnI9+NKbqOJhrUhv4tt o8DMWKhBHDCnyJx2gVVqRmH0MIXQZwbdebx/WhpXTra2PQCk3ewiOepYNIiXeaXU KPUyHYCkCw18ayI/Niqu+/GV6j8KVzo5qarcl8rcS3qesvqMhCZmmhmdqD9w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1730049702; x=1730136102; bh=yOpK+TjSYM0F/8RnI16GiZns9duR Si5QdM3eOBUUnrs=; b=FQUeQ+8LSSeOdrJ02NBgeQad1DKnQ1K+7YdtspR/aBuj pfYVHBGKFO8Zany5ub7SVQDA8gDv8/nHDpQClSQK4zyieYc+tKf0Xt2Jra22R9fk LPZzowMdsvOQSVHsiU8O06/6U3vmGzALQYWLbivvGy1Yq8npkaBd65U0Htg5+rQQ cdIAPmTwNpgqnHtJ9duPz5mxX/rtdK1bMD98w7KSThO75dr4x+Lq1VOiTdUGaRcK eQVp1hAVuIfQhJbMrgmAC6ZTYrXpSjUGHhgO3vPi0HaAMNIlDl6g1lnA15LX1xwa IOMJZ+67SQ68TGVuVfVGscRsvhqcpM/zS5BBd+osfw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdejiedguddttdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecu hfhrohhmpefluhhsthhinhcuhggvihhsshcuoehjuhhsthhinhesjhhushhtihhnfigvih hsshdrtghomheqnecuggftrfgrthhtvghrnhephffhfeelheeuvdegtdelueelkeeltedv fefhgeevieeguedtgfetleekkedvtedvnecuffhomhgrihhnpehkvghrnhgvlhdrohhrgh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjuhhs thhinhesjhhushhtihhnfigvihhsshdrtghomhdpnhgspghrtghpthhtohepudefpdhmoh guvgepshhmthhpohhuthdprhgtphhtthhopehlrghniigrnhhordgrlhgvgiesghhmrghi lhdrtghomhdprhgtphhtthhopehjihgtvdefsehkvghrnhgvlhdrohhrghdprhgtphhtth hopehlrghrshesmhgvthgrfhhoohdruggvpdhrtghpthhtoheprhhosghhsehkvghrnhgv lhdrohhrghdprhgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtph htthhopegtohhnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprghnughr ihihrdhshhgvvhgthhgvnhhkoheslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtth hopehjuhhsthhinhesjhhushhtihhnfigvihhsshdrtghomhdprhgtphhtthhopehlihhn uhigqdhiihhosehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: icf614246:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 27 Oct 2024 13:21:40 -0400 (EDT) From: Justin Weiss To: Alex Lanzano , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Shevchenko Cc: Justin Weiss , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, "Derek J . Clark" , =?utf-8?q?Philip_M=C3=BCller?= Subject: [PATCH v4 0/4] Add i2c driver for Bosch BMI260 IMU Date: Sun, 27 Oct 2024 10:20:21 -0700 Message-ID: <20241027172029.160134-1-justin@justinweiss.com> X-Mailer: git-send-email 2.47.0 Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add support for the Bosch BMI260 IMU to the BMI270 device driver. The BMI270 and BMI260 have nearly identical register maps, but have different chip IDs and firmware. The BMI260 is the IMU on a number of handheld PCs. Unfortunately, these devices often misidentify it in ACPI as a BMI160 ("BMI0160," for example), and it can only be correctly identified using the chip ID. To avoid conflicts with the bmi160 driver, this driver will not probe if it detects a BMI160 chip ID. Also add triggered buffer and scale / sampling frequency attributes, which the input tools commonly used on handheld PCs require to support IMUs. Like the BMI270, the BMI260 requires firmware to be provided. Signed-off-by: Justin Weiss --- Changelog: V4 - Move triggered buffer and attributes patches to the front of the set - Add more detailed commit message to DT documentation patch - Remove ACPI IDs from SPI driver - Remove 10EC5280 and BMI0260 ACPI IDs from I2C driver - Add DSDT excerpt for BMI0160 ACPI ID V3 https://lore.kernel.org/lkml/20241020220011.212395-1-justin@justinweiss.com/ - Fix: Remove SCALE and FREQUENCY attributes - Use separate configuration structures instead of an array - Add bmi260 as compatible ID in bmi270 dt binding doc - Check chip ID against value in configuration instead of constant - Update comment for DMA alignment - Remove unreachable return statement V2 https://lore.kernel.org/all/20241018233723.28757-1-justin@justinweiss.com/ - Fix commit titles - Fix: Change FREQUENCY to SAMP_FREQ - Split chip_info refactor into a separate commit from adding bmi260 - Only fail probe when BMI160 is detected - Update chip_info based on detected chip ID - Add BMI260 to DT documentation - Add BMI260 to of_device_id - Add expected BMI260 ACPI ID to the SPI driver - Remove unused/unexpected BMI260 ACPI IDs - Remove trailing comma for null terminators - Use DMA_MINALIGN for channel buffer - Read channels in bulk - Improve for loops for detecting scale / odr attrs - Add missing masks - Use FIELD_GET - Use read_avail instead of custom attrs - Misc. formatting and line wrapping improvements V1 https://lore.kernel.org/all/20241011153751.65152-1-justin@justinweiss.com/ Justin Weiss (4): iio: imu: bmi270: Add triggered buffer for Bosch BMI270 IMU iio: imu: bmi270: Add scale and sampling frequency to BMI270 IMU dt-bindings: iio: imu: bmi270: Add Bosch BMI260 iio: imu: bmi270: Add support for BMI260 .../bindings/iio/imu/bosch,bmi270.yaml | 4 +- drivers/iio/imu/bmi270/Kconfig | 1 + drivers/iio/imu/bmi270/bmi270.h | 10 + drivers/iio/imu/bmi270/bmi270_core.c | 424 +++++++++++++++++- drivers/iio/imu/bmi270/bmi270_i2c.c | 9 + drivers/iio/imu/bmi270/bmi270_spi.c | 2 + 6 files changed, 448 insertions(+), 2 deletions(-) base-commit: 9090ececac9ff1e22fb7e042f3c886990a8fb090