hal: Branch 'master'
David Zeuthen
david at kemper.freedesktop.org
Thu Mar 1 09:51:31 PST 2007
hald/linux/acpi.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
New commits:
diff-tree 5158e179937a70ebed6bc9436d00ffa37ff3707a (from f5b862f5690106bb3d5500b1091d12f089bae070)
Author: David Zeuthen <davidz at redhat.com>
Date: Thu Mar 1 12:51:27 2007 -0500
on Rescan() for ACPI batteries, retrieve all properties (slow path)
This is needed for hibernation where we don't get events on thaw that
the some battery might have been removed. Pointed out by Peter Jones
<pjones at redhat.com>.
diff --git a/hald/linux/acpi.c b/hald/linux/acpi.c
index 30e5fdf..414165c 100644
--- a/hald/linux/acpi.c
+++ b/hald/linux/acpi.c
@@ -61,7 +61,7 @@ typedef struct ACPIDevHandler_s
HalDevice *(*add) (const gchar *acpi_path, HalDevice *parent, struct ACPIDevHandler_s *handler);
gboolean (*compute_udi) (HalDevice *d, struct ACPIDevHandler_s *handler);
gboolean (*remove) (HalDevice *d, struct ACPIDevHandler_s *handler);
- gboolean (*refresh) (HalDevice *d, struct ACPIDevHandler_s *handler);
+ gboolean (*refresh) (HalDevice *d, struct ACPIDevHandler_s *handler, gboolean force_full_refresh);
} ACPIDevHandler;
/**
@@ -385,7 +385,7 @@ acpi_poll (gpointer data)
}
static gboolean
-ac_adapter_refresh (HalDevice *d, ACPIDevHandler *handler)
+ac_adapter_refresh (HalDevice *d, ACPIDevHandler *handler, gboolean force_full_refresh)
{
const char *path;
path = hal_device_property_get_string (d, "linux.acpi_path");
@@ -606,7 +606,7 @@ battery_refresh_add (HalDevice *d, const
* Refresh the battery device information.
*/
static gboolean
-battery_refresh (HalDevice *d, ACPIDevHandler *handler)
+battery_refresh (HalDevice *d, ACPIDevHandler *handler, gboolean force_full_refresh)
{
const char *path;
@@ -636,7 +636,7 @@ battery_refresh (HalDevice *d, ACPIDevHa
* /proc/acpi/battery/BAT%d/[info|state] so don't read
* static data that won't change
*/
- if (!hal_device_has_property (d, "battery.vendor")) {
+ if (force_full_refresh || !hal_device_has_property (d, "battery.vendor")) {
/* battery has no information, so coldplug */
battery_refresh_add (d, path);
}
@@ -715,7 +715,7 @@ get_processor_model_name (gint proc_num)
}
static gboolean
-processor_refresh (HalDevice *d, ACPIDevHandler *handler)
+processor_refresh (HalDevice *d, ACPIDevHandler *handler, gboolean force_full_refresh)
{
const char *path;
@@ -749,7 +749,7 @@ processor_refresh (HalDevice *d, ACPIDev
}
static gboolean
-fan_refresh (HalDevice *d, ACPIDevHandler *handler)
+fan_refresh (HalDevice *d, ACPIDevHandler *handler, gboolean force_full_refresh)
{
const char *path;
@@ -771,7 +771,7 @@ fan_refresh (HalDevice *d, ACPIDevHandle
* Using /proc/acpi/video does not work, this method is much more reliable.
*/
static gboolean
-laptop_panel_refresh (HalDevice *d, ACPIDevHandler *handler)
+laptop_panel_refresh (HalDevice *d, ACPIDevHandler *handler, gboolean force_full_refresh)
{
const char *path;
int acpi_type;
@@ -856,7 +856,7 @@ laptop_panel_refresh (HalDevice *d, ACPI
}
static gboolean
-button_refresh (HalDevice *d, ACPIDevHandler *handler)
+button_refresh (HalDevice *d, ACPIDevHandler *handler, gboolean force_full_refresh)
{
const char *path;
gchar *parent_path;
@@ -1133,7 +1133,7 @@ acpi_generic_add (const gchar *acpi_path
hal_device_property_set_string (d, "info.parent", hal_device_get_udi (parent));
else
hal_device_property_set_string (d, "info.parent", "/org/freedesktop/Hal/devices/computer");
- if (handler->refresh == NULL || !handler->refresh (d, handler)) {
+ if (handler->refresh == NULL || !handler->refresh (d, handler, FALSE)) {
g_object_unref (d);
d = NULL;
}
@@ -1413,7 +1413,7 @@ acpi_rescan_device (HalDevice *d)
handler = acpi_handlers[i];
if (handler->acpi_type == acpi_type) {
- return handler->refresh (d, handler);
+ return handler->refresh (d, handler, TRUE);
}
}
More information about the hal-commit
mailing list