Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63952
b: refs/heads/master
c: d8dd3cb
h: refs/heads/master
v: v3
  • Loading branch information
Len Brown committed Aug 12, 2007
1 parent 8bd1c06 commit 3d6bc42
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 44 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b5bfa1cbefdc6e4c60f30ed545389b5ffe0f75f
refs/heads/master: d8dd3cbcf1b30c315a28f65cb719bb2d7105a317
2 changes: 2 additions & 0 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ and is between 256 and 4096 characters. It is defined in the file
acpi_irq_isa= [HW,ACPI] If irq_balance, mark listed IRQs used by ISA
Format: <irq>,<irq>...

acpi_no_auto_ssdt [HW,ACPI] Disable automatic loading of SSDT

acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS
Format: To spoof as Windows 98: ="Microsoft Windows"

Expand Down
4 changes: 2 additions & 2 deletions trunk/Documentation/thinkpad-acpi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ The version of thinkpad-acpi's sysfs interface is exported by the driver
as a driver attribute (see below).

Sysfs driver attributes are on the driver's sysfs attribute space,
for 2.6.20 this is /sys/bus/platform/drivers/thinkpad-acpi/.
for 2.6.20 this is /sys/bus/platform/drivers/thinkpad_acpi/.

Sysfs device attributes are on the driver's sysfs attribute space,
for 2.6.20 this is /sys/devices/platform/thinkpad-acpi/.
for 2.6.20 this is /sys/devices/platform/thinkpad_acpi/.

Driver version
--------------
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/acpi/asus_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,7 @@ static int asus_hotk_get_info(void)
break;
default:
kfree(model);
model = NULL;
break;
}
}
Expand Down
47 changes: 17 additions & 30 deletions trunk/drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ struct acpi_battery_info {
acpi_string oem_info;
};

enum acpi_battery_files{
enum acpi_battery_files {
ACPI_BATTERY_INFO = 0,
ACPI_BATTERY_STATE,
ACPI_BATTERY_ALARM,
Expand All @@ -129,13 +129,14 @@ struct acpi_battery_flags {
};

struct acpi_battery {
struct mutex mutex;
struct acpi_device *device;
struct acpi_battery_flags flags;
struct acpi_buffer bif_data;
struct acpi_buffer bst_data;
struct mutex lock;
unsigned long alarm;
unsigned long update_time[ACPI_BATTERY_NUMFILES];

};

inline int acpi_battery_present(struct acpi_battery *battery)
Expand Down Expand Up @@ -235,10 +236,10 @@ static int acpi_battery_get_info(struct acpi_battery *battery)
return 0;

/* Evaluate _BIF */

status =
acpi_evaluate_object(acpi_battery_handle(battery), "_BIF", NULL,
&buffer);
mutex_lock(&battery->lock);
status = acpi_evaluate_object(acpi_battery_handle(battery), "_BIF",
NULL, &buffer);
mutex_unlock(&battery->lock);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF"));
return -ENODEV;
Expand Down Expand Up @@ -285,10 +286,10 @@ static int acpi_battery_get_state(struct acpi_battery *battery)
return 0;

/* Evaluate _BST */

status =
acpi_evaluate_object(acpi_battery_handle(battery), "_BST", NULL,
&buffer);
mutex_lock(&battery->lock);
status = acpi_evaluate_object(acpi_battery_handle(battery), "_BST",
NULL, &buffer);
mutex_unlock(&battery->lock);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST"));
return -ENODEV;
Expand Down Expand Up @@ -336,9 +337,10 @@ static int acpi_battery_set_alarm(struct acpi_battery *battery,

arg0.integer.value = alarm;

status =
acpi_evaluate_object(acpi_battery_handle(battery), "_BTP",
mutex_lock(&battery->lock);
status = acpi_evaluate_object(acpi_battery_handle(battery), "_BTP",
&arg_list, NULL);
mutex_unlock(&battery->lock);
if (ACPI_FAILURE(status))
return -ENODEV;

Expand Down Expand Up @@ -658,8 +660,6 @@ acpi_battery_write_alarm(struct file *file,
if (!battery || (count > sizeof(alarm_string) - 1))
return -EINVAL;

mutex_lock(&battery->mutex);

result = acpi_battery_update(battery, 1, &update_result);
if (result) {
result = -ENODEV;
Expand Down Expand Up @@ -688,9 +688,7 @@ acpi_battery_write_alarm(struct file *file,
acpi_battery_check_result(battery, result);

if (!result)
result = count;

mutex_unlock(&battery->mutex);
return count;

return result;
}
Expand All @@ -714,8 +712,6 @@ static int acpi_battery_read(int fid, struct seq_file *seq)
int update_result = ACPI_BATTERY_NONE_UPDATE;
int update = 0;

mutex_lock(&battery->mutex);

update = (get_seconds() - battery->update_time[fid] >= update_time);
update = (update | battery->flags.update[fid]);

Expand All @@ -733,7 +729,6 @@ static int acpi_battery_read(int fid, struct seq_file *seq)
result = acpi_read_funcs[fid].print(seq, result);
acpi_battery_check_result(battery, result);
battery->flags.update[fid] = result;
mutex_unlock(&battery->mutex);
return result;
}

Expand Down Expand Up @@ -897,10 +892,7 @@ static int acpi_battery_add(struct acpi_device *device)
if (!battery)
return -ENOMEM;

mutex_init(&battery->mutex);

mutex_lock(&battery->mutex);

mutex_init(&battery->lock);
battery->device = device;
strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME);
strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS);
Expand Down Expand Up @@ -936,7 +928,6 @@ static int acpi_battery_add(struct acpi_device *device)
kfree(battery);
}

mutex_unlock(&battery->mutex);

return result;
}
Expand All @@ -951,8 +942,6 @@ static int acpi_battery_remove(struct acpi_device *device, int type)

battery = acpi_driver_data(device);

mutex_lock(&battery->mutex);

status = acpi_remove_notify_handler(device->handle,
ACPI_ALL_NOTIFY,
acpi_battery_notify);
Expand All @@ -963,9 +952,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type)

kfree(battery->bst_data.pointer);

mutex_unlock(&battery->mutex);

mutex_destroy(&battery->mutex);
mutex_destroy(&battery->lock);

kfree(battery);

Expand Down
23 changes: 23 additions & 0 deletions trunk/drivers/acpi/tables/tbxface.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ ACPI_MODULE_NAME("tbxface")
/* Local prototypes */
static acpi_status acpi_tb_load_namespace(void);

static int no_auto_ssdt;

/*******************************************************************************
*
* FUNCTION: acpi_allocate_root_table
Expand Down Expand Up @@ -536,6 +538,10 @@ static acpi_status acpi_tb_load_namespace(void)

ACPI_INFO((AE_INFO, "Table DSDT replaced by host OS"));
acpi_tb_print_table_header(0, table);

if (no_auto_ssdt == 0) {
printk(KERN_WARNING "ACPI: DSDT override uses original SSDTs unless \"acpi_no_auto_ssdt\"");
}
}

status =
Expand Down Expand Up @@ -577,6 +583,11 @@ static acpi_status acpi_tb_load_namespace(void)
continue;
}

if (no_auto_ssdt) {
printk(KERN_WARNING "ACPI: SSDT ignored due to \"acpi_no_auto_ssdt\"\n");
continue;
}

/* Ignore errors while loading tables, get as many as possible */

(void)acpi_ut_release_mutex(ACPI_MTX_TABLES);
Expand Down Expand Up @@ -622,3 +633,15 @@ acpi_status acpi_load_tables(void)
}

ACPI_EXPORT_SYMBOL(acpi_load_tables)


static int __init acpi_no_auto_ssdt_setup(char *s) {

printk(KERN_NOTICE "ACPI: SSDT auto-load disabled\n");

no_auto_ssdt = 1;

return 1;
}

__setup("acpi_no_auto_ssdt", acpi_no_auto_ssdt_setup);
7 changes: 6 additions & 1 deletion trunk/drivers/char/sonypi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1147,10 +1147,15 @@ static int sonypi_acpi_remove(struct acpi_device *device, int type)
return 0;
}

const static struct acpi_device_id sonypi_device_ids[] = {
{"SNY6001", 0},
{"", 0},
};

static struct acpi_driver sonypi_acpi_driver = {
.name = "sonypi",
.class = "hkey",
.ids = "SNY6001",
.ids = sonypi_device_ids,
.ops = {
.add = sonypi_acpi_add,
.remove = sonypi_acpi_remove,
Expand Down
22 changes: 15 additions & 7 deletions trunk/drivers/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,22 @@ config THINKPAD_ACPI_BAY
config THINKPAD_ACPI_INPUT_ENABLED
bool "Enable input layer support by default"
depends on THINKPAD_ACPI
default y
default n
---help---
Enables hot key handling over the input layer by default. If unset,
the driver does not enable any hot key handling by default, and also
starts up with a mostly empty keymap.

If you are not sure, say Y here. Say N to retain the deprecated
behavior of ibm-acpi, and thinkpad-acpi for kernels up to 2.6.21.
This option enables thinkpad-acpi hot key handling over the input
layer at driver load time. When it is unset, the driver does not
enable hot key handling by default, and also starts up with a mostly
empty keymap.

This option should be enabled if you have a new enough HAL or other
userspace support that properly handles the thinkpad-acpi event
device. It auto-tunes the hot key support to those reported by the
firmware and enables it automatically.

If unsure, say N here to retain the old behaviour of ibm-acpi, and
thinkpad-acpi up to kernel 2.6.21: userspace will have to enable and
set up the thinkpad-acpi hot key handling using the sysfs interace
after loading the driver.


endif # MISC_DEVICES
7 changes: 6 additions & 1 deletion trunk/drivers/misc/sony-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ static struct sony_nc_event sony_C_events[] = {
};

/* SNC-only model map */
struct dmi_system_id sony_nc_ids[] = {
static struct dmi_system_id sony_nc_ids[] = {
{
.ident = "Sony Vaio FE Series",
.callback = sony_nc_C_enable,
Expand Down Expand Up @@ -942,6 +942,11 @@ static int sony_nc_resume(struct acpi_device *device)
}
}

/* set the last requested brightness level */
if (sony_backlight_device &&
!sony_backlight_update_status(sony_backlight_device))
printk(KERN_WARNING DRV_PFX "unable to restore brightness level");

/* re-initialize models with specific requirements */
dmi_check_system(sony_nc_ids);

Expand Down
10 changes: 8 additions & 2 deletions trunk/drivers/misc/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -4668,12 +4668,15 @@ static int __init thinkpad_acpi_module_init(void)
thinkpad_acpi_module_exit();
return ret;
}
tp_features.platform_drv_registered = 1;

ret = tpacpi_create_driver_attributes(&tpacpi_pdriver.driver);
if (ret) {
printk(IBM_ERR "unable to create sysfs driver attributes\n");
thinkpad_acpi_module_exit();
return ret;
}
tp_features.platform_drv_attrs_registered = 1;


/* Device initialization */
Expand Down Expand Up @@ -4756,8 +4759,11 @@ static void thinkpad_acpi_module_exit(void)
if (tpacpi_pdev)
platform_device_unregister(tpacpi_pdev);

tpacpi_remove_driver_attributes(&tpacpi_pdriver.driver);
platform_driver_unregister(&tpacpi_pdriver);
if (tp_features.platform_drv_attrs_registered)
tpacpi_remove_driver_attributes(&tpacpi_pdriver.driver);

if (tp_features.platform_drv_registered)
platform_driver_unregister(&tpacpi_pdriver);

if (proc_dir)
remove_proc_entry(IBM_PROC_DIR, acpi_root_dir);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/misc/thinkpad_acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ static struct {
u16 wan:1;
u16 fan_ctrl_status_undef:1;
u16 input_device_registered:1;
u16 platform_drv_registered:1;
u16 platform_drv_attrs_registered:1;
} tp_features;

struct thinkpad_id_data {
Expand Down

0 comments on commit 3d6bc42

Please sign in to comment.