summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2007-04-28 23:13:03 -0400
committerLen Brown <len.brown@intel.com>2007-04-28 23:13:03 -0400
commit14d21785885c018611efd8aa75a5c11eaea29087 (patch)
treea6c38d6a972d4ea614e09385bcb6e0106b4942cd
parent03feb0524660bcd890674d11d29a1873ca14d13c (diff)
parent62a6d7fd9bc1d85f9aae734c46234e88fa839db0 (diff)
Pull dock into release branch
-rw-r--r--drivers/acpi/dock.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 54a697f9aa1..4546bf873ae 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -29,6 +29,7 @@
#include <linux/notifier.h>
#include <linux/platform_device.h>
#include <linux/jiffies.h>
+#include <linux/stddef.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
@@ -667,6 +668,23 @@ static ssize_t write_undock(struct device *dev, struct device_attribute *attr,
}
DEVICE_ATTR(undock, S_IWUSR, NULL, write_undock);
+/*
+ * show_dock_uid - read method for "uid" file in sysfs
+ */
+static ssize_t show_dock_uid(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ unsigned long lbuf;
+ acpi_status status = acpi_evaluate_integer(dock_station->handle, "_UID", NULL, &lbuf);
+ if(ACPI_FAILURE(status)) {
+ return 0;
+ }
+ return snprintf(buf, PAGE_SIZE, "%lx\n", lbuf);
+}
+DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL);
+
+
+
/**
* dock_add - add a new dock station
* @handle: the dock station handle
@@ -715,6 +733,13 @@ static int dock_add(acpi_handle handle)
kfree(dock_station);
return ret;
}
+ ret = device_create_file(&dock_device.dev, &dev_attr_uid);
+ if (ret) {
+ printk("Error %d adding sysfs file\n", ret);
+ platform_device_unregister(&dock_device);
+ kfree(dock_station);
+ return ret;
+ }
/* Find dependent devices */
acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,