Message ID | cover.1674954271.git.ang.iglesiasg@gmail.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1566947wrn; Sat, 28 Jan 2023 17:35:05 -0800 (PST) X-Google-Smtp-Source: AK7set+QymB72xNHLjV6I/HsxCDYooul0lpcfqh7RZf1QsbFs/9biY2CblKNeiD+JYUAiGu+zpgb X-Received: by 2002:a50:fb90:0:b0:49f:20fd:d683 with SMTP id e16-20020a50fb90000000b0049f20fdd683mr20354429edq.31.1674956105608; Sat, 28 Jan 2023 17:35:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674956105; cv=none; d=google.com; s=arc-20160816; b=JOapgWHGoWQbg3TJfeug2feIV3KKmLf+cyKubrRJ+PhDQIriMKxtYXcyvSU9+kA3pK aR2pI61rwXekxT8JIhbdjUGl4o/fth+VwAy3wHWNVXyIOhLtOKTl4+nnFFKVN7buI6j4 AEoGUZtFQfNElIlDA2VTtcnl4chrF+zj6HN1I7ROoH711o97+jrRxU+UYla6XLESJfMk IRBcCr3zWLtmTACZPLDPAgatp/QIaAOvfwKFahWERS+v1XijL8/Bb5gbdROzyr0mcwyy 3lE9+XVEaXMHLgvcOHFJ13BeMDICroURYXfRUacyQPt5atXffG1RbPIaTokFbiBLKOKb pY4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=IRsgsFOkDL2GeFrKorEQKN10FPDAyCyhKXv2uU/88Ko=; b=Ft5CN1LP7uCzMa87KxezwdqxfLvoHIAr7FZwfl3qgq9LEMj6GyYY+nxW2i557paJx1 72Eto1gUjVblimO99497+Se5/M8kCQicpMuQZrx1o+E7Q7lwg4muae+Jb9SUQKCM/B0g TSHpVj+cbIg/3RAcH4w0i+uNao6UhQIk2Xsv44n1Q+NVAF4Jj/GaT90grwOe6fsYEGzE VFfLppxYMkpCeIDzoNBIs3ydZGkCMwJ3GSh21lKovunzZUCJeyIMqREDnxAK7cU2hM/C 4bYsfWQzCQ6MW9uznlXdWaARJ6eusqApaeHZ/nWKvSoEkK/3DwxtnZeiLlIeONuVEjmL emXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dxKQuht2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r24-20020aa7cfd8000000b004a09059b2c0si10946103edy.255.2023.01.28.17.34.42; Sat, 28 Jan 2023 17:35:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dxKQuht2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230128AbjA2BeF (ORCPT <rfc822;n2h9z4@gmail.com> + 99 others); Sat, 28 Jan 2023 20:34:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbjA2BeC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 28 Jan 2023 20:34:02 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1934E6E90; Sat, 28 Jan 2023 17:34:00 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id iv8-20020a05600c548800b003db04a0a46bso7234327wmb.0; Sat, 28 Jan 2023 17:34:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=IRsgsFOkDL2GeFrKorEQKN10FPDAyCyhKXv2uU/88Ko=; b=dxKQuht2s4U4X2KDPzAlSyw52WRimmYQVTovbxtRZQro32CD+XMb9O+yz8R7kpRa3y VQR+CWM0j+VO1lMXcYPc79YRTGc39KJSRSXI0TRXwW9Xe+pPqwfmEz7wQ6nIzmobh9/u nY4UVGcu7DDVxxlsfMef3JrHlHgY2U8+gKnTMdcg9zKICO85H9mZkEuoPo+x2oPlzQMx Pd//E1ZX+lCLNnl3OvfYxzbb9pYAjXWvEB+MDmjzhJOl9PRPaa4R/leWIeOhU8lo0vEM oWllPU3VOWJr4DmCK7iXDWBbwLo2dtLLzXC5/HZTi+3ui0vH7bWITd+9Ly2CSktBUbfK ml5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IRsgsFOkDL2GeFrKorEQKN10FPDAyCyhKXv2uU/88Ko=; b=PLrCtIrIQz4w/4a2wVvsZ2TlomKKIbe2VB3X18KbTfr87FOqATXgKBzCDh0iyNprJo yxW7enWcx3m0T7EtbRgGnhnDqEpmJ0Ygjv5a6bFv4Yt+g5FpUIEeak6AVFKy6GEbNV4O 15fXfs0+Qtop3BmbPFDmaEFISns9UOjTTYECCwlCOezJYBcmFSpVlB82Tm6cAkqmla3O F3L90GZaOMLhTO+31fyZHFcyokMgsS4v5YUuRqgrW54zcIyXmMrAGzyqyk+KzQ2bGuVN 30Qc336naWM7OkgJz7gq7que9Y7pi9DS/DbAI/gMrhslZ+cUrBSpcHFM2Q+X4eQkK0sh mmYg== X-Gm-Message-State: AO0yUKVSL9x/9lhFgA9HI5RSvkeBEouXWGvOAgn3MLes9XzczGhhQBzD peAhLVCuGZHm67mN385u+g2ajor0HN4= X-Received: by 2002:a7b:c85a:0:b0:3d2:813:138a with SMTP id c26-20020a7bc85a000000b003d20813138amr850568wml.35.1674956038257; Sat, 28 Jan 2023 17:33:58 -0800 (PST) Received: from localhost.localdomain (143.red-83-35-57.dynamicip.rima-tde.net. [83.35.57.143]) by smtp.gmail.com with ESMTPSA id r7-20020a05600c434700b003dc3f195abesm5197132wme.39.2023.01.28.17.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jan 2023 17:33:57 -0800 (PST) From: Angel Iglesias <ang.iglesiasg@gmail.com> To: linux-iio@vger.kernel.org Cc: Angel Iglesias <ang.iglesiasg@gmail.com>, Jonathan Cameron <jic23@kernel.org>, Lars-Peter Clausen <lars@metafoo.de>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Andreas Klinger <ak@it-klinger.de>, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/7] Add support for pressure sensor Bosch BMP580 Date: Sun, 29 Jan 2023 02:33:02 +0100 Message-Id: <cover.1674954271.git.ang.iglesiasg@gmail.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756318773403669096?= X-GMAIL-MSGID: =?utf-8?q?1756318773403669096?= |
Series |
Add support for pressure sensor Bosch BMP580
|
|
Message
Angel Iglesias
Jan. 29, 2023, 1:33 a.m. UTC
This patchset adds support for the new pressure sensors BMP580 extending the bmp280 driver. Patch 1 introduces a minor refactor of the driver structure to change how the device matching and driver initialization is performed. In place of the chips ids, the driver_data now contains a pointer to its chip_info. To perform this change, a series of declarations previously on the core file were migrated to the shared header file, to allow access to specific fields on the chip_info on the I2C and SPI drivers. This change is required because BMP380 and BMP580 have the same chip_id and values would collide using the chip_id as the driver_data value. Patch 2 introduces new preinit callback and unifies init logic across all supported variants. Patch 3 made calibration callback function optional. Patch 4 deletes misleading i2c reference on bmp280 Kconfig entry. Patch 5 extends the bmp280 driver with the new logic to read measurements and configure the operation parameters for the BMP580 sensors. Patch 6 updates the devicetree binding docs with the new sensor id. Patch 7 adds the NVMEM operations to read and program the NVM user range contained in the non-volatile memory of the BMP580 sensors. Changes in v3: * Refactor driver structure to use chip_info structs as driver_data and updated i2c and spi implementations device match codepaths. * Deleted Kconfig driver title misleading i2c reference. * Made calibration reading optional as a prerequisite patch in preparation for the bmp580 built in compensation. * Break command helper function in soft-reset helper function and NVM operation helper. * Fixed minor styling issues thorough patches. Changes in v2: * For patch 3, fixed missing retcodes reported by the kernel test robot. * For patch 5, fixed logic paths that left the sensor mutex locked reported by the kernel test robot. Angel Iglesias (7): iio: pressure: bmp280: Use chip_info pointers for each chip as driver data iio: pressure: bmp280: Add preinit callback iio: pressure: bmp280: Make read calibration callback optional iio: pressure: Kconfig: Delete misleading I2C reference on bmp280 title iio: pressure: bmp280: Add support for new sensor BMP580 dt-bindings: iio: pressure: bmp085: Add BMP580 compatible string iio: pressure: bmp280: Add nvmem operations for BMP580 .../bindings/iio/pressure/bmp085.yaml | 2 + drivers/iio/pressure/Kconfig | 6 +- drivers/iio/pressure/bmp280-core.c | 762 ++++++++++++++---- drivers/iio/pressure/bmp280-i2c.c | 45 +- drivers/iio/pressure/bmp280-regmap.c | 60 ++ drivers/iio/pressure/bmp280-spi.c | 47 +- drivers/iio/pressure/bmp280.h | 273 ++++++- 7 files changed, 958 insertions(+), 237 deletions(-) base-commit: 354f23ac2c8703d170354577738edad159a7d37b
Comments
On Sun, Jan 29, 2023 at 02:33:02AM +0100, Angel Iglesias wrote: > This patchset adds support for the new pressure sensors BMP580 extending > the bmp280 driver. > > Patch 1 introduces a minor refactor of the driver structure to change how > the device matching and driver initialization is performed. In place of > the chips ids, the driver_data now contains a pointer to its chip_info. > To perform this change, a series of declarations previously on the core > file were migrated to the shared header file, to allow access to specific > fields on the chip_info on the I2C and SPI drivers. This change is > required because BMP380 and BMP580 have the same chip_id and values would > collide using the chip_id as the driver_data value. > Patch 2 introduces new preinit callback and unifies init logic across all > supported variants. > Patch 3 made calibration callback function optional. > Patch 4 deletes misleading i2c reference on bmp280 Kconfig entry. > Patch 5 extends the bmp280 driver with the new logic to read measurements > and configure the operation parameters for the BMP580 sensors. > Patch 6 updates the devicetree binding docs with the new sensor id. > Patch 7 adds the NVMEM operations to read and program the NVM user range > contained in the non-volatile memory of the BMP580 sensors. Patches 1-5 are good enough for me, Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> If anything, we can fix in the followups.