Commit 006cb8b6 authored by Stephen Boyd's avatar Stephen Boyd

clk: h8300: Use standard Linux I/O accessors

There doesn't seem to be any reason why we can't use the standard
readb()/writeb() accessors here because ctrl_inb() and
ctrl_outb() match the generic implementation of readb() and
writeb() that the h8300 architecture uses. This allows us to test
compile this driver on other architectures besides h8300.

Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 9298f026
...@@ -28,7 +28,7 @@ static unsigned long pll_recalc_rate(struct clk_hw *hw, ...@@ -28,7 +28,7 @@ static unsigned long pll_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) unsigned long parent_rate)
{ {
struct pll_clock *pll_clock = to_pll_clock(hw); struct pll_clock *pll_clock = to_pll_clock(hw);
int mul = 1 << (ctrl_inb((unsigned long)pll_clock->pllcr) & 3); int mul = 1 << (readb(pll_clock->pllcr) & 3);
return parent_rate * mul; return parent_rate * mul;
} }
...@@ -65,13 +65,13 @@ static int pll_set_rate(struct clk_hw *hw, unsigned long rate, ...@@ -65,13 +65,13 @@ static int pll_set_rate(struct clk_hw *hw, unsigned long rate,
pll = ((rate / parent_rate) / 2) & 0x03; pll = ((rate / parent_rate) / 2) & 0x03;
spin_lock_irqsave(&clklock, flags); spin_lock_irqsave(&clklock, flags);
val = ctrl_inb((unsigned long)pll_clock->sckcr); val = readb(pll_clock->sckcr);
val |= 0x08; val |= 0x08;
ctrl_outb(val, (unsigned long)pll_clock->sckcr); writeb(val, pll_clock->sckcr);
val = ctrl_inb((unsigned long)pll_clock->pllcr); val = readb(pll_clock->pllcr);
val &= ~0x03; val &= ~0x03;
val |= pll; val |= pll;
ctrl_outb(val, (unsigned long)pll_clock->pllcr); writeb(val, pll_clock->pllcr);
spin_unlock_irqrestore(&clklock, flags); spin_unlock_irqrestore(&clklock, flags);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment