Skip to contentSkip to conversation

ADC: npcm: add NPCM7xx ADC iio driver

PATCH Superseded Tomer Maimon 1 participant 3 messages Jan 7, 2018

Subsystems (3)
lore
Share & tools
lore

Tomer Maimon

author maintainer
#0 lore raw

v2 cover ADC: npcm: add NPCM7xx ADC iio driver

Changes since version 1:
- Modify DT compatible name

This patch set adds Analog-to-digital converter (ADC) support for the Nuvoton NPCM7xx Baseboard Management Controller (BMC).

The NPCM7xx ADC is a 10-bit converter for eight channel inputs, the ADC module includes an eight-to-one multiplexer.

Tomer Maimon (2):
dt-binding: iio: document NPCM7xx ADC DT bindings
ADC: npcm: add NPCM7xx ADC driver

 .../devicetree/bindings/iio/adc/npcm7xx-adc.txt    |  23 ++
 drivers/iio/adc/Kconfig                            |   9 +
 drivers/iio/adc/Makefile                           |   1 +
 drivers/iio/adc/npcm7xx-adc.c                      | 352 +++++++++++++++++++++
 4 files changed, 385 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/npcm7xx-adc.txt
 create mode 100644 drivers/iio/adc/npcm7xx-adc.c
Signature · 1 line
2.14.1
author maintainer
#1 lore raw

PATCH v2 1/2 dt-binding: iio: document NPCM7xx ADC DT bindings

Added device tree binding documentation for Nuvoton NPCM7xx ADC.

---
 .../devicetree/bindings/iio/adc/npcm7xx-adc.txt    | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/npcm7xx-adc.txt
Documentation/devicetree/bindings/iio/adc/npcm7xx-adc.txt new file +23 -0
new file mode 100644
index 000000000000..c4eb433563b6
@@ -0,0 +1,23 @@
+Nuvoton NPCM7XX Analog to Digital Converter (ADC)
+
+The NPCM7XX ADC is a 10-bit converter for eight channel inputs,
+The ADC module includes an eight-to-one multiplexer.
+
+Required properties:
+- compatible      : "nuvoton,npcm750-adc" for Poleg NPCM750.
+- reg             : Offset and length of the register set for the device.
+
+Required clocking property, have to be one of:
+- clocks          : phandle of timer reference clock.
+- clock-names	  : Must contain "clk_adc", matching entry in the clocks property.
+- vref			  : ADC Reference voltage, defualt 2048.
+
+Example:
+
+adc: adc@f000c000 {
+	compatible = "nuvoton,npcm750-adc";
+	reg = <0xf000c000 0x1000>;
+	clocks = <&clk NPCM7XX_CLK_ADC>;
+	clock-names = "clk_adc";
+	vref = <2048>;
+};
Signature · 1 line
2.14.1
author maintainer
#2 lore raw

PATCH v2 2/2 ADC: npcm: add NPCM7xx ADC driver

In reply to Tomer Maimon

Add Nuvoton BMC NPCM7xx Analog-to-digital
converter (ADC) driver

The NPCM7xx ADC is a 10-bit converter for eight channel inputs, the ADC module includes an eight-to-one multiplexer.

---
 drivers/iio/adc/Kconfig       |   9 ++
 drivers/iio/adc/Makefile      |   1 +
 drivers/iio/adc/npcm7xx-adc.c | 352 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 362 insertions(+)
 create mode 100644 drivers/iio/adc/npcm7xx-adc.c
drivers/iio/adc/Kconfig +9 -0
index 614fa41559b1..77705fde21ca 100644
@@ -857,4 +857,13 @@ config XILINX_XADC
 	  The driver can also be build as a module. If so, the module will be called
 	  xilinx-xadc.
 
+config NPCM7XX_ADC
+	tristate "NPCM7XX ADC driver"
+	depends on ARCH_NPCM7XX || COMPILE_TEST
+	depends on HAS_IOMEM
+	help
+	  Say yes here to build support for NPCM7XX ADC.
+	  This driver can also be built as a module. If so, the module will be
+	  called npcm750_adc.
+
 endmenu
drivers/iio/adc/Makefile +1 -0
index b546736a5541..871074d7b0cd 100644
@@ -78,3 +78,4 @@ obj-$(CONFIG_VF610_ADC) += vf610_adc.o
 obj-$(CONFIG_VIPERBOARD_ADC) += viperboard_adc.o
 xilinx-xadc-y := xilinx-xadc-core.o xilinx-xadc-events.o
 obj-$(CONFIG_XILINX_XADC) += xilinx-xadc.o
+obj-$(CONFIG_NPCM7XX_ADC) += npcm7xx-adc.o
drivers/iio/adc/npcm7xx-adc.c new file +352 -0

352 lines not on this page · raw message

Signature · 1 line
2.14.1