From: Zhang Rui <rui.zhang@intel.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: Linux ACPI <linux-acpi@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
Richard Purdie <rpurdie@rpsys.net>
Subject: Re: Backlight device class redesign
Date: Thu, 03 Dec 2009 16:01:14 +0800 [thread overview]
Message-ID: <1259827274.27069.50.camel@rzhang1-desktop> (raw)
In-Reply-To: <b170af450911291209o33ebfc36n850826e54096f3b4@mail.gmail.com>
On Mon, 2009-11-30 at 04:09 +0800, Rafał Miłecki wrote:
> W dniu 28 listopada 2009 01:30 użytkownik Rafał Miłecki
> <zajec5@gmail.com> napisał:
> > As discussed in http://marc.info/?t=124947671300008&r=1&w=2 we need to
> > redesign our backlight device class.
>
> I was trying to make it work this way:
> 1. Everytime register request comes, look for backlight_display with given name.
> 1. A. If needed, create new backlight_display
> 2. Add new device to devices list of backlight_display
> 3. Find best device on devices list of backlight_display
> 4. Register if under /sys/class/backlight/name_of_display
>
> This didn't work because of registering only the best device. Look at
> this code in drivers/acpi/video.c:
>
> device->backlight = backlight_device_register(name,
> NULL, device, &acpi_backlight_ops);
> (...)
> result = sysfs_create_link(&device->backlight->dev.kobj,
> &device->dev->dev.kobj, "device");
>
IMO, we should create one device for one display.
For example, device /sys/class/backlight/panel0 is created the first
time a backlight_ops for this display is registered.
And create the symbol link from the backlight class device to "physical
device" (device that invokes backlight_device_register) in the backlight
class device driver, if we really need it.
Remove and recreate a link pointing to the new physical device when the
backlight mode is changed.
thanks,
rui
> It expects device to be registered (have dev.kobj) after calling
> backlight_device_register.
>
> So in summary we just can not do lazy registration. Every device
> passed to backlight_device_register has to be registered in that
> function or never.
>
> So I think we have to register every device and just keep symlink
> /sys/class/backlight/display_name pointing best device. We could
> register devices in
> 1) /sys/class/backlight/.devicename (hidden)
> 2) some /sys/class/internal-usage/devicename
>
> Do you agree on this?
>
next prev parent reply other threads:[~2009-12-03 8:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-28 0:30 Rafał Miłecki
2009-11-28 10:30 ` Rafał Miłecki
2009-11-28 12:22 ` Henrique de Moraes Holschuh
2009-11-28 12:58 ` Rafał Miłecki
2009-11-28 17:21 ` Henrique de Moraes Holschuh
2009-11-29 20:09 ` Rafał Miłecki
2009-11-29 21:51 ` Rafał Miłecki
2009-11-29 21:51 ` Rafał Miłecki
2009-11-30 0:04 ` Henrique de Moraes Holschuh
2009-12-03 8:01 ` Zhang Rui [this message]
2009-12-03 10:52 ` Henrique de Moraes Holschuh
2009-12-04 1:50 ` Zhang Rui
2009-12-03 14:55 ` Matthew Garrett
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=1259827274.27069.50.camel@rzhang1-desktop \
--to=rui.zhang@intel.com \
--cc=hmh@hmh.eng.br \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
--cc=zajec5@gmail.com \
/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®