dd NPCM7xx ADC patch to dev-4.19
Subsystems (4)
Tomer Maimon
maintainercover dd NPCM7xx ADC patch to dev-4.19
Add NPCM7xx ADC patch to dev-4.19.
please add the NPCM7xx ADC patch set after adding
the following patch set:
https://patchwork.ozlabs.org/cover/1014101/
Tomer Maimon (4):
dt-binding: iio: add NPCM ADC documentation
iio: adc: add NPCM ADC driver
dts: npcm7xx: Modify NPCM7xx device tree
arm: configs: add NPCM7xx ADC and MMIO configuration
.../bindings/iio/adc/nuvoton,npcm-adc.txt | 35 +++ arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi | 182 +++++++---- arch/arm/boot/dts/nuvoton-npcm750-evb.dts | 157 +++++++--- arch/arm/boot/dts/nuvoton-npcm750-gpio.dtsi | 4 +- arch/arm/boot/dts/nuvoton-npcm750.dtsi | 1 + arch/arm/configs/npcm7xx_defconfig | 5 + drivers/iio/adc/Kconfig | 10 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/npcm_adc.c | 336 +++++++++++++++++++++ 9 files changed, 627 insertions(+), 104 deletions(-) create mode 100644 Documentation/devicetree/bindings/iio/adc/nuvoton,npcm-adc.txt create mode 100644 drivers/iio/adc/npcm_adc.c
Signature · 1 line
2.14.1
Tomer Maimon
maintainerPATCH 1/4 dt-binding: iio: add NPCM ADC documentation
Added device tree binding documentation for Nuvoton BMC NPCM Analog-to-Digital Converter(ADC).
--- .../bindings/iio/adc/nuvoton,npcm-adc.txt | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/nuvoton,npcm-adc.txt
Documentation/devicetree/bindings/iio/adc/nuvoton,npcm-adc.txt new file +35 -0
@@ -0,0 +1,35 @@ +Nuvoton NPCM Analog to Digital Converter (ADC) + +The NPCM ADC is a 10-bit converter for eight channel inputs. + +Required properties: +- compatible : "nuvoton,npcm750-adc" for the NPCM7XX BMC. +- reg : specifies physical base address and size of the registers. +- interrupts : Contain the ADC interrupt with flags for falling edge. + +Optional properties: +- clocks : phandle of ADC reference clock, in case the clock is not + added the ADC will use the default ADC sample rate. +- vref-supply : The regulator supply ADC reference voltage, in case the + vref-supply is not added the ADC will use internal voltage + reference. + +Required Node in the NPCM7xx BMC: +An additional register is present in the NPCM7xx SOC which is +assumed to be in the same device tree, with and marked as +compatible with "nuvoton,npcm750-rst". + +Example: + +adc: adc@f000c000 { + compatible = "nuvoton,npcm750-adc"; + reg = <0xf000c000 0x8>; + interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk NPCM7XX_CLK_ADC>; +}; + +rst: rst@f0801000 { + compatible = "nuvoton,npcm750-rst", "syscon", + "simple-mfd"; + reg = <0xf0801000 0x6C>; +};
Signature · 1 line
2.14.1
Tomer Maimon
maintainerPATCH 2/4 iio: adc: add NPCM ADC driver
In reply to Tomer MaimonAdd Nuvoton NPCM BMC Analog-to-Digital Converter(ADC) driver.
The NPCM ADC is a 10-bit converter for eight channel inputs.
--- drivers/iio/adc/Kconfig | 10 ++ drivers/iio/adc/Makefile | 1 + drivers/iio/adc/npcm_adc.c | 336 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 347 insertions(+) create mode 100644 drivers/iio/adc/npcm_adc.c
drivers/iio/adc/Kconfig +10 -0
@@ -545,6 +545,16 @@ config NAU7802 To compile this driver as a module, choose M here: the module will be called nau7802. +config NPCM_ADC + tristate "Nuvoton NPCM ADC driver" + depends on ARCH_NPCM || COMPILE_TEST + depends on HAS_IOMEM + help + Say yes here to build support for Nuvoton NPCM ADC. + + This driver can also be built as a module. If so, the module + will be called npcm_adc. + config PALMAS_GPADC tristate "TI Palmas General Purpose ADC" depends on MFD_PALMAS
drivers/iio/adc/Makefile +1 -0
@@ -52,6 +52,7 @@ obj-$(CONFIG_MEN_Z188_ADC) += men_z188_adc.o obj-$(CONFIG_MESON_SARADC) += meson_saradc.o obj-$(CONFIG_MXS_LRADC_ADC) += mxs-lradc-adc.o obj-$(CONFIG_NAU7802) += nau7802.o +obj-$(CONFIG_NPCM_ADC) += npcm_adc.o obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o obj-$(CONFIG_QCOM_SPMI_IADC) += qcom-spmi-iadc.o obj-$(CONFIG_QCOM_VADC_COMMON) += qcom-vadc-common.o
drivers/iio/adc/npcm_adc.c new file +336 -0
336 lines not on this page · raw message
Signature · 1 line
2.14.1
Tomer Maimon
maintainerPATCH 4/4 arm: configs: add NPCM7xx ADC and MMIO configuration
In reply to Tomer MaimonAdd ADC and MMIO configuration to NPCM7xx (Poleg) BMC.
--- arch/arm/configs/npcm7xx_defconfig | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/configs/npcm7xx_defconfig +5 -0
@@ -67,6 +67,8 @@ CONFIG_SENSORS_LM75=y CONFIG_SENSORS_NPCM7XX=y CONFIG_SENSORS_TMP102=y CONFIG_WATCHDOG=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_USB_HIDDEV=y CONFIG_USB=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
@@ -81,6 +83,9 @@ CONFIG_USB_MASS_STORAGE=m CONFIG_MMC=y CONFIG_MMC_SDHCI=y CONFIG_IIO=y +CONFIG_NPCM_ADC=y +CONFIG_IIO_MUX=y +CONFIG_MUX_MMIO=y CONFIG_MSDOS_FS=y CONFIG_VFAT_FS=y CONFIG_TMPFS=y
Signature · 1 line
2.14.1
Tomer Maimon
maintainerPATCH 3/4 dts: npcm7xx: Modify NPCM7xx device tree
In reply to Tomer MaimonModify NPCM7xx device tree FIU, ADC, RST, VCD and SPI nodes Add regulator and HGPIO pins nodes.
--- arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi | 182 +++++++++++++++++--------- arch/arm/boot/dts/nuvoton-npcm750-evb.dts | 157 ++++++++++++++++------ arch/arm/boot/dts/nuvoton-npcm750-gpio.dtsi | 4 +- arch/arm/boot/dts/nuvoton-npcm750.dtsi | 1 + 4 files changed, 240 insertions(+), 104 deletions(-)
arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi +117 -65
@@ -5,6 +5,7 @@ #include "skeleton.dtsi" #include <dt-bindings/interrupt-controller/arm-gic.h> #include <dt-bindings/clock/nuvoton,npcm7xx-clock.h> +#include <dt-bindings/gpio/gpio.h> / { #address-cells = <1>;
@@ -74,7 +75,7 @@ rst: rst@f0801000 { compatible = "nuvoton,npcm750-rst", "syscon", "simple-mfd"; - reg = <0x801000 0x1000>; + reg = <0x801000 0x6C>; }; scu: scu@3fe000 {
@@ -144,6 +145,7 @@ pinctrl-0 = <&r1_pins &r1err_pins &r1md_pins>; + status = "disabled"; }; ehci1:usb@f0806000 {
@@ -213,39 +215,39 @@ interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; }; - spi0: spi@fb000000 { - compatible = "nuvoton,npcm750-spi"; + fiu0: fiu@fb000000 { + compatible = "nuvoton,npcm750-fiu"; #address-cells = <1>; #size-cells = <0>; reg = <0xfb000000 0x1000>, <0x80000000 0x10000000>; reg-names = "control", "memory"; - chip-max-address-map = <0x8000000>; clocks = <&clk NPCM7XX_CLK_AHB>; clock-names = "clk_ahb"; - spi-nor@0 { - compatible = "jedec,spi-nor"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - }; + status = "disabled"; }; - spi3: spi@c0000000 { - compatible = "nuvoton,npcm750-spi"; + + fiu3: fiu@c0000000 { + compatible = "nuvoton,npcm750-fiu"; #address-cells = <1>; #size-cells = <0>; reg = <0xc0000000 0x1000>, <0xA0000000 0x20000000>; reg-names = "control", "memory"; - chip-max-address-map = <0x8000000>; clocks = <&clk NPCM7XX_CLK_AHB>; clock-names = "clk_ahb"; pinctrl-names = "default"; - pinctrl-0 = <&spi3_pins &spi3quad_pins>; - spi-nor@0 { - compatible = "jedec,spi-nor"; - #address-cells = <1>; - #size-cells = <1>; - reg = <0>; - }; + pinctrl-0 = <&spi3_pins>; + status = "disabled"; + }; + + fiux: fiu@fb001000 { + compatible = "nuvoton,npcm750-fiu"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xfb001000 0x1000>, <0xf8000000 0x2000000>; + reg-names = "control", "memory"; + clocks = <&clk NPCM7XX_CLK_AHB>; + clock-names = "clk_ahb"; + status = "disabled"; }; pci_rc: axi-pcie@e1000000 {
@@ -271,17 +273,18 @@ vcd: vcd@f0810000 { compatible = "nuvoton,npcm750-vcd"; reg = <0xf0810000 0x10000>; - phy-memory = <0x3e200000 0x600000>; - de-mode = /bits/ 8 <1>; - interrupts = <0 22 4>; + mem-addr = <0x3e200000>; + mem-size = <0x600000>; + interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; }; ece: ece@f0820000 { compatible = "nuvoton,npcm750-ece"; reg = <0xf0820000 0x2000>; - phy-memory = <0x3e800000 0x600000>; - interrupts = <0 24 4>; + mem-addr = <0x3e800000>; + mem-size = <0x600000>; + interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; status = "disabled"; };
@@ -352,13 +355,30 @@ }; }; - pspi: pspi@0 { + spi0: spi@200000 { + compatible = "nuvoton,npcm750-pspi"; + reg = <0x200000 0x1000>; + pinctrl-names = "default"; + pinctrl-0 = <&pspi1_pins>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk NPCM7XX_CLK_APB5>; + clock-names = "clk_apb5"; + status = "disabled"; + }; + + spi1: spi@201000 { compatible = "nuvoton,npcm750-pspi"; - reg = <0x200000 0x2000>; - interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x201000 0x1000>; + pinctrl-names = "default"; + pinctrl-0 = <&pspi2_pins>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clk NPCM7XX_CLK_APB5>; clock-names = "clk_apb5"; + status = "disabled"; }; timer0: timer@8000 {
@@ -438,10 +458,10 @@ adc: adc@c000 { compatible = "nuvoton,npcm750-adc"; - reg = <0xc000 0x1000>; + reg = <0xc000 0x8>; + interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clk NPCM7XX_CLK_ADC>; - clock-names = "clk_adc"; - vref = <2048>; + status = "disabled"; }; otp:otp@189000 {
@@ -453,7 +473,7 @@ clock-names = "clk_apb4"; }; - pwm_fan:pwm-fan-controller@103000 { + pwm_fan:pwm-fan-controller@103000 { #address-cells = <1>; #size-cells = <0>; compatible = "nuvoton,npcm750-pwm-fan";
@@ -487,9 +507,9 @@ status = "disabled"; }; - i2c0: i2c-bus@80000 { + i2c0: i2c@80000 { reg = <0x80000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
@@ -498,9 +518,9 @@ status = "disabled"; }; - i2c1: i2c-bus@81000 { + i2c1: i2c@81000 { reg = <0x81000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
@@ -509,9 +529,9 @@ status = "disabled"; }; - i2c2: i2c-bus@82000 { + i2c2: i2c@82000 { reg = <0x82000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>;
@@ -520,9 +540,9 @@ status = "disabled"; }; - i2c3: i2c-bus@83000 { + i2c3: i2c@83000 { reg = <0x83000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
@@ -531,9 +551,9 @@ status = "disabled"; }; - i2c4: i2c-bus@84000 { + i2c4: i2c@84000 { reg = <0x84000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
@@ -542,9 +562,9 @@ status = "disabled"; }; - i2c5: i2c-bus@85000 { + i2c5: i2c@85000 { reg = <0x85000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
@@ -553,9 +573,9 @@ status = "disabled"; }; - i2c6: i2c-bus@86000 { + i2c6: i2c@86000 { reg = <0x86000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
@@ -564,9 +584,9 @@ status = "disabled"; }; - i2c7: i2c-bus@87000 { + i2c7: i2c@87000 { reg = <0x87000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
@@ -575,9 +595,9 @@ status = "disabled"; }; - i2c8: i2c-bus@88000 { + i2c8: i2c@88000 { reg = <0x88000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
@@ -586,9 +606,9 @@ status = "disabled"; }; - i2c9: i2c-bus@89000 { + i2c9: i2c@89000 { reg = <0x89000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
@@ -597,9 +617,9 @@ status = "disabled"; }; - i2c10: i2c-bus@8a000 { + i2c10: i2c@8a000 { reg = <0x8a000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
@@ -608,9 +628,9 @@ status = "disabled"; }; - i2c11: i2c-bus@8b000 { + i2c11: i2c@8b000 { reg = <0x8b000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
@@ -619,9 +639,9 @@ status = "disabled"; }; - i2c12: i2c-bus@8c000 { + i2c12: i2c@8c000 { reg = <0x8c000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
@@ -630,9 +650,9 @@ status = "disabled"; }; - i2c13: i2c-bus@8d000 { + i2c13: i2c@8d000 { reg = <0x8d000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
@@ -641,9 +661,9 @@ status = "disabled"; }; - i2c14: i2c-bus@8e000 { + i2c14: i2c@8e000 { reg = <0x8e000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
@@ -652,9 +672,9 @@ status = "disabled"; }; - i2c15: i2c-bus@8f000 { + i2c15: i2c@8f000 { reg = <0x8f000 0x1000>; - compatible = "nuvoton,npcm750-i2c-bus"; + compatible = "nuvoton,npcm750-i2c"; clocks = <&clk NPCM7XX_CLK_APB2>; bus-frequency = <100000>; interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
@@ -1202,5 +1222,37 @@ groups = "clkreq"; function = "clkreq"; }; + hgpio0_pins: hgpio0-pins { + groups = "hgpio0"; + function = "hgpio0"; + }; + hgpio1_pins: hgpio1-pins { + groups = "hgpio1"; + function = "hgpio1"; + }; + hgpio2_pins: hgpio2-pins { + groups = "hgpio2"; + function = "hgpio2"; + }; + hgpio3_pins: hgpio3-pins { + groups = "hgpio3"; + function = "hgpio3"; + }; + hgpio4_pins: hgpio4-pins { + groups = "hgpio4"; + function = "hgpio4"; + }; + hgpio5_pins: hgpio5-pins { + groups = "hgpio5"; + function = "hgpio5"; + }; + hgpio6_pins: hgpio6-pins { + groups = "hgpio6"; + function = "hgpio6"; + }; + hgpio7_pins: hgpio7-pins { + groups = "hgpio7"; + function = "hgpio7"; + }; }; };
arch/arm/boot/dts/nuvoton-npcm750-evb.dts +120 -37
291 lines not on this page · raw message
arch/arm/boot/dts/nuvoton-npcm750-gpio.dtsi +2 -2
@@ -1107,10 +1107,10 @@ bias-disable; input-enable; }; - gpio132o_pins: gpio132o-pins { + gpio132_pins: gpio132-pins { pins = "GPIO132/SMB10SCL"; bias-disable; - output-high; + input-enable; }; gpio133_pins: gpio133-pins { pins = "GPIO133/SMB10SDA";
arch/arm/boot/dts/nuvoton-npcm750.dtsi +1 -0
@@ -73,6 +73,7 @@ pinctrl-0 = <&r2_pins &r2err_pins &r2md_pins>; + status = "disabled"; }; udc0:udc@f0830000 {
Signature · 1 line
2.14.1