diff options
author | Hao Wu | 2021-03-11 19:08:51 +0100 |
---|---|---|
committer | Peter Maydell | 2021-03-12 13:48:56 +0100 |
commit | 71b50b9d1ca2f5e8ae65678294ceacbd7b6520c8 (patch) | |
tree | fd819745e484ed141c58b77b2beb39d12cbde9ca /include | |
parent | hw/arm/virt: KVM: The IPA lower bound is 32 (diff) | |
download | qemu-71b50b9d1ca2f5e8ae65678294ceacbd7b6520c8.tar.gz qemu-71b50b9d1ca2f5e8ae65678294ceacbd7b6520c8.tar.xz qemu-71b50b9d1ca2f5e8ae65678294ceacbd7b6520c8.zip |
hw/misc: Add GPIOs for duty in NPCM7xx PWM
This patch adds GPIOs in NPCM7xx PWM module for its duty values.
The purpose of this is to connect it to the MFT module to provide
an input for measuring a PWM fan's RPM. Each PWM module has
NPCM7XX_PWM_PER_MODULE of GPIOs, each one corresponds to
one PWM instance and can connect to multiple fan instances in MFT.
Reviewed-by: Doug Evans <dje@google.com>
Reviewed-by: Tyrone Ting <kfting@nuvoton.com>
Signed-off-by: Hao Wu <wuhaotsh@google.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20210311180855.149764-2-wuhaotsh@google.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/misc/npcm7xx_pwm.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/hw/misc/npcm7xx_pwm.h b/include/hw/misc/npcm7xx_pwm.h index 5a689d3f66..7ad632a93a 100644 --- a/include/hw/misc/npcm7xx_pwm.h +++ b/include/hw/misc/npcm7xx_pwm.h @@ -77,6 +77,7 @@ typedef struct NPCM7xxPWM { * @iomem: Memory region through which registers are accessed. * @clock: The PWM clock. * @pwm: The PWM channels owned by this module. + * @duty_gpio_out: The duty cycle of each PWM channels as a output GPIO. * @ppr: The prescaler register. * @csr: The clock selector register. * @pcr: The control register. @@ -89,7 +90,8 @@ struct NPCM7xxPWMState { MemoryRegion iomem; Clock *clock; - NPCM7xxPWM pwm[NPCM7XX_PWM_PER_MODULE]; + NPCM7xxPWM pwm[NPCM7XX_PWM_PER_MODULE]; + qemu_irq duty_gpio_out[NPCM7XX_PWM_PER_MODULE]; uint32_t ppr; uint32_t csr; |