Re: Linux support for a 7 segment LED display
From: Pavel Machek
Date: Fri Feb 23 2024 - 02:47:46 EST
Hi!
> > Right, but also with some additional properties, like
> > - type of the indicator (7, 14, etc segments, for now we have only
> > these two supported)
> > - use-dot (+1 led per each digit)
> > - characters (how many digits we have, so we need respective amount of GPIOs)
> >
> > With this it's indeed belongs directly to auxdisplay as we have almost
> > everything is done already there.
>
> 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";
> 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.
One solution would be to treat separate digits as separata devices
:-).
Other would be saying you don't have hardware for that, and make it
someone else's future problem.
Best regards,
Pavel
--
People of Russia, stop Putin before his war on Ukraine escalates.
Attachment:
signature.asc
Description: PGP signature