mbox series

[v1,RESEND,0/7] Fix/Add is31fl319{0,1,3} support

Message ID 20220628182147.2837180-1-vincent.knecht@mailoo.org
Headers show
Series Fix/Add is31fl319{0,1,3} support | expand

Message

Vincent Knecht June 28, 2022, 6:21 p.m. UTC
Changes since v1:
- no change, resending after configuring git to accomodate
  for smtp provider limit of 5 emails per batch
- just change cover-letter to mention si-en chip for idol347

  
The is31fl3190, is31fl3191 and is31fl3193 chips (1 or 3 PWM channels)
cannot be handled the same as is31fl3196 and is31fl3199,
if only because the register map is different.
Also:
- the software shutdown bit is reversed
- and additional field needs to be set to enable all channels
- the led-max-microamp current values and setting are not the same

Datasheets:
https://lumissil.com/assets/pdf/core/IS31FL3190_DS.pdf
https://lumissil.com/assets/pdf/core/IS31FL3191_DS.pdf
https://lumissil.com/assets/pdf/core/IS31FL3193_DS.pdf
https://lumissil.com/assets/pdf/core/IS31FL3196_DS.pdf
https://lumissil.com/assets/pdf/core/IS31FL3199_DS.pdf

This series:

- converts dt-bindings to dtschema, adding all si-en compatibles
  for convenience and consistency, and adding constraints on
  supported values for eg. reg address and led-max-microamp

- changes vars, structs and defines to not use 319X suffix
  but 3190 for 319{0,1,3} and 3196 for 319{6,9}

- adds fields in chipdef struct for chip-specific values

- only in the last patch, adds is31fl319{0,1,3} specific values
  so those chips can work.

Tested on msm8916-alcatel-idol347, which probably has an
si-en,sn3190 or si-en,sn3191 (only one white led indicator).

Vincent Knecht (7):
  dt-bindings: leds: Convert is31fl319x to dtschema
  dt-bindings: leds: is31fl319x: Add missing si-en compatibles
  leds: is31fl319x: Add missing si-en compatibles
  dt-bindings: leds: is31fl319x: Document variants specificities
  leds: is31fl319x: Use non-wildcard names for vars, structs and defines
  leds: is31fl319x: Move chipset-specific values in chipdef struct
  leds: is31fl319x: Add support for is31fl319{0,1,3} chips

 .../bindings/leds/issi,is31fl319x.yaml        | 193 +++++++++
 .../bindings/leds/leds-is31fl319x.txt         |  61 ---
 drivers/leds/leds-is31fl319x.c                | 406 +++++++++++++-----
 3 files changed, 488 insertions(+), 172 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/leds/issi,is31fl319x.yaml
 delete mode 100644 Documentation/devicetree/bindings/leds/leds-is31fl319x.txt

Comments

Rob Herring June 29, 2022, 2:09 a.m. UTC | #1
On Tue, 28 Jun 2022 20:21:39 +0200, Vincent Knecht wrote:
> Convert leds-is31fl319x.txt to dtschema.
> Set license to the one recommended by DT project.
> 
> Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
> ---
>  .../bindings/leds/issi,is31fl319x.yaml        | 113 ++++++++++++++++++
>  .../bindings/leds/leds-is31fl319x.txt         |  61 ----------
>  2 files changed, 113 insertions(+), 61 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/leds/issi,is31fl319x.yaml
>  delete mode 100644 Documentation/devicetree/bindings/leds/leds-is31fl319x.txt
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml: patternProperties:^thermistor@:properties:adi,excitation-current-nanoamp: '$ref' should not be valid under {'const': '$ref'}
	hint: Standard unit suffix properties don't need a type $ref
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml: ignoring, error in schema: patternProperties: ^thermistor@: properties: adi,excitation-current-nanoamp
Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.example.dtb:0:0: /example-0/spi/ltc2983@0: failed to match any schema with compatible: ['adi,ltc2983']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Rob Herring June 30, 2022, 3:28 p.m. UTC | #2
On Tue, Jun 28, 2022 at 08:09:39PM -0600, Rob Herring wrote:
> On Tue, 28 Jun 2022 20:21:39 +0200, Vincent Knecht wrote:
> > Convert leds-is31fl319x.txt to dtschema.
> > Set license to the one recommended by DT project.

Do you have permission to do so? The original .txt file is default GPL2 
and owned by H. Nikolaus Schaller. 

> > 
> > Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
> > ---
> >  .../bindings/leds/issi,is31fl319x.yaml        | 113 ++++++++++++++++++
> >  .../bindings/leds/leds-is31fl319x.txt         |  61 ----------
> >  2 files changed, 113 insertions(+), 61 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/leds/issi,is31fl319x.yaml
> >  delete mode 100644 Documentation/devicetree/bindings/leds/leds-is31fl319x.txt
> > 
> 
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
> 
> yamllint warnings/errors:
> 
> dtschema/dtc warnings/errors:
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml: patternProperties:^thermistor@:properties:adi,excitation-current-nanoamp: '$ref' should not be valid under {'const': '$ref'}
> 	hint: Standard unit suffix properties don't need a type $ref
> 	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml: ignoring, error in schema: patternProperties: ^thermistor@: properties: adi,excitation-current-nanoamp
> Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.example.dtb:0:0: /example-0/spi/ltc2983@0: failed to match any schema with compatible: ['adi,ltc2983']

You can ignore this. The bot went amuck.

Rob
Vincent Knecht June 30, 2022, 9:43 p.m. UTC | #3
Le jeudi 30 juin 2022 à 09:28 -0600, Rob Herring a écrit :
> On Tue, Jun 28, 2022 at 08:09:39PM -0600, Rob Herring wrote:
> > On Tue, 28 Jun 2022 20:21:39 +0200, Vincent Knecht wrote:
> > > Convert leds-is31fl319x.txt to dtschema.
> > > Set license to the one recommended by DT project.
> 
> Do you have permission to do so? The original .txt file is default GPL2 
> and owned by H. Nikolaus Schaller. 

No, sorry for the mistake.
Adding to cc, which I forgot to do in the first place...
For reference: https://lore.kernel.org/linux-leds/20220628182147.2837180-1-vincent.knecht@mailoo.org/T/

> > > 
> > > Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
> > > ---
> > >  .../bindings/leds/issi,is31fl319x.yaml        | 113 ++++++++++++++++++
> > >  .../bindings/leds/leds-is31fl319x.txt         |  61 ----------
> > >  2 files changed, 113 insertions(+), 61 deletions(-)
> > >  create mode 100644 Documentation/devicetree/bindings/leds/issi,is31fl319x.yaml
> > >  delete mode 100644 Documentation/devicetree/bindings/leds/leds-is31fl319x.txt
> > > 
> > 
> > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> > on your patch (DT_CHECKER_FLAGS is new in v5.13):
> > 
> > yamllint warnings/errors:
> > 
> > dtschema/dtc warnings/errors:
> > /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml:
> > patternProperties:^thermistor@:properties:adi,excitation-current-nanoamp: '$ref' should not be valid under {'const':
> > '$ref'}
> >         hint: Standard unit suffix properties don't need a type $ref
> >         from schema $id: http://devicetree.org/meta-schemas/core.yaml#
> > /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml: ignoring,
> > error in schema: patternProperties: ^thermistor@: properties: adi,excitation-current-nanoamp
> > Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.example.dtb:0:0: /example-0/spi/ltc2983@0: failed to
> > match any schema with compatible: ['adi,ltc2983']
> 
> You can ignore this. The bot went amuck.
> 

Ack... at least it respected the 3 Laws :-)
H. Nikolaus Schaller July 1, 2022, 4:34 p.m. UTC | #4
Hi,

> Am 30.06.2022 um 23:43 schrieb Vincent Knecht <vincent.knecht@mailoo.org>:
> 
> Le jeudi 30 juin 2022 à 09:28 -0600, Rob Herring a écrit :
>> On Tue, Jun 28, 2022 at 08:09:39PM -0600, Rob Herring wrote:
>>> On Tue, 28 Jun 2022 20:21:39 +0200, Vincent Knecht wrote:
>>>> Convert leds-is31fl319x.txt to dtschema.
>>>> Set license to the one recommended by DT project.
>> 
>> Do you have permission to do so? The original .txt file is default GPL2 
>> and owned by H. Nikolaus Schaller. 
> 
> No, sorry for the mistake.
> Adding to cc, which I forgot to do in the first place...
> For reference: https://lore.kernel.org/linux-leds/20220628182147.2837180-1-vincent.knecht@mailoo.org/T/

Please go ahead and change as you suggested. I won't find time to maintain this (new) document.

BR and thanks,
Nikolaus