-
Notifications
You must be signed in to change notification settings - Fork 8.3k
drivers: led: lp5569: implement write_channels api #81497
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
drivers: led: lp5569: implement write_channels api #81497
Conversation
jonas-rem
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also adapt the test for the driver so that this feature is used there? Some of the other tests for the led drivers already test the write_channels function.
I haven't been able to find any existing test for the ti,lp5569 except for
Do you have a reference on that - again I wasn't really able to find anything. Though for this one, the led-api test, |
Oh, it's not a test but a sample. You can find the sample for the lp5569 here:
And for the other led drivers in the same head folder: |
Thank you! |
Thanks! I think this is sufficient to demonstrate. I have a board with two lp5569 here and will test later today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @Emil-Juhl,
Thanks for implementing the write_channels() API for the lp5569 driver. It is clear and straightforward.
See below for the changes I am requesting.
The lp5569 controller supports auto-increment for its registers. This is by default enabled in the chip, but the driver actively disabled it. Since auto-increment is useful for writing multiple consecutive registers, enable the feature. The driver, however, doesn't perform such consecutive writes and thus the existing behavior is not altered. Signed-off-by: Emil Dahl Juhl <[email protected]>
The lp5569 has multiple pwm outputs, and thus implementing the write_channels api to set multiple values in a single call makes sense. Implement the write_channels function with a basic range check on the channel range. Since the lp5569 supports auto-increment, all of the channels can be written in one i2c transfer, starting from the pwm register of the start_channel. Signed-off-by: Emil Dahl Juhl <[email protected]>
Add a simple demonstration of the led_write_channels api on the lp5569 driver sample. The demonstration simply turns on all of the channels with a single call to led_write_channels. Then the same is done for turning off the channels. Thus, it doesn't add much visually, but it shows the usage of the api. Signed-off-by: Emil Dahl Juhl <[email protected]>
8365651 to
57fc739
Compare
|
@simonguinot Thanks for the comments, I've resolved the conversations - but if you don't think I've resolved the issues appropriately, just re-open them and let me know. |
simonguinot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Emil-Juhl !
drivers: led: lp5569: enable auto-increment
The lp5569 controller supports auto-increment for its registers. This is by
default enabled in the chip, but the driver actively disabled it.
Since auto-increment is useful for writing multiple consecutive registers,
enable the feature. The driver, however, doesn't perform such consecutive
writes and thus the existing behavior is not altered.
Signed-off-by: Emil Dahl Juhl [email protected]
drivers: led: lp5569: implement write_channels api
The lp5569 has multiple pwm outputs, and thus implementing the
write_channels api to set multiple values in a single call makes sense.
Implement the write_channels function with a basic range check on the
channel range.
Since the lp5569 supports auto-increment, all of the channels can be
written in one i2c transfer, starting from the pwm register of the
start_channel.
Signed-off-by: Emil Dahl Juhl [email protected]