From: Pavel Machek <pavel@ucw.cz>
To: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
"lee@kernel.org" <lee@kernel.org>,
"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Linux support for a 7 segment LED display
Date: Fri, 23 Feb 2024 08:47:33 +0100 [thread overview]
Message-ID: <ZdhNlUotGJCklJTs@duo.ucw.cz> (raw)
In-Reply-To: <2a8d19ee-b18b-4b7c-869f-7d601cea30b6@alliedtelesis.co.nz>
[-- Attachment #1: Type: text/plain, Size: 2422 bytes --]
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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2024-02-23 7:47 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-11 20:46 Linux support for a 7 segment LED display Chris Packham
2024-02-19 15:13 ` Lee Jones
2024-02-19 20:12 ` Chris Packham
2024-02-20 8:18 ` Lee Jones
2024-02-20 17:30 ` Pavel Machek
2024-02-19 15:34 ` Pavel Machek
2024-02-19 20:08 ` Chris Packham
2024-02-22 21:34 ` andy.shevchenko
2024-02-22 21:53 ` Chris Packham
2024-02-22 21:59 ` Andy Shevchenko
2024-02-22 22:08 ` Chris Packham
2024-02-22 22:13 ` Andy Shevchenko
2024-02-23 3:46 ` Chris Packham
2024-02-23 7:47 ` Pavel Machek [this message]
2024-02-23 7:53 ` Geert Uytterhoeven
2024-02-23 7:51 ` Geert Uytterhoeven
2024-02-23 12:35 ` Andy Shevchenko
2024-02-23 13:01 ` Geert Uytterhoeven
2024-02-23 14:44 ` Andy Shevchenko
2024-02-22 22:34 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZdhNlUotGJCklJTs@duo.ucw.cz \
--to=pavel@ucw.cz \
--cc=Chris.Packham@alliedtelesis.co.nz \
--cc=andy.shevchenko@gmail.com \
--cc=geert@linux-m68k.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox