lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Veyvw75jc4LFpW2EQQ=wSYmn_VdsPBWVG03b+P0QvyGaQ@mail.gmail.com>
Date: Fri, 23 Feb 2024 14:35:46 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Chris Packham <Chris.Packham@...iedtelesis.co.nz>, 
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>, Pavel Machek <pavel@....cz>, 
	"lee@...nel.org" <lee@...nel.org>, "linux-leds@...r.kernel.org" <linux-leds@...r.kernel.org>, 
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: Linux support for a 7 segment LED display

On Fri, Feb 23, 2024 at 9:52 AM Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
> On Fri, Feb 23, 2024 at 4:46 AM Chris Packham
> <Chris.Packham@...iedtelesis.co.nz> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ