devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
To: Thomas Petazzoni
	<thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: Lior Amsalem <alior-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>,
	Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>,
	Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH 3.9] Driver for 7-segment displays connected over GPIOs
Date: Mon, 7 Jan 2013 18:06:44 +0000	[thread overview]
Message-ID: <20130107180644.GE3222@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20130107184352.2e90abfb@skate>

On Mon, Jan 07, 2013 at 06:43:52PM +0100, Thomas Petazzoni wrote:
> On Mon, 7 Jan 2013 18:40:22 +0100, Thomas Petazzoni wrote:
> > > > Not having a kernel driver means that gazillions of applications
> > > > re-invent the same piece of code over and over again, have to hardcode
> > > > the GPIO numbers for a given piece of hardware, while the kernel
> > > > abstract all of this very nicely.
> > > 
> > > That sounds like a wonderful use of a userspace library to do this
> > > properly.  Much like libusb does, right?
> > > 
> > > I still think as this can be done in userspace, it probably should be.
> > 
> > Understood. Patches discarded.
> 
> Thinking more about this. How would your userspace library know on which
> GPIOs your 7-seg segment device is connected? Should it parse the
> Device Tree from userspace? Given by the user-space application who
> would have to hardcode the GPIO numbers, completely defeating the
> hardware abstraction layer that the kernel intends to be?

An application using the library gives it a list of GPIOs corresponding to
the segments.  If you think about it, the library could also know about a
group of 7-segs and output a multi-digit number in a sane manner.

There's also alphanumeric segmented displays too.  Do we want yet another
different kernel driver for that or should that also be handled in
userspace by the library?  What about a mixture of numeric and alphanumeric
displays?

Some radios I've seen have a mixture of these two types of display.  Others
have partial displays too - take for instance a clock display.  The hours
display only needs to display nothing or 1, or maybe nothing, 1, 2 (yes,
you can get displays with segments missing.)

The contary point to this is... what about 7-segment displays which are
scanned, where the cathodes of each display are commoned (so segment 'a'
is shared between each 7-seg display) and the anodes are sequenced?
Those are popular in certain consumer equipment (like radios) and I
suspect such a display wouldn't be possible from userspace.  _However_
again, there's nothing saying that it will always be a 7-seg display -
it could be again a mixture.

In the case of vacuum flourescent displays, these are very commonly
scanned affairs (gate scanning with commoned anodes for the segments)
in the manner I describe above, and included are segments for various
functions (eg, a separate segment for the weekday name.)  We've all
seen them on video recorders and such like over the years:
http://en.wikipedia.org/wiki/File:Vacuum_fluorescent_1.jpg

So really, there's a whole pile of display classes here that need to be
thought about before anyone goes creating a single interface for just
one specific display type.

  parent reply	other threads:[~2013-01-07 18:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07 16:42 [PATCH 3.9] Driver for 7-segment displays connected over GPIOs Thomas Petazzoni
2013-01-07 16:42 ` [PATCH 3.9 1/3] misc: new driver for GPIO-connected 7-segment displays Thomas Petazzoni
     [not found]   ` <1357576928-29133-2-git-send-email-thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2013-01-07 19:43     ` Arnd Bergmann
     [not found]       ` <201301071943.40074.arnd-r2nGTMty4D4@public.gmane.org>
2013-01-07 19:58         ` Thomas Petazzoni
2013-01-07 21:41           ` Arnd Bergmann
     [not found]             ` <201301072141.48487.arnd-r2nGTMty4D4@public.gmane.org>
2013-02-08 22:38               ` Grant Likely
2013-02-08 22:35     ` Grant Likely
2013-01-07 16:42 ` [PATCH 3.9 2/3] arm: mvebu: add the 7-segment display DT informations to Armada 370 DB Thomas Petazzoni
2013-01-07 16:42 ` [PATCH 3.9 3/3] arm: mvebu: add the 7-segment display DT informations to Armada XP DB Thomas Petazzoni
     [not found]   ` <1357576928-29133-4-git-send-email-thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2013-02-08 22:39     ` Grant Likely
     [not found] ` <1357576928-29133-1-git-send-email-thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2013-01-07 16:48   ` [PATCH 3.9] Driver for 7-segment displays connected over GPIOs Greg Kroah-Hartman
     [not found]     ` <20130107164845.GA2911-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2013-01-07 17:07       ` Thomas Petazzoni
2013-01-07 17:23         ` Greg Kroah-Hartman
     [not found]           ` <20130107172340.GA32401-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2013-01-07 17:40             ` Thomas Petazzoni
2013-01-07 17:43               ` Thomas Petazzoni
2013-01-07 17:56                 ` H Hartley Sweeten
     [not found]                   ` <ADE657CA350FB648AAC2C43247A983F00206D6C98E38-gaq956PjLg32KbjnnMDalRurcAul1UnsRrxOEX5GOmysTnJN9+BGXg@public.gmane.org>
2013-01-07 18:02                     ` Jason Cooper
2013-01-07 18:06                 ` Russell King - ARM Linux [this message]
2013-01-07 17:53             ` Thomas Petazzoni
2013-01-07 18:36               ` Greg Kroah-Hartman
     [not found]                 ` <20130107183642.GA26612-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2013-01-07 18:38                   ` Thomas Petazzoni
2013-01-07 23:05   ` Linus Walleij
2013-02-09 16:28     ` 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=20130107180644.GE3222@n2100.arm.linux.org.uk \
    --to=linux-lfz/pmaqli7xmaaqvzeohq@public.gmane.org \
    --cc=alior-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org \
    --cc=andrew-g2DYL2Zd6BY@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.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;
as well as URLs for NNTP newsgroup(s).