clk: renesas: rcar-gen3: Add support for mode pin clock selection
Make the existing support for selecting between clean and SSCG clocks using MD12 more generic, to allow using other mode pins for arbitrary clock selection. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
This commit is contained in:
@@ -539,16 +539,14 @@ struct clk * __init rcar_gen3_cpg_clk_register(struct device *dev,
|
||||
parent = clks[cpg_clk_extalr];
|
||||
break;
|
||||
|
||||
case CLK_TYPE_GEN3_PE:
|
||||
case CLK_TYPE_GEN3_MDSEL:
|
||||
/*
|
||||
* Peripheral clock with a fixed divider, selectable between
|
||||
* clean and spread spectrum parents using MD12
|
||||
* Clock selectable between two parents and two fixed dividers
|
||||
* using a mode pin
|
||||
*/
|
||||
if (cpg_mode & BIT(12)) {
|
||||
/* Clean */
|
||||
if (cpg_mode & BIT(core->offset)) {
|
||||
div = core->div & 0xffff;
|
||||
} else {
|
||||
/* SCCG */
|
||||
parent = clks[core->parent >> 16];
|
||||
if (IS_ERR(parent))
|
||||
return ERR_CAST(parent);
|
||||
|
مرجع در شماره جدید
Block a user