diff mbox

[v2,5/6] arm: dts: imx7-colibri: Use pwm polarity control

Message ID 20161001101235.24598-6-bhuvanchandra.dv@toradex.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bhuvanchandra DV Oct. 1, 2016, 10:12 a.m. UTC
Configure PWM polarity control.

Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
---
 arch/arm/boot/dts/imx7-colibri.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lukasz Majewski Oct. 6, 2016, 6:40 a.m. UTC | #1
On Sat, 1 Oct 2016 15:42:34 +0530
Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> wrote:

> Configure PWM polarity control.
> 
> Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
> ---
>  arch/arm/boot/dts/imx7-colibri.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi
> b/arch/arm/boot/dts/imx7-colibri.dtsi index a9cc657..2af5e3e 100644
> --- a/arch/arm/boot/dts/imx7-colibri.dtsi
> +++ b/arch/arm/boot/dts/imx7-colibri.dtsi
> @@ -43,7 +43,7 @@
>  / {
>  	bl: backlight {
>  		compatible = "pwm-backlight";
> -		pwms = <&pwm1 0 5000000>;
> +		pwms = <&pwm1 0 5000000 0>;

My recommendation would be to add:
#include <dt-bindings/pwm/pwm.h>

and then define pwms as:

pwms = <&pwm1 0 5000000 PWM_POLARITY_NORMAL>;

It would be more readable

Best regards,
Łukasz Majewski

>  	};
>  
>  	reg_module_3v3: regulator-module-3v3 {
Bhuvanchandra DV Oct. 7, 2016, 4:49 a.m. UTC | #2
On 10/06/16 12:10, Lukasz Majewski wrote:

> On Sat, 1 Oct 2016 15:42:34 +0530
> Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> wrote:
>
>> Configure PWM polarity control.
>>
>> Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
>> ---
>>   arch/arm/boot/dts/imx7-colibri.dtsi | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi
>> b/arch/arm/boot/dts/imx7-colibri.dtsi index a9cc657..2af5e3e 100644
>> --- a/arch/arm/boot/dts/imx7-colibri.dtsi
>> +++ b/arch/arm/boot/dts/imx7-colibri.dtsi
>> @@ -43,7 +43,7 @@
>>   / {
>>   	bl: backlight {
>>   		compatible = "pwm-backlight";
>> -		pwms = <&pwm1 0 5000000>;
>> +		pwms = <&pwm1 0 5000000 0>;
> My recommendation would be to add:
> #include <dt-bindings/pwm/pwm.h>
>
> and then define pwms as:
>
> pwms = <&pwm1 0 5000000 PWM_POLARITY_NORMAL>;
>
> It would be more readable

Ok, will add that.

--
Bhuvan

>
> Best regards,
> Łukasz Majewski
>
>>   	};
>>   
>>   	reg_module_3v3: regulator-module-3v3 {
Bhuvanchandra DV Oct. 7, 2016, 6:08 a.m. UTC | #3
On 10/06/16 12:10, Lukasz Majewski wrote:

> On Sat, 1 Oct 2016 15:42:34 +0530
> Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> wrote:
>
>> Configure PWM polarity control.
>>
>> Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
>> ---
>>   arch/arm/boot/dts/imx7-colibri.dtsi | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi
>> b/arch/arm/boot/dts/imx7-colibri.dtsi index a9cc657..2af5e3e 100644
>> --- a/arch/arm/boot/dts/imx7-colibri.dtsi
>> +++ b/arch/arm/boot/dts/imx7-colibri.dtsi
>> @@ -43,7 +43,7 @@
>>   / {
>>   	bl: backlight {
>>   		compatible = "pwm-backlight";
>> -		pwms = <&pwm1 0 5000000>;
>> +		pwms = <&pwm1 0 5000000 0>;
> My recommendation would be to add:
> #include <dt-bindings/pwm/pwm.h>
>
> and then define pwms as:
>
> pwms = <&pwm1 0 5000000 PWM_POLARITY_NORMAL>;

Addendum:
There is no "PWM_POLARITY_NORMAL" defined in "#include <dt-bindings/pwm/pwm.h>"
I guess it is helpful when polarity inversion is enabled.

--
Bhuvan

>
> It would be more readable
>
> Best regards,
> Łukasz Majewski
>
>>   	};
>>   
>>   	reg_module_3v3: regulator-module-3v3 {
Lukasz Majewski Oct. 7, 2016, 6:41 a.m. UTC | #4
On Fri, 7 Oct 2016 11:38:52 +0530
Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> wrote:

> On 10/06/16 12:10, Lukasz Majewski wrote:
> 
> > On Sat, 1 Oct 2016 15:42:34 +0530
> > Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> wrote:
> >
> >> Configure PWM polarity control.
> >>
> >> Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
> >> ---
> >>   arch/arm/boot/dts/imx7-colibri.dtsi | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi
> >> b/arch/arm/boot/dts/imx7-colibri.dtsi index a9cc657..2af5e3e 100644
> >> --- a/arch/arm/boot/dts/imx7-colibri.dtsi
> >> +++ b/arch/arm/boot/dts/imx7-colibri.dtsi
> >> @@ -43,7 +43,7 @@
> >>   / {
> >>   	bl: backlight {
> >>   		compatible = "pwm-backlight";
> >> -		pwms = <&pwm1 0 5000000>;
> >> +		pwms = <&pwm1 0 5000000 0>;
> > My recommendation would be to add:
> > #include <dt-bindings/pwm/pwm.h>
> >
> > and then define pwms as:
> >
> > pwms = <&pwm1 0 5000000 PWM_POLARITY_NORMAL>;
> 
> Addendum:
> There is no "PWM_POLARITY_NORMAL" defined in "#include
> <dt-bindings/pwm/pwm.h>" I guess it is helpful when polarity
> inversion is enabled.

Yes, you are right :-), the normal polarity is assumed to be the
default.

There is only defined flag for inversion.

Sorry for the noise.

Best regards,
Łukasz Majewski

> 
> --
> Bhuvan
> 
> >
> > It would be more readable
> >
> > Best regards,
> > Łukasz Majewski
> >
> >>   	};
> >>   
> >>   	reg_module_3v3: regulator-module-3v3 {
>
diff mbox

Patch

diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi b/arch/arm/boot/dts/imx7-colibri.dtsi
index a9cc657..2af5e3e 100644
--- a/arch/arm/boot/dts/imx7-colibri.dtsi
+++ b/arch/arm/boot/dts/imx7-colibri.dtsi
@@ -43,7 +43,7 @@ 
 / {
 	bl: backlight {
 		compatible = "pwm-backlight";
-		pwms = <&pwm1 0 5000000>;
+		pwms = <&pwm1 0 5000000 0>;
 	};
 
 	reg_module_3v3: regulator-module-3v3 {