|
|
@@ -876,10 +876,14 @@ static unsigned int ssp_get_clk_div(struct driver_data *drv_data, int rate)
|
|
|
|
|
|
rate = min_t(int, ssp_clk, rate);
|
|
|
|
|
|
+ /*
|
|
|
+ * Calculate the divisor for the SCR (Serial Clock Rate), avoiding
|
|
|
+ * that the SSP transmission rate can be greater than the device rate
|
|
|
+ */
|
|
|
if (ssp->type == PXA25x_SSP || ssp->type == CE4100_SSP)
|
|
|
- return (ssp_clk / (2 * rate) - 1) & 0xff;
|
|
|
+ return (DIV_ROUND_UP(ssp_clk, 2 * rate) - 1) & 0xff;
|
|
|
else
|
|
|
- return (ssp_clk / rate - 1) & 0xfff;
|
|
|
+ return (DIV_ROUND_UP(ssp_clk, rate) - 1) & 0xfff;
|
|
|
}
|
|
|
|
|
|
static unsigned int pxa2xx_ssp_get_clk_div(struct driver_data *drv_data,
|