diff options
author | Florian Fainelli <florian@openwrt.org> | 2009-03-17 11:28:54 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2009-03-17 11:28:54 +0000 |
commit | 1675d3bed9cd0db97dbf777dcc3a4b57fa42e28c (patch) | |
tree | e042476eede552ddc039252cb7eebbf65d53ce63 /target/linux/brcm63xx/files/arch/mips/bcm63xx/clk.c | |
parent | 5a05e49782ac63c29fd89fce308569c52b31f2bc (diff) | |
download | master-187ad058-1675d3bed9cd0db97dbf777dcc3a4b57fa42e28c.tar.gz master-187ad058-1675d3bed9cd0db97dbf777dcc3a4b57fa42e28c.tar.bz2 master-187ad058-1675d3bed9cd0db97dbf777dcc3a4b57fa42e28c.zip |
[brcm63xx] fix SPI register switch and prepare for UDC, thanks to Henk Vergonet (#4783)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14914 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm63xx/files/arch/mips/bcm63xx/clk.c')
-rw-r--r-- | target/linux/brcm63xx/files/arch/mips/bcm63xx/clk.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/files/arch/mips/bcm63xx/clk.c b/target/linux/brcm63xx/files/arch/mips/bcm63xx/clk.c index ae1f41fe52..ce93c30e86 100644 --- a/target/linux/brcm63xx/files/arch/mips/bcm63xx/clk.c +++ b/target/linux/brcm63xx/files/arch/mips/bcm63xx/clk.c @@ -137,6 +137,26 @@ static struct clk clk_usbh = { }; /* + * USB slave clock + */ +static void usbs_set(struct clk *clk, int enable) +{ + u32 mask; + + switch(bcm63xx_get_cpu_id()) { + case BCM6338_CPU_ID: mask = CKCTL_6338_USBS_EN; break; + case BCM6348_CPU_ID: mask = CKCTL_6348_USBS_EN; break; + default: + return; + } + bcm_hwclock_set(mask, enable); +} + +static struct clk clk_usbs = { + .set = usbs_set, +}; + +/* * SPI clock */ static void spi_set(struct clk *clk, int enable) @@ -202,6 +222,8 @@ struct clk *clk_get(struct device *dev, const char *id) return &clk_ephy; if (!strcmp(id, "usbh")) return &clk_usbh; + if (!strcmp(id, "usbs")) + return &clk_usbs; if (!strcmp(id, "spi")) return &clk_spi; if (!strcmp(id, "periph")) |