Skip to content

iio: processed channel handling fixes + Intel Dollar Cove TI PMIC ADC driver

Hans de Goede linux-iio 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest6 patches 1 replyIn review
  2. v46 patches 11 repliesSuperseded
  3. v32 patches 10 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v22 patches12 repliesSuperseded

Changes in v5 from the cover letter

- Do not put case foo: val = x; break; statements on a single line
- Use IIO_UNIT_TEST module-namespace for iio_multiply_value()
- iio_read_channel_processed_scale(): Use pval + pval2 local variables for better readability
- Consistenly use s / ms / ųs for seconds in comments
- Various other small (comment) style fixups
- Add Andy's Reviewed-by to all patches

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6iio: consumers: Fix handling of negative channel scale in iio_convert_raw_to_processed()drivers/iio/inkern.c+14 -140 replies
2/6iio: consumers: Fix offset handling in iio_convert_raw_to_processed()drivers/iio/inkern.c+1 -10 replies
3/6iio: consumers: Add an iio_multiply_value() helper functiondrivers/iio/inkern.c include/linux/iio/consumer.h+60 -300 replies
4/6iio: Improve iio_read_channel_processed_scale() precisiondrivers/iio/inkern.c+3 -40 replies
5/6iio: test: Add KUnit tests for iio_multiply_value()drivers/iio/test/Kconfig drivers/iio/test/Makefile drivers/iio/test/iio-test-multiply.c+225 -00 replies
6/6iio: adc: Add Intel Dollar Cove TI PMIC ADC driverdrivers/iio/adc/Kconfig drivers/iio/adc/Makefile drivers/iio/adc/intel_dc_ti_adc.c+340 -00 replies

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchAndy Shevchenko
1/6R-b
2/6R-b
3/6R-b
4/6R-b
5/6R-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/6] iio: processed channel handling fixes + Intel Dollar Cove TI PMIC ADC driver

Hi All,

Here is v5 of my patch-set to add an IIO driver for the Intel Dollar Cove TI PMIC ADC. This has turned more into a series with fixes / changes to iio_convert_raw_to_processed() and iio_read_channel_processed_scale(), with the new driver tagged on as the last patch :)

Changes in v5:
- Do not put case foo: val = x; break; statements on a single line
- Use IIO_UNIT_TEST module-namespace for iio_multiply_value()
- iio_read_channel_processed_scale(): Use pval + pval2 local variables for better readability
- Consistenly use s / ms / ųs for seconds in comments
- Various other small (comment) style fixups
- Add Andy's Reviewed-by to all patches

Changes in v4:
- 2 new bug-fixes for iio_convert_raw_to_processed()
- Factor the bugfixed code multiply a s64 and an iio (type, val, val2) triplet out of iio_convert_raw_to_processed() into a new iio_multiply_value() helper
- Add a KUnit test for iio_multiply_value()
- Redo the "Improve iio_read_channel_processed_scale() precision" patch using the iio_multiply_value() helper

Changes in v3:
- "iio: Improve iio_read_channel_processed_scale() precision"
- Use div_s64() instead of div_u64() to fix -1.0 - 0.0 range
- Directly return IIO_VAL_INT from valid cases and drop the final return ret after the switch-case
- "iio: adc: Add Intel Dollar Cove TI PMIC ADC driver"
- Use new more compact DC_TI_ADC_DATA_REG_CH(x) macro
- Use regmap_set_bits() regmap_clear_bits() where applicable
- Use regmap_bulk_read() + be16_to_cpu() to read ADC value
- Use sign_extend32() for vbat_zse and vbat_ge reading in probe()

Changes in v2:
- Add new "iio: Improve iio_read_channel_processed_scale() precision" patch to the series
- Add IIO_CHAN_INFO_SCALE and provide ADC scale info for Vbat
- Add IIO_CHAN_INFO_PROCESSED which applies calibration and scaling for the VBat channel
- Address some other small review remarks

Regards,

Hans

Hans de Goede (6):
iio: consumers: Fix handling of negative channel scale in
iio_convert_raw_to_processed()
iio: consumers: Fix offset handling in iio_convert_raw_to_processed()
iio: consumers: Add an iio_multiply_value() helper function
iio: Improve iio_read_channel_processed_scale() precision
iio: test: Add KUnit tests for iio_multiply_value()
iio: adc: Add Intel Dollar Cove TI PMIC ADC driver

 drivers/iio/adc/Kconfig              |  11 +
 drivers/iio/adc/Makefile             |   1 +
 drivers/iio/adc/intel_dc_ti_adc.c    | 328 +++++++++++++++++++++++++++
 drivers/iio/inkern.c                 |  81 ++++---
 drivers/iio/test/Kconfig             |  12 +
 drivers/iio/test/Makefile            |   1 +
 drivers/iio/test/iio-test-multiply.c | 212 +++++++++++++++++
 include/linux/iio/consumer.h         |  18 ++
 8 files changed, 629 insertions(+), 35 deletions(-)
 create mode 100644 drivers/iio/adc/intel_dc_ti_adc.c
 create mode 100644 drivers/iio/test/iio-test-multiply.c
Signature · 1 line
2.51.0