Linux ACPI
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: lenb@kernel.org
Cc: linux-acpi@vger.kernel.org, Zhang Rui <rui.zhang@intel.com>
Subject: [PATCH 1/5] Show the physical device node of backlight class device.
Date: Mon, 22 Jun 2009 11:31:14 +0800	[thread overview]
Message-ID: <1245641478-31805-1-git-send-email-rui.zhang@intel.com> (raw)
In-Reply-To: <n>

Create symbol link from backlight class device to ACPI video device.

More and more laptops are shipped with multiple ACPI
video devices, while we export only one of them to userspace.

With this patch applied, we can know which ACPI video device
is used by "cat /sys/class/backlight/acpi_video0/device/path".

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/acpi/video.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 1bdfb37..9de143a 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -976,6 +976,11 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
 		device->backlight->props.max_brightness = device->brightness->count-3;
 		kfree(name);
 
+		result = sysfs_create_link(&device->backlight->dev.kobj,
+					   &device->dev->dev.kobj, "device");
+		if (result)
+			printk(KERN_ERR PREFIX "Create sysfs link\n");
+
 		device->cdev = thermal_cooling_device_register("LCD",
 					device->dev, &video_cooling_ops);
 		if (IS_ERR(device->cdev))
@@ -1990,6 +1995,7 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
 	status = acpi_remove_notify_handler(device->dev->handle,
 					    ACPI_DEVICE_NOTIFY,
 					    acpi_video_device_notify);
+	sysfs_remove_link(&device->backlight->dev.kobj, "device");
 	backlight_device_unregister(device->backlight);
 	if (device->cdev) {
 		sysfs_remove_link(&device->dev->dev.kobj,
-- 
1.5.4.4


             reply	other threads:[~2009-06-22  3:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-22  3:31 Zhang Rui [this message]
2009-06-22  3:31 ` [PATCH 2/5] fix a deadlock in hotplug case Zhang Rui
2009-06-22  3:31   ` [PATCH 3/5] run ACPI device hot removal in kacpi_hotplug_wq Zhang Rui
2009-06-22  3:31     ` [PATCH 4/5] disable Vista compatibility on some sony laptops Zhang Rui
2009-06-22  3:31       ` [PATCH 5/5] ACPI: video: DMI workaround broken Acer 7720 BIOS enabling display brightness Zhang Rui
2009-06-24  3:41         ` Len Brown
2009-06-24  3:41       ` [PATCH 4/5] disable Vista compatibility on some sony laptops Len Brown
2009-06-24  3:41     ` [PATCH 3/5] run ACPI device hot removal in kacpi_hotplug_wq Len Brown
2009-06-22 21:54   ` [PATCH 2/5] fix a deadlock in hotplug case Bjorn Helgaas
2009-06-23  2:20     ` Zhang Rui
2009-06-23 21:59       ` Bjorn Helgaas
2009-06-24  3:24         ` Len Brown
2009-06-24  3:24 ` [PATCH 1/5] Show the physical device node of backlight class device Len Brown

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=1245641478-31805-1-git-send-email-rui.zhang@intel.com \
    --to=rui.zhang@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@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