brcm2708: update linux 4.4 patches to latest version
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0254-clk-bcm2835-Add-PWM-clock-support.patch
1 From c1f2dd85b1d53093fdf7af80ece7517ffed00f3a Mon Sep 17 00:00:00 2001
2 From: Remi Pommarel <repk@triplefau.lt>
3 Date: Sun, 6 Dec 2015 17:22:48 +0100
4 Subject: [PATCH 254/381] clk: bcm2835: Add PWM clock support
5
6 Register the pwm clock for bcm2835.
7
8 Signed-off-by: Remi Pommarel <repk@triplefau.lt>
9 Reviewed-by: Eric Anholt <eric@anholt.net>
10 Signed-off-by: Michael Turquette <mturquette@baylibre.com>
11 (cherry picked from commit cfbab8fbab9c330aca963095a439c451ac97c0dd)
12 ---
13 drivers/clk/bcm/clk-bcm2835.c | 13 +++++++++++++
14 include/dt-bindings/clock/bcm2835.h | 3 ++-
15 2 files changed, 15 insertions(+), 1 deletion(-)
16
17 --- a/drivers/clk/bcm/clk-bcm2835.c
18 +++ b/drivers/clk/bcm/clk-bcm2835.c
19 @@ -807,6 +807,16 @@ static const struct bcm2835_clock_data b
20 .frac_bits = 8,
21 };
22
23 +static const struct bcm2835_clock_data bcm2835_clock_pwm_data = {
24 + .name = "pwm",
25 + .num_mux_parents = ARRAY_SIZE(bcm2835_clock_per_parents),
26 + .parents = bcm2835_clock_per_parents,
27 + .ctl_reg = CM_PWMCTL,
28 + .div_reg = CM_PWMDIV,
29 + .int_bits = 12,
30 + .frac_bits = 12,
31 +};
32 +
33 struct bcm2835_pll {
34 struct clk_hw hw;
35 struct bcm2835_cprman *cprman;
36 @@ -1590,6 +1600,9 @@ static int bcm2835_clk_probe(struct plat
37 cprman->regs + CM_PERIICTL, CM_GATE_BIT,
38 0, &cprman->regs_lock);
39
40 + clks[BCM2835_CLOCK_PWM] =
41 + bcm2835_register_clock(cprman, &bcm2835_clock_pwm_data);
42 +
43 return of_clk_add_provider(dev->of_node, of_clk_src_onecell_get,
44 &cprman->onecell);
45 }
46 --- a/include/dt-bindings/clock/bcm2835.h
47 +++ b/include/dt-bindings/clock/bcm2835.h
48 @@ -43,5 +43,6 @@
49 #define BCM2835_CLOCK_TSENS 27
50 #define BCM2835_CLOCK_EMMC 28
51 #define BCM2835_CLOCK_PERI_IMAGE 29
52 +#define BCM2835_CLOCK_PWM 30
53
54 -#define BCM2835_CLOCK_COUNT 30
55 +#define BCM2835_CLOCK_COUNT 31