1*9c6c4233STomer MaimonNuvoton NPCM PWM and Fan Tacho controller device 268dde6caSTomer Maimon 368dde6caSTomer MaimonThe Nuvoton BMC NPCM7XX supports 8 Pulse-width modulation (PWM) 468dde6caSTomer Maimoncontroller outputs and 16 Fan tachometer controller inputs. 568dde6caSTomer Maimon 6*9c6c4233STomer MaimonThe Nuvoton BMC NPCM8XX supports 12 Pulse-width modulation (PWM) 7*9c6c4233STomer Maimoncontroller outputs and 16 Fan tachometer controller inputs. 8*9c6c4233STomer Maimon 968dde6caSTomer MaimonRequired properties for pwm-fan node 1068dde6caSTomer Maimon- #address-cells : should be 1. 1168dde6caSTomer Maimon- #size-cells : should be 0. 1268dde6caSTomer Maimon- compatible : "nuvoton,npcm750-pwm-fan" for Poleg NPCM7XX. 13*9c6c4233STomer Maimon : "nuvoton,npcm845-pwm-fan" for Arbel NPCM8XX. 1468dde6caSTomer Maimon- reg : specifies physical base address and size of the registers. 1568dde6caSTomer Maimon- reg-names : must contain: 1668dde6caSTomer Maimon * "pwm" for the PWM registers. 1768dde6caSTomer Maimon * "fan" for the Fan registers. 1868dde6caSTomer Maimon- clocks : phandle of reference clocks. 1968dde6caSTomer Maimon- clock-names : must contain 2068dde6caSTomer Maimon * "pwm" for PWM controller operating clock. 2168dde6caSTomer Maimon * "fan" for Fan controller operating clock. 2268dde6caSTomer Maimon- interrupts : contain the Fan interrupts with flags for falling edge. 2368dde6caSTomer Maimon- pinctrl-names : a pinctrl state named "default" must be defined. 2468dde6caSTomer Maimon- pinctrl-0 : phandle referencing pin configuration of the PWM and Fan 2568dde6caSTomer Maimon controller ports. 2668dde6caSTomer Maimon 2768dde6caSTomer Maimonfan subnode format: 2868dde6caSTomer Maimon=================== 2968dde6caSTomer MaimonUnder fan subnode can be upto 8 child nodes, each child node representing a fan. 3068dde6caSTomer MaimonEach fan subnode must have one PWM channel and at least one Fan tach channel. 3168dde6caSTomer Maimon 3268dde6caSTomer MaimonFor PWM channel can be configured cooling-levels to create cooling device. 3368dde6caSTomer MaimonCooling device could be bound to a thermal zone for the thermal control. 3468dde6caSTomer Maimon 3568dde6caSTomer MaimonRequired properties for each child node: 3668dde6caSTomer Maimon- reg : specify the PWM output channel. 3768dde6caSTomer Maimon integer value in the range 0 through 7, that represent 3868dde6caSTomer Maimon the PWM channel number that used. 3968dde6caSTomer Maimon 4068dde6caSTomer Maimon- fan-tach-ch : specify the Fan tach input channel. 4168dde6caSTomer Maimon integer value in the range 0 through 15, that represent 4268dde6caSTomer Maimon the fan tach channel number that used. 4368dde6caSTomer Maimon 4468dde6caSTomer Maimon At least one Fan tach input channel is required 4568dde6caSTomer Maimon 4668dde6caSTomer MaimonOptional property for each child node: 4768dde6caSTomer Maimon- cooling-levels: PWM duty cycle values in a range from 0 to 255 4868dde6caSTomer Maimon which correspond to thermal cooling states. 4968dde6caSTomer Maimon 5068dde6caSTomer MaimonExamples: 5168dde6caSTomer Maimon 5268dde6caSTomer Maimonpwm_fan:pwm-fan-controller@103000 { 5368dde6caSTomer Maimon #address-cells = <1>; 5468dde6caSTomer Maimon #size-cells = <0>; 5568dde6caSTomer Maimon compatible = "nuvoton,npcm750-pwm-fan"; 5668dde6caSTomer Maimon reg = <0x103000 0x2000>, 5768dde6caSTomer Maimon <0x180000 0x8000>; 5868dde6caSTomer Maimon reg-names = "pwm", "fan"; 5968dde6caSTomer Maimon clocks = <&clk NPCM7XX_CLK_APB3>, 6068dde6caSTomer Maimon <&clk NPCM7XX_CLK_APB4>; 6168dde6caSTomer Maimon clock-names = "pwm","fan"; 6268dde6caSTomer Maimon interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>, 6368dde6caSTomer Maimon <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>, 6468dde6caSTomer Maimon <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>, 6568dde6caSTomer Maimon <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>, 6668dde6caSTomer Maimon <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>, 6768dde6caSTomer Maimon <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>, 6868dde6caSTomer Maimon <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>, 6968dde6caSTomer Maimon <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>; 7068dde6caSTomer Maimon pinctrl-names = "default"; 7168dde6caSTomer Maimon pinctrl-0 = <&pwm0_pins &pwm1_pins &pwm2_pins 7268dde6caSTomer Maimon &fanin0_pins &fanin1_pins &fanin2_pins 7368dde6caSTomer Maimon &fanin3_pins &fanin4_pins>; 7468dde6caSTomer Maimon fan@0 { 7568dde6caSTomer Maimon reg = <0x00>; 7668dde6caSTomer Maimon fan-tach-ch = /bits/ 8 <0x00 0x01>; 7768dde6caSTomer Maimon cooling-levels = <127 255>; 7868dde6caSTomer Maimon }; 7968dde6caSTomer Maimon fan@1 { 8068dde6caSTomer Maimon reg = <0x01>; 8168dde6caSTomer Maimon fan-tach-ch = /bits/ 8 <0x02 0x03>; 8268dde6caSTomer Maimon }; 8368dde6caSTomer Maimon fan@2 { 8468dde6caSTomer Maimon reg = <0x02>; 8568dde6caSTomer Maimon fan-tach-ch = /bits/ 8 <0x04>; 8668dde6caSTomer Maimon }; 8768dde6caSTomer Maimon 8868dde6caSTomer Maimon}; 89