sun4i_pwm         109 drivers/pwm/pwm-sun4i.c 	struct sun4i_pwm_chip *sun4i_pwm = to_sun4i_pwm_chip(chip);
sun4i_pwm         114 drivers/pwm/pwm-sun4i.c 	clk_rate = clk_get_rate(sun4i_pwm->clk);
sun4i_pwm         116 drivers/pwm/pwm-sun4i.c 	val = sun4i_pwm_readl(sun4i_pwm, PWM_CTRL_REG);
sun4i_pwm         119 drivers/pwm/pwm-sun4i.c 	    sun4i_pwm->data->has_prescaler_bypass)
sun4i_pwm         138 drivers/pwm/pwm-sun4i.c 	val = sun4i_pwm_readl(sun4i_pwm, PWM_CH_PRD(pwm->hwpwm));
sun4i_pwm         147 drivers/pwm/pwm-sun4i.c static int sun4i_pwm_calculate(struct sun4i_pwm_chip *sun4i_pwm,
sun4i_pwm         154 drivers/pwm/pwm-sun4i.c 	clk_rate = clk_get_rate(sun4i_pwm->clk);
sun4i_pwm         156 drivers/pwm/pwm-sun4i.c 	if (sun4i_pwm->data->has_prescaler_bypass) {
sun4i_pwm         201 drivers/pwm/pwm-sun4i.c 	struct sun4i_pwm_chip *sun4i_pwm = to_sun4i_pwm_chip(chip);
sun4i_pwm         211 drivers/pwm/pwm-sun4i.c 		ret = clk_prepare_enable(sun4i_pwm->clk);
sun4i_pwm         218 drivers/pwm/pwm-sun4i.c 	spin_lock(&sun4i_pwm->ctrl_lock);
sun4i_pwm         219 drivers/pwm/pwm-sun4i.c 	ctrl = sun4i_pwm_readl(sun4i_pwm, PWM_CTRL_REG);
sun4i_pwm         226 drivers/pwm/pwm-sun4i.c 		ret = sun4i_pwm_calculate(sun4i_pwm, state,
sun4i_pwm         230 drivers/pwm/pwm-sun4i.c 			spin_unlock(&sun4i_pwm->ctrl_lock);
sun4i_pwm         232 drivers/pwm/pwm-sun4i.c 				clk_disable_unprepare(sun4i_pwm->clk);
sun4i_pwm         239 drivers/pwm/pwm-sun4i.c 			sun4i_pwm_writel(sun4i_pwm, ctrl, PWM_CTRL_REG);
sun4i_pwm         246 drivers/pwm/pwm-sun4i.c 		sun4i_pwm_writel(sun4i_pwm, val, PWM_CH_PRD(pwm->hwpwm));
sun4i_pwm         247 drivers/pwm/pwm-sun4i.c 		sun4i_pwm->next_period[pwm->hwpwm] = jiffies +
sun4i_pwm         249 drivers/pwm/pwm-sun4i.c 		sun4i_pwm->needs_delay[pwm->hwpwm] = true;
sun4i_pwm         260 drivers/pwm/pwm-sun4i.c 	} else if (!sun4i_pwm->needs_delay[pwm->hwpwm]) {
sun4i_pwm         265 drivers/pwm/pwm-sun4i.c 	sun4i_pwm_writel(sun4i_pwm, ctrl, PWM_CTRL_REG);
sun4i_pwm         267 drivers/pwm/pwm-sun4i.c 	spin_unlock(&sun4i_pwm->ctrl_lock);
sun4i_pwm         272 drivers/pwm/pwm-sun4i.c 	if (!sun4i_pwm->needs_delay[pwm->hwpwm]) {
sun4i_pwm         273 drivers/pwm/pwm-sun4i.c 		clk_disable_unprepare(sun4i_pwm->clk);
sun4i_pwm         279 drivers/pwm/pwm-sun4i.c 	if (sun4i_pwm->needs_delay[pwm->hwpwm] &&
sun4i_pwm         280 drivers/pwm/pwm-sun4i.c 	    time_before(now, sun4i_pwm->next_period[pwm->hwpwm])) {
sun4i_pwm         281 drivers/pwm/pwm-sun4i.c 		delay_us = jiffies_to_usecs(sun4i_pwm->next_period[pwm->hwpwm] -
sun4i_pwm         288 drivers/pwm/pwm-sun4i.c 	sun4i_pwm->needs_delay[pwm->hwpwm] = false;
sun4i_pwm         290 drivers/pwm/pwm-sun4i.c 	spin_lock(&sun4i_pwm->ctrl_lock);
sun4i_pwm         291 drivers/pwm/pwm-sun4i.c 	ctrl = sun4i_pwm_readl(sun4i_pwm, PWM_CTRL_REG);
sun4i_pwm         294 drivers/pwm/pwm-sun4i.c 	sun4i_pwm_writel(sun4i_pwm, ctrl, PWM_CTRL_REG);
sun4i_pwm         295 drivers/pwm/pwm-sun4i.c 	spin_unlock(&sun4i_pwm->ctrl_lock);
sun4i_pwm         297 drivers/pwm/pwm-sun4i.c 	clk_disable_unprepare(sun4i_pwm->clk);