Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

clk: at91: clk-master: Add check for divide by 3

A potential divider for the master clock is div/3. The register
configuration for div/3 is MASTER_PRES_MAX. The current bit shifting
method does not work for this case. Checking for MASTER_PRES_MAX will
ensure the correct decimal value is stored in the system.

Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>

authored by

Ryan Wanner and committed by
Nicolas Ferre
e0237f56 af98caea

+3
+3
drivers/clk/at91/clk-master.c
··· 580 580 { 581 581 struct clk_master *master = to_clk_master(hw); 582 582 583 + if (master->div == MASTER_PRES_MAX) 584 + return DIV_ROUND_CLOSEST_ULL(parent_rate, 3); 585 + 583 586 return DIV_ROUND_CLOSEST_ULL(parent_rate, (1 << master->div)); 584 587 } 585 588