Commit 2e70a47c authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'acpi-pm' and 'acpi-properties'

Merge an ACPI power management quirk and a change related to the
handling of ACPI device properties for 6.4-rc1:

 - Do not turn off unused power resources during initialization on the
   Toshiba Click Mini (Hans de Goede).

 - Support strings in device properties supplied by ACPI _DSM on Apple
   platforms (Hector Martin).

* acpi-pm:
  ACPI: PM: Do not turn of unused power resources on the Toshiba Click Mini

* acpi-properties:
  ACPI: property: Support strings in Apple _DSM props
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#define pr_fmt(fmt) "ACPI: PM: " fmt #define pr_fmt(fmt) "ACPI: PM: " fmt
#include <linux/dmi.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -1022,6 +1023,21 @@ void acpi_resume_power_resources(void) ...@@ -1022,6 +1023,21 @@ void acpi_resume_power_resources(void)
} }
#endif #endif
static const struct dmi_system_id dmi_leave_unused_power_resources_on[] = {
{
/*
* The Toshiba Click Mini has a CPR3 power-resource which must
* be on for the touchscreen to work, but which is not in any
* _PR? lists. The other 2 affected power-resources are no-ops.
*/
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE Click Mini L9W-B"),
},
},
{}
};
/** /**
* acpi_turn_off_unused_power_resources - Turn off power resources not in use. * acpi_turn_off_unused_power_resources - Turn off power resources not in use.
*/ */
...@@ -1029,6 +1045,9 @@ void acpi_turn_off_unused_power_resources(void) ...@@ -1029,6 +1045,9 @@ void acpi_turn_off_unused_power_resources(void)
{ {
struct acpi_power_resource *resource; struct acpi_power_resource *resource;
if (dmi_check_system(dmi_leave_unused_power_resources_on))
return;
mutex_lock(&power_resource_list_lock); mutex_lock(&power_resource_list_lock);
list_for_each_entry_reverse(resource, &acpi_power_resource_list, list_node) { list_for_each_entry_reverse(resource, &acpi_power_resource_list, list_node) {
......
...@@ -71,13 +71,16 @@ void acpi_extract_apple_properties(struct acpi_device *adev) ...@@ -71,13 +71,16 @@ void acpi_extract_apple_properties(struct acpi_device *adev)
if ( key->type != ACPI_TYPE_STRING || if ( key->type != ACPI_TYPE_STRING ||
(val->type != ACPI_TYPE_INTEGER && (val->type != ACPI_TYPE_INTEGER &&
val->type != ACPI_TYPE_BUFFER)) val->type != ACPI_TYPE_BUFFER &&
val->type != ACPI_TYPE_STRING))
continue; /* skip invalid properties */ continue; /* skip invalid properties */
__set_bit(i, valid); __set_bit(i, valid);
newsize += key->string.length + 1; newsize += key->string.length + 1;
if ( val->type == ACPI_TYPE_BUFFER) if ( val->type == ACPI_TYPE_BUFFER)
newsize += val->buffer.length; newsize += val->buffer.length;
else if (val->type == ACPI_TYPE_STRING)
newsize += val->string.length + 1;
} }
numvalid = bitmap_weight(valid, numprops); numvalid = bitmap_weight(valid, numprops);
...@@ -119,6 +122,12 @@ void acpi_extract_apple_properties(struct acpi_device *adev) ...@@ -119,6 +122,12 @@ void acpi_extract_apple_properties(struct acpi_device *adev)
newprops[v].type = val->type; newprops[v].type = val->type;
if (val->type == ACPI_TYPE_INTEGER) { if (val->type == ACPI_TYPE_INTEGER) {
newprops[v].integer.value = val->integer.value; newprops[v].integer.value = val->integer.value;
} else if (val->type == ACPI_TYPE_STRING) {
newprops[v].string.length = val->string.length;
newprops[v].string.pointer = free_space;
memcpy(free_space, val->string.pointer,
val->string.length);
free_space += val->string.length + 1;
} else { } else {
newprops[v].buffer.length = val->buffer.length; newprops[v].buffer.length = val->buffer.length;
newprops[v].buffer.pointer = free_space; newprops[v].buffer.pointer = free_space;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment