1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-01 05:45:45 +00:00

- Do not search for Linux-specific hald-addon-acpi module.

- Remove unnecessary ioctl calls for battery on non-laptops.
- Do not use model-specific sysctl if it is not available.
- Always provide frequencies of BSP as we do not export APs' yet.

Reviewed by:	marcus
This commit is contained in:
Jung-uk Kim 2009-02-02 22:33:22 +00:00
parent dc2795b91d
commit 28e9540211
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=227471
4 changed files with 73 additions and 5 deletions

View File

@ -8,7 +8,7 @@
PORTNAME= hal
DISTVERSION= 0.5.11
PORTREVISION= 15
PORTREVISION= 16
CATEGORIES= sysutils
MASTER_SITES= http://hal.freedesktop.org/releases/

View File

@ -0,0 +1,13 @@
--- fdi/policy/10osvendor/10-power-mgmt-policy.fdi.orig 2008-05-07 19:21:15.000000000 -0400
+++ fdi/policy/10osvendor/10-power-mgmt-policy.fdi 2009-01-30 17:41:05.000000000 -0500
@@ -10,7 +10,9 @@
<device>
<match key="power_management.type" string="acpi">
- <append key="info.addons" type="strlist">hald-addon-acpi</append>
+ <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" string="Linux">
+ <append key="info.addons" type="strlist">hald-addon-acpi</append>
+ </match>
</match>
</device>

View File

@ -0,0 +1,31 @@
--- hald/freebsd/hf-acpi.c.orig 2008-05-07 19:23:59.000000000 -0400
+++ hald/freebsd/hf-acpi.c 2009-01-30 15:53:14.000000000 -0500
@@ -105,6 +105,9 @@ hf_acpi_poll_batt (HalDevice *device)
gboolean ispresent;
union acpi_battery_ioctl_arg battif, battst, battinfo;
+ if (! hf_has_sysctl("hw.acpi.battery"))
+ return;
+
battif.unit = battst.unit = battinfo.unit =
hal_device_property_get_int(device, "freebsd.unit");
@@ -504,6 +507,8 @@ hf_acpi_laptop_panel_new (HalDevice *par
g_return_val_if_fail(HAL_IS_DEVICE(parent), NULL);
+ if (! hf_has_sysctl("hw.acpi.%s", access))
+ return NULL;
device = hf_device_new(parent);
hf_device_property_set_string_printf(device, "info.product", "Laptop Panel (%s)", name);
@@ -597,7 +602,8 @@ hf_acpi_probe (void)
laptop_panel_types[i].max_sysctl,
laptop_panel_types[i].access,
laptop_panel_types[i].name);
- hf_device_preprobe_and_add(panel_device);
+ if (panel_device)
+ hf_device_preprobe_and_add(panel_device);
}
}
}

View File

@ -1,6 +1,30 @@
--- hald/freebsd/hf-devtree.c.orig 2008-05-07 19:24:03.000000000 -0400
+++ hald/freebsd/hf-devtree.c 2009-01-25 17:17:02.000000000 -0500
@@ -426,7 +426,13 @@ hf_devtree_probe (void)
+++ hald/freebsd/hf-devtree.c 2009-01-30 14:30:57.000000000 -0500
@@ -86,7 +86,11 @@ hf_devtree_cpu_can_throttle (int cpu)
gboolean can = FALSE;
char *levels;
+#ifdef notyet
levels = hf_get_string_sysctl(NULL, "dev.cpu.%i.freq_levels", cpu);
+#else
+ levels = hf_get_string_sysctl(NULL, "dev.cpu.0.freq_levels");
+#endif
if (levels)
{
char **toks;
@@ -109,7 +113,11 @@ hf_devtree_cpu_get_maxfreq (int cpu)
char *levels;
int freq = -1;
+#ifdef notyet
levels = hf_get_string_sysctl(NULL, "dev.cpu.%i.freq_levels", cpu);
+#else
+ levels = hf_get_string_sysctl(NULL, "dev.cpu.0.freq_levels");
+#endif
if (levels)
{
sscanf(levels, "%i/", &freq);
@@ -426,7 +434,13 @@ hf_devtree_probe (void)
HalDevice *device;
device = hf_devtree_device_new(parent, info->handler, info->unit);
@ -15,7 +39,7 @@
}
devices = g_slist_delete_link(devices, root);
@@ -434,6 +440,17 @@ hf_devtree_probe (void)
@@ -434,6 +448,17 @@ hf_devtree_probe (void)
}
}
@ -33,7 +57,7 @@
HalDevice *
hf_devtree_find_from_name (HalDeviceStore *store, const char *name)
{
@@ -597,5 +614,6 @@ hf_devtree_is_driver (const char *name,
@@ -597,5 +622,6 @@ hf_devtree_is_driver (const char *name,
}
HFHandler hf_devtree_handler = {