Lines Matching refs:channel
30 #define RCAR_PWM_CR(channel) \ argument
31 ((uint32_t)((channel * RCAR_PWM_REG_SHIFT)) + 0x00) /* PWM Control Register */
32 #define RCAR_PWM_CNT(channel) \ argument
33 ((uint32_t)((channel * RCAR_PWM_REG_SHIFT)) + 0x04) /* PWM Count Register */
89 static int pwm_rcar_update_clk(const struct pwm_rcar_cfg *config, uint32_t channel, in pwm_rcar_update_clk() argument
94 power = pwm_rcar_read(config, RCAR_PWM_CR(channel)) & RCAR_PWM_DIVISER_MASK; in pwm_rcar_update_clk()
127 reg_val = pwm_rcar_read(config, RCAR_PWM_CR(channel)); in pwm_rcar_update_clk()
130 pwm_rcar_write(config, RCAR_PWM_CR(channel), reg_val); in pwm_rcar_update_clk()
135 static int pwm_rcar_set_cycles(const struct device *dev, uint32_t channel, uint32_t period_cycles, in pwm_rcar_set_cycles() argument
142 if (channel > RCAR_PWM_MAX_CHANNEL) { in pwm_rcar_set_cycles()
161 pwm_rcar_write_bit(config, RCAR_PWM_CR(channel), RCAR_PWM_CR_EN, false); in pwm_rcar_set_cycles()
164 pwm_rcar_write_bit(config, RCAR_PWM_CR(channel), RCAR_PWM_CR_SS, false); in pwm_rcar_set_cycles()
167 pwm_rcar_write_bit(config, RCAR_PWM_CR(channel), RCAR_PWM_CR_SYNC, true); in pwm_rcar_set_cycles()
176 ret = pwm_rcar_update_clk(config, channel, &period_cycles, &pulse_cycles); in pwm_rcar_set_cycles()
183 reg_val = pwm_rcar_read(config, RCAR_PWM_CNT(channel)); in pwm_rcar_set_cycles()
186 pwm_rcar_write(config, RCAR_PWM_CNT(channel), reg_val); in pwm_rcar_set_cycles()
189 reg_val = pwm_rcar_read(config, RCAR_PWM_CNT(channel)); in pwm_rcar_set_cycles()
192 pwm_rcar_write(config, RCAR_PWM_CNT(channel), reg_val); in pwm_rcar_set_cycles()
195 pwm_rcar_write_bit(config, RCAR_PWM_CR(channel), RCAR_PWM_CR_EN, true); in pwm_rcar_set_cycles()
200 static int pwm_rcar_get_cycles_per_sec(const struct device *dev, uint32_t channel, uint64_t *cycles) in pwm_rcar_get_cycles_per_sec() argument
206 if (channel > RCAR_PWM_MAX_CHANNEL) { in pwm_rcar_get_cycles_per_sec()
210 diviser = pwm_rcar_read(config, RCAR_PWM_CR(channel)) & RCAR_PWM_DIVISER_MASK; in pwm_rcar_get_cycles_per_sec()