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: display: uc81xx: add support for uc8175 #61439
Conversation
60e3910
to
cd1c4a9
Compare
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.
Please drop all of the necessary code reformatting, then we can continue with the review.
Got it, thank you! |
5ff8a20
to
6d30fe4
Compare
Hi @danieldegrasse @galak can we get a quick review to unblock the merging? Thanks |
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 for this change. This looks like a good way of implementing UC8175 support. I have a minor change request (see comment below), but it looks good other than that.
drivers/display/uc81xx.c
Outdated
@@ -425,12 +413,6 @@ static int uc81xx_write(const struct device *dev, const uint16_t x, const uint16 | |||
__ASSERT(!(desc->width % UC81XX_PIXELS_PER_BYTE), | |||
"Buffer width not multiple of %d", UC81XX_PIXELS_PER_BYTE); | |||
|
|||
if ((y_end_idx > (config->height - 1)) || |
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.
I'd suggest keeping this check here to limit code duplication. That implies that you'll need to pass x_end_idx
and y_end_idx
to the quirk function.
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.
Sounds good, thank you!
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 for the updated change. I'm OK with this version of the change, but I would prefer it if you could address the two comments I have added in this review.
drivers/display/uc81xx.c
Outdated
.vred = sys_cpu_to_be16(y_end_idx), | ||
.flags = UC81XX_PTL_FLAG_PT_SCAN, | ||
}; | ||
|
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.
This newline seems redundant.
drivers/display/uc81xx.c
Outdated
@@ -425,8 +417,7 @@ static int uc81xx_write(const struct device *dev, const uint16_t x, const uint16 | |||
__ASSERT(!(desc->width % UC81XX_PIXELS_PER_BYTE), | |||
"Buffer width not multiple of %d", UC81XX_PIXELS_PER_BYTE); | |||
|
|||
if ((y_end_idx > (config->height - 1)) || | |||
(x_end_idx > (config->width - 1))) { | |||
if ((y_end_idx > (config->height - 1)) || (x_end_idx > (config->width - 1))) { |
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.
It'd be nice if you could keep the same formatting as as before to keep the diff as small as possible. That keeps the git annotate log clean and avoids merge conflicts in the future.
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.
ah sorry about that, fixed :)
Add support for uc8175 display driver. uc8175 has a slightly different command/data length requirements for certain registers, namely TRES and PTL, compared to uc8176/uc8179 This commit refactors the driver code and such that setting TRES and PTL registers are now done by function pointers provided by config->quirks, by the same token as how it is done for setting CDI register Signed-off-by: Xiao Qin <xiaoq@google.com>
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 for the quick turnaround. This looks good to me.
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
@andysan Thanks! please consider becoming a collaborator in this area: |
Add support for uc8175 display driver. uc8175 has a slightly different command/data length requirements for certain registers, namely TRES and PTL, compared to uc8176/uc8179
This commit refactors the driver code and such that setting TRES and PTL registers are now done by function pointers provided by config->quirks, by the same token as how it is done for the CDI register