Lines Matching refs:pwm

83 static void hibvt_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)  in hibvt_pwm_enable()  argument
87 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CTRL_ADDR(pwm->hwpwm), in hibvt_pwm_enable()
91 static void hibvt_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) in hibvt_pwm_disable() argument
95 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CTRL_ADDR(pwm->hwpwm), in hibvt_pwm_disable()
99 static void hibvt_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, in hibvt_pwm_config() argument
110 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CFG0_ADDR(pwm->hwpwm), in hibvt_pwm_config()
113 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CFG1_ADDR(pwm->hwpwm), in hibvt_pwm_config()
118 struct pwm_device *pwm, in hibvt_pwm_set_polarity() argument
124 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CTRL_ADDR(pwm->hwpwm), in hibvt_pwm_set_polarity()
127 hibvt_pwm_set_bits(hi_pwm_chip->base, PWM_CTRL_ADDR(pwm->hwpwm), in hibvt_pwm_set_polarity()
131 static int hibvt_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm, in hibvt_pwm_get_state() argument
141 value = readl(base + PWM_CFG0_ADDR(pwm->hwpwm)); in hibvt_pwm_get_state()
144 value = readl(base + PWM_CFG1_ADDR(pwm->hwpwm)); in hibvt_pwm_get_state()
147 value = readl(base + PWM_CTRL_ADDR(pwm->hwpwm)); in hibvt_pwm_get_state()
154 static int hibvt_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, in hibvt_pwm_apply() argument
159 if (state->polarity != pwm->state.polarity) in hibvt_pwm_apply()
160 hibvt_pwm_set_polarity(chip, pwm, state->polarity); in hibvt_pwm_apply()
162 if (state->period != pwm->state.period || in hibvt_pwm_apply()
163 state->duty_cycle != pwm->state.duty_cycle) { in hibvt_pwm_apply()
164 hibvt_pwm_config(chip, pwm, state->duty_cycle, state->period); in hibvt_pwm_apply()
171 hibvt_pwm_enable(chip, pwm); in hibvt_pwm_apply()
174 if (state->enabled != pwm->state.enabled) { in hibvt_pwm_apply()
176 hibvt_pwm_enable(chip, pwm); in hibvt_pwm_apply()
178 hibvt_pwm_disable(chip, pwm); in hibvt_pwm_apply()