Commit 314c6e2b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

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[]
...@@ -133,7 +133,7 @@ static unsigned int ec_storm_threshold __read_mostly = 8; ...@@ -133,7 +133,7 @@ static unsigned int ec_storm_threshold __read_mostly = 8;
module_param(ec_storm_threshold, uint, 0644); module_param(ec_storm_threshold, uint, 0644);
MODULE_PARM_DESC(ec_storm_threshold, "Maxim false GPE numbers not considered as GPE storm"); 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_param(ec_freeze_events, bool, 0644);
MODULE_PARM_DESC(ec_freeze_events, "Disabling event handling during suspend/resume"); MODULE_PARM_DESC(ec_freeze_events, "Disabling event handling during suspend/resume");
...@@ -177,7 +177,7 @@ struct acpi_ec *first_ec; ...@@ -177,7 +177,7 @@ struct acpi_ec *first_ec;
EXPORT_SYMBOL(first_ec); EXPORT_SYMBOL(first_ec);
static struct acpi_ec *boot_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_wq;
static struct workqueue_struct *ec_query_wq; static struct workqueue_struct *ec_query_wq;
...@@ -2152,6 +2152,13 @@ static const struct dmi_system_id acpi_ec_no_wakeup[] = { ...@@ -2152,6 +2152,13 @@ static const struct dmi_system_id acpi_ec_no_wakeup[] = {
DMI_MATCH(DMI_PRODUCT_FAMILY, "ThinkPad X1 Yoga 3rd"), 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"),
},
},
{ }, { },
}; };
......
...@@ -211,31 +211,36 @@ static acpi_status intel_pmic_regs_handler(u32 function, ...@@ -211,31 +211,36 @@ static acpi_status intel_pmic_regs_handler(u32 function,
void *handler_context, void *region_context) void *handler_context, void *region_context)
{ {
struct intel_pmic_opregion *opregion = 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) { if (function == ACPI_READ && address == 3) {
case 0: *value64 = opregion->ctx.val;
return AE_OK;
case 1:
opregion->ctx.addr |= (*value64 & 0xff) << 8;
return AE_OK;
case 2:
opregion->ctx.addr |= *value64 & 0xff;
return AE_OK; 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) { if (result < 0) {
......
This diff is collapsed.
...@@ -10,25 +10,12 @@ ...@@ -10,25 +10,12 @@
#ifndef __ACGCC_H__ #ifndef __ACGCC_H__
#define __ACGCC_H__ #define __ACGCC_H__
/*
* Use compiler specific <stdarg.h> is a good practice for even when
* -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined.
*/
#ifndef va_arg #ifndef va_arg
#ifdef ACPI_USE_BUILTIN_STDARG
typedef __builtin_va_list va_list;
#define va_start(v, l) __builtin_va_start(v, l)
#define va_end(v) __builtin_va_end(v)
#define va_arg(v, l) __builtin_va_arg(v, l)
#define va_copy(d, s) __builtin_va_copy(d, s)
#else
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/stdarg.h> #include <linux/stdarg.h>
#else #else
/* Used to build acpi tools */
#include <stdarg.h> #include <stdarg.h>
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* ACPI_USE_BUILTIN_STDARG */
#endif /* ! va_arg */ #endif /* ! va_arg */
#define ACPI_INLINE __inline__ #define ACPI_INLINE __inline__
......
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