All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/4] iio: adc: Maxim max9611 driver
@ 2017-04-06 14:20 ` Jacopo Mondi
  0 siblings, 0 replies; 23+ messages in thread
From: Jacopo Mondi @ 2017-04-06 14:20 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

Hi there,
   fifth round for max9611/9612 ADC iio driver.

I have changed dt-bindings to use "shunt-resistor-micro-ohms" as ina2xx does,
and changed the sysfs attributes exposing the shunt resistor value to use Ohms
as units.

Output of iio_info on Salvator-X board for max9611 chip installed on
VDD_0.8 lines.
The VDD_0.8 line powers the CPU cluster and on-board RAM.

        iio:device0: max9611
                5 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
                        power:  (input)
                        2 channel-specific attributes found:
                                attr 0: shunt_resistor value: 5.000
                                attr 1: input value: 663.404000000
                        current:  (input)
                        2 channel-specific attributes found:
                                attr 0: shunt_resistor value: 5.000
                                attr 1: input value: 817.000000000
                        temp:  (input)
                        2 channel-specific attributes found:
                                attr 0: scale value: 480.076812289
                                attr 1: raw value: 59

The collected information represent:

* voltage0 (current sense voltage) Vcsa
  voltage drop between RS+ and RS- input = 4,085 mV
* voltage1: (common input voltage) Vcim
  voltage at RS+ input = (59 - 1) * 14 = 812 mV
* current flowing on shunt resistor (Icsa)
  = Vcsa / Rshunt = 817 mA
* power load on the sensed line (Pload)
  = Vcim * Icsa = 663 m
* die temperature = (57 * 480.07) = 27360 milli Celsius

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

v3 -> v4:
- Move all locking to read_single() function
- Re-structure read_raw() with Jonathan's and Peter's comments
- Rename some defines pre-pending MAX9611 prefix
- Use values from .comaptible entries for device name
- Change temperature scale to have a value in milli Celsius
- Simplify init routine using read_single

v4 -> v5:
- Change device tree property name for shunt resistor in
  "shunt-resistor-micro-ohms"
- Display shunt resistor value with Ohms as units in sysfs

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          |  17 +
 .../devicetree/bindings/iio/adc/max9611.txt        |  27 +
 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                          | 587 +++++++++++++++++++++
 6 files changed, 660 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

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2017-05-02 19:21 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06 14:20 [PATCH v5 0/4] iio: adc: Maxim max9611 driver Jacopo Mondi
2017-04-06 14:20 ` Jacopo Mondi
     [not found] ` <1491488454-22468-1-git-send-email-jacopo+renesas-AW8dsiIh9cEdnm+yROfE0A@public.gmane.org>
2017-04-06 14:20   ` [PATCH v5 1/4] Documentation: dt-bindings: iio: Add max9611 ADC Jacopo Mondi
2017-04-06 14:20     ` Jacopo Mondi
     [not found]     ` <1491488454-22468-2-git-send-email-jacopo+renesas-AW8dsiIh9cEdnm+yROfE0A@public.gmane.org>
2017-04-06 14:43       ` Geert Uytterhoeven
2017-04-06 14:43         ` Geert Uytterhoeven
     [not found]         ` <CAMuHMdUNWJ2C9b9Xzod5HRU_ZG3mVamN6a-ZdOywODJqv6TxQw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-08 15:59           ` Jonathan Cameron
2017-04-08 15:59             ` Jonathan Cameron
     [not found]             ` <e7a53314-2e57-ae3a-af53-0d22ab445f5a-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-04-08 16:45               ` jmondi
2017-04-08 16:45                 ` jmondi
2017-04-06 14:20   ` [PATCH v5 3/4] iio: adc: Add Maxim max9611 ADC driver Jacopo Mondi
2017-04-06 14:20     ` Jacopo Mondi
2017-04-08 16:01     ` Jonathan Cameron
2017-04-06 14:20 ` [PATCH v5 2/4] iio: Documentation: Add max9611 sysfs documentation Jacopo Mondi
     [not found]   ` <1491488454-22468-3-git-send-email-jacopo+renesas-AW8dsiIh9cEdnm+yROfE0A@public.gmane.org>
2017-04-08 16:00     ` Jonathan Cameron
2017-04-08 16:00       ` Jonathan Cameron
2017-05-02 19:21   ` Geert Uytterhoeven
2017-04-06 14:20 ` [PATCH v5 4/4] arm64: dts: salvator-x: Add current sense amplifiers Jacopo Mondi
     [not found]   ` <1491488454-22468-5-git-send-email-jacopo+renesas-AW8dsiIh9cEdnm+yROfE0A@public.gmane.org>
2017-04-08 16:02     ` Jonathan Cameron
2017-04-08 16:02       ` Jonathan Cameron
2017-04-19  8:40   ` Geert Uytterhoeven
2017-04-20  9:16     ` Simon Horman
2017-05-02 18:46       ` Geert Uytterhoeven

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.