aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk-mux.c
diff options
context:
space:
mode:
authorGerhard Sittig <gsi@denx.de>2013-07-22 08:14:40 -0400
committerMike Turquette <mturquette@linaro.org>2013-08-27 20:50:38 -0400
commitaa514ce34b65e3dc01f95a0b470b39bbb7e09998 (patch)
tree6d83d3f8e7560e5cd46fafe39960cd78cdfdc815 /drivers/clk/clk-mux.c
parent29f79cb713c5173457b80602adab357403f22c48 (diff)
clk: wrap I/O access for improved portability
the common clock drivers were motivated/initiated by ARM development and apparently assume little endian peripherals wrap register/peripherals access in the common code (div, gate, mux) in preparation of adding COMMON_CLK support for other platforms Signed-off-by: Gerhard Sittig <gsi@denx.de> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk/clk-mux.c')
-rw-r--r--drivers/clk/clk-mux.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
index 0811633fcc4d..4f96ff3ba728 100644
--- a/drivers/clk/clk-mux.c
+++ b/drivers/clk/clk-mux.c
@@ -42,7 +42,7 @@ static u8 clk_mux_get_parent(struct clk_hw *hw)
42 * OTOH, pmd_trace_clk_mux_ck uses a separate bit for each clock, so 42 * OTOH, pmd_trace_clk_mux_ck uses a separate bit for each clock, so
43 * val = 0x4 really means "bit 2, index starts at bit 0" 43 * val = 0x4 really means "bit 2, index starts at bit 0"
44 */ 44 */
45 val = readl(mux->reg) >> mux->shift; 45 val = clk_readl(mux->reg) >> mux->shift;
46 val &= mux->mask; 46 val &= mux->mask;
47 47
48 if (mux->table) { 48 if (mux->table) {
@@ -89,11 +89,11 @@ static int clk_mux_set_parent(struct clk_hw *hw, u8 index)
89 if (mux->flags & CLK_MUX_HIWORD_MASK) { 89 if (mux->flags & CLK_MUX_HIWORD_MASK) {
90 val = mux->mask << (mux->shift + 16); 90 val = mux->mask << (mux->shift + 16);
91 } else { 91 } else {
92 val = readl(mux->reg); 92 val = clk_readl(mux->reg);
93 val &= ~(mux->mask << mux->shift); 93 val &= ~(mux->mask << mux->shift);
94 } 94 }
95 val |= index << mux->shift; 95 val |= index << mux->shift;
96 writel(val, mux->reg); 96 clk_writel(val, mux->reg);
97 97
98 if (mux->lock) 98 if (mux->lock)
99 spin_unlock_irqrestore(mux->lock, flags); 99 spin_unlock_irqrestore(mux->lock, flags);