From: Andrew Zabolotny <zap@homelink.ru>
To: Greg KH <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Backlight and LCD module patches [1]
Date: Sun, 27 Jun 2004 00:21:52 +0400 [thread overview]
Message-ID: <20040627002152.20e2da7d.zap@homelink.ru> (raw)
In-Reply-To: <20040624213452.GC2477@kroah.com>
On Thu, 24 Jun 2004 14:34:52 -0700
Greg KH <greg@kroah.com> wrote:
> How about just having every l/b driver containing a pointer to the
> fbinfo that it is associated with? Isn't there some way you can keep
> the pointer that you need around within the place that you need to use
> it from eventually?
It's not a question of b/l driver needing the framebuffer driver; it's the
other way around: the framebuffer driver needs the b/l drivers (needs so
much that it can fail initialization in some cases if it doesn't find the
corresponding b/l device). Framebuffer interface has some functionality that
is directly related to b/l, notably the 'un/blank screen' method, and also
at initialization it would be very nice to turn on lcd and the backlight,
otherwise the user wouldn't see anything.
One possible solution would be to place the b/l pointers in the
'platform_data' field of the framebuffer device, but it's usable only for
platform devices, and even there not very handy (because the code registering
the framebuffer platform device would need to know about the b/l drivers, what
if b/l is a module that's not yet loaded?). In the case where devices are
registered by the bus enumerator the things are even worse.
After some discussion on IRC here's a slightly different proposal: During
framebuffer driver initialization it calls lcd_find_device(struct device*),
passing him the 'struct device' of the framebuffer device. The lcd or the
backlight driver looks inside the struct device (notably at the bus, bus_id
and other related fields) and compares them with whatever it expects them to
be (for example, a platform device-based lcd driver could compare
dev->bus_type with &platform_bus_type, a PCI driver could study the PCI device
ids and so on). And it returns either 0 (success) or -ENODEV (failure).
Reasoning: There isn't any static way to find out which b/l device corresponds
to a given framebuffer device. This is something that only the b/l driver
knows. For example, the b/l controls for a PCI video card could be embedded
into the PCI card; for palmtops they are implemented absolutely differently
(e.g. through auxiliary GPIOs, controlled by unrelated ASICs and so on). So
deciding the correspondence between the b/l driver and the framebuffer device
is the responsability of b/l driver: there is simply no other driver that
knows that.
If you'll ask why not embed the b/l controls directly into the framebuffer
drivers, the reason is simple: some video controllers just don't have a
predefined way of controlling the b/l, so in every implementation it's
different. Example: many PDAs use the PXA2xx CPU embedded video controller
(drivers/video/pxafb.c), but every PDA has his own way of controlling the
backlight and lcd. So the only solution here is to make pxafb ask "who knows
how to handle the backlight/lcd for *this* device" and get a pointer to the
b/l drivers.
--
Greetings,
Andrew
next prev parent reply other threads:[~2004-06-26 20:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-17 18:35 Andrew Zabolotny
2004-06-17 19:47 ` Greg KH
2004-06-17 21:55 ` Andrew Zabolotny
2004-06-17 22:05 ` Greg KH
2004-06-18 5:55 ` Andrew Zabolotny
2004-06-24 21:34 ` Greg KH
2004-06-26 20:21 ` Andrew Zabolotny [this message]
2004-07-14 6:11 ` Greg KH
2004-07-14 19:14 ` Andrew Zabolotny
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=20040627002152.20e2da7d.zap@homelink.ru \
--to=zap@homelink.ru \
--cc=greg@kroah.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®