brcm63xx: add preliminary support for 3.13
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.13 / 002-MIPS-BCM63XX-expose-the-HSSPI-clock.patch
1 From f0df10fb498c21bbb201bc81dd209ea646b5a311 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Sat, 12 Nov 2011 12:19:09 +0100
4 Subject: [PATCH 1/5] MIPS: BCM63XX: expose the HSSPI clock
5
6 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
7 ---
8 arch/mips/bcm63xx/clk.c | 24 ++++++++++++++++++++++++
9 1 file changed, 24 insertions(+)
10
11 --- a/arch/mips/bcm63xx/clk.c
12 +++ b/arch/mips/bcm63xx/clk.c
13 @@ -226,6 +226,28 @@ static struct clk clk_spi = {
14 };
15
16 /*
17 + * HSSPI clock
18 + */
19 +static void hsspi_set(struct clk *clk, int enable)
20 +{
21 + u32 mask;
22 +
23 + if (BCMCPU_IS_6328())
24 + mask = CKCTL_6328_HSSPI_EN;
25 + else if (BCMCPU_IS_6362())
26 + mask = CKCTL_6362_HSSPI_EN;
27 + else
28 + return;
29 +
30 + bcm_hwclock_set(mask, enable);
31 +}
32 +
33 +static struct clk clk_hsspi = {
34 + .set = hsspi_set,
35 +};
36 +
37 +
38 +/*
39 * XTM clock
40 */
41 static void xtm_set(struct clk *clk, int enable)
42 @@ -346,6 +368,8 @@ struct clk *clk_get(struct device *dev,
43 return &clk_usbd;
44 if (!strcmp(id, "spi"))
45 return &clk_spi;
46 + if (!strcmp(id, "hsspi"))
47 + return &clk_hsspi;
48 if (!strcmp(id, "xtm"))
49 return &clk_xtm;
50 if (!strcmp(id, "periph"))