Skip to content

Commit

Permalink
Merge branches 'acpica', 'acpi-ec', 'acpi-pmic' and 'acpi-video'
Browse files Browse the repository at this point in the history
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[]
  • Loading branch information
rafaeljw committed Nov 10, 2021
5 parents 2c49dab + 63b0a7b + 69cace6 + 009a789 + 60e6655 commit 314c6e2
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 73 deletions.
11 changes: 9 additions & 2 deletions drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static unsigned int ec_storm_threshold __read_mostly = 8;
module_param(ec_storm_threshold, uint, 0644);
MODULE_PARM_DESC(ec_storm_threshold, "Maxim false GPE numbers not considered as GPE storm");

static bool ec_freeze_events __read_mostly = false;
static bool ec_freeze_events __read_mostly;
module_param(ec_freeze_events, bool, 0644);
MODULE_PARM_DESC(ec_freeze_events, "Disabling event handling during suspend/resume");

Expand Down Expand Up @@ -177,7 +177,7 @@ struct acpi_ec *first_ec;
EXPORT_SYMBOL(first_ec);

static struct acpi_ec *boot_ec;
static bool boot_ec_is_ecdt = false;
static bool boot_ec_is_ecdt;
static struct workqueue_struct *ec_wq;
static struct workqueue_struct *ec_query_wq;

Expand Down Expand Up @@ -2152,6 +2152,13 @@ static const struct dmi_system_id acpi_ec_no_wakeup[] = {
DMI_MATCH(DMI_PRODUCT_FAMILY, "ThinkPad X1 Yoga 3rd"),
},
},
{
.ident = "HP ZHAN 66 Pro",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
DMI_MATCH(DMI_PRODUCT_FAMILY, "103C_5336AN HP ZHAN 66 Pro"),
},
},
{ },
};

Expand Down
51 changes: 28 additions & 23 deletions drivers/acpi/pmic/intel_pmic.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,31 +211,36 @@ static acpi_status intel_pmic_regs_handler(u32 function,
void *handler_context, void *region_context)
{
struct intel_pmic_opregion *opregion = region_context;
int result = 0;
int result = -EINVAL;

if (function == ACPI_WRITE) {
switch (address) {
case 0:
return AE_OK;
case 1:
opregion->ctx.addr |= (*value64 & 0xff) << 8;
return AE_OK;
case 2:
opregion->ctx.addr |= *value64 & 0xff;
return AE_OK;
case 3:
opregion->ctx.val = *value64 & 0xff;
return AE_OK;
case 4:
if (*value64) {
result = regmap_write(opregion->regmap, opregion->ctx.addr,
opregion->ctx.val);
} else {
result = regmap_read(opregion->regmap, opregion->ctx.addr,
&opregion->ctx.val);
}
opregion->ctx.addr = 0;
}
}

switch (address) {
case 0:
return AE_OK;
case 1:
opregion->ctx.addr |= (*value64 & 0xff) << 8;
return AE_OK;
case 2:
opregion->ctx.addr |= *value64 & 0xff;
if (function == ACPI_READ && address == 3) {
*value64 = opregion->ctx.val;
return AE_OK;
case 3:
opregion->ctx.val = *value64 & 0xff;
return AE_OK;
case 4:
if (*value64) {
result = regmap_write(opregion->regmap, opregion->ctx.addr,
opregion->ctx.val);
} else {
result = regmap_read(opregion->regmap, opregion->ctx.addr,
&opregion->ctx.val);
if (result == 0)
*value64 = opregion->ctx.val;
}
memset(&opregion->ctx, 0x00, sizeof(opregion->ctx));
}

if (result < 0) {
Expand Down
Loading

0 comments on commit 314c6e2

Please sign in to comment.