Re: Linux support for a 7 segment LED display

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

 



On Fri, Feb 23, 2024 at 9:52 AM Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
> On Fri, Feb 23, 2024 at 4:46 AM Chris Packham
> <Chris.Packham@xxxxxxxxxxxxxxxxxxx> wrote:
> > On 23/02/24 11:13, Andy Shevchenko wrote:

...

> > I've been playing about with this. I've got an auxdisplay driver that's
> > basically working (I won't bother spamming list with it yet). But I'm
> > wondering how I'd represent multiple characters. I kind of feel the
> > natural representation would be something like.
> >
> >          led-7seg {
> >                  compatible = "generic,7-segment-on-gpio";
>
> gpio-7seg?
>
> >                  char-0 {
> >                      segment-gpios = <&gpio 0 GPIO_ACTIVE_LOW
> >                                       &gpio 1 GPIO_ACTIVE_LOW
> >                                       &gpio 2 GPIO_ACTIVE_LOW
> >                                       &gpio 3 GPIO_ACTIVE_LOW
> >                                       &gpio 4 GPIO_ACTIVE_LOW
> >                                       &gpio 5 GPIO_ACTIVE_LOW
> >                                       &gpio 6 GPIO_ACTIVE_LOW>;
> >                  };
> >                  char-1 {
> >                      segment-gpios = <&gpio 8 GPIO_ACTIVE_LOW
> >                                       &gpio 9 GPIO_ACTIVE_LOW
> >                                       &gpio 10 GPIO_ACTIVE_LOW
> >                                       &gpio 11 GPIO_ACTIVE_LOW
> >                                       &gpio 12 GPIO_ACTIVE_LOW
> >                                       &gpio 13 GPIO_ACTIVE_LOW
> >                                       &gpio 14 GPIO_ACTIVE_LOW>;
> >                  };
> >          };
> >
> > But having those sub-nodes means I can't just use devm_gpiod_get_array()
> > instead I'd have to use device_for_each_child_node() and
> > devm_fwnode_gpiod_get_index(). Am I missing something? I could do away
> > with the sub-nodes and have properties like "segment-0-gpios",
> > "segment-1-gpios" but that feels awkward.
>
> Just use a single segment-gpios property?
> The dot is optional, and can be zero.
> The number of characters is (the number of elements + 1) / 8.
> The "+ 1" serves to accommodate the optional dot for the last character,
> but if people find that too complicated, you can enforce a multiple
> of 8 instead.
>
> The colon found on many 4-digit displays can be a separate gpios
> property.
>
> I do agree subnodes could be more appropriate for more complex
> displays, but ideally you need some way to describe relative positions
> for such displays, too.

For line display the sequence is the same as in DT, so I'm supporting
the idea of separate subnodes per digit. Note, that we can
theoretically have different displays to form the line, but it makes
things more complex if we ever want to support that combination.

> Note that most larger displays are not individual LEDs, but matrices
> of LEDs. Do we want to drive/scan them from software, using a
> gpio-7seg-matrix driver?

LED matrices are the displays (like tinyDRM is for).


-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux