Skip to content

Commit 3d730ee

Browse files
schaecsnrafaeljw
authored andcommitted
ACPI: AC: Quirk GK45 to skip reading _PSR
Let GK45 not go into BIOS for determining the AC power state. The BIOS wrongly returns 0, so hardcode the power state to 1. The mini PC GK45 by Besstar Tech Lld. (aka Kodlix) just runs off AC. It does not include any batteries. Nevertheless BIOS reports AC off: root@kodlix:/usr/src/linux# cat /sys/class/power_supply/ADP1/online 0 root@kodlix:/usr/src/linux# modprobe acpi_dbg root@kodlix:/usr/src/linux# tools/power/acpi/acpidbg - find _PSR \_SB.PCI0.SBRG.H_EC.ADP1._PSR Method 000000009283cee8 001 Args 0 Len 001C Aml 00000000f54e5f67 - execute \_SB.PCI0.SBRG.H_EC.ADP1._PSR Evaluating \_SB.PCI0.SBRG.H_EC.ADP1._PSR Evaluation of \_SB.PCI0.SBRG.H_EC.ADP1._PSR returned object 00000000dc08c187, external buffer length 18 [Integer] = 0000000000000000 that should be [Integer] = 0000000000000001 Signed-off-by: Stefan Schaeckeler <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 3906fe9 commit 3d730ee

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

drivers/acpi/ac.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);
6161

6262
static int ac_sleep_before_get_state_ms;
6363
static int ac_check_pmic = 1;
64+
static int ac_only;
6465

6566
static struct acpi_driver acpi_ac_driver = {
6667
.name = "ac",
@@ -93,6 +94,11 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
9394
if (!ac)
9495
return -EINVAL;
9596

97+
if (ac_only) {
98+
ac->state = 1;
99+
return 0;
100+
}
101+
96102
status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL,
97103
&ac->state);
98104
if (ACPI_FAILURE(status)) {
@@ -200,6 +206,12 @@ static int __init ac_do_not_check_pmic_quirk(const struct dmi_system_id *d)
200206
return 0;
201207
}
202208

209+
static int __init ac_only_quirk(const struct dmi_system_id *d)
210+
{
211+
ac_only = 1;
212+
return 0;
213+
}
214+
203215
/* Please keep this list alphabetically sorted */
204216
static const struct dmi_system_id ac_dmi_table[] __initconst = {
205217
{
@@ -209,6 +221,13 @@ static const struct dmi_system_id ac_dmi_table[] __initconst = {
209221
DMI_MATCH(DMI_PRODUCT_NAME, "EF20EA"),
210222
},
211223
},
224+
{
225+
/* Kodlix GK45 returning incorrect state */
226+
.callback = ac_only_quirk,
227+
.matches = {
228+
DMI_MATCH(DMI_PRODUCT_NAME, "GK45"),
229+
},
230+
},
212231
{
213232
/* Lenovo Ideapad Miix 320, AXP288 PMIC, separate fuel-gauge */
214233
.callback = ac_do_not_check_pmic_quirk,

0 commit comments

Comments
 (0)