summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <hughsient@gmail.com>2006-02-18 23:11:23 +0000
committerRichard Hughes <hughsient@gmail.com>2006-02-18 23:11:23 +0000
commitc853f7185b36309ff20ee96d5620553393f60f29 (patch)
treeaba7a1e91bd22b0a3557437c6d19ff38d107243f
parent7bfffce13d63abd3290a05621553ff6b60133c20 (diff)
add handler for omnibook displays.
Add omnibook support. don't prepend the acpi/ here as the new omnibook isn't under /proc/acpi. See http://bugzilla.gnome.org/show_bug.cgi?id=331458 for details.
-rw-r--r--ChangeLog12
-rw-r--r--hald/linux2/acpi.c28
-rwxr-xr-xtools/hal-system-lcd-get-brightness4
-rwxr-xr-xtools/hal-system-lcd-set-brightness4
4 files changed, 42 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index d8ea2241..1c49f889 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2006-02-18 Richard Hughes <richard@hughsie.com>
+ * hald/linux2/acpi.c (laptop_panel_refresh,
+ acpi_synthesize_hotplug_events): add handler for omnibook displays.
+
+ * tools/hal-system-lcd-get-brightness,
+ tools/hal-system-lcd-set-brightness: Add omnibook support.
+
+ * hald/linux2/acpi.c (acpi_synthesize_display): don't prepend the
+ acpi/ here as the new omnibook isn't under /proc/acpi.
+ See http://bugzilla.gnome.org/show_bug.cgi?id=331458 for details.
+
+2006-02-18 Richard Hughes <richard@hughsie.com>
+
* tools/Makefile.am: Move hal-system-power-pmu from bin to libexec
as it's only meant to be called by hal, not a user.
diff --git a/hald/linux2/acpi.c b/hald/linux2/acpi.c
index 972f3e17..8d8ad2b1 100644
--- a/hald/linux2/acpi.c
+++ b/hald/linux2/acpi.c
@@ -47,6 +47,7 @@ enum {
ACPI_TYPE_IBM_DISPLAY,
ACPI_TYPE_PANASONIC_DISPLAY,
ACPI_TYPE_SONY_DISPLAY,
+ ACPI_TYPE_OMNIBOOK_DISPLAY,
ACPI_TYPE_BUTTON
};
@@ -693,6 +694,10 @@ laptop_panel_refresh (HalDevice *d, ACPIDevHandler *handler)
type = "sony";
desc = "Sony LCD Panel";
br_levels = 8;
+ } else if (acpi_type == ACPI_TYPE_OMNIBOOK_DISPLAY) {
+ type = "omnibook";
+ desc = "Omnibook LCD Panel";
+ br_levels = 8;
} else {
type = "unknown";
desc = "Unknown LCD Panel";
@@ -837,7 +842,7 @@ static void
acpi_synthesize_display (char *vendor, char *display, int method)
{
gchar path[HAL_PATH_MAX];
- snprintf (path, sizeof (path), "%s/acpi/%s/%s", get_hal_proc_path (), vendor, display);
+ snprintf (path, sizeof (path), "%s/%s/%s", get_hal_proc_path (), vendor, display);
/*
* We do not use acpi_synthesize as the target is not a directory full
* of directories, but a flat file list.
@@ -903,11 +908,13 @@ acpi_synthesize_hotplug_events (void)
* When the sysfs code comes into mainline, we can use that, but until
* then we can supply an abstracted interface to the user.
*/
- acpi_synthesize_display ("toshiba", "lcd", ACPI_TYPE_TOSHIBA_DISPLAY);
- acpi_synthesize_display ("asus", "brn", ACPI_TYPE_ASUS_DISPLAY);
- acpi_synthesize_display ("pcc", "brightness", ACPI_TYPE_PANASONIC_DISPLAY);
- acpi_synthesize_display ("ibm", "brightness", ACPI_TYPE_IBM_DISPLAY);
- acpi_synthesize_display ("sony", "brightness", ACPI_TYPE_SONY_DISPLAY);
+ acpi_synthesize_display ("acpi/toshiba", "lcd", ACPI_TYPE_TOSHIBA_DISPLAY);
+ acpi_synthesize_display ("acpi/asus", "brn", ACPI_TYPE_ASUS_DISPLAY);
+ acpi_synthesize_display ("acpi/pcc", "brightness", ACPI_TYPE_PANASONIC_DISPLAY);
+ acpi_synthesize_display ("acpi/ibm", "brightness", ACPI_TYPE_IBM_DISPLAY);
+ acpi_synthesize_display ("acpi/sony", "brightness", ACPI_TYPE_SONY_DISPLAY);
+ /* onmibook does not live under acpi GNOME#331458 */
+ acpi_synthesize_display ("omnibook", "lcd", ACPI_TYPE_OMNIBOOK_DISPLAY);
/* setup timer for things that we need to poll */
g_timeout_add (ACPI_POLL_INTERVAL,
@@ -1022,6 +1029,14 @@ static ACPIDevHandler acpidev_handler_laptop_panel_sony = {
.remove = acpi_generic_remove
};
+static ACPIDevHandler acpidev_handler_laptop_panel_omnibook = {
+ .acpi_type = ACPI_TYPE_OMNIBOOK_DISPLAY,
+ .add = acpi_generic_add,
+ .compute_udi = acpi_generic_compute_udi,
+ .refresh = laptop_panel_refresh,
+ .remove = acpi_generic_remove
+};
+
static ACPIDevHandler acpidev_handler_button = {
.acpi_type = ACPI_TYPE_BUTTON,
.add = acpi_generic_add,
@@ -1049,6 +1064,7 @@ static ACPIDevHandler *acpi_handlers[] = {
&acpidev_handler_laptop_panel_panasonic,
&acpidev_handler_laptop_panel_asus,
&acpidev_handler_laptop_panel_sony,
+ &acpidev_handler_laptop_panel_omnibook,
NULL
};
diff --git a/tools/hal-system-lcd-get-brightness b/tools/hal-system-lcd-get-brightness
index c7fd79a8..ab826670 100755
--- a/tools/hal-system-lcd-get-brightness
+++ b/tools/hal-system-lcd-get-brightness
@@ -54,6 +54,10 @@ elif [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "sony" ]; then
# 5
value="`cat $HAL_PROP_LINUX_ACPI_PATH`"
let "value = ${value} - 1"
+elif [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "omnibook" ]; then
+ # cat /proc/omnibook/lcd
+ # LCD brightness: 7
+ value="`cat $HAL_PROP_LINUX_ACPI_PATH | awk '{print $3;}'`"
else
echo "org.freedesktop.Hal.Device.LaptopPanel.NotSupported" >&2
echo "No ACPI method found" >&2
diff --git a/tools/hal-system-lcd-set-brightness b/tools/hal-system-lcd-set-brightness
index 686ecdd2..e70a6032 100755
--- a/tools/hal-system-lcd-set-brightness
+++ b/tools/hal-system-lcd-set-brightness
@@ -60,6 +60,10 @@ elif [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "sony" ]; then
# echo "{1..8}" > /proc/acpi/sony/brightness
# http://popies.net/sonypi/2.6-sony_acpi4.patch
echo "$value" > $HAL_PROP_LINUX_ACPI_PATH
+elif [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "omnibook" ]; then
+ # echo "{0..7}" > /proc/omnibook/lcd
+ # http://bugzilla.gnome.org/show_bug.cgi?id=331458
+ echo "$value" > $HAL_PROP_LINUX_ACPI_PATH
else
echo "org.freedesktop.Hal.Device.LaptopPanel.NotSupported" >&2
echo "No ACPI method found" >&2