Skip to contentSkip to conversation

hwmon: Add NPCM7xx PWM driver support

PATCH New Tomer Maimon 1 participant 3 messages May 29, 2018

Subsystems (3)
lore
Share & tools
lore

Tomer Maimon

author maintainer
#0 lore raw

cover hwmon: Add NPCM7xx PWM driver support

This patch set adds Pulse Width Modulation (PWM) support for the Nuvoton NPCM7xx Baseboard Management Controller (BMC).

The NPCM7xx PWM controller can support 8 PWM output ports.

The hwmon driver provides sysfs entries through which the user can configure and get the duty cycle between 0 (disable the specific PWM) to 255 of particular PWM output port.

The NPCM7xx PWM driver tested on NPCM750 evaluation board.

Tomer Maimon (2):
dt-binding: hwmon: Add NPCM7xx PWM documentation
hwmon: npcm-pwm: add NPCM7xx PWM driver

 .../devicetree/bindings/hwmon/npcm7xx-pwm.txt      |  25 ++
 drivers/hwmon/Kconfig                              |   6 +
 drivers/hwmon/Makefile                             |   1 +
 drivers/hwmon/npcm7xx-pwm.c                        | 363 +++++++++++++++++++++
 4 files changed, 395 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/npcm7xx-pwm.txt
 create mode 100644 drivers/hwmon/npcm7xx-pwm.c
Signature · 1 line
2.14.1
author maintainer
#1 lore raw

PATCH 1/2 dt-binding: hwmon: Add NPCM7xx PWM documentation

Added device tree binding documentation for Nuvoton BMC NPCM7xx Pulse Width Modulation (PWM) controller.

---
 .../devicetree/bindings/hwmon/npcm7xx-pwm.txt      | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/npcm7xx-pwm.txt
Documentation/devicetree/bindings/hwmon/npcm7xx-pwm.txt new file +25 -0
new file mode 100644
index 000000000000..2d8a7ccdc8cf
@@ -0,0 +1,25 @@
+Nuvoton NPCM7xx Pulse-width modulation (PWM) controller device driver
+
+The NPCM7xx has two identical PWM controller modules,
+Each module has four PWM controller outputs.
+NPCM7xx PWM controller module 0 outputs PWM0-3 and NPCM7xx PWM controller
+module 1 outputs PWM4-7.
+
+Required properties:
+- compatible	: "nuvoton,npcm750-pwm" for Poleg NPCM7XX.
+- reg		: Offset and length of the registers set for the device.
+- clocks	: phandle of pwm reference clock.
+- pinctrl-names	: a pinctrl state named "default" must be defined.
+- pinctrl-0 	: phandle referencing pin configuration of the PWM ports.
+
+pwm:pwm@f0103000 {
+	compatible = "nuvoton,npcm750-pwm";
+	reg = <0xf0103000 0x50
+		0xf0104000 0x50>;
+	clocks = <&clk NPCM7XX_CLK_APB3>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pwm0_pins &pwm1_pins
+			&pwm2_pins &pwm3_pins
+			&pwm4_pins &pwm5_pins
+			&pwm6_pins &pwm7_pins>;
+};
Signature · 1 line
2.14.1
author maintainer
#2 lore raw

PATCH 2/2 hwmon: npcm-pwm: add NPCM7xx PWM driver

In reply to Tomer Maimon

Add Nuvoton BMC NPCM7xx Pulse Width Modulation (PWM) driver.

The Nuvoton BMC NPCM7xx has two identical PWM controller modules, each module has four PWM controller outputs.

---
 drivers/hwmon/Kconfig       |   6 +
 drivers/hwmon/Makefile      |   1 +
 drivers/hwmon/npcm7xx-pwm.c | 363 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 370 insertions(+)
 create mode 100644 drivers/hwmon/npcm7xx-pwm.c
drivers/hwmon/Kconfig +6 -0
index 6ec307c93ece..693ba09cff8e 100644
@@ -1891,6 +1891,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 driver"
+	help
+	  This driver provides support for Nuvoton NPCM7XX PWM
+	  controller.
+
 if ACPI
 
 comment "ACPI drivers"
drivers/hwmon/Makefile +1 -0
index e7d52a36e6c4..24aad895a3bb 100644
@@ -174,6 +174,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
 
 obj-$(CONFIG_PMBUS)		+= pmbus/
 
drivers/hwmon/npcm7xx-pwm.c new file +363 -0

363 lines not on this page · raw message

Signature · 1 line
2.14.1