Skip to content

Commit

Permalink
Pull now into release branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Len Brown committed Jun 2, 2007
2 parents f285e3d + 6287ee3 commit fcf7535
Show file tree
Hide file tree
Showing 10 changed files with 125 additions and 112 deletions.
25 changes: 11 additions & 14 deletions Documentation/thinkpad-acpi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Hot keys
--------

procfs: /proc/acpi/ibm/hotkey
sysfs device attribute: hotkey/*
sysfs device attribute: hotkey_*

Without this driver, only the Fn-F4 key (sleep button) generates an
ACPI event. With the driver loaded, the hotkey feature enabled and the
Expand Down Expand Up @@ -196,30 +196,27 @@ The following commands can be written to the /proc/acpi/ibm/hotkey file:

sysfs notes:

The hot keys attributes are in a hotkey/ subdirectory off the
thinkpad device.

bios_enabled:
hotkey_bios_enabled:
Returns the status of the hot keys feature when
thinkpad-acpi was loaded. Upon module unload, the hot
key feature status will be restored to this value.

0: hot keys were disabled
1: hot keys were enabled

bios_mask:
hotkey_bios_mask:
Returns the hot keys mask when thinkpad-acpi was loaded.
Upon module unload, the hot keys mask will be restored
to this value.

enable:
hotkey_enable:
Enables/disables the hot keys feature, and reports
current status of the hot keys feature.

0: disables the hot keys feature / feature disabled
1: enables the hot keys feature / feature enabled

mask:
hotkey_mask:
bit mask to enable ACPI event generation for each hot
key (see above). Returns the current status of the hot
keys mask, and allows one to modify it.
Expand All @@ -229,7 +226,7 @@ Bluetooth
---------

procfs: /proc/acpi/ibm/bluetooth
sysfs device attribute: bluetooth/enable
sysfs device attribute: bluetooth_enable

This feature shows the presence and current state of a ThinkPad
Bluetooth device in the internal ThinkPad CDC slot.
Expand All @@ -244,15 +241,15 @@ If Bluetooth is installed, the following commands can be used:
Sysfs notes:

If the Bluetooth CDC card is installed, it can be enabled /
disabled through the "bluetooth/enable" thinkpad-acpi device
disabled through the "bluetooth_enable" thinkpad-acpi device
attribute, and its current status can also be queried.

enable:
0: disables Bluetooth / Bluetooth is disabled
1: enables Bluetooth / Bluetooth is enabled.

Note: this interface will be probably be superseeded by the
generic rfkill class.
generic rfkill class, so it is NOT to be considered stable yet.

Video output control -- /proc/acpi/ibm/video
--------------------------------------------
Expand Down Expand Up @@ -898,7 +895,7 @@ EXPERIMENTAL: WAN
-----------------

procfs: /proc/acpi/ibm/wan
sysfs device attribute: wwan/enable
sysfs device attribute: wwan_enable

This feature is marked EXPERIMENTAL because the implementation
directly accesses hardware registers and may not work as expected. USE
Expand All @@ -921,15 +918,15 @@ If the W-WAN card is installed, the following commands can be used:
Sysfs notes:

If the W-WAN card is installed, it can be enabled /
disabled through the "wwan/enable" thinkpad-acpi device
disabled through the "wwan_enable" thinkpad-acpi device
attribute, and its current status can also be queried.

enable:
0: disables WWAN card / WWAN card is disabled
1: enables WWAN card / WWAN card is enabled.

Note: this interface will be probably be superseeded by the
generic rfkill class.
generic rfkill class, so it is NOT to be considered stable yet.

Multiple Commands, Module Parameters
------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int node_to_pxm(int node)
return node_to_pxm_map[node];
}

int __cpuinit acpi_map_pxm_to_node(int pxm)
int acpi_map_pxm_to_node(int pxm)
{
int node = pxm_to_node_map[pxm];

Expand Down
8 changes: 4 additions & 4 deletions drivers/acpi/tables/tbinstal.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc,
}
}

/* The table must be either an SSDT or a PSDT */
/* The table must be either an SSDT or a PSDT or an OEMx */

if ((!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_PSDT))
&&
(!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT)))
{
(!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT))
&& (strncmp(table_desc->pointer->signature, "OEM", 3))) {
ACPI_ERROR((AE_INFO,
"Table has invalid signature [%4.4s], must be SSDT or PSDT",
"Table has invalid signature [%4.4s], must be SSDT, PSDT or OEMx",
table_desc->pointer->signature));
return_ACPI_STATUS(AE_BAD_SIGNATURE);
}
Expand Down
13 changes: 7 additions & 6 deletions drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file)
static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_thermal *tz = seq->private;
struct acpi_device *device;
int i = 0;
int j = 0;

Expand All @@ -849,9 +850,8 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
tz->trips.passive.tc1, tz->trips.passive.tc2,
tz->trips.passive.tsp);
for (j = 0; j < tz->trips.passive.devices.count; j++) {

seq_printf(seq, "0x%p ",
tz->trips.passive.devices.handles[j]);
acpi_bus_get_device(tz->trips.passive.devices.handles[j], &device);
seq_printf(seq, "%4.4s ", acpi_device_bid(device));
}
seq_puts(seq, "\n");
}
Expand All @@ -862,9 +862,10 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
seq_printf(seq, "active[%d]: %ld C: devices=",
i,
KELVIN_TO_CELSIUS(tz->trips.active[i].temperature));
for (j = 0; j < tz->trips.active[i].devices.count; j++)
seq_printf(seq, "0x%p ",
tz->trips.active[i].devices.handles[j]);
for (j = 0; j < tz->trips.active[i].devices.count; j++){
acpi_bus_get_device(tz->trips.active[i].devices.handles[j], &device);
seq_printf(seq, "%4.4s ", acpi_device_bid(device));
}
seq_puts(seq, "\n");
}

Expand Down
120 changes: 50 additions & 70 deletions drivers/acpi/utilities/utcopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ static acpi_status
acpi_ut_copy_esimple_to_isimple(union acpi_object *user_obj,
union acpi_operand_object **return_obj);

static acpi_status
acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object,
union acpi_operand_object **internal_object);

static acpi_status
acpi_ut_copy_simple_object(union acpi_operand_object *source_desc,
union acpi_operand_object *dest_desc);
Expand Down Expand Up @@ -518,77 +522,73 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
return_ACPI_STATUS(AE_NO_MEMORY);
}

#ifdef ACPI_FUTURE_IMPLEMENTATION
/* Code to convert packages that are parameters to control methods */

/*******************************************************************************
*
* FUNCTION: acpi_ut_copy_epackage_to_ipackage
*
* PARAMETERS: *internal_object - Pointer to the object we are returning
* *Buffer - Where the object is returned
* *space_used - Where the length of the object is returned
* PARAMETERS: external_object - The external object to be converted
* internal_object - Where the internal object is returned
*
* RETURN: Status
*
* DESCRIPTION: This function is called to place a package object in a user
* buffer. A package object by definition contains other objects.
*
* The buffer is assumed to have sufficient space for the object.
* The caller must have verified the buffer length needed using the
* acpi_ut_get_object_size function before calling this function.
* DESCRIPTION: Copy an external package object to an internal package.
* Handles nested packages.
*
******************************************************************************/

static acpi_status
acpi_ut_copy_epackage_to_ipackage(union acpi_operand_object *internal_object,
u8 * buffer, u32 * space_used)
acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object,
union acpi_operand_object **internal_object)
{
u8 *free_space;
union acpi_object *external_object;
u32 length = 0;
u32 this_index;
u32 object_space = 0;
union acpi_operand_object *this_internal_obj;
union acpi_object *this_external_obj;
acpi_status status = AE_OK;
union acpi_operand_object *package_object;
union acpi_operand_object **package_elements;
acpi_native_uint i;

ACPI_FUNCTION_TRACE(ut_copy_epackage_to_ipackage);

/*
* First package at head of the buffer
*/
external_object = (union acpi_object *)buffer;
/* Create the package object */

/*
* Free space begins right after the first package
*/
free_space = buffer + sizeof(union acpi_object);
package_object =
acpi_ut_create_package_object(external_object->package.count);
if (!package_object) {
return_ACPI_STATUS(AE_NO_MEMORY);
}

external_object->type = ACPI_GET_OBJECT_TYPE(internal_object);
external_object->package.count = internal_object->package.count;
external_object->package.elements = (union acpi_object *)free_space;
package_elements = package_object->package.elements;

/*
* Build an array of ACPI_OBJECTS in the buffer
* and move the free space past it
* Recursive implementation. Probably ok, since nested external packages
* as parameters should be very rare.
*/
free_space +=
external_object->package.count * sizeof(union acpi_object);
for (i = 0; i < external_object->package.count; i++) {
status =
acpi_ut_copy_eobject_to_iobject(&external_object->package.
elements[i],
&package_elements[i]);
if (ACPI_FAILURE(status)) {

/* Call walk_package */
/* Truncate package and delete it */

}
package_object->package.count = i;
package_elements[i] = NULL;
acpi_ut_remove_reference(package_object);
return_ACPI_STATUS(status);
}
}

#endif /* Future implementation */
*internal_object = package_object;
return_ACPI_STATUS(status);
}

/*******************************************************************************
*
* FUNCTION: acpi_ut_copy_eobject_to_iobject
*
* PARAMETERS: *internal_object - The external object to be converted
* *buffer_ptr - Where the internal object is returned
* PARAMETERS: external_object - The external object to be converted
* internal_object - Where the internal object is returned
*
* RETURN: Status - the status of the call
* RETURN: Status - the status of the call
*
* DESCRIPTION: Converts an external object to an internal object.
*
Expand All @@ -603,16 +603,10 @@ acpi_ut_copy_eobject_to_iobject(union acpi_object *external_object,
ACPI_FUNCTION_TRACE(ut_copy_eobject_to_iobject);

if (external_object->type == ACPI_TYPE_PACKAGE) {
/*
* Packages as external input to control methods are not supported,
*/
ACPI_ERROR((AE_INFO,
"Packages as parameters not implemented!"));

return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
}

else {
status =
acpi_ut_copy_epackage_to_ipackage(external_object,
internal_object);
} else {
/*
* Build a simple object (no nested objects)
*/
Expand Down Expand Up @@ -803,33 +797,19 @@ acpi_ut_copy_ielement_to_ielement(u8 object_type,
* Create and build the package object
*/
target_object =
acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE);
acpi_ut_create_package_object(source_object->package.count);
if (!target_object) {
return (AE_NO_MEMORY);
}

target_object->package.count = source_object->package.count;
target_object->common.flags = source_object->common.flags;

/*
* Create the object array
*/
target_object->package.elements =
ACPI_ALLOCATE_ZEROED(((acpi_size) source_object->package.
count + 1) * sizeof(void *));
if (!target_object->package.elements) {
status = AE_NO_MEMORY;
goto error_exit;
}
/* Pass the new package object back to the package walk routine */

/*
* Pass the new package object back to the package walk routine
*/
state->pkg.this_target_obj = target_object;

/*
* Store the object pointer in the parent package object
*/
/* Store the object pointer in the parent package object */

*this_target_ptr = target_object;
break;

Expand Down
42 changes: 42 additions & 0 deletions drivers/acpi/utilities/utobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,48 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name,
return_PTR(object);
}

/*******************************************************************************
*
* FUNCTION: acpi_ut_create_package_object
*
* PARAMETERS: Count - Number of package elements
*
* RETURN: Pointer to a new Package object, null on failure
*
* DESCRIPTION: Create a fully initialized package object
*
******************************************************************************/

union acpi_operand_object *acpi_ut_create_package_object(u32 count)
{
union acpi_operand_object *package_desc;
union acpi_operand_object **package_elements;

ACPI_FUNCTION_TRACE_U32(ut_create_package_object, count);

/* Create a new Package object */

package_desc = acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE);
if (!package_desc) {
return_PTR(NULL);
}

/*
* Create the element array. Count+1 allows the array to be null
* terminated.
*/
package_elements = ACPI_ALLOCATE_ZEROED((acpi_size)
(count + 1) * sizeof(void *));
if (!package_elements) {
ACPI_FREE(package_desc);
return_PTR(NULL);
}

package_desc->package.count = count;
package_desc->package.elements = package_elements;
return_PTR(package_desc);
}

/*******************************************************************************
*
* FUNCTION: acpi_ut_create_buffer_object
Expand Down
Loading

0 comments on commit fcf7535

Please sign in to comment.