Message ID | 03BE10FE-D743-4CD3-8825-112D0F6B2D43@martin.sperl.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi, [fix Michael's address and add Remi] Am 21.12.2015 um 16:17 schrieb Martin Sperl: > > I started looking and found that drivers/clk/bcm/clk-bcm2835.c > does not include the PWM clock either. yes but please look at Remi's patch series first: http://lists.infradead.org/pipermail/linux-rpi-kernel/2015-December/002672.html Regards Stefan
> On 21.12.2015, at 19:08, Stefan Wahren <info@lategoodbye.de> wrote: > > Hi, > > [fix Michael's address and add Remi] > > Am 21.12.2015 um 16:17 schrieb Martin Sperl: >> >> I started looking and found that drivers/clk/bcm/clk-bcm2835.c >> does not include the PWM clock either. > > yes but please look at Remi's patch series first: > > http://lists.infradead.org/pipermail/linux-rpi-kernel/2015-December/002672.html I guess I must have seen it, but have not realized that I could apply these. It still leaves the i2s driver itself to get modified - I got something working but there are still issues... Thanks, Martin
diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi index aef64de..288d678 100644 --- a/arch/arm/boot/dts/bcm2835.dtsi +++ b/arch/arm/boot/dts/bcm2835.dtsi @@ -120,8 +120,9 @@ i2s: i2s@7e203000 { compatible = "brcm,bcm2835-i2s"; - reg = <0x7e203000 0x20>, - <0x7e101098 0x02>; + reg = <0x7e203000 0x24>; + clocks = <&clocks BCM2835_CLOCK_PWM>, + <&clocks BCM2835_CLOCK_VPU>; dmas = <&dma 2>, <&dma 3>; diff --git a/include/dt-bindings/clock/bcm2835.h b/include/dt-bindings/clock/bcm index d323efa..61f1d20 100644 --- a/include/dt-bindings/clock/bcm2835.h +++ b/include/dt-bindings/clock/bcm2835.h @@ -43,5 +43,6 @@ #define BCM2835_CLOCK_TSENS 27 #define BCM2835_CLOCK_EMMC 28 #define BCM2835_CLOCK_PERI_IMAGE 29 +#define BCM2835_CLOCK_PWM 30 -#define BCM2835_CLOCK_COUNT 30 +#define BCM2835_CLOCK_COUNT 31 And obviously more changes to the clock driver itself to support it: --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -807,6 +807,17 @@ static const struct bcm2835_clock_data bcm2835_clock_emmc_d .frac_bits = 8, }; +/* PWM/I2S clock */ +static const struct bcm2835_clock_data bcm2835_clock_pwm_data = { + .name = "pwm", + .num_mux_parents = ARRAY_SIZE(bcm2835_clock_per_parents), + .parents = bcm2835_clock_per_parents, + .ctl_reg = CM_PWMCTL, + .div_reg = CM_PWMDIV, + .int_bits = 4, + .frac_bits = 8, +}; + struct bcm2835_pll { struct clk_hw hw; struct bcm2835_cprman *cprman; @@ -1537,6 +1548,8 @@ static int bcm2835_clk_probe(struct platform_device *pdev) bcm2835_register_clock(cprman, &bcm2835_clock_hsm_data); clks[BCM2835_CLOCK_EMMC] = bcm2835_register_clock(cprman, &bcm2835_clock_emmc_data); + clks[BCM2835_CLOCK_PWM] = + bcm2835_register_clock(cprman, &bcm2835_clock_pwm_data); /* * CM_PERIICTL (and CM_PERIACTL, CM_SYSCTL and CM_VPUCTL if