Skip to content

Commit 314c6e2

Browse files
committed
Merge branches 'acpica', 'acpi-ec', 'acpi-pmic' and 'acpi-video'
Merge assorted fixes and cleanups and one new backlight quirk list item for 5.16-rc1. * acpica: ACPI: Drop ACPI_USE_BUILTIN_STDARG ifdef from acgcc.h * acpi-ec: ACPI: EC: Remove initialization of static variables to false ACPI: EC: Use ec_no_wakeup on HP ZHAN 66 Pro * acpi-pmic: ACPI: PMIC: Fix intel_pmic_regs_handler() read accesses * acpi-video: ACPI: video: use platform backlight driver on Xiaomi Mi Pad 2 ACPI: video: Drop dmi_system_id.ident settings from video_detect_dmi_table[]
5 parents 2c49dab + 63b0a7b + 69cace6 + 009a789 + 60e6655 commit 314c6e2

File tree

4 files changed

+80
-73
lines changed

4 files changed

+80
-73
lines changed

drivers/acpi/ec.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static unsigned int ec_storm_threshold __read_mostly = 8;
133133
module_param(ec_storm_threshold, uint, 0644);
134134
MODULE_PARM_DESC(ec_storm_threshold, "Maxim false GPE numbers not considered as GPE storm");
135135

136-
static bool ec_freeze_events __read_mostly = false;
136+
static bool ec_freeze_events __read_mostly;
137137
module_param(ec_freeze_events, bool, 0644);
138138
MODULE_PARM_DESC(ec_freeze_events, "Disabling event handling during suspend/resume");
139139

@@ -177,7 +177,7 @@ struct acpi_ec *first_ec;
177177
EXPORT_SYMBOL(first_ec);
178178

179179
static struct acpi_ec *boot_ec;
180-
static bool boot_ec_is_ecdt = false;
180+
static bool boot_ec_is_ecdt;
181181
static struct workqueue_struct *ec_wq;
182182
static struct workqueue_struct *ec_query_wq;
183183

@@ -2152,6 +2152,13 @@ static const struct dmi_system_id acpi_ec_no_wakeup[] = {
21522152
DMI_MATCH(DMI_PRODUCT_FAMILY, "ThinkPad X1 Yoga 3rd"),
21532153
},
21542154
},
2155+
{
2156+
.ident = "HP ZHAN 66 Pro",
2157+
.matches = {
2158+
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
2159+
DMI_MATCH(DMI_PRODUCT_FAMILY, "103C_5336AN HP ZHAN 66 Pro"),
2160+
},
2161+
},
21552162
{ },
21562163
};
21572164

drivers/acpi/pmic/intel_pmic.c

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -211,31 +211,36 @@ static acpi_status intel_pmic_regs_handler(u32 function,
211211
void *handler_context, void *region_context)
212212
{
213213
struct intel_pmic_opregion *opregion = region_context;
214-
int result = 0;
214+
int result = -EINVAL;
215+
216+
if (function == ACPI_WRITE) {
217+
switch (address) {
218+
case 0:
219+
return AE_OK;
220+
case 1:
221+
opregion->ctx.addr |= (*value64 & 0xff) << 8;
222+
return AE_OK;
223+
case 2:
224+
opregion->ctx.addr |= *value64 & 0xff;
225+
return AE_OK;
226+
case 3:
227+
opregion->ctx.val = *value64 & 0xff;
228+
return AE_OK;
229+
case 4:
230+
if (*value64) {
231+
result = regmap_write(opregion->regmap, opregion->ctx.addr,
232+
opregion->ctx.val);
233+
} else {
234+
result = regmap_read(opregion->regmap, opregion->ctx.addr,
235+
&opregion->ctx.val);
236+
}
237+
opregion->ctx.addr = 0;
238+
}
239+
}
215240

216-
switch (address) {
217-
case 0:
218-
return AE_OK;
219-
case 1:
220-
opregion->ctx.addr |= (*value64 & 0xff) << 8;
221-
return AE_OK;
222-
case 2:
223-
opregion->ctx.addr |= *value64 & 0xff;
241+
if (function == ACPI_READ && address == 3) {
242+
*value64 = opregion->ctx.val;
224243
return AE_OK;
225-
case 3:
226-
opregion->ctx.val = *value64 & 0xff;
227-
return AE_OK;
228-
case 4:
229-
if (*value64) {
230-
result = regmap_write(opregion->regmap, opregion->ctx.addr,
231-
opregion->ctx.val);
232-
} else {
233-
result = regmap_read(opregion->regmap, opregion->ctx.addr,
234-
&opregion->ctx.val);
235-
if (result == 0)
236-
*value64 = opregion->ctx.val;
237-
}
238-
memset(&opregion->ctx, 0x00, sizeof(opregion->ctx));
239244
}
240245

241246
if (result < 0) {

0 commit comments

Comments
 (0)