|
@@ -193,9 +193,18 @@ static unsigned long pwm_samsung_calc_tin(struct samsung_pwm_chip *chip,
|
|
* divider settings and choose the lowest divisor that can generate
|
|
* divider settings and choose the lowest divisor that can generate
|
|
* frequencies lower than requested.
|
|
* frequencies lower than requested.
|
|
*/
|
|
*/
|
|
- for (div = variant->div_base; div < 4; ++div)
|
|
|
|
- if ((rate >> (variant->bits + div)) < freq)
|
|
|
|
- break;
|
|
|
|
|
|
+ if (variant->bits < 32) {
|
|
|
|
+ /* Only for s3c24xx */
|
|
|
|
+ for (div = variant->div_base; div < 4; ++div)
|
|
|
|
+ if ((rate >> (variant->bits + div)) < freq)
|
|
|
|
+ break;
|
|
|
|
+ } else {
|
|
|
|
+ /*
|
|
|
|
+ * Other variants have enough counter bits to generate any
|
|
|
|
+ * requested rate, so no need to check higher divisors.
|
|
|
|
+ */
|
|
|
|
+ div = variant->div_base;
|
|
|
|
+ }
|
|
|
|
|
|
pwm_samsung_set_divisor(chip, chan, BIT(div));
|
|
pwm_samsung_set_divisor(chip, chan, BIT(div));
|
|
|
|
|