Re: [PATCH V1 2/5] backlight: qcom-wled: Add support for WLED4 peripheral

2018-05-18 Thread Rob Herring
On Thu, May 17, 2018 at 10:10 AM,   wrote:
> On 2018-05-17 18:01, Rob Herring wrote:
>>
>> On Thu, May 17, 2018 at 4:47 AM,   wrote:
>>>
>>> On 2018-05-08 15:55, kgu...@codeaurora.org wrote:


 On 2018-05-07 21:50, Bjorn Andersson wrote:
>
>
> On Thu 03 May 02:57 PDT 2018, Kiran Gunda wrote:
>
>> WLED4 peripheral is present on some PMICs like pmi8998
>> and pm660l. It has a different register map and also
>> configurations are different. Add support for it.

[...]

>> + value:
>> + For pm8941: from 0 to 25000 with 5000 ua step
>> + Default 2 uA
>> + For pmi8998: from 0 to 3 with 5000 ua step
>> +  Default 25000 uA.
>
>
>
> These values could be described just as well in mA, so keep the
> original
> unit - in particular since the boot-limit is in mA...
>
 Ok. Will keep the original as is in the next series.
>>>
>>>
>>> Here, I may have to go with the approach as in "qcom,ovp". Because for
>>> pm8941
>>> the current step is 1 mA (I have wrongly mentioned as 5000uA here) and
>>> for
>>> PMI8998
>>> the current step is 2.5 mA. Hence, I will add another variable
>>> "qcom,current-limit-ua"
>>> just like "qcom,ovp-mv".
>>
>>
>> Use unit suffixes defined in bindings/property-units.txt.
>
> Thanks for pointing it ! hope I can use "qcom,current-limit-microamp" and
> "qcom,ovp-millivolt". I am asking this because i found only "-microvolt".
> "-millivolt" is not present in the bindings you pointed.

That's by design so everyone doesn't just pick whatever random units
they like. Does microvolts not give you enough range?

Rob
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH V1 2/5] backlight: qcom-wled: Add support for WLED4 peripheral

2018-05-18 Thread kgunda

On 2018-05-17 18:01, Rob Herring wrote:

On Thu, May 17, 2018 at 4:47 AM,   wrote:

On 2018-05-08 15:55, kgu...@codeaurora.org wrote:


On 2018-05-07 21:50, Bjorn Andersson wrote:


On Thu 03 May 02:57 PDT 2018, Kiran Gunda wrote:


WLED4 peripheral is present on some PMICs like pmi8998
and pm660l. It has a different register map and also
configurations are different. Add support for it.



Several things are going on in this patch, it needs to be split to
not hide the functional changes from the structural/renames.


Ok. I will split it in the next series.


Signed-off-by: Kiran Gunda 
---
 .../bindings/leds/backlight/qcom-wled.txt  | 172 -
 drivers/video/backlight/qcom-wled.c| 749
+++--
 2 files changed, 696 insertions(+), 225 deletions(-)

diff --git
a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
index fb39e32..0ceffa1 100644
--- 
a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
+++ 
b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt

@@ -1,30 +1,129 @@
 Binding for Qualcomm Technologies, Inc. WLED driver

-Required properties:
-- compatible: should be "qcom,pm8941-wled"
-- reg: slave address
-
-Optional properties:
-- default-brightness: brightness value on boot, value from: 0-4095
-   default: 2048
-- label: The name of the backlight device
-- qcom,cs-out: bool; enable current sink output
-- qcom,cabc: bool; enable content adaptive backlight control
-- qcom,ext-gen: bool; use externally generated modulator signal to 
dim
-- qcom,current-limit: mA; per-string current limit; value from 0 
to 25

-   default: 20mA
-- qcom,current-boost-limit: mA; boost current limit; one of:
-   105, 385, 525, 805, 980, 1260, 1400, 1680
-   default: 805mA
-- qcom,switching-freq: kHz; switching frequency; one of:
-   600, 640, 685, 738, 800, 872, 960, 1066, 1200, 1371,
-   1600, 1920, 2400, 3200, 4800, 9600,
-   default: 1600kHz
-- qcom,ovp: V; Over-voltage protection limit; one of:
-   27, 29, 32, 35
-   default: 29V
-- qcom,num-strings: #; number of led strings attached; value from 
1 to

3
-   default: 2
+WLED (White Light Emitting Diode) driver is used for controlling
display
+backlight that is part of PMIC on Qualcomm Technologies, Inc. 
reference
+platforms. The PMIC is connected to the host processor via SPMI 
bus.

+
+- compatible
+   Usage:required
+   Value type:   
+   Definition:   should be "qcom,pm8941-wled" or
"qcom,pmi8998-wled".
+ or "qcom,pm660l-wled".



Better written as

should be one of:
X
Y
Z


Will do it in the next series.


+
+- reg
+   Usage:required
+   Value type:   
+   Definition:   Base address of the WLED modules.
+
+- interrupts
+   Usage:optional
+   Value type:   
+   Definition:   Interrupts associated with WLED. Interrupts 
can be

+ specified as per the encoding listed under
+ Documentation/devicetree/bindings/spmi/
+ qcom,spmi-pmic-arb.txt.



Better to describe that this should be the "short" and "ovp" 
interrupts

in this property than in the interrupt-names.


Ok. I will do it in the next series.


+
+- interrupt-names
+   Usage:optional
+   Value type:   
+   Definition:   Interrupt names associated with the 
interrupts.

+ Must be "short" and "ovp". The short circuit
detection
+ is not supported for PM8941.
+
+- label
+   Usage:required
+   Value type:   
+   Definition:   The name of the backlight device
+
+- default-brightness
+   Usage:optional
+   Value type:   
+   Definition:   brightness value on boot, value from: 0-4095
+ Default: 2048
+
+- qcom,current-limit
+   Usage:optional
+   Value type:   
+   Definition:   uA; per-string current limit



You can't change unit on an existing property, that breaks any 
existing

dts using the qcom,pm8941-wled compatible.




+ value:
+ For pm8941: from 0 to 25000 with 5000 ua step
+ Default 2 uA
+ For pmi8998: from 0 to 3 with 5000 ua 
step

+  Default 25000 uA.



These values could be described just as well in mA, so keep the 
original

unit - in particular since the boot-limit is in mA...


Ok. Will keep the original as is in the next series.


Here, I may have to go with the approach as in "qcom,ovp". Because for
pm8941
the current step is 1 mA (I have wrongly mentioned as 5000uA here) and 
for

PMI8998
the current step is 2.5 mA. Hence, I will add another variable
"qcom,current-limit-ua"
just 

Re: [PATCH V1 2/5] backlight: qcom-wled: Add support for WLED4 peripheral

2018-05-18 Thread kgunda

On 2018-05-08 15:55, kgu...@codeaurora.org wrote:

On 2018-05-07 21:50, Bjorn Andersson wrote:

On Thu 03 May 02:57 PDT 2018, Kiran Gunda wrote:


WLED4 peripheral is present on some PMICs like pmi8998
and pm660l. It has a different register map and also
configurations are different. Add support for it.



Several things are going on in this patch, it needs to be split to
not hide the functional changes from the structural/renames.


Ok. I will split it in the next series.

Signed-off-by: Kiran Gunda 
---
 .../bindings/leds/backlight/qcom-wled.txt  | 172 -
 drivers/video/backlight/qcom-wled.c| 749 
+++--

 2 files changed, 696 insertions(+), 225 deletions(-)

diff --git 
a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt 
b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt

index fb39e32..0ceffa1 100644
--- a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
+++ b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
@@ -1,30 +1,129 @@
 Binding for Qualcomm Technologies, Inc. WLED driver

-Required properties:
-- compatible: should be "qcom,pm8941-wled"
-- reg: slave address
-
-Optional properties:
-- default-brightness: brightness value on boot, value from: 0-4095
-   default: 2048
-- label: The name of the backlight device
-- qcom,cs-out: bool; enable current sink output
-- qcom,cabc: bool; enable content adaptive backlight control
-- qcom,ext-gen: bool; use externally generated modulator signal to 
dim
-- qcom,current-limit: mA; per-string current limit; value from 0 to 
25

-   default: 20mA
-- qcom,current-boost-limit: mA; boost current limit; one of:
-   105, 385, 525, 805, 980, 1260, 1400, 1680
-   default: 805mA
-- qcom,switching-freq: kHz; switching frequency; one of:
-   600, 640, 685, 738, 800, 872, 960, 1066, 1200, 1371,
-   1600, 1920, 2400, 3200, 4800, 9600,
-   default: 1600kHz
-- qcom,ovp: V; Over-voltage protection limit; one of:
-   27, 29, 32, 35
-   default: 29V
-- qcom,num-strings: #; number of led strings attached; value from 1 
to 3

-   default: 2
+WLED (White Light Emitting Diode) driver is used for controlling 
display
+backlight that is part of PMIC on Qualcomm Technologies, Inc. 
reference

+platforms. The PMIC is connected to the host processor via SPMI bus.
+
+- compatible
+   Usage:required
+   Value type:   
+   Definition:   should be "qcom,pm8941-wled" or "qcom,pmi8998-wled".
+ or "qcom,pm660l-wled".


Better written as

should be one of:
X
Y
Z


Will do it in the next series.

+
+- reg
+   Usage:required
+   Value type:   
+   Definition:   Base address of the WLED modules.
+
+- interrupts
+   Usage:optional
+   Value type:   
+   Definition:   Interrupts associated with WLED. Interrupts can be
+ specified as per the encoding listed under
+ Documentation/devicetree/bindings/spmi/
+ qcom,spmi-pmic-arb.txt.


Better to describe that this should be the "short" and "ovp" 
interrupts

in this property than in the interrupt-names.


Ok. I will do it in the next series.

+
+- interrupt-names
+   Usage:optional
+   Value type:   
+   Definition:   Interrupt names associated with the interrupts.
+ Must be "short" and "ovp". The short circuit detection
+ is not supported for PM8941.
+
+- label
+   Usage:required
+   Value type:   
+   Definition:   The name of the backlight device
+
+- default-brightness
+   Usage:optional
+   Value type:   
+   Definition:   brightness value on boot, value from: 0-4095
+ Default: 2048
+
+- qcom,current-limit
+   Usage:optional
+   Value type:   
+   Definition:   uA; per-string current limit


You can't change unit on an existing property, that breaks any 
existing

dts using the qcom,pm8941-wled compatible.




+ value:
+ For pm8941: from 0 to 25000 with 5000 ua step
+ Default 2 uA
+ For pmi8998: from 0 to 3 with 5000 ua step
+  Default 25000 uA.


These values could be described just as well in mA, so keep the 
original

unit - in particular since the boot-limit is in mA...


Ok. Will keep the original as is in the next series.
Here, I may have to go with the approach as in "qcom,ovp". Because for 
pm8941
the current step is 1 mA (I have wrongly mentioned as 5000uA here) and 
for PMI8998
the current step is 2.5 mA. Hence, I will add another variable 
"qcom,current-limit-ua"

just like "qcom,ovp-mv".

+
+- qcom,current-boost-limit
+   Usage:optional
+   Value type:   
+   

Re: [PATCH V1 2/5] backlight: qcom-wled: Add support for WLED4 peripheral

2018-05-17 Thread Rob Herring
On Thu, May 17, 2018 at 4:47 AM,   wrote:
> On 2018-05-08 15:55, kgu...@codeaurora.org wrote:
>>
>> On 2018-05-07 21:50, Bjorn Andersson wrote:
>>>
>>> On Thu 03 May 02:57 PDT 2018, Kiran Gunda wrote:
>>>
 WLED4 peripheral is present on some PMICs like pmi8998
 and pm660l. It has a different register map and also
 configurations are different. Add support for it.

>>>
>>> Several things are going on in this patch, it needs to be split to
>>> not hide the functional changes from the structural/renames.
>>>
>> Ok. I will split it in the next series.

 Signed-off-by: Kiran Gunda 
 ---
  .../bindings/leds/backlight/qcom-wled.txt  | 172 -
  drivers/video/backlight/qcom-wled.c| 749
 +++--
  2 files changed, 696 insertions(+), 225 deletions(-)

 diff --git
 a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
 b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
 index fb39e32..0ceffa1 100644
 --- a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
 +++ b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
 @@ -1,30 +1,129 @@
  Binding for Qualcomm Technologies, Inc. WLED driver

 -Required properties:
 -- compatible: should be "qcom,pm8941-wled"
 -- reg: slave address
 -
 -Optional properties:
 -- default-brightness: brightness value on boot, value from: 0-4095
 -   default: 2048
 -- label: The name of the backlight device
 -- qcom,cs-out: bool; enable current sink output
 -- qcom,cabc: bool; enable content adaptive backlight control
 -- qcom,ext-gen: bool; use externally generated modulator signal to dim
 -- qcom,current-limit: mA; per-string current limit; value from 0 to 25
 -   default: 20mA
 -- qcom,current-boost-limit: mA; boost current limit; one of:
 -   105, 385, 525, 805, 980, 1260, 1400, 1680
 -   default: 805mA
 -- qcom,switching-freq: kHz; switching frequency; one of:
 -   600, 640, 685, 738, 800, 872, 960, 1066, 1200, 1371,
 -   1600, 1920, 2400, 3200, 4800, 9600,
 -   default: 1600kHz
 -- qcom,ovp: V; Over-voltage protection limit; one of:
 -   27, 29, 32, 35
 -   default: 29V
 -- qcom,num-strings: #; number of led strings attached; value from 1 to
 3
 -   default: 2
 +WLED (White Light Emitting Diode) driver is used for controlling
 display
 +backlight that is part of PMIC on Qualcomm Technologies, Inc. reference
 +platforms. The PMIC is connected to the host processor via SPMI bus.
 +
 +- compatible
 +   Usage:required
 +   Value type:   
 +   Definition:   should be "qcom,pm8941-wled" or
 "qcom,pmi8998-wled".
 + or "qcom,pm660l-wled".
>>>
>>>
>>> Better written as
>>>
>>> should be one of:
>>> X
>>> Y
>>> Z
>>>
>> Will do it in the next series.

 +
 +- reg
 +   Usage:required
 +   Value type:   
 +   Definition:   Base address of the WLED modules.
 +
 +- interrupts
 +   Usage:optional
 +   Value type:   
 +   Definition:   Interrupts associated with WLED. Interrupts can be
 + specified as per the encoding listed under
 + Documentation/devicetree/bindings/spmi/
 + qcom,spmi-pmic-arb.txt.
>>>
>>>
>>> Better to describe that this should be the "short" and "ovp" interrupts
>>> in this property than in the interrupt-names.
>>>
>> Ok. I will do it in the next series.

 +
 +- interrupt-names
 +   Usage:optional
 +   Value type:   
 +   Definition:   Interrupt names associated with the interrupts.
 + Must be "short" and "ovp". The short circuit
 detection
 + is not supported for PM8941.
 +
 +- label
 +   Usage:required
 +   Value type:   
 +   Definition:   The name of the backlight device
 +
 +- default-brightness
 +   Usage:optional
 +   Value type:   
 +   Definition:   brightness value on boot, value from: 0-4095
 + Default: 2048
 +
 +- qcom,current-limit
 +   Usage:optional
 +   Value type:   
 +   Definition:   uA; per-string current limit
>>>
>>>
>>> You can't change unit on an existing property, that breaks any existing
>>> dts using the qcom,pm8941-wled compatible.
>>>
>>
 + value:
 + For pm8941: from 0 to 25000 with 5000 ua step
 + Default 2 uA
 + For pmi8998: from 

Re: [PATCH V1 2/5] backlight: qcom-wled: Add support for WLED4 peripheral

2018-05-15 Thread kgunda

On 2018-05-14 22:27, Pavel Machek wrote:

Hi!


WLED4 peripheral is present on some PMICs like pmi8998
and pm660l. It has a different register map and also
configurations are different. Add support for it.

Signed-off-by: Kiran Gunda 
---
 .../bindings/leds/backlight/qcom-wled.txt  | 172 -
 drivers/video/backlight/qcom-wled.c| 749 
+++--

 2 files changed, 696 insertions(+), 225 deletions(-)

diff --git 
a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt 
b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt

index fb39e32..0ceffa1 100644
--- a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
+++ b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
@@ -1,30 +1,129 @@
 Binding for Qualcomm Technologies, Inc. WLED driver

-Required properties:
-- compatible: should be "qcom,pm8941-wled"
-- reg: slave address
-
-Optional properties:
-- default-brightness: brightness value on boot, value from: 0-4095
-   default: 2048
+- compatible
+   Usage:required
+   Value type:   
+   Definition:   should be "qcom,pm8941-wled" or "qcom,pmi8998-wled".
+ or "qcom,pm660l-wled".
+
+- reg
+   Usage:required
+   Value type:   
+   Definition:   Base address of the WLED modules.


I'm not sure if this change of format is good idea here...

Pavel
--
This format is clean and easily readable. That's why I have moved to 
this format.
To avoid confusion, I will move out the existing properties 
(pm8941-wled.c) to other

patch. So that it will be easy to review.

To unsubscribe from this list: send the line "unsubscribe 
linux-arm-msm" in

the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH V1 2/5] backlight: qcom-wled: Add support for WLED4 peripheral

2018-05-14 Thread Pavel Machek
Hi!

> WLED4 peripheral is present on some PMICs like pmi8998
> and pm660l. It has a different register map and also
> configurations are different. Add support for it.
> 
> Signed-off-by: Kiran Gunda 
> ---
>  .../bindings/leds/backlight/qcom-wled.txt  | 172 -
>  drivers/video/backlight/qcom-wled.c| 749 
> +++--
>  2 files changed, 696 insertions(+), 225 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt 
> b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
> index fb39e32..0ceffa1 100644
> --- a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
> +++ b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
> @@ -1,30 +1,129 @@
>  Binding for Qualcomm Technologies, Inc. WLED driver
>  
> -Required properties:
> -- compatible: should be "qcom,pm8941-wled"
> -- reg: slave address
> -
> -Optional properties:
> -- default-brightness: brightness value on boot, value from: 0-4095
> - default: 2048
> +- compatible
> + Usage:required
> + Value type:   
> + Definition:   should be "qcom,pm8941-wled" or "qcom,pmi8998-wled".
> +   or "qcom,pm660l-wled".
> +
> +- reg
> + Usage:required
> + Value type:   
> + Definition:   Base address of the WLED modules.

I'm not sure if this change of format is good idea here...

Pavel
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH V1 2/5] backlight: qcom-wled: Add support for WLED4 peripheral

2018-05-09 Thread Bjorn Andersson
On Tue 08 May 03:25 PDT 2018, kgu...@codeaurora.org wrote:

> On 2018-05-07 21:50, Bjorn Andersson wrote:
> > On Thu 03 May 02:57 PDT 2018, Kiran Gunda wrote:
[..]
> > > +- qcom,ovp
> > > + Usage:optional
> > > + Value type:   
> > > + Definition:   mV; Over-voltage protection limit;
> > 
> > The existing users of qcom,pm8941-wled depends on this being in V, so
> > you can't change the unit. I suggest that you add a new "qcom,ovp-mv"
> > property and make the driver fall back to looking for qcom,ovp if that
> > isn't specified.
> > 
> > PS. This is a very good example of why it is a good idea to not
> > restructure and make changes at the same time - I almost missed this.
> > 
> Actually I have checked the current kernel and none of the properties are
> being configured from the device tree node. Hence, i thought it is the right
> time modify the units to mV to support the PMI8998.
> 

arch/arm/boot/dts/qcom-msm8974-sony-xperia-honami.dts does.

> You still want to have the qcom,ovp-mv, even though it is not being
> configured from device tree ?

Yes, please.

> > > +   For pm8941:  one of 27000, 29000, 32000, 35000
> > > +   Default: 29000 mV
> > > +   For pmi8998: one of 18100, 19600, 29600, 31100
> > > +   Default: 29600 mV
> > > +

Regards,
Bjorn
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH V1 2/5] backlight: qcom-wled: Add support for WLED4 peripheral

2018-05-09 Thread kgunda

On 2018-05-08 22:47, Bjorn Andersson wrote:

On Tue 08 May 03:25 PDT 2018, kgu...@codeaurora.org wrote:


On 2018-05-07 21:50, Bjorn Andersson wrote:
> On Thu 03 May 02:57 PDT 2018, Kiran Gunda wrote:

[..]

> > +- qcom,ovp
> > + Usage:optional
> > + Value type:   
> > + Definition:   mV; Over-voltage protection limit;
>
> The existing users of qcom,pm8941-wled depends on this being in V, so
> you can't change the unit. I suggest that you add a new "qcom,ovp-mv"
> property and make the driver fall back to looking for qcom,ovp if that
> isn't specified.
>
> PS. This is a very good example of why it is a good idea to not
> restructure and make changes at the same time - I almost missed this.
>
Actually I have checked the current kernel and none of the properties 
are
being configured from the device tree node. Hence, i thought it is the 
right

time modify the units to mV to support the PMI8998.



arch/arm/boot/dts/qcom-msm8974-sony-xperia-honami.dts does.


You still want to have the qcom,ovp-mv, even though it is not being
configured from device tree ?


Yes, please.


Sure.

> > +   For pm8941:  one of 27000, 29000, 32000, 35000
> > +   Default: 29000 mV
> > +   For pmi8998: one of 18100, 19600, 29600, 31100
> > +   Default: 29600 mV
> > +


Regards,
Bjorn

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH V1 2/5] backlight: qcom-wled: Add support for WLED4 peripheral

2018-05-09 Thread kgunda

On 2018-05-07 21:50, Bjorn Andersson wrote:

On Thu 03 May 02:57 PDT 2018, Kiran Gunda wrote:


WLED4 peripheral is present on some PMICs like pmi8998
and pm660l. It has a different register map and also
configurations are different. Add support for it.



Several things are going on in this patch, it needs to be split to
not hide the functional changes from the structural/renames.


Ok. I will split it in the next series.

Signed-off-by: Kiran Gunda 
---
 .../bindings/leds/backlight/qcom-wled.txt  | 172 -
 drivers/video/backlight/qcom-wled.c| 749 
+++--

 2 files changed, 696 insertions(+), 225 deletions(-)

diff --git 
a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt 
b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt

index fb39e32..0ceffa1 100644
--- a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
+++ b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
@@ -1,30 +1,129 @@
 Binding for Qualcomm Technologies, Inc. WLED driver

-Required properties:
-- compatible: should be "qcom,pm8941-wled"
-- reg: slave address
-
-Optional properties:
-- default-brightness: brightness value on boot, value from: 0-4095
-   default: 2048
-- label: The name of the backlight device
-- qcom,cs-out: bool; enable current sink output
-- qcom,cabc: bool; enable content adaptive backlight control
-- qcom,ext-gen: bool; use externally generated modulator signal to 
dim
-- qcom,current-limit: mA; per-string current limit; value from 0 to 
25

-   default: 20mA
-- qcom,current-boost-limit: mA; boost current limit; one of:
-   105, 385, 525, 805, 980, 1260, 1400, 1680
-   default: 805mA
-- qcom,switching-freq: kHz; switching frequency; one of:
-   600, 640, 685, 738, 800, 872, 960, 1066, 1200, 1371,
-   1600, 1920, 2400, 3200, 4800, 9600,
-   default: 1600kHz
-- qcom,ovp: V; Over-voltage protection limit; one of:
-   27, 29, 32, 35
-   default: 29V
-- qcom,num-strings: #; number of led strings attached; value from 1 
to 3

-   default: 2
+WLED (White Light Emitting Diode) driver is used for controlling 
display
+backlight that is part of PMIC on Qualcomm Technologies, Inc. 
reference

+platforms. The PMIC is connected to the host processor via SPMI bus.
+
+- compatible
+   Usage:required
+   Value type:   
+   Definition:   should be "qcom,pm8941-wled" or "qcom,pmi8998-wled".
+ or "qcom,pm660l-wled".


Better written as

should be one of:
X
Y
Z


Will do it in the next series.

+
+- reg
+   Usage:required
+   Value type:   
+   Definition:   Base address of the WLED modules.
+
+- interrupts
+   Usage:optional
+   Value type:   
+   Definition:   Interrupts associated with WLED. Interrupts can be
+ specified as per the encoding listed under
+ Documentation/devicetree/bindings/spmi/
+ qcom,spmi-pmic-arb.txt.


Better to describe that this should be the "short" and "ovp" interrupts
in this property than in the interrupt-names.


Ok. I will do it in the next series.

+
+- interrupt-names
+   Usage:optional
+   Value type:   
+   Definition:   Interrupt names associated with the interrupts.
+ Must be "short" and "ovp". The short circuit detection
+ is not supported for PM8941.
+
+- label
+   Usage:required
+   Value type:   
+   Definition:   The name of the backlight device
+
+- default-brightness
+   Usage:optional
+   Value type:   
+   Definition:   brightness value on boot, value from: 0-4095
+ Default: 2048
+
+- qcom,current-limit
+   Usage:optional
+   Value type:   
+   Definition:   uA; per-string current limit


You can't change unit on an existing property, that breaks any existing
dts using the qcom,pm8941-wled compatible.




+ value:
+ For pm8941: from 0 to 25000 with 5000 ua step
+ Default 2 uA
+ For pmi8998: from 0 to 3 with 5000 ua step
+  Default 25000 uA.


These values could be described just as well in mA, so keep the 
original

unit - in particular since the boot-limit is in mA...


Ok. Will keep the original as is in the next series.

+
+- qcom,current-boost-limit
+   Usage:optional
+   Value type:   
+   Definition:   mA; boost current limit.
+ For pm8941: one of: 105, 385, 525, 805, 980, 1260, 1400,
+1680. Default: 805 mA
+ For pmi8998: one of: 105, 280, 450, 620, 970, 1150, 1300,
+ 1500. Default: 970 mA
+
+- qcom,switching-freq
+   

Re: [PATCH V1 2/5] backlight: qcom-wled: Add support for WLED4 peripheral

2018-05-08 Thread Bjorn Andersson
On Thu 03 May 02:57 PDT 2018, Kiran Gunda wrote:

> WLED4 peripheral is present on some PMICs like pmi8998
> and pm660l. It has a different register map and also
> configurations are different. Add support for it.
> 

Several things are going on in this patch, it needs to be split to
not hide the functional changes from the structural/renames.

> Signed-off-by: Kiran Gunda 
> ---
>  .../bindings/leds/backlight/qcom-wled.txt  | 172 -
>  drivers/video/backlight/qcom-wled.c| 749 
> +++--
>  2 files changed, 696 insertions(+), 225 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt 
> b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
> index fb39e32..0ceffa1 100644
> --- a/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
> +++ b/Documentation/devicetree/bindings/leds/backlight/qcom-wled.txt
> @@ -1,30 +1,129 @@
>  Binding for Qualcomm Technologies, Inc. WLED driver
>  
> -Required properties:
> -- compatible: should be "qcom,pm8941-wled"
> -- reg: slave address
> -
> -Optional properties:
> -- default-brightness: brightness value on boot, value from: 0-4095
> - default: 2048
> -- label: The name of the backlight device
> -- qcom,cs-out: bool; enable current sink output
> -- qcom,cabc: bool; enable content adaptive backlight control
> -- qcom,ext-gen: bool; use externally generated modulator signal to dim
> -- qcom,current-limit: mA; per-string current limit; value from 0 to 25
> - default: 20mA
> -- qcom,current-boost-limit: mA; boost current limit; one of:
> - 105, 385, 525, 805, 980, 1260, 1400, 1680
> - default: 805mA
> -- qcom,switching-freq: kHz; switching frequency; one of:
> - 600, 640, 685, 738, 800, 872, 960, 1066, 1200, 1371,
> - 1600, 1920, 2400, 3200, 4800, 9600,
> - default: 1600kHz
> -- qcom,ovp: V; Over-voltage protection limit; one of:
> - 27, 29, 32, 35
> - default: 29V
> -- qcom,num-strings: #; number of led strings attached; value from 1 to 3
> - default: 2
> +WLED (White Light Emitting Diode) driver is used for controlling display
> +backlight that is part of PMIC on Qualcomm Technologies, Inc. reference
> +platforms. The PMIC is connected to the host processor via SPMI bus.
> +
> +- compatible
> + Usage:required
> + Value type:   
> + Definition:   should be "qcom,pm8941-wled" or "qcom,pmi8998-wled".
> +   or "qcom,pm660l-wled".

Better written as

should be one of:
X
Y
Z

> +
> +- reg
> + Usage:required
> + Value type:   
> + Definition:   Base address of the WLED modules.
> +
> +- interrupts
> + Usage:optional
> + Value type:   
> + Definition:   Interrupts associated with WLED. Interrupts can be
> +   specified as per the encoding listed under
> +   Documentation/devicetree/bindings/spmi/
> +   qcom,spmi-pmic-arb.txt.

Better to describe that this should be the "short" and "ovp" interrupts
in this property than in the interrupt-names.

> +
> +- interrupt-names
> + Usage:optional
> + Value type:   
> + Definition:   Interrupt names associated with the interrupts.
> +   Must be "short" and "ovp". The short circuit detection
> +   is not supported for PM8941.
> +
> +- label
> + Usage:required
> + Value type:   
> + Definition:   The name of the backlight device
> +
> +- default-brightness
> + Usage:optional
> + Value type:   
> + Definition:   brightness value on boot, value from: 0-4095
> +   Default: 2048
> +
> +- qcom,current-limit
> + Usage:optional
> + Value type:   
> + Definition:   uA; per-string current limit

You can't change unit on an existing property, that breaks any existing
dts using the qcom,pm8941-wled compatible.

> +   value:
> +   For pm8941: from 0 to 25000 with 5000 ua step
> +   Default 2 uA
> +   For pmi8998: from 0 to 3 with 5000 ua step
> +Default 25000 uA.

These values could be described just as well in mA, so keep the original
unit - in particular since the boot-limit is in mA...

> +
> +- qcom,current-boost-limit
> + Usage:optional
> + Value type:   
> + Definition:   mA; boost current limit.
> +   For pm8941: one of: 105, 385, 525, 805, 980, 1260, 1400,
> +  1680. Default: 805 mA
> +   For pmi8998: one of: 105, 280, 450, 620, 970, 1150, 1300,
> +   1500. Default: 970 mA
> +
> +- qcom,switching-freq
> + Usage:optional
> + Value type:   
> + Definition:   kHz; switching frequency; one of: 600, 640, 685, 738,
> +