From: Jakob Hauser <jahau@rocketmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Linus Walleij <linus.walleij@linaro.org>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
Hans de Goede <hdegoede@redhat.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
phone-devel@vger.kernel.org,
~postmarketos/upstreaming@lists.sr.ht,
Jakob Hauser <jahau@rocketmail.com>
Subject: [PATCH v3 0/8] Add support for magnetometer Yamaha YAS537
Date: Sat, 18 Jun 2022 02:13:08 +0200 [thread overview]
Message-ID: <cover.1655509425.git.jahau@rocketmail.com> (raw)
In-Reply-To: cover.1655509425.git.jahau.ref@rocketmail.com
This patchset adds YAS537 variant to the already existing driver for
Yamaha YAS magnetometers.
Patch 1 is a fix on the current driver.
Patches 2-7 are cleanups and refactoring.
Patch 8 finally adds the YAS537 variant.
Changes in v3:
- In patch 3 fixed 2x typo "Divide".
- In commit message of patch 4 fixed wording "in the yas5xx_get_measure()
function".
- In patch 4 in the comment for the temperature calculation fixed wording
"is the number of counts".
- In patch 4 added defaults to switch statements.
- Splitted stray changes into new patch 7 v3. "Add YAS537 variant" is now
patch 8 v3. I haven't added "Reviewed-by:" tag of Linus to patch 7 v3
because as a separate patch these changes appear in a different context.
- In new patch 7 v3, changed printk format specifiers in the function
yas530_get_calibration_data() to "%16ph" and in the function
yas532_get_calibration_data() to "%14ph". The first one is also a minor
correction in behaviour, as the calibration data array size of YAS530
is 16 (the dev_dbg printed 14 before).
- Rebased to linux-next to include patch bb52d3691db8 "iio: magnetometer:
yas530: Fix memchr_inv() misuse".
- In patch 7 v3, changed memchr_inv() line for YAS532.
- In patch 8 v3 in the function yas537_get_calibration_data(), changed
memchr_inv() line for YAS537.
- Removed comment "corresponds to 0x70" at define YAS537_MAG_AVERAGE_32_MASK.
- Added suffixes _US and _MS in defines for YAS537.
- In the function yas537_measure(), removed comments "Read data", "Arrange
data", "Assign data".
- In the function yas537_measure(), replaced bitwise shift by
get_unaligned_be16().
- Replaced "if (h[i] < -8192)" etc. by clamp_val().
- In the functions yas537_measure() and yas537_get_measure(), replaced 8192
by BIT(13) and 16384 by BIT(14).
- Fixed typo "resolution" in the function yas5xx_read_raw().
- Fixed typo "Divide" in patch 8 v3 in the function yas5xx_read_raw().
- In patch 8 v3 in the yas537_get_calibration_data(), changed printk format
specifier to "%17ph"
- In the functions yas537_measure() and yas537_get_calibration_data(), drop
some parentheses in regmap_write().
- In the function yas537_power_on(), added comment "Wait until the coil has
ramped up".
- In the function yas5xx_probe(), put YAS537 variant and version printings
into one print.
- In the function yas537_get_measure(), fixed wording "is the number of
counts" in the comment for the temperature calculation.
- In the function yas537_get_measure(), added product description document No.
into the comment for the temperature calculation (as I first thought the
review comment "the number" is related to this).
- In the function yas537_get_calibration_data(), corrected comment "Get data
into these four blocks val1 to val4".
Changes in v2:
- Reordered the patchset by moving patch 4 v1 to patch 1 v2.
- Removed patch 6 v1 ("Remove redundant defaults on switch devid")
- Accordingly, added "default:" to each switch statement in patch 7.
- Moved renamings in patch 7 v1 into a separate new patch 6 v2. I added
the "Reviewed-by:" tag of Linus to both patches, hope that's ok, else
feel free to comment.
- Removed regmap reads and related debug dumps in patch 7 in function
yas537_dump_calibration(). As this function now applies to version 1
only, replaced switch statement by if clause.
- Also removed "hard_offsets" debug dumps in that function.
- Fixed typo "initialized" in commit message of patch 7.
Jakob Hauser (8):
iio: magnetometer: yas530: Change data type of hard_offsets to signed
iio: magnetometer: yas530: Change range of data in volatile register
iio: magnetometer: yas530: Correct scaling of magnetic axes
iio: magnetometer: yas530: Correct temperature handling
iio: magnetometer: yas530: Change data type of calibration
coefficients
iio: magnetometer: yas530: Rename functions and registers
iio: magnetometer: yas530: Apply minor cleanups
iio: magnetometer: yas530: Add YAS537 variant
drivers/iio/magnetometer/Kconfig | 4 +-
drivers/iio/magnetometer/yamaha-yas530.c | 797 +++++++++++++++++++----
2 files changed, 688 insertions(+), 113 deletions(-)
--
2.35.1
next parent reply other threads:[~2022-06-18 0:14 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1655509425.git.jahau.ref@rocketmail.com>
2022-06-18 0:13 ` Jakob Hauser [this message]
2022-06-18 0:13 ` [PATCH v3 1/8] iio: magnetometer: yas530: Change data type of hard_offsets to signed Jakob Hauser
2022-06-18 14:18 ` Jonathan Cameron
2022-06-21 0:36 ` Jakob Hauser
2022-06-18 0:13 ` [PATCH v3 2/8] iio: magnetometer: yas530: Change range of data in volatile register Jakob Hauser
2022-06-18 14:21 ` Jonathan Cameron
2022-06-21 0:39 ` Jakob Hauser
2022-06-18 0:13 ` [PATCH v3 3/8] iio: magnetometer: yas530: Correct scaling of magnetic axes Jakob Hauser
2022-06-18 0:13 ` [PATCH v3 4/8] iio: magnetometer: yas530: Correct temperature handling Jakob Hauser
2022-06-18 14:53 ` Jonathan Cameron
2022-06-21 0:48 ` Jakob Hauser
2022-06-25 14:14 ` Jonathan Cameron
2022-06-18 0:13 ` [PATCH v3 5/8] iio: magnetometer: yas530: Change data type of calibration coefficients Jakob Hauser
2022-06-18 14:56 ` Jonathan Cameron
2022-06-21 0:51 ` Jakob Hauser
2022-06-22 8:49 ` Linus Walleij
2022-06-26 7:51 ` Jakob Hauser
2022-06-18 0:13 ` [PATCH v3 6/8] iio: magnetometer: yas530: Rename functions and registers Jakob Hauser
2022-06-18 15:00 ` Jonathan Cameron
2022-06-21 0:53 ` Jakob Hauser
2022-06-21 8:51 ` Andy Shevchenko
2022-06-25 14:16 ` Jonathan Cameron
2022-06-26 8:39 ` Jakob Hauser
2022-06-18 0:13 ` [PATCH v3 7/8] iio: magnetometer: yas530: Apply minor cleanups Jakob Hauser
2022-06-18 9:53 ` Andy Shevchenko
2022-06-21 0:57 ` Jakob Hauser
2022-06-18 0:13 ` [PATCH v3 8/8] iio: magnetometer: yas530: Add YAS537 variant Jakob Hauser
2022-06-18 10:57 ` Andy Shevchenko
2022-06-21 1:10 ` Jakob Hauser
2022-06-18 15:28 ` Jonathan Cameron
2022-06-19 10:32 ` Andy Shevchenko
2022-06-19 10:58 ` Jonathan Cameron
2022-06-21 1:29 ` Jakob Hauser
2022-06-25 14:22 ` 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.1655509425.git.jahau@rocketmail.com \
--to=jahau@rocketmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=hdegoede@redhat.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=phone-devel@vger.kernel.org \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/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.