mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
MIPS: AR7: Implement clock API
This patch makes the ar7 clock code implement the Linux clk API. Drivers using the various clocks available in the SoC are updated accordingly. Signed-off-by: Florian Fainelli <[email protected]> Acked-by: Wim Van Sebroeck <[email protected]> To: [email protected] Cc: Wim Van Sebroeck <[email protected]> Cc: [email protected] Cc: David Miller <[email protected]> Patchwork: http://patchwork.linux-mips.org/patch/881/ Signed-off-by: Ralf Baechle <[email protected]>
This commit is contained in:
parent
5f3c909881
commit
780019ddf0
6 changed files with 126 additions and 56 deletions
|
|
@ -36,6 +36,7 @@
|
|||
#include <linux/phy_fixed.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/clk.h>
|
||||
#include <asm/gpio.h>
|
||||
#include <asm/atomic.h>
|
||||
|
||||
|
|
@ -294,9 +295,16 @@ static int cpmac_mdio_write(struct mii_bus *bus, int phy_id,
|
|||
|
||||
static int cpmac_mdio_reset(struct mii_bus *bus)
|
||||
{
|
||||
struct clk *cpmac_clk;
|
||||
|
||||
cpmac_clk = clk_get(&bus->dev, "cpmac");
|
||||
if (IS_ERR(cpmac_clk)) {
|
||||
printk(KERN_ERR "unable to get cpmac clock\n");
|
||||
return -1;
|
||||
}
|
||||
ar7_device_reset(AR7_RESET_BIT_MDIO);
|
||||
cpmac_write(bus->priv, CPMAC_MDIO_CONTROL, MDIOC_ENABLE |
|
||||
MDIOC_CLKDIV(ar7_cpmac_freq() / 2200000 - 1));
|
||||
MDIOC_CLKDIV(clk_get_rate(cpmac_clk) / 2200000 - 1));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue