diff options
author | florian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2009-03-17 11:28:54 +0000 |
---|---|---|
committer | florian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2009-03-17 11:28:54 +0000 |
commit | e41d42803fe1bcf67178500085d8be65f61749fa (patch) | |
tree | e042476eede552ddc039252cb7eebbf65d53ce63 /target/linux/brcm63xx/files/arch/mips/bcm63xx/clk.c | |
parent | 1b48ac40e8a904489b2f4151acb359d5ad7532ea (diff) |
[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 ae1f41fe5..ce93c30e8 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")) |