All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] iio: adc: Maxim max9611 driver
@ 2017-03-24 15:28 ` Jacopo Mondi
  0 siblings, 0 replies; 39+ messages in thread
From: Jacopo Mondi @ 2017-03-24 15:28 UTC (permalink / raw)
  To: geert-Td1EMuHUCqxL1ZNQvxDV9g,
	wsa+renesas-jBu1N2QxHDJrcw3mvpCnnVaTQe2KTcn/,
	magnus.damm-Re5JQEeQqe8AvxtiuMwx3w,
	laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw,
	jic23-DgEjT+Ai2ygdnm+yROfE0A, knaack.h-Mmb7MZpHnFY,
	lars-Qo5EllUWu/uELgA04lAiVw, pmeerw-jW+XmwGofnusTnJN9+BGXg,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8
  Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

Hello!

Third round for Maxim max9611/max9612 high-side current sense amplifier driver.

For reference, a simplified integration schematic drawing is here reported:

 ----o----/\/\/-----o-------|LOAD|---
     |    shunt     |
 ____|______________|___
 |  RS+            RS-  |
 |   |-----gain-----|   |
 |          |           |
 |          |           |
 |max9611   |->| ADC |===== I2c
 |______________________|

public datasheet available at
https://datasheets.maximintegrated.com/en/ds/MAX9611-MAX9612.pdf

In v2 all channels whose values are calculated using parameters
depending on the applied gain have been transformed in "processed" channels.

In v3 fixed DT bindings to use a more generic name for ADC nodes, and shunt
resistor description property.

output reported from iio_info tool:
iio:device0: max9611_vdd
                6 channels found:
                        voltage0:  (input)
                        1 channel-specific attributes found:
                                attr 0: input value: 4.085000000
                        voltage1:  (input)
                        3 channel-specific attributes found:
                                attr 0: scale value: 14
                                attr 1: offset value: 1
                                attr 2: raw value: 59
                        shunt:  (input)
                        2 channel-specific attributes found:
                                attr 0: resistor_power value: 5000
                                attr 1: resistor_current value: 5000
                        power:  (input)
                        1 channel-specific attributes found:
                                attr 0: input value: 663.404000000
                        temp:  (input)
                        2 channel-specific attributes found:
                                attr 0: scale value: 0.480076812
                                attr 1: raw value: 59
                        current:  (input)
                        1 channel-specific attributes found:
                                attr 0: input value: 817.000000000

Tested on Salvator-X M3-W board.

Thanks
   j

v1 -> v2:
- Drop wildcard (max961x) in driver, documentation and dt-bindings. Use
  max9611 instead.
- Make 3 processed channels for csa voltage, csa current and power load
- Remove wrapper functions around i2c buffer access
- Add locking in read_raw()
- Make 2 separate attributes for shunt resistor: current and power
- Renamed shunt resistor attribute
- Fixed several review comments

v2 -> v3:
- Incorporated Geert's suggestions on using a more generic name for ADC nodes
  in device tree
- Changed "maxim,shunt-resistor-uohm" to "shunt-resistor-uohm"
- Update documentation accordingly to the two previous changes


Jacopo Mondi (4):
  Documentation: dt-bindings: iio: Add max9611 ADC
  iio: Documentation: Add max9611 sysfs documentation
  iio: adc: Add Maxim max9611 ADC driver
  arm64: dts: salvator-x: Add current sense amplifiers

 .../ABI/testing/sysfs-bus-iio-adc-max9611          |  16 +
 .../devicetree/bindings/iio/adc/max9611.txt        |  26 +
 arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts |  18 +
 drivers/iio/adc/Kconfig                            |  10 +
 drivers/iio/adc/Makefile                           |   1 +
 drivers/iio/adc/max9611.c                          | 590 +++++++++++++++++++++
 6 files changed, 661 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-adc-max9611
 create mode 100644 Documentation/devicetree/bindings/iio/adc/max9611.txt
 create mode 100644 drivers/iio/adc/max9611.c

-- 
2.7.4

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2017-03-27  8:54 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-24 15:28 [PATCH v3 0/4] iio: adc: Maxim max9611 driver Jacopo Mondi
2017-03-24 15:28 ` Jacopo Mondi
     [not found] ` <1490369323-13866-1-git-send-email-jacopo+renesas-AW8dsiIh9cEdnm+yROfE0A@public.gmane.org>
2017-03-24 15:28   ` [PATCH v3 1/4] Documentation: dt-bindings: iio: Add max9611 ADC Jacopo Mondi
2017-03-24 15:28     ` Jacopo Mondi
     [not found]     ` <1490369323-13866-2-git-send-email-jacopo+renesas-AW8dsiIh9cEdnm+yROfE0A@public.gmane.org>
2017-03-25 15:27       ` Jonathan Cameron
2017-03-25 15:27         ` Jonathan Cameron
2017-03-24 15:28   ` [PATCH v3 2/4] iio: Documentation: Add max9611 sysfs documentation Jacopo Mondi
2017-03-24 15:28     ` Jacopo Mondi
     [not found]     ` <1490369323-13866-3-git-send-email-jacopo+renesas-AW8dsiIh9cEdnm+yROfE0A@public.gmane.org>
2017-03-25 16:32       ` Jonathan Cameron
2017-03-25 16:32         ` Jonathan Cameron
2017-03-26  8:38       ` Geert Uytterhoeven
2017-03-26  8:38         ` Geert Uytterhoeven
2017-03-24 15:28   ` [PATCH v3 3/4] iio: adc: Add Maxim max9611 ADC driver Jacopo Mondi
2017-03-24 15:28     ` Jacopo Mondi
     [not found]     ` <1490369323-13866-4-git-send-email-jacopo+renesas-AW8dsiIh9cEdnm+yROfE0A@public.gmane.org>
2017-03-25 15:45       ` Jonathan Cameron
2017-03-25 15:45         ` Jonathan Cameron
2017-03-25 16:13         ` Peter Meerwald-Stadler
2017-03-25 16:34           ` Jonathan Cameron
2017-03-26 10:08           ` jacopo
2017-03-26 10:24             ` Jonathan Cameron
2017-03-26 10:50               ` jacopo
2017-03-27  8:30           ` jacopo
     [not found]         ` <a911f5d1-e019-772f-0889-849cf42e6827-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-03-25 17:21           ` jacopo
2017-03-25 17:21             ` jacopo
2017-03-25 17:37             ` Jonathan Cameron
2017-03-25 17:37               ` Jonathan Cameron
     [not found]               ` <834f03d3-36d2-9b86-6b1e-04a23d440e10-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-03-26 10:02                 ` jacopo
2017-03-26 10:02                   ` jacopo
2017-03-26 10:23                   ` Jonathan Cameron
2017-03-26 10:23                     ` Jonathan Cameron
2017-03-24 15:28   ` [PATCH v3 4/4] arm64: dts: salvator-x: Add current sense amplifiers Jacopo Mondi
2017-03-24 15:28     ` Jacopo Mondi
     [not found]     ` <1490369323-13866-5-git-send-email-jacopo+renesas-AW8dsiIh9cEdnm+yROfE0A@public.gmane.org>
2017-03-26  8:49       ` Geert Uytterhoeven
2017-03-26  8:49         ` Geert Uytterhoeven
2017-03-27  8:53   ` [PATCH v3 0/4] iio: adc: Maxim max9611 driver Geert Uytterhoeven
2017-03-27  8:53     ` Geert Uytterhoeven
2017-03-26  9:07 ` Geert Uytterhoeven
2017-03-26  9:18   ` Jonathan Cameron
2017-03-26  9:18     ` Jonathan Cameron

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.