clk: composite: allow fixed rates & fixed dividers
authorMike Turquette <mturquette@linaro.org>
Thu, 11 Apr 2013 18:31:37 +0000 (11:31 -0700)
committerMike Turquette <mturquette@linaro.org>
Fri, 12 Apr 2013 18:23:24 +0000 (11:23 -0700)
commitf363e215931ecc8077b6f6ee6d39d9ffaf1c3bd0
tree737e5e9ccd32fc757d7435af3e0b0ba0b9cda7bf
parentd3a1c7be8361e2fbb6affbdb19de47ca48d6c402
clk: composite: allow fixed rates & fixed dividers

The composite clock assumes that any clock implementing the .recalc_rate
callback will also implement .round_rate and .set_rate.  This is not
always true; the basic fixed-rate clock will only implement .recalc_rate
and a fixed-divider clock may choose to implement .recalc_rate and
.round_rate but not .set_rate.

Fix this by conditionally registering .round_rate and .set_rate
callbacks based on the rate_ops passed in to clk_composite_register.

Signed-off-by: Mike Turquette <mturquette@linaro.org>
Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
Tested-by: Emilio López <emilio@elopez.com.ar>
Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
drivers/clk/clk-composite.c