-
Notifications
You must be signed in to change notification settings - Fork 914
Add LTC3220 driver #3005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add LTC3220 driver #3005
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) | ||
| %YAML 1.2 | ||
| --- | ||
| $id: http://devicetree.org/schemas/leds/leds-ltc3220.yaml# | ||
| $schema: http://devicetree.org/meta-schemas/core.yaml# | ||
|
|
||
| title: Analog Devices LTC3220 LED Drivers | ||
|
|
||
| maintainers: | ||
| - Edelweise Escala <edelweise.escala@analog.com> | ||
|
|
||
| description: Bindings for the Analog Devices LTC3220 18 channel LED Drivers. | ||
|
|
||
| For more product information please see the link below | ||
| https://www.analog.com/en/products/ltc3220.html | ||
|
|
||
| properties: | ||
| compatible: | ||
| enum: | ||
| - adi,ltc3220 | ||
| - adi,ltc3220-1 | ||
|
|
||
| reg: | ||
| maxItems: 1 | ||
|
|
||
| '#address-cells': | ||
| const: 1 | ||
|
|
||
| '#size-cells': | ||
| const: 0 | ||
|
|
||
| reset-gpios: | ||
| maxItems: 1 | ||
| description: GPIO attached to the chip's reset pin | ||
|
|
||
| adi,force-cpo-mode: | ||
| $ref: /schemas/types.yaml#/definitions/uint32 | ||
| description: | ||
| Force charge pump operation mode. | ||
| 0 = Auto mode (default) - Automatically selects optimal charge pump mode | ||
| 1 = 1.5x mode - 1.5x voltage multiplication | ||
| 2 = 2x mode - 2x voltage multiplication | ||
| 3 = 1x mode - Charge pump bypass | ||
| minimum: 0 | ||
| maximum: 3 | ||
| default: 0 | ||
|
Comment on lines
+36
to
+46
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this similar to LTC3208 force-cpo-mode ? |
||
|
|
||
| adi,quick-write-enable: | ||
| type: boolean | ||
| description: | ||
| Enable quick write mode. When enabled, writing to LED D1 (register 0x01) | ||
| will update all 18 LED outputs with the same brightness value. | ||
|
Comment on lines
+48
to
+52
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't see why this needs to be in device tree. To me, this sounds more like a device runtime configuration property. What about registering a 19th led? Set ltc3220_state->uled_cfg[<19 or last led index>].led_cdev.name = "all";
ltc3220_state->uled_cfg[i].led_cdev.brightness_set_blocking = ltc3220_set_all_led_data;with |
||
|
|
||
| patternProperties: | ||
| "(^led@([1-9]|1[0-8])$|led)": | ||
| type: object | ||
| $ref: /schemas/leds/common.yaml# | ||
| unevaluatedProperties: false | ||
| properties: | ||
| reg: | ||
| description: Output channel for the LED (1-18 maps to LED outputs D1-D18) | ||
| minimum: 1 | ||
| maximum: 18 | ||
| required: | ||
| - reg | ||
|
|
||
| required: | ||
| - compatible | ||
| - reg | ||
|
|
||
| additionalProperties: false | ||
|
|
||
| examples: | ||
| - | | ||
| #include <dt-bindings/gpio/gpio.h> | ||
| #include <dt-bindings/leds/common.h> | ||
|
|
||
| i2c { | ||
| #address-cells = <1>; | ||
| #size-cells = <0>; | ||
|
|
||
| led-controller@1c { | ||
| compatible = "adi,ltc3220"; | ||
| reg = <0x1c>; | ||
| #address-cells = <1>; | ||
| #size-cells = <0>; | ||
| reset-gpios = <&gpio 17 GPIO_ACTIVE_LOW>; | ||
| adi,force-cpo-mode = <0>; | ||
| adi,quick-write-enable; | ||
|
|
||
| led@1 { | ||
| reg = <1>; | ||
| function = LED_FUNCTION_INDICATOR; | ||
| function-enumerator = <1>; | ||
| }; | ||
|
|
||
| led@2 { | ||
| reg = <2>; | ||
| function = LED_FUNCTION_INDICATOR; | ||
| function-enumerator = <2>; | ||
| }; | ||
|
|
||
| led@3 { | ||
| reg = <3>; | ||
| function = LED_FUNCTION_INDICATOR; | ||
| function-enumerator = <3>; | ||
| }; | ||
|
|
||
| led@4 { | ||
| reg = <4>; | ||
| function = LED_FUNCTION_INDICATOR; | ||
| function-enumerator = <4>; | ||
| }; | ||
|
|
||
| led@5 { | ||
| reg = <5>; | ||
| function = LED_FUNCTION_INDICATOR; | ||
| function-enumerator = <5>; | ||
| }; | ||
|
|
||
| led@6 { | ||
| reg = <6>; | ||
| function = LED_FUNCTION_INDICATOR; | ||
| function-enumerator = <6>; | ||
| }; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to have some of the properties coming from common.yaml that the device supports. Otherwise I wonder why we $ref it.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added function and function-enumerator. |
||
| }; | ||
| }; | ||
|
|
||
| ... | ||
Uh oh!
There was an error while loading. Please reload this page.