162306a36Sopenharmony_ciNuvoton NPCM7xx PWM and Fan Tacho controller device
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciThe Nuvoton BMC NPCM7XX supports 8 Pulse-width modulation (PWM)
462306a36Sopenharmony_cicontroller outputs and 16 Fan tachometer controller inputs.
562306a36Sopenharmony_ci
662306a36Sopenharmony_ciRequired properties for pwm-fan node
762306a36Sopenharmony_ci- #address-cells : should be 1.
862306a36Sopenharmony_ci- #size-cells	: should be 0.
962306a36Sopenharmony_ci- compatible	: "nuvoton,npcm750-pwm-fan" for Poleg NPCM7XX.
1062306a36Sopenharmony_ci- reg			: specifies physical base address and size of the registers.
1162306a36Sopenharmony_ci- reg-names	: must contain:
1262306a36Sopenharmony_ci					* "pwm" for the PWM registers.
1362306a36Sopenharmony_ci					* "fan" for the Fan registers.
1462306a36Sopenharmony_ci- clocks		: phandle of reference clocks.
1562306a36Sopenharmony_ci- clock-names	: must contain
1662306a36Sopenharmony_ci					* "pwm" for PWM controller operating clock.
1762306a36Sopenharmony_ci					* "fan" for Fan controller operating clock.
1862306a36Sopenharmony_ci- interrupts	: contain the Fan interrupts with flags for falling edge.
1962306a36Sopenharmony_ci- pinctrl-names	: a pinctrl state named "default" must be defined.
2062306a36Sopenharmony_ci- pinctrl-0	: phandle referencing pin configuration of the PWM and Fan
2162306a36Sopenharmony_ci					controller ports.
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_cifan subnode format:
2462306a36Sopenharmony_ci===================
2562306a36Sopenharmony_ciUnder fan subnode can be upto 8 child nodes, each child node representing a fan.
2662306a36Sopenharmony_ciEach fan subnode must have one PWM channel and at least one Fan tach channel.
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ciFor PWM channel can be configured cooling-levels to create cooling device.
2962306a36Sopenharmony_ciCooling device could be bound to a thermal zone for the thermal control.
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ciRequired properties for each child node:
3262306a36Sopenharmony_ci- reg : specify the PWM output channel.
3362306a36Sopenharmony_ci	integer value in the range 0 through 7, that represent
3462306a36Sopenharmony_ci	the PWM channel number that used.
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci- fan-tach-ch : specify the Fan tach input channel.
3762306a36Sopenharmony_ci		integer value in the range 0 through 15, that represent
3862306a36Sopenharmony_ci		the fan tach channel number that used.
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci		At least one Fan tach input channel is required
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ciOptional property for each child node:
4362306a36Sopenharmony_ci- cooling-levels: PWM duty cycle values in a range from 0 to 255
4462306a36Sopenharmony_ci                  which correspond to thermal cooling states.
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ciExamples:
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_cipwm_fan:pwm-fan-controller@103000 {
4962306a36Sopenharmony_ci	#address-cells = <1>;
5062306a36Sopenharmony_ci	#size-cells = <0>;
5162306a36Sopenharmony_ci	compatible = "nuvoton,npcm750-pwm-fan";
5262306a36Sopenharmony_ci	reg = <0x103000 0x2000>,
5362306a36Sopenharmony_ci		<0x180000 0x8000>;
5462306a36Sopenharmony_ci	reg-names = "pwm", "fan";
5562306a36Sopenharmony_ci	clocks = <&clk NPCM7XX_CLK_APB3>,
5662306a36Sopenharmony_ci		<&clk NPCM7XX_CLK_APB4>;
5762306a36Sopenharmony_ci	clock-names = "pwm","fan";
5862306a36Sopenharmony_ci	interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
5962306a36Sopenharmony_ci			<GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
6062306a36Sopenharmony_ci			<GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
6162306a36Sopenharmony_ci			<GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
6262306a36Sopenharmony_ci			<GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
6362306a36Sopenharmony_ci			<GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
6462306a36Sopenharmony_ci			<GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
6562306a36Sopenharmony_ci			<GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
6662306a36Sopenharmony_ci	pinctrl-names = "default";
6762306a36Sopenharmony_ci	pinctrl-0 = <&pwm0_pins &pwm1_pins &pwm2_pins
6862306a36Sopenharmony_ci			&fanin0_pins &fanin1_pins &fanin2_pins
6962306a36Sopenharmony_ci			&fanin3_pins &fanin4_pins>;
7062306a36Sopenharmony_ci	fan@0 {
7162306a36Sopenharmony_ci		reg = <0x00>;
7262306a36Sopenharmony_ci		fan-tach-ch = /bits/ 8 <0x00 0x01>;
7362306a36Sopenharmony_ci		cooling-levels = <127 255>;
7462306a36Sopenharmony_ci	};
7562306a36Sopenharmony_ci	fan@1 {
7662306a36Sopenharmony_ci		reg = <0x01>;
7762306a36Sopenharmony_ci		fan-tach-ch = /bits/ 8 <0x02 0x03>;
7862306a36Sopenharmony_ci	};
7962306a36Sopenharmony_ci	fan@2 {
8062306a36Sopenharmony_ci		reg = <0x02>;
8162306a36Sopenharmony_ci		fan-tach-ch = /bits/ 8 <0x04>;
8262306a36Sopenharmony_ci	};
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci};
85