Lines Matching refs:prescaler
55 #define SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler) (1 << (7 - (prescaler))) argument
56 #define SL28CPLD_PWM_PERIOD(prescaler) \ argument
57 (NSEC_PER_SEC / SL28CPLD_PWM_CLK * SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler))
99 int prescaler; in sl28cpld_pwm_get_state() local
105 prescaler = FIELD_GET(SL28CPLD_PWM_CTRL_PRESCALER_MASK, reg); in sl28cpld_pwm_get_state()
106 state->period = SL28CPLD_PWM_PERIOD(prescaler); in sl28cpld_pwm_get_state()
129 unsigned int cycle, prescaler; in sl28cpld_pwm_apply() local
142 prescaler = DIV_ROUND_UP_ULL(SL28CPLD_PWM_PERIOD(0), state->period); in sl28cpld_pwm_apply()
143 prescaler = order_base_2(prescaler); in sl28cpld_pwm_apply()
145 if (prescaler > field_max(SL28CPLD_PWM_CTRL_PRESCALER_MASK)) in sl28cpld_pwm_apply()
148 ctrl = FIELD_PREP(SL28CPLD_PWM_CTRL_PRESCALER_MASK, prescaler); in sl28cpld_pwm_apply()
153 cycle = min_t(unsigned int, cycle, SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler)); in sl28cpld_pwm_apply()