From patchwork Mon Jun 22 03:31:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Rui X-Patchwork-Id: 31695 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5M3UbIw016127 for ; Mon, 22 Jun 2009 03:30:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751636AbZFVDad (ORCPT ); Sun, 21 Jun 2009 23:30:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752730AbZFVDad (ORCPT ); Sun, 21 Jun 2009 23:30:33 -0400 Received: from mga11.intel.com ([192.55.52.93]:56781 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751636AbZFVDac (ORCPT ); Sun, 21 Jun 2009 23:30:32 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 21 Jun 2009 20:23:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.42,265,1243839600"; d="scan'208";a="701311600" Received: from rzhang-dt.sh.intel.com (HELO localhost.localdomain) ([10.239.36.94]) by fmsmga001.fm.intel.com with ESMTP; 21 Jun 2009 20:33:57 -0700 From: Zhang Rui To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, Zhang Rui Subject: [PATCH 1/5] Show the physical device node of backlight class device. Date: Mon, 22 Jun 2009 11:31:14 +0800 Message-Id: <1245641478-31805-1-git-send-email-rui.zhang@intel.com> X-Mailer: git-send-email 1.5.4.4 In-Reply-To: References: Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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 --- 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,