From: Angel Iglesias <ang.iglesiasg@gmail.com>
To: linux-iio <linux-iio@vger.kernel.org>
Cc: Angel Iglesias <ang.iglesiasg@gmail.com>,
Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Paul Cercueil <paul@crapouillou.net>,
Ulf Hansson <ulf.hansson@linaro.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH v6 0/9] Add support for pressure sensor Bosch BMP380
Date: Tue, 13 Sep 2022 01:43:46 +0200 [thread overview]
Message-ID: <cover.1663025017.git.ang.iglesiasg@gmail.com> (raw)
This patchset adds BMP380 variant to the already existing drivers for
the Bosch BMP180/280 pressure sensors.
Patch 1 reorder local variables declarations following reverse xmas tree
conventions, as suggested by Andy Shevchenko <andy.shevchenko@gmail.com>.
Patch 2 migrates existing code to use FIELD_GET/FIELD_PREP and GENMASK
utilities.
Patch 3 is a minor refactor of the function that loads bmp280 calibration
params, taking advantage of the data contiguity in memory.
Patch 4 is a minor refactor simplifying driver initialization logic
to facilitate the integration of the new sensor variant extending the
information stored in the "chip_info" struct.
Patch 5 fixes DMA unsafe regmap_bulk_* calls reported by Jonathan Cameron
<jic23@kernel.org>.
Patch 6 is a minor refactor reordering device match tables declarations in
forward order as suggested by Andy Shevchenko <andy.shevchenko@gmail.com>.
Patch 7 adds the basic logic to initialize and read measurements from
the sensor.
Patch 8 adds references and sensor id to the devicetree bindings docs.
Patch 9 adds advanced configurable features such as sampling frequency
and IIR filter through the IIO sysfs ABI.
Changes in v6:
- Introduced patch 1 reordering local variables declarations.
- Patch 2 is separated form v5 patch 1, separating initialization
refactor from migration to FIELD_GET, FIELD_PREP and GENMASK.
- Patch 3 backports a refactor made to bmp280 calibration load
on v5 patch 2.
- Introduced patch 6 reordering i2c device match tables declarations.
- Revised patch 7 and 9 and smoothed transition to patch 9 moving some
code on v5 patch 5 to patch 7 (BMP380 basic enablement).
- Cleaned error handling of regmap calls thorough patches.
- Changed formula used to handle IIR filter on patch 9 following feedback
made by Andy Shevchenko <andy.shevchenko@gmail.com>.
- Made union with data buffers on patch 5 anonymous (suggested by Andy
Shevchenko <andy.shevchenko@gmail.com>)
- Improved handling of be16 and le16 data on patch 5 integrating changes
suggested by Jonathan Cameron <jic23@kernel.org>.
Changes in v5:
- Moved dt bindings patch (previously patch 2/5) to 4/5 to preserve
tree coherence as suggested by Jonathan Cameron <jic23@kernel.org>
- Patch 1: Simplified initial oversampling values assignation.
- Patch 1: Updated codepaths for bmp180 and bmp280 to use FIELD_GET and
FIELD_GET helpers. Migrated compatible masks to use GENMASK.
- Patch 2: Store DMA-safe buffers on the device data struct instead of
using dynamic allocations for calibration buffers.
Thanks Jonathan Cameron <jic23@kernel.org>.
- Patch 3: Fixed small typos
- Patch 3: Fixed incompatible division on 32-bit machines reported by
Andy Shevchenko <andy.shevchenko@gmail.com> and kernel test robot
<lkp@intel.com>.
- Patch 3: Fixed inconsistent use of "x" and "X" declaring constants.
- Patch 5: Dropped incorrect reported-by tag on changelog message.
- Patch 5: Fixed typos on various comments.
Changes in v4:
- Patch 4 and 2: Merged v3 patch 2 (Kconfig refs update) into this patch.
- Patch 3: Added patch fixing unsafe DMA regmap_bulk_* calls reported by
Jonathan Cameron <jic23@kernel.org>.
- Patch 4: Fixed DMA unsafe buffers used on regmap_bulk_* calls reported
by Jonathan Cameron <jic23@kernel.org>.
Changes in v3:
- Patch 2: Fixed incorrect abbreviation.
- Patch 3: use dev_err_probe helper to handle error initializing sensor.
- Patch 4: Fixed kernel test robot warning provoked by missing include.
- Patch 4: Fixed bug reported by Dan Carpenter <dan.carpenter@oracle.com>.
- Patch 5: Fixed formatting and typos on multiple comments.
- Patch 5: Fixed missing boolean initialization reported by
Andy Shevchenko <andy.shevchenko@gmail.com>.
- Patch 5: Replaced duplicated comments with a single comment containing
a brief explantation in a shared location.
- Patch 5: Dropped incorrect use of unlikely macro.
Changes in v2:
- Added patch 2 updating Kconfig with references to new sensor.
- Patch 3 adds changes proposed by Jonathan Cameron <jic23@kernel.org>
to declutter and unify configuration logic for the different sensors
extending "chip_info" struct with default configuration parameters.
- Patch 4: store temperature and pressure adc values on 3 byte array
instead of using the type __le32. Uses function get_unaligned_le24
to convert the little-endian encoded 3 byte value to an integer.
- Patch 4: drops custom macro le16_from_bytes and use get_unaligned_le16.
- Patch 4: generate masks using GENMASK macro.
- Patch 4: use FIELD_PREP to generate bitfields for registries.
- Patch 4: dropped stray formatting change.
- Patch 5: adds sanity checks in bmp280_read_raw for channel properties
only available in the BMP380.
- Patch 5: on bmp280_write_* checks if a problem occurred committing new
configuration and tries to restore previous working configuration
to keep the sensor in a previous working state.
- Patch 5: refactored bmp380_chip_config to only check for configuration
errors when a configuration change is detected.
- Patch 5: improved invalid configuration detection on BMP380 restarting
measurement loop to force a new measurement after the configuration is
updated.
Previous patch version available on:
https://lore.kernel.org/all/cover.1659872590.git.ang.iglesiasg@gmail.com/
Angel Iglesias (9):
iio: pressure: bmp280: reorder local variables following reverse xmas
tree
iio: pressure: bmp280: use FIELD_GET, FIELD_PREP and GENMASK
iio: pressure: bmp280: Simplify bmp280 calibration data reading
iio: pressure: bmp280: simplify driver initialization logic
iio: pressure: bmp280: Fix alignment for DMA safety
iio: pressure: bmp280: reorder i2c device tables declarations
iio: pressure: bmp280: Add support for BMP380 sensor family
dt-bindings: iio: pressure: bmp085: Add BMP380 compatible string
iio: pressure: bmp280: Add more tunable config parameters for BMP380
.../bindings/iio/pressure/bmp085.yaml | 4 +-
drivers/iio/pressure/Kconfig | 6 +-
drivers/iio/pressure/bmp280-core.c | 962 +++++++++++++++---
drivers/iio/pressure/bmp280-i2c.c | 15 +-
drivers/iio/pressure/bmp280-regmap.c | 55 +
drivers/iio/pressure/bmp280-spi.c | 5 +
drivers/iio/pressure/bmp280.h | 164 ++-
7 files changed, 1018 insertions(+), 193 deletions(-)
base-commit: 2f61ff8272967c9bdcba810aa978170814b08f7c
--
2.37.3
next reply other threads:[~2022-09-12 23:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-12 23:43 Angel Iglesias [this message]
2022-09-12 23:44 ` [PATCH v6 1/9] iio: pressure: bmp280: reorder local variables following reverse xmas tree Angel Iglesias
2022-09-12 23:45 ` [PATCH v6 2/9] iio: pressure: bmp280: use FIELD_GET, FIELD_PREP and GENMASK Angel Iglesias
2022-09-15 14:54 ` Jonathan Cameron
2022-09-12 23:46 ` [PATCH v6 3/9] iio: pressure: bmp280: Simplify bmp280 calibration data reading Angel Iglesias
2022-09-15 14:57 ` Jonathan Cameron
2022-09-12 23:47 ` [PATCH v6 4/9] iio: pressure: bmp280: simplify driver initialization logic Angel Iglesias
2022-09-17 13:16 ` Jonathan Cameron
2022-09-12 23:48 ` [PATCH v6 5/9] iio: pressure: bmp280: Fix alignment for DMA safety Angel Iglesias
2022-09-17 13:17 ` Jonathan Cameron
2022-09-12 23:50 ` [PATCH v6 6/9] iio: pressure: bmp280: reorder i2c device tables declarations Angel Iglesias
2022-09-17 13:18 ` Jonathan Cameron
2022-09-12 23:52 ` [PATCH v6 7/9] iio: pressure: bmp280: Add support for BMP380 sensor family Angel Iglesias
2022-09-13 16:46 ` Andy Shevchenko
2022-09-13 21:19 ` Angel Iglesias
2022-09-14 9:30 ` Andy Shevchenko
2022-09-17 13:25 ` Jonathan Cameron
2022-09-18 10:06 ` Angel Iglesias
2022-09-18 14:37 ` Jonathan Cameron
2022-09-12 23:53 ` [PATCH v6 8/9] dt-bindings: iio: pressure: bmp085: Add BMP380 compatible string Angel Iglesias
2022-09-12 23:54 ` [PATCH v6 9/9] iio: pressure: bmp280: Add more tunable config parameters for BMP380 Angel Iglesias
2022-09-17 13:31 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1663025017.git.ang.iglesiasg@gmail.com \
--to=ang.iglesiasg@gmail.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul@crapouillou.net \
--cc=rafael.j.wysocki@intel.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.