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))
100 int prescaler; in sl28cpld_pwm_get_state() local
106 prescaler = FIELD_GET(SL28CPLD_PWM_CTRL_PRESCALER_MASK, reg); in sl28cpld_pwm_get_state()
107 state->period = SL28CPLD_PWM_PERIOD(prescaler); in sl28cpld_pwm_get_state()
130 unsigned int cycle, prescaler; in sl28cpld_pwm_apply() local
143 prescaler = DIV_ROUND_UP_ULL(SL28CPLD_PWM_PERIOD(0), state->period); in sl28cpld_pwm_apply()
144 prescaler = order_base_2(prescaler); in sl28cpld_pwm_apply()
146 if (prescaler > field_max(SL28CPLD_PWM_CTRL_PRESCALER_MASK)) in sl28cpld_pwm_apply()
149 ctrl = FIELD_PREP(SL28CPLD_PWM_CTRL_PRESCALER_MASK, prescaler); in sl28cpld_pwm_apply()
154 cycle = min_t(unsigned int, cycle, SL28CPLD_PWM_MAX_DUTY_CYCLE(prescaler)); in sl28cpld_pwm_apply()