Skip to content

Commit 0153d8e

Browse files
committed
Merge tag 'acpi-6.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more ACPI updates from Rafael Wysocki: "These add two ACPI-related quirks and extend support for Apple device properties supplied via ACPI _DSM. Specifics: - 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) - Add an ACPI device ID quirk for Lenovo Yoga Tablet 2 (Marius Hoch)" * tag 'acpi-6.4-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: property: Support strings in Apple _DSM props ACPI: x86: utils: Remove Lenovo Yoga Tablet 2's MAGN0001 ACPI: PM: Do not turn of unused power resources on the Toshiba Click Mini
2 parents 667de5c + 2e70a47 commit 0153d8e

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

drivers/acpi/power.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#define pr_fmt(fmt) "ACPI: PM: " fmt
2525

26+
#include <linux/dmi.h>
2627
#include <linux/kernel.h>
2728
#include <linux/module.h>
2829
#include <linux/init.h>
@@ -1022,13 +1023,31 @@ void acpi_resume_power_resources(void)
10221023
}
10231024
#endif
10241025

1026+
static const struct dmi_system_id dmi_leave_unused_power_resources_on[] = {
1027+
{
1028+
/*
1029+
* The Toshiba Click Mini has a CPR3 power-resource which must
1030+
* be on for the touchscreen to work, but which is not in any
1031+
* _PR? lists. The other 2 affected power-resources are no-ops.
1032+
*/
1033+
.matches = {
1034+
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1035+
DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE Click Mini L9W-B"),
1036+
},
1037+
},
1038+
{}
1039+
};
1040+
10251041
/**
10261042
* acpi_turn_off_unused_power_resources - Turn off power resources not in use.
10271043
*/
10281044
void acpi_turn_off_unused_power_resources(void)
10291045
{
10301046
struct acpi_power_resource *resource;
10311047

1048+
if (dmi_check_system(dmi_leave_unused_power_resources_on))
1049+
return;
1050+
10321051
mutex_lock(&power_resource_list_lock);
10331052

10341053
list_for_each_entry_reverse(resource, &acpi_power_resource_list, list_node) {

drivers/acpi/x86/apple.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,16 @@ void acpi_extract_apple_properties(struct acpi_device *adev)
7171

7272
if ( key->type != ACPI_TYPE_STRING ||
7373
(val->type != ACPI_TYPE_INTEGER &&
74-
val->type != ACPI_TYPE_BUFFER))
74+
val->type != ACPI_TYPE_BUFFER &&
75+
val->type != ACPI_TYPE_STRING))
7576
continue; /* skip invalid properties */
7677

7778
__set_bit(i, valid);
7879
newsize += key->string.length + 1;
7980
if ( val->type == ACPI_TYPE_BUFFER)
8081
newsize += val->buffer.length;
82+
else if (val->type == ACPI_TYPE_STRING)
83+
newsize += val->string.length + 1;
8184
}
8285

8386
numvalid = bitmap_weight(valid, numprops);
@@ -119,6 +122,12 @@ void acpi_extract_apple_properties(struct acpi_device *adev)
119122
newprops[v].type = val->type;
120123
if (val->type == ACPI_TYPE_INTEGER) {
121124
newprops[v].integer.value = val->integer.value;
125+
} else if (val->type == ACPI_TYPE_STRING) {
126+
newprops[v].string.length = val->string.length;
127+
newprops[v].string.pointer = free_space;
128+
memcpy(free_space, val->string.pointer,
129+
val->string.length);
130+
free_space += val->string.length + 1;
122131
} else {
123132
newprops[v].buffer.length = val->buffer.length;
124133
newprops[v].buffer.pointer = free_space;

drivers/acpi/x86/utils.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,16 @@ static const struct override_status_id override_status_ids[] = {
143143
DMI_EXACT_MATCH(DMI_BOARD_SERIAL, "Default string"),
144144
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"),
145145
}),
146+
147+
/*
148+
* The LSM303D on the Lenovo Yoga Tablet 2 series is present
149+
* as both ACCL0001 and MAGN0001. As we can only ever register an
150+
* i2c client for one of them, ignore MAGN0001.
151+
*/
152+
NOT_PRESENT_ENTRY_HID("MAGN0001", "1", ATOM_SILVERMONT, {
153+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
154+
DMI_MATCH(DMI_PRODUCT_FAMILY, "YOGATablet2"),
155+
}),
146156
};
147157

148158
bool acpi_device_override_status(struct acpi_device *adev, unsigned long long *status)

0 commit comments

Comments
 (0)