diff options
author | Georgi Djakov <georgi.djakov@linaro.org> | 2015-03-20 19:30:26 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2015-03-24 02:09:19 +0300 |
commit | 293d2e97b37f545bb36aef78cd549d9e6cd66e7f (patch) | |
tree | 4b8ba1c40d681b198dd67696087cf03531f03ca0 /drivers/clk/qcom/lcc-ipq806x.c | |
parent | fae507afbdf3384227ced662c51c5b6cbff223c8 (diff) | |
download | linux-293d2e97b37f545bb36aef78cd549d9e6cd66e7f.tar.xz |
clk: qcom: Introduce parent_map tables
In the current parent mapping code, we can get duplicate or inconsistent
indexes, which leads to discrepancy between the number of elements in the
array and the number of parents. Until now, this was solved with some
reordering but this is not always possible.
This patch introduces index tables that are used to define the relations
between the PLL source and the hardware mux configuration value.
To accomplish this, here we do the following:
- Define a parent_map struct to map the relations between PLL source index
and register configuration value.
- Add a qcom_find_src_index() function for finding the index of a clock
matching the specific PLL configuration.
- Update the {set,get}_parent RCG functions use the newly introduced
parent_map struct.
- Convert all existing drivers to the new parent_map tables.
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/qcom/lcc-ipq806x.c')
-rw-r--r-- | drivers/clk/qcom/lcc-ipq806x.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/clk/qcom/lcc-ipq806x.c b/drivers/clk/qcom/lcc-ipq806x.c index 19378b080dd7..e4ac699666d5 100644 --- a/drivers/clk/qcom/lcc-ipq806x.c +++ b/drivers/clk/qcom/lcc-ipq806x.c @@ -61,12 +61,14 @@ static const struct pll_config pll4_config = { .main_output_mask = BIT(23), }; -#define P_PXO 0 -#define P_PLL4 1 +enum { + P_PXO, + P_PLL4, +}; -static const u8 lcc_pxo_pll4_map[] = { - [P_PXO] = 0, - [P_PLL4] = 2, +static const struct parent_map lcc_pxo_pll4_map[] = { + { P_PXO, 0 }, + { P_PLL4, 2 } }; static const char *lcc_pxo_pll4[] = { |