linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]dts: add bcm2835-pwm bindings
@ 2015-01-05 15:33 Bart Tanghe
  2015-01-10 16:38 ` Stephen Warren
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Tanghe @ 2015-01-05 15:33 UTC (permalink / raw)
  To: swarren, lee, devicetree
  Cc: thierry.reding, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak, linux, linux-arm-kernel, linux-kernel,
	bart.tanghe

To probe the bcm2835-pwm driver properly, this dts bindings has to be added 
to the bcm2835 dtsi file.
In expectation of a bcm2835 clock driver, I've added fixed-clock clock binding.
To change the status of the gpio pins into pwm output pins, some additional 
bindings has to be added but this has not to be done automatically.
Is it possible to document this bindings somewhere?

Signed-off-by: Bart Tanghe <bart.tanghe@thomasmore.be>

diff --git a/arch/arm/boot/dts/bcm2835.dtsi b/arch/arm/boot/dts/bcm2835.dtsi
index 3342cb1..ba76bb4 100644
--- a/arch/arm/boot/dts/bcm2835.dtsi
+++ b/arch/arm/boot/dts/bcm2835.dtsi
@@ -146,6 +147,14 @@
 			interrupts = <1 9>;
 		};
 
+		pwm: pwm@7E20C000 {
+			compatible = "brcm,bcm2835-pwm";
+			reg = <0x7e20c000 0x28>;
+			clocks = <&clk_pwm>;
+			#pwm-cells = <2>;
+			status = "ok";
+		};
+
 		arm-pmu {
 			compatible = "arm,arm1176-pmu";
 		};
@@ -179,5 +188,13 @@
 			clock-output-names = "spi";
 			clock-frequency = <250000000>;
 		};
+
+		clk_pwm: pwm@3 {
+			compatible = "fixed-clock";
+			reg = <3>;
+			#clock-cells = <0>;
+			clock-output-names = "pwm";
+			clock-frequency = <9200000>;
+		};
 	};
 };

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH]dts: add bcm2835-pwm bindings
  2015-01-05 15:33 [PATCH]dts: add bcm2835-pwm bindings Bart Tanghe
@ 2015-01-10 16:38 ` Stephen Warren
  2015-01-13 15:40   ` Bart Tanghe
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2015-01-10 16:38 UTC (permalink / raw)
  To: Bart Tanghe, lee, devicetree
  Cc: thierry.reding, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak, linux, linux-arm-kernel, linux-kernel

On 01/05/2015 08:33 AM, Bart Tanghe wrote:
> To probe the bcm2835-pwm driver properly, this dts bindings has to be added 
> to the bcm2835 dtsi file.
> In expectation of a bcm2835 clock driver, I've added fixed-clock clock binding.
> To change the status of the gpio pins into pwm output pins, some additional 
> bindings has to be added but this has not to be done automatically.
> Is it possible to document this bindings somewhere?

The pinctrl bindings allow you to do this. They're documented in:

Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt

pinctrl setup would typically be added to the board file (i.e.
arch/arm/boot/dts/bcm2835-rpi-b.dts) rather than the SoC file. I think
on the RPi, the pins that can generate PWM aren't dedicated to PWM by
the RPi board design (they could be GPIOs and probably other functions
too) so we probably need to leave it up to individual users to add PWM
configuration to their DT, if/when they use the PWM feature.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH]dts: add bcm2835-pwm bindings
  2015-01-10 16:38 ` Stephen Warren
@ 2015-01-13 15:40   ` Bart Tanghe
  2015-01-13 16:19     ` Stephen Warren
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Tanghe @ 2015-01-13 15:40 UTC (permalink / raw)
  To: Stephen Warren, lee, devicetree
  Cc: thierry.reding, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak, linux, linux-arm-kernel, linux-kernel

On 01/10/2015 05:38 PM, Stephen Warren wrote:
> On 01/05/2015 08:33 AM, Bart Tanghe wrote:
>> To probe the bcm2835-pwm driver properly, this dts bindings has to be added 
>> to the bcm2835 dtsi file.
>> In expectation of a bcm2835 clock driver, I've added fixed-clock clock binding.
>> To change the status of the gpio pins into pwm output pins, some additional 
>> bindings has to be added but this has not to be done automatically.
>> Is it possible to document this bindings somewhere?
> 
> The pinctrl bindings allow you to do this. They're documented in:
> 
> Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
> Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
> 
> pinctrl setup would typically be added to the board file (i.e.
> arch/arm/boot/dts/bcm2835-rpi-b.dts) rather than the SoC file. I think
> on the RPi, the pins that can generate PWM aren't dedicated to PWM by
> the RPi board design (they could be GPIOs and probably other functions
> too) so we probably need to leave it up to individual users to add PWM
> configuration to their DT, if/when they use the PWM feature.
> 

Indeed, the pins aren't dedicated to pwm and can be used for other functions.
Is it usefull to add  the pwm pinctrl description to 
Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt or is this 
useless? 

Regards,

Bart

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH]dts: add bcm2835-pwm bindings
  2015-01-13 15:40   ` Bart Tanghe
@ 2015-01-13 16:19     ` Stephen Warren
  2015-01-14  8:16       ` Bart Tanghe
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2015-01-13 16:19 UTC (permalink / raw)
  To: Bart Tanghe, lee, devicetree
  Cc: thierry.reding, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak, linux, linux-arm-kernel, linux-kernel

On 01/13/2015 08:40 AM, Bart Tanghe wrote:
> On 01/10/2015 05:38 PM, Stephen Warren wrote:
>> On 01/05/2015 08:33 AM, Bart Tanghe wrote:
>>> To probe the bcm2835-pwm driver properly, this dts bindings has to be added
>>> to the bcm2835 dtsi file.
>>> In expectation of a bcm2835 clock driver, I've added fixed-clock clock binding.
>>> To change the status of the gpio pins into pwm output pins, some additional
>>> bindings has to be added but this has not to be done automatically.
>>> Is it possible to document this bindings somewhere?
>>
>> The pinctrl bindings allow you to do this. They're documented in:
>>
>> Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
>> Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
>>
>> pinctrl setup would typically be added to the board file (i.e.
>> arch/arm/boot/dts/bcm2835-rpi-b.dts) rather than the SoC file. I think
>> on the RPi, the pins that can generate PWM aren't dedicated to PWM by
>> the RPi board design (they could be GPIOs and probably other functions
>> too) so we probably need to leave it up to individual users to add PWM
>> configuration to their DT, if/when they use the PWM feature.
>>
>
> Indeed, the pins aren't dedicated to pwm and can be used for other functions.
> Is it usefull to add  the pwm pinctrl description to
> Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt or is this
> useless?

As far as I can tell, that file already describes everything required to 
configure those pins as PWM (or indeed any pins as any function). Can 
you expand on what you think is missing?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH]dts: add bcm2835-pwm bindings
  2015-01-13 16:19     ` Stephen Warren
@ 2015-01-14  8:16       ` Bart Tanghe
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Tanghe @ 2015-01-14  8:16 UTC (permalink / raw)
  To: Stephen Warren, lee, devicetree
  Cc: thierry.reding, robh+dt, pawel.moll, mark.rutland,
	ijc+devicetree, galak, linux, linux-arm-kernel, linux-kernel

On 01/13/2015 05:19 PM, Stephen Warren wrote:
> On 01/13/2015 08:40 AM, Bart Tanghe wrote:
>> On 01/10/2015 05:38 PM, Stephen Warren wrote:
>>> On 01/05/2015 08:33 AM, Bart Tanghe wrote:
>>>> To probe the bcm2835-pwm driver properly, this dts bindings has to be added
>>>> to the bcm2835 dtsi file.
>>>> In expectation of a bcm2835 clock driver, I've added fixed-clock clock binding.
>>>> To change the status of the gpio pins into pwm output pins, some additional
>>>> bindings has to be added but this has not to be done automatically.
>>>> Is it possible to document this bindings somewhere?
>>>
>>> The pinctrl bindings allow you to do this. They're documented in:
>>>
>>> Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
>>> Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
>>>
>>> pinctrl setup would typically be added to the board file (i.e.
>>> arch/arm/boot/dts/bcm2835-rpi-b.dts) rather than the SoC file. I think
>>> on the RPi, the pins that can generate PWM aren't dedicated to PWM by
>>> the RPi board design (they could be GPIOs and probably other functions
>>> too) so we probably need to leave it up to individual users to add PWM
>>> configuration to their DT, if/when they use the PWM feature.
>>>
>>
>> Indeed, the pins aren't dedicated to pwm and can be used for other functions.
>> Is it usefull to add  the pwm pinctrl description to
>> Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt or is this
>> useless?
> 
> As far as I can tell, that file already describes everything required to configure those pins as PWM (or indeed any pins as any function). Can you expand on what you think is missing?
Indeed, everything is described in the file. I thought about a specific pwm pinctrl section but it's the same for i2c and spi. This will just make the file unclear. 
No need to add documentation.

Regards,

Bart

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-01-14  8:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-05 15:33 [PATCH]dts: add bcm2835-pwm bindings Bart Tanghe
2015-01-10 16:38 ` Stephen Warren
2015-01-13 15:40   ` Bart Tanghe
2015-01-13 16:19     ` Stephen Warren
2015-01-14  8:16       ` Bart Tanghe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).