64
65
#define HF_ACPI_FUJITSU_MAX_LEVELS 8
65
66
/* NOTE: Each new type must also be added to hf-devtree.c */
66
67
} laptop_panel_types[] = {
69
"dev.acpi_ibm.0.lcd_brightness",
68
71
HF_ACPI_IBM_MAX_LEVELS },
69
{ "toshiba", "Toshiba", NULL,
72
{ "toshiba", "Toshiba",
73
"hw.acpi.toshiba.lcd_brightness",
70
75
HF_ACPI_TOSHIBA_MAX_LEVELS },
71
{ "sony", "Sony", NULL,
77
"dev.acpi_sony.0.brightness",
72
79
HF_ACPI_SONY_MAX_LEVELS },
73
{ "panasonic", "Panasonic", "hw.acpi.panasonic.lcd_brightness_max",
80
{ "panasonic", "Panasonic",
81
"hw.acpi.panasonic.lcd_brightness",
82
"hw.acpi.panasonic.lcd_brightness_max",
74
83
HF_ACPI_PANASONIC_MAX_LEVELS },
75
{ "asus", "Asus", NULL,
85
"hw.acpi.asus.lcd_brightness",
76
87
HF_ACPI_ASUS_MAX_LEVELS },
77
{ "fujitsu", "Fujitsu", NULL,
88
{ "fujitsu", "Fujitsu",
89
"hw.acpi.fujitsu.lcd_brightness",
78
91
HF_ACPI_FUJITSU_MAX_LEVELS }
105
118
gboolean ispresent;
106
119
union acpi_battery_ioctl_arg battif, battst, battinfo;
121
if (! hf_has_sysctl("hw.acpi.battery.units"))
108
124
battif.unit = battst.unit = battinfo.unit =
109
125
hal_device_property_get_int(device, "freebsd.unit");
498
514
static HalDevice *
499
515
hf_acpi_laptop_panel_new (HalDevice *parent, int max_levels,
500
const char *max_sysctl, const char *access,
516
const char *get_sysctl, const char *max_sysctl,
517
const char *access, const char *name)
503
519
HalDevice *device;
505
521
g_return_val_if_fail(HAL_IS_DEVICE(parent), NULL);
523
if (get_sysctl == NULL || ! hf_has_sysctl(get_sysctl))
507
525
device = hf_device_new(parent);
509
527
hf_device_property_set_string_printf(device, "info.product", "Laptop Panel (%s)", name);
593
611
HalDevice *panel_device;
595
613
panel_device = hf_acpi_laptop_panel_new(parent,
596
laptop_panel_types[i].max_levels,
614
laptop_panel_types[i].max_levels,
615
laptop_panel_types[i].get_sysctl,
597
616
laptop_panel_types[i].max_sysctl,
598
617
laptop_panel_types[i].access,
599
618
laptop_panel_types[i].name);
600
hf_device_preprobe_and_add(panel_device);
620
hf_device_preprobe_and_add(panel_device);