Re: [PATCH v3 9/9] auxdisplay: Add driver for MAX695x 7-segment LED controllers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andy,

On Mon, Feb 26, 2024 at 5:17 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> On Mon, Feb 26, 2024 at 05:01:46PM +0100, Geert Uytterhoeven wrote:
> > On Mon, Feb 19, 2024 at 6:03 PM Andy Shevchenko
> > <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > > Add initial driver for the MAX6958 and MAX6959 7-segment LED
> > > controllers.
>
> > LGTM, so
> > Reviewed-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
>
> Thanks, but see below.
>
> ...
>
> > > +       u8 buf[4];
> > > +
> > > +       /* Map segments according to datasheet */
> > > +       buf[0] = bitrev8(map_to_seg7(&map->map.seg7, *s++)) >> 1;
> > > +       buf[1] = bitrev8(map_to_seg7(&map->map.seg7, *s++)) >> 1;
> > > +       buf[2] = bitrev8(map_to_seg7(&map->map.seg7, *s++)) >> 1;
> > > +       buf[3] = bitrev8(map_to_seg7(&map->map.seg7, *s++)) >> 1;
> >
> > for (unsigned int i = 0; i < linedisp->num_chars; i++) { ... }
> >
> > > +
> > > +       regmap_bulk_write(priv->regmap, REG_DIGIT(0), buf, ARRAY_SIZE(buf));
> >
> > linedisp->num_chars
>
> Maybe, but then we probably want to synchronize the 4 there and here as we
> can't have VLA on stack.

You can still keep the maximum buf[4], so no VLA needed?

>
> > > +}
>
> ...
>
> > > +       ret = linedisp_register(&priv->linedisp, dev, 4, &max6959_linedisp_ops);
> >
> > + device_property_read_u32(dev, "display-width-chars", ...) handling.
>
> Not sure it should be part of this series.

Fair enough, so please go ahead without.

Even "display-width-chars" might not cover all cases, as a board
may use any subset of the 4 DIGn signals, even in any order...

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux