lkml.org 
[lkml]   [2022]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 3/4] drm/tiny: Add driver for Solomon SSD1307 OLED displays
From
Hello Thomas,

On 2/2/22 09:23, Thomas Zimmermann wrote:

[snip]

>
> Thanks to both of you. I was asking because I found the code to be
> repetitive and it's not clear that these 3 statements belong together.
>
> I'd like to suggest to add a function
>
> ssd1307_write_cmds(client, len, const u8 *cmds)
>
> that loops through cmds and sends the values one by one. A call would
> look like this:
>
> const u8 set_col_range[] = {
> SSD1307_SET_COL_RANGE,
> col_start,
> col_end
> };
>
> ssd1307_write_cmds(client, ARRAY_SIZE(set_col_range), set_col_range);
>
> AND/OR
>
> You could have functions that take a command with arguments; either as
> va_args or with one function per number of arguments. Or you could
> combine all these somehow.
>

Thanks for the suggestion, that a makes sense to me. I'll look into
it when working on v2. Probably during the weekend.

Best regards,
--
Javier Martinez Canillas
Linux Engineering
Red Hat

\
 
 \ /
  Last update: 2022-02-02 09:31    [W:0.059 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site