19 #include <linux/kernel.h>
22 #include <linux/module.h>
23 #include <linux/device.h>
29 unsigned int ssp_clk, ssp_sck;
35 for (clock_divide = 2; clock_divide <= 254; clock_divide += 2) {
37 clock_rate = (clock_rate > 0) ? clock_rate - 1 : 0;
38 if (clock_rate <= 255)
42 if (clock_divide > 254) {
44 "%s: cannot set clock to %d\n", __func__, rate);
48 ssp_sck = ssp_clk / clock_divide / (1 +
clock_rate);
52 val |=
BF_SSP(clock_divide, TIMING_CLOCK_DIVIDE);
53 val |=
BF_SSP(clock_rate, TIMING_CLOCK_RATE);
59 "%s: clock_divide %d, clock_rate %d, ssp_clk %d, rate_actual %d, rate_requested %d\n",
60 __func__, clock_divide, clock_rate, ssp_clk, ssp_sck, rate);