Linux IIO development
 help / color / mirror / Atom feed
From: Yusuf Alper Bilgin <y.alperbilgin@gmail.com>
To: "Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Liam Beguin" <liambeguin@gmail.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>,
	 linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	 linux-kernel@vger.kernel.org,
	Yusuf Alper Bilgin <y.alperbilgin@gmail.com>
Subject: [PATCH v3 0/4] Add LTC2495 support
Date: Thu, 14 Aug 2025 13:00:16 +0200	[thread overview]
Message-ID: <20250814-ltc2495-v3-0-c2a6cecd6b99@gmail.com> (raw)

Hi All,

This is the v3 of the patch series adding support for the LTC2495 ADC in
the ltc2497 driver, and enabling the internal temperature channel for
the LTC2495 and LTC2499.

Thanks to Andy Shevchenko for his quick, helpful, and continued review
of the previous version.

In response to the request to check for code size changes, I have run
`bloat-o-meter`. The results confirm no meaningful impact on code size.

Full bloat-o-meter output:
```
./scripts/bloat-o-meter \
    before_patch_4/ltc2497-core.o drivers/iio/adc/ltc2497-core.o
add/remove: 0/0 grow/shrink: 1/1 up/down: 1/-1 (0)
Function                      old     new   delta
ltc2497core_read_raw          413     414      +1
ltc2497core_probe             374     373      -1
Total: Before=11576, After=11576, chg +0.00%

./scripts/bloat-o-meter \
    before_patch_4/ltc2497.o drivers/iio/adc/ltc2497.o
add/remove: 0/0 grow/shrink: 2/0 up/down: 2/0 (2)
Function                      old     new   delta
ltc2497_result_and_measure    275     276      +1
ltc2497_probe                 158     159      +1
Total: Before=1946, After=1948, chg +0.10%

./scripts/bloat-o-meter \
    before_patch_4/ltc2496.o drivers/iio/adc/ltc2496.o
add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0)
Function                      old     new   delta
Total: Before=1251, After=1251, chg +0.00%
```

Best Regards,

Alper

Signed-off-by: Yusuf Alper Bilgin <y.alperbilgin@gmail.com>
---
Changes in v3:
  - Used the standard `kelvin_to_celsius()` helper instead of a custom
    define.
  - Corrected macro definition style.
  - Renamed `LTC2497_CHANNELS` and `LTC_T_CHAN` for clarity.
  - Combined all struct layout optimizations into a single patch.
  - Link to v2: https://lore.kernel.org/r/20250813-ltc2495-v2-0-bbaf20f6ba07@gmail.com

Changes in v2:
  - Rewrote all commit messages to use the imperative mood.
  - Added a justification for the new compatible string to the device
    tree binding commit message.
  - Removed all unrelated whitespace and formatting changes.
  - Removed redundant explicit `false` initializers from structs.
  - Replaced the magic number for Kelvin conversion with a define.
  - Improved comments for defines and temperature scaling constants.
  - Renamed confusing macros and struct fields to be more descriptive.
  - Replaced dynamic channel allocation with a static array approach
    using a shared macro to improve readability.
  - Optimized data structure layouts based on pahole output to remove
    memory holes.
  - Link to v1: https://lore.kernel.org/r/20250812-ltc2495-v1-0-7bf4c6feec2e@gmail.com
---
Implementation Notes
 - checkpatch warning: The new static array approach uses a shared macro
   for the common channels (`LTC2497_CHANNELS`), which triggers a
   checkpatch.pl warning: "Macros with complex values should be enclosed
   in parentheses". However, this will cause a compilitaion error, as an
   initializer list cannot be parenthesized.
 - uV to mV conversion: I could not find a standard macro, so a manual
   division is used for now. This could be a point of future
   improvement.

---
Yusuf Alper Bilgin (4):
      dt-bindings: iio: adc: ltc2497: add lltc,ltc2495 bindings
      iio: adc: ltc2497: add support for LTC2495
      iio: adc: ltc2497: add temperature sensor support
      iio: adc: ltc2497: reorder struct members to fix memory holes

 .../devicetree/bindings/iio/adc/lltc,ltc2497.yaml  |   3 +
 drivers/iio/adc/ltc2497-core.c                     | 141 +++++++++++++++------
 drivers/iio/adc/ltc2497.c                          |  35 ++++-
 drivers/iio/adc/ltc2497.h                          |  23 +++-
 4 files changed, 159 insertions(+), 43 deletions(-)
---
base-commit: acbbb5a20971089064ca6b271dd251e629be8d4d
change-id: 20250811-ltc2495-572817c13fd3

Best regards,
-- 
Yusuf Alper Bilgin <y.alperbilgin@gmail.com>


             reply	other threads:[~2025-08-14 11:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14 11:00 Yusuf Alper Bilgin [this message]
2025-08-14 11:00 ` [PATCH v3 1/4] dt-bindings: iio: adc: ltc2497: add lltc,ltc2495 bindings Yusuf Alper Bilgin
2025-08-15  8:57   ` Krzysztof Kozlowski
2025-08-16 10:23     ` Jonathan Cameron
2025-08-14 11:00 ` [PATCH v3 2/4] iio: adc: ltc2497: add support for LTC2495 Yusuf Alper Bilgin
2025-08-14 11:00 ` [PATCH v3 3/4] iio: adc: ltc2497: add temperature sensor support Yusuf Alper Bilgin
2025-08-14 19:19   ` David Lechner
2025-08-15  8:56   ` Krzysztof Kozlowski
2025-08-14 11:00 ` [PATCH v3 4/4] iio: adc: ltc2497: reorder struct members to fix memory holes Yusuf Alper Bilgin

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=20250814-ltc2495-v3-0-c2a6cecd6b99@gmail.com \
    --to=y.alperbilgin@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=liambeguin@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox