clk: at91: clk-generated: pass the id of changeable parent at registration
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Wed, 22 Jul 2020 07:38:18 +0000 (10:38 +0300)
committerStephen Boyd <sboyd@kernel.org>
Fri, 24 Jul 2020 09:19:08 +0000 (02:19 -0700)
commit64c9247b9e87e96e41cea545eb64727cee10c55c
treed2f3209147859cb29277faeac92bccd39824406e
parent42324d953b38e74cf5cb05a02c81d4922a2ddcd5
clk: at91: clk-generated: pass the id of changeable parent at registration

Pass the ID of changeable parent at registration. This will allow
the scalability of this clock driver with regards to the changeable
parent ID for versions of this IP where changeable parent is not the
last one in the parents list (e.g. SAMA7G5). With this the clock flags
are set to zero in case we have no changeable parent. Also in
clk_generated_best_diff() the *best_diff variable is check against
tmp_diff variable using ">=" operator instead of ">" so that in case
the requested frequency could be obtained using fix parents + gck
dividers but the clock also supports changeable parent to be able
to force the usage of the changeable parent.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/1595403506-8209-11-git-send-email-claudiu.beznea@microchip.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/at91/clk-generated.c
drivers/clk/at91/dt-compat.c
drivers/clk/at91/pmc.h
drivers/clk/at91/sam9x60.c
drivers/clk/at91/sama5d2.c