All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Amlogic Meson SAR ADC support
@ 2017-01-11 17:43 ` Martin Blumenstingl
  0 siblings, 0 replies; 122+ messages in thread
From: Martin Blumenstingl @ 2017-01-11 17:43 UTC (permalink / raw)
  To: jic23-DgEjT+Ai2ygdnm+yROfE0A, knaack.h-Mmb7MZpHnFY,
	lars-Qo5EllUWu/uELgA04lAiVw, pmeerw-jW+XmwGofnusTnJN9+BGXg,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	khilman-rdvid1DuHRBWk0Htik3J/w, linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-amlogic-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-clk-u79uwXL29TY76Z2rM5mHXA
  Cc: carlo-KA+7E9HrN00dnm+yROfE0A, catalin.marinas-5wv7dgnIgG8,
	will.deacon-5wv7dgnIgG8, mturquette-rdvid1DuHRBWk0Htik3J/w,
	sboyd-sgV2jX0FEOL9JmXXK+q4OQ, narmstrong-rdvid1DuHRBWk0Htik3J/w,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Martin Blumenstingl

This series add support for the SAR ADC on Amlogic Meson GXBB, GXL and
GXM SoCs.
The hardware on GXBB provides 10-bit ADC results, while GXL and GXM are
providing 12-bit results. Support for older SoCs (Meson8b and Meson8)
can be added with little effort, most of which is testing I guess (I
don't have any pre-GXBB hardware so I can't say).

A new set of clocks had to be added to the GXBB clock controller (used
by the GXBB/GXL/GXM SoCs) which are required to get the ADC working.

The ADC itself can sample multiple channels at the same time and allows
capturing multiple samples (which can be used for filtering/averaging).
The ADC results are stored inside a FIFO register. More details on what
the driver supports (or doesn't) can be found in the description of
patch #3.

The code is based on the public S805 (Meson8b) and S905 (GXBB)
datasheets, as well as by reading (various versions of) the vendor
driver and by inspecting the registers on the vendor kernels of my
testing-hardware.

Typical use-cases for the ADC on the Meson GX SoCs are:
- adc-keys ("ADC attached resistor ladder buttons")
- SoC temperature measurement (not supported by this driver yet as
  the system firmware does this already and provides the values via the
  SCPI protocol)
- "version-strapping" (different resistor values are used to indicate
  the board-revision)
- and of course typical ADC measurements


Martin Blumenstingl (4):
  Documentation: dt-bindings: add the Amlogic Meson SAR ADC
    documentation
  clk: gxbb: add the SAR ADC clocks and expose them
  iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs
  ARM64: dts: meson: meson-gx: add the SAR ADC

 .../bindings/iio/adc/amlogic,meson-saradc.txt      |  31 +
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi          |   8 +
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi        |  10 +
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi         |  10 +
 drivers/clk/meson/gxbb.c                           |  48 ++
 drivers/clk/meson/gxbb.h                           |   9 +-
 drivers/iio/adc/Kconfig                            |  12 +
 drivers/iio/adc/Makefile                           |   1 +
 drivers/iio/adc/meson_saradc.c                     | 860 +++++++++++++++++++++
 include/dt-bindings/clock/gxbb-clkc.h              |   4 +
 10 files changed, 990 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.txt
 create mode 100644 drivers/iio/adc/meson_saradc.c

-- 
2.11.0

^ permalink raw reply	[flat|nested] 122+ messages in thread
[parent not found: <02fbde00-f325-56a6-7367-7101f7d4ee21@gmail.com>]

end of thread, other threads:[~2017-01-22 12:30 UTC | newest]

Thread overview: 122+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-11 17:43 [PATCH 0/4] Amlogic Meson SAR ADC support Martin Blumenstingl
2017-01-11 17:43 ` Martin Blumenstingl
2017-01-11 17:43 ` Martin Blumenstingl
2017-01-11 17:43 ` Martin Blumenstingl
2017-01-11 17:43 ` [PATCH 3/4] iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs Martin Blumenstingl
2017-01-11 17:43   ` Martin Blumenstingl
2017-01-11 17:43   ` Martin Blumenstingl
2017-01-14 14:46   ` Jonathan Cameron
2017-01-14 14:46     ` Jonathan Cameron
2017-01-14 14:46     ` Jonathan Cameron
     [not found]     ` <870f8899-b3a1-153a-5953-88ac23ff6942-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-01-14 17:44       ` Martin Blumenstingl
2017-01-14 17:44         ` Martin Blumenstingl
2017-01-14 17:44         ` Martin Blumenstingl
2017-01-14 17:44         ` Martin Blumenstingl
2017-01-15 13:08         ` Jonathan Cameron
2017-01-15 13:08           ` Jonathan Cameron
2017-01-15 13:08           ` Jonathan Cameron
     [not found]   ` <20170111174334.24343-4-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2017-01-15 12:26     ` Lars-Peter Clausen
2017-01-15 12:26       ` Lars-Peter Clausen
2017-01-15 12:26       ` Lars-Peter Clausen
2017-01-15 12:26       ` Lars-Peter Clausen
2017-01-15 13:09       ` Jonathan Cameron
2017-01-15 13:09         ` Jonathan Cameron
2017-01-15 13:09         ` Jonathan Cameron
2017-01-11 17:43 ` [PATCH 4/4] ARM64: dts: meson: meson-gx: add the SAR ADC Martin Blumenstingl
2017-01-11 17:43   ` Martin Blumenstingl
2017-01-11 17:43   ` Martin Blumenstingl
     [not found] ` <20170111174334.24343-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2017-01-11 17:43   ` [PATCH 1/4] Documentation: dt-bindings: add the Amlogic Meson SAR ADC documentation Martin Blumenstingl
2017-01-11 17:43     ` Martin Blumenstingl
2017-01-11 17:43     ` Martin Blumenstingl
2017-01-11 17:43     ` Martin Blumenstingl
2017-01-11 17:43   ` [PATCH 2/4] clk: gxbb: add the SAR ADC clocks and expose them Martin Blumenstingl
2017-01-11 17:43     ` Martin Blumenstingl
2017-01-11 17:43     ` Martin Blumenstingl
2017-01-11 17:43     ` Martin Blumenstingl
2017-01-15 22:42   ` [PATCH v2 0/4] Amlogic Meson SAR ADC support Martin Blumenstingl
2017-01-15 22:42     ` Martin Blumenstingl
2017-01-15 22:42     ` Martin Blumenstingl
2017-01-15 22:42     ` Martin Blumenstingl
     [not found]     ` <20170115224221.15510-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2017-01-15 22:42       ` [PATCH v2 1/4] Documentation: dt-bindings: add the Amlogic Meson SAR ADC documentation Martin Blumenstingl
2017-01-15 22:42         ` Martin Blumenstingl
2017-01-15 22:42         ` Martin Blumenstingl
2017-01-15 22:42         ` Martin Blumenstingl
2017-01-15 22:42       ` [PATCH v2 3/4] iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs Martin Blumenstingl
2017-01-15 22:42         ` Martin Blumenstingl
2017-01-15 22:42         ` Martin Blumenstingl
2017-01-15 22:42         ` Martin Blumenstingl
2017-01-16 17:41         ` Peter Meerwald-Stadler
2017-01-16 17:41           ` Peter Meerwald-Stadler
2017-01-16 10:18       ` [PATCH v2 0/4] Amlogic Meson SAR ADC support Neil Armstrong
2017-01-16 10:18         ` Neil Armstrong
2017-01-16 10:18         ` Neil Armstrong
2017-01-16 10:18         ` Neil Armstrong
2017-01-15 22:42     ` [PATCH v2 2/4] clk: gxbb: add the SAR ADC clocks and expose them Martin Blumenstingl
2017-01-15 22:42       ` Martin Blumenstingl
2017-01-15 22:42       ` Martin Blumenstingl
2017-01-15 22:42     ` [PATCH v2 4/4] ARM64: dts: meson: meson-gx: add the SAR ADC Martin Blumenstingl
2017-01-15 22:42       ` Martin Blumenstingl
2017-01-15 22:42       ` Martin Blumenstingl
2017-01-19 14:58     ` [PATCH v3 0/4] Amlogic Meson SAR ADC support Martin Blumenstingl
2017-01-19 14:58       ` Martin Blumenstingl
2017-01-19 14:58       ` Martin Blumenstingl
2017-01-19 14:58       ` [PATCH v3 1/4] Documentation: dt-bindings: add the Amlogic Meson SAR ADC documentation Martin Blumenstingl
2017-01-19 14:58         ` Martin Blumenstingl
2017-01-19 14:58         ` Martin Blumenstingl
     [not found]         ` <20170119145822.26239-2-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2017-01-21 12:39           ` Jonathan Cameron
2017-01-21 12:39             ` Jonathan Cameron
2017-01-21 12:39             ` Jonathan Cameron
2017-01-21 12:39             ` Jonathan Cameron
2017-01-21 13:21         ` Andreas Färber
2017-01-21 13:21           ` Andreas Färber
2017-01-21 13:21           ` Andreas Färber
2017-01-21 20:56         ` Rob Herring
2017-01-21 20:56           ` Rob Herring
2017-01-21 20:56           ` Rob Herring
2017-01-21 20:56           ` Rob Herring
2017-01-21 23:10           ` Martin Blumenstingl
2017-01-21 23:10             ` Martin Blumenstingl
2017-01-21 23:10             ` Martin Blumenstingl
2017-01-22 12:30             ` Jonathan Cameron
2017-01-22 12:30               ` Jonathan Cameron
2017-01-22 12:30               ` Jonathan Cameron
2017-01-19 14:58       ` [PATCH v3 2/4] clk: gxbb: add the SAR ADC clocks and expose them Martin Blumenstingl
2017-01-19 14:58         ` Martin Blumenstingl
2017-01-19 14:58         ` Martin Blumenstingl
     [not found]         ` <20170119145822.26239-3-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2017-01-19 19:13           ` Stephen Boyd
2017-01-19 19:13             ` Stephen Boyd
2017-01-19 19:13             ` Stephen Boyd
2017-01-19 19:13             ` Stephen Boyd
2017-01-20 15:46             ` Kevin Hilman
2017-01-20 15:46               ` Kevin Hilman
2017-01-20 15:46               ` Kevin Hilman
2017-01-20 15:46               ` Kevin Hilman
2017-01-19 14:58       ` [PATCH v3 3/4] iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs Martin Blumenstingl
2017-01-19 14:58         ` Martin Blumenstingl
2017-01-19 14:58         ` Martin Blumenstingl
2017-01-21 12:52         ` Jonathan Cameron
2017-01-21 12:52           ` Jonathan Cameron
2017-01-21 12:52           ` Jonathan Cameron
2017-01-21 12:52           ` Jonathan Cameron
2017-01-19 14:58       ` [PATCH v3 4/4] ARM64: dts: meson: meson-gx: add the SAR ADC Martin Blumenstingl
2017-01-19 14:58         ` Martin Blumenstingl
2017-01-19 14:58         ` Martin Blumenstingl
2017-01-21 13:28         ` Andreas Färber
2017-01-21 13:28           ` Andreas Färber
2017-01-21 13:28           ` Andreas Färber
     [not found]       ` <20170119145822.26239-1-martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
2017-01-21 12:37         ` [PATCH v3 0/4] Amlogic Meson SAR ADC support Jonathan Cameron
2017-01-21 12:37           ` Jonathan Cameron
2017-01-21 12:37           ` Jonathan Cameron
2017-01-21 12:37           ` Jonathan Cameron
     [not found] <02fbde00-f325-56a6-7367-7101f7d4ee21@gmail.com>
2017-01-13 19:35 ` [PATCH 3/4] iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs Heiner Kallweit
2017-01-13 19:35   ` Heiner Kallweit
2017-01-13 19:57   ` Martin Blumenstingl
2017-01-13 19:57     ` Martin Blumenstingl
2017-01-13 20:26     ` Heiner Kallweit
2017-01-13 20:26       ` Heiner Kallweit
2017-01-13 23:48       ` Martin Blumenstingl
2017-01-13 23:48         ` Martin Blumenstingl
2017-01-14 13:57         ` Jonathan Cameron
2017-01-14 13:57           ` Jonathan Cameron
2017-01-14 14:06           ` Jonathan Cameron
2017-01-14 14:06             ` 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.