hwmon: npcm: add NPCM7xx PWM and Fan Tacho driver
Tomer Maimon
maintainercover hwmon: npcm: add NPCM7xx PWM and Fan Tacho driver
This patch set adds Pulse Width Modulation (PWM) and Fan tachometer (Fan) support for the Nuvoton NPCM7xx Baseboard Management Controller (BMC).
Nuvoton NPCM7xx support upto 16 Fan tachometer inputs and upto 8 PWM outputs.
Each PWM output module have watchdog.
Tomer Maimon (2):
dt-binding: hwmon: document NPCM7xx sensors DT bindings
hwmon: npcm: add NPCM7xx PWM and Fan driver
.../devicetree/bindings/hwmon/npcm7xx-fan.txt | 18 + .../devicetree/bindings/hwmon/npcm7xx-pwm.txt | 16 + drivers/hwmon/Kconfig | 6 + drivers/hwmon/Makefile | 1 + drivers/hwmon/npcm7xx-fan.c | 722 +++++++++++++++++++++ drivers/hwmon/npcm7xx-pwm.c | 534 +++++++++++++++ 6 files changed, 1297 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/npcm7xx-fan.txt create mode 100644 Documentation/devicetree/bindings/hwmon/npcm7xx-pwm.txt create mode 100644 drivers/hwmon/npcm7xx-fan.c create mode 100644 drivers/hwmon/npcm7xx-pwm.c
Signature · 1 line
2.14.1
Tomer Maimon
maintainerPATCH 1/2 dt-binding: hwmon: document NPCM7xx sensors DT bindings
Added device tree binding documentation for Nuvoton NPCM7xx Pulse Width Modulation (PWM) and Fan Tachometer devices.
--- .../devicetree/bindings/hwmon/npcm7xx-fan.txt | 18 ++++++++++++++++++ .../devicetree/bindings/hwmon/npcm7xx-pwm.txt | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/npcm7xx-fan.txt create mode 100644 Documentation/devicetree/bindings/hwmon/npcm7xx-pwm.txt
Documentation/devicetree/bindings/hwmon/npcm7xx-fan.txt new file +18 -0
@@ -0,0 +1,18 @@ +Nuvoton NPCM7xx fan tachometer (Fan) controller device driver + +The NPCM7xx fan tachometer controller supports upto 16 Fan inputs. + +Required properties: +- compatible : "nuvoton,npcm750-fan" for Poleg NPCM750. +- reg : Offset and length of the register set for the device. +- clocks : phandle of fan reference clock. +- interrupts : Contain the fan interrupts with flags for + falling edge. + +fan: fan@0 { + compatible = "nuvoton,npcm750-fan"; + reg = <0xf0180000 0x8000>; + interrupts = <0 96 4>, <0 97 4>, <0 98 4>, <0 99 4>, + <0 100 4>, <0 101 4>, <0 102 4>, <0 103 4>; + clocks = <&clk NPCM7XX_CLK_APB4>; +};
Documentation/devicetree/bindings/hwmon/npcm7xx-pwm.txt new file +16 -0
@@ -0,0 +1,16 @@ +Nuvoton NPCM7xx Pulse-width modulation (PWM) controller device driver + +The NPCM7xx PWM controller supports upto 8 PWM outputs. +Each PWM output module have watchdog. + +Required properties: +- compatible : "nuvoton,npcm750-pwm" for Poleg NPCM750. +- reg : Offset and length of the registers set for the device. +- clocks : phandle of pwm reference clock. + +pwm:pwm@f0103000 { + compatible = "nuvoton,npcm750-pwm"; + reg = <0xf0103000 0x1000 + 0xf0104000 0x1000>; + clocks = <&clk NPCM7XX_CLK_APB3>; +};
Signature · 1 line
2.14.1
Re: [PATCH linux dev-4.13 v1 1/2] dt-binding: hwmon: document NPCM7xx sensors DT bindings
Quoted 18 lines · Tomer Maimon
Added device tree binding documentation for Nuvoton NPCM7xx Pulse Width Modulation (PWM) and Fan Tachometer devices.
Signed-off-by Tomer Maimon <[email protected]>--- .../devicetree/bindings/hwmon/npcm7xx-fan.txt | 18 ++++++++++++++++++ .../devicetree/bindings/hwmon/npcm7xx-pwm.txt | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/npcm7xx-fan.txt create mode 100644 Documentation/devicetree/bindings/hwmon/npcm7xx-pwm.txtDocumentation/devicetree/bindings/hwmon/npcm7xx-fan.txt new file +0
-0
Documentation/devicetree/bindings/hwmon/npcm7xx-fan.txt line 3
Quoted 3 lines
Documentation/devicetree/bindings/hwmon/npcm7xx-fan.txt new file +3
-0@@ -0,0 +1,18 @@ +Nuvoton NPCM7xx fan tachometer (Fan) controller device driver + +The NPCM7xx fan tachometer controller supports upto 16 Fan inputs.
... up to ....
Quoted 40 lines
Documentation/devicetree/bindings/hwmon/npcm7xx-fan.txt new file +15
-0+ +Required properties: +- compatible : "nuvoton,npcm750-fan" for Poleg NPCM750. +- reg : Offset and length of the register set for the device. +- clocks : phandle of fan reference clock. +- interrupts : Contain the fan interrupts with flags for + falling edge. + +fan: fan@0 { + compatible = "nuvoton,npcm750-fan"; + reg = <0xf0180000 0x8000>; + interrupts = <0 96 4>, <0 97 4>, <0 98 4>, <0 99 4>, + <0 100 4>, <0 101 4>, <0 102 4>, <0 103 4>; + clocks = <&clk NPCM7XX_CLK_APB4>; +};Documentation/devicetree/bindings/hwmon/npcm7xx-pwm.txt new file +16
-1@@ -0,0 +1,16 @@ +Nuvoton NPCM7xx Pulse-width modulation (PWM) controller device driver + +The NPCM7xx PWM controller supports upto 8 PWM outputs. +Each PWM output module have watchdog. + +Required properties: +- compatible : "nuvoton,npcm750-pwm" for Poleg NPCM750. +- reg : Offset and length of the registers set for the device. +- clocks : phandle of pwm reference clock. + +pwm:pwm@f0103000 { + compatible = "nuvoton,npcm750-pwm"; + reg = <0xf0103000 0x1000 + 0xf0104000 0x1000>; + clocks = <&clk NPCM7XX_CLK_APB3>; +}; --2.14.1
Re: [PATCH linux dev-4.13 v1 1/2] dt-binding: hwmon: document NPCM7xx sensors DT bindings
In reply to Tomer MaimonQuoted 8 lines · Tomer Maimon
Added device tree binding documentation for Nuvoton NPCM7xx Pulse Width Modulation (PWM) and Fan Tachometer devices.
Signed-off-by Tomer Maimon <[email protected]>--- .../devicetree/bindings/hwmon/npcm7xx-fan.txt | 18 ++++++++++++++++++ .../devicetree/bindings/hwmon/npcm7xx-pwm.txt | 16 ++++++++++++++++
The bindings look okay to me, but I feel they probably should be split into individual patches. I suggest this based on wanting to split the drivers out, as they are more complicated and thus more susceptible to review comments. Decoupling them from eachother means they can be reviewed and submitted independently.
Andrew
Quoted 50 lines
2 files changed, 34 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/npcm7xx-fan.txt create mode 100644 Documentation/devicetree/bindings/hwmon/npcm7xx-pwm.txtDocumentation/devicetree/bindings/hwmon/npcm7xx-fan.txt new file +18
-0@@ -0,0 +1,18 @@ +Nuvoton NPCM7xx fan tachometer (Fan) controller device driver + +The NPCM7xx fan tachometer controller supports upto 16 Fan inputs. + +Required properties: +- compatible : "nuvoton,npcm750-fan" for Poleg NPCM750. +- reg : Offset and length of the register set for the device. +- clocks : phandle of fan reference clock. +- interrupts : Contain the fan interrupts with flags for + falling edge. + +fan: fan@0 { + compatible = "nuvoton,npcm750-fan"; + reg = <0xf0180000 0x8000>; + interrupts = <0 96 4>, <0 97 4>, <0 98 4>, <0 99 4>, + <0 100 4>, <0 101 4>, <0 102 4>, <0 103 4>; + clocks = <&clk NPCM7XX_CLK_APB4>; +};Documentation/devicetree/bindings/hwmon/npcm7xx-pwm.txt new file +16
-0@@ -0,0 +1,16 @@ +Nuvoton NPCM7xx Pulse-width modulation (PWM) controller device driver + +The NPCM7xx PWM controller supports upto 8 PWM outputs. +Each PWM output module have watchdog. + +Required properties: +- compatible : "nuvoton,npcm750-pwm" for Poleg NPCM750. +- reg : Offset and length of the registers set for the device. +- clocks : phandle of pwm reference clock. + +pwm:pwm@f0103000 { + compatible = "nuvoton,npcm750-pwm"; + reg = <0xf0103000 0x1000 + 0xf0104000 0x1000>; + clocks = <&clk NPCM7XX_CLK_APB3>; +};
Tomer Maimon
maintainerPATCH 2/2 hwmon: npcm: add NPCM7xx PWM and Fan driver
In reply to Tomer MaimonAdd Nuvoton BMC NPCM7xx Pulse Width Modulation (PWM) Fan tachometer (Fan) drivers
Nuvoton NPCM7xx support upto 16 Fan tachometer inputs and upto 8 PWM outputs.
Each PWM output module have watchdog.
--- drivers/hwmon/Kconfig | 6 + drivers/hwmon/Makefile | 1 + drivers/hwmon/npcm7xx-fan.c | 722 ++++++++++++++++++++++++++++++++++++++++++++ drivers/hwmon/npcm7xx-pwm.c | 534 ++++++++++++++++++++++++++++++++ 4 files changed, 1263 insertions(+) create mode 100644 drivers/hwmon/npcm7xx-fan.c create mode 100644 drivers/hwmon/npcm7xx-pwm.c
drivers/hwmon/Kconfig +6 -0
@@ -1861,6 +1861,12 @@ config SENSORS_XGENE If you say yes here you get support for the temperature and power sensors for APM X-Gene SoC. +config SENSORS_NPCM7XX + tristate "Nuvoton NPCM7XX PWM and Fan driver" + help + This driver provides support for Nuvoton NPCM7XX PWM and Fan + controllers. + if ACPI comment "ACPI drivers"
drivers/hwmon/Makefile +1 -0
@@ -169,6 +169,7 @@ obj-$(CONFIG_SENSORS_W83L786NG) += w83l786ng.o obj-$(CONFIG_SENSORS_WM831X) += wm831x-hwmon.o obj-$(CONFIG_SENSORS_WM8350) += wm8350-hwmon.o obj-$(CONFIG_SENSORS_XGENE) += xgene-hwmon.o +obj-$(CONFIG_SENSORS_NPCM7XX) += npcm7xx-pwm.o npcm7xx-fan.o obj-$(CONFIG_PMBUS) += pmbus/
drivers/hwmon/npcm7xx-fan.c new file +722 -0
722 lines not on this page · raw message
drivers/hwmon/npcm7xx-pwm.c new file +534 -0
534 lines not on this page · raw message
Signature · 1 line
2.14.1