Hans de Goede
dce69e0a06
ACPI: PMIC: Fix intel_pmic_regs_handler() read accesses
...
[ Upstream commit 009a789443fe4c8e6b1ecb7c16b4865c026184cd ]
The handling of PMIC register reads through writing 0 to address 4
of the OpRegion is wrong. Instead of returning the read value
through the value64, which is a no-op for function == ACPI_WRITE calls,
store the value and then on a subsequent function == ACPI_READ with
address == 3 (the address for the value field of the OpRegion)
return the stored value.
This has been tested on a Xiaomi Mi Pad 2 and makes the ACPI battery dev
there mostly functional (unfortunately there are still other issues).
Here are the SET() / GET() functions of the PMIC ACPI device,
which use this OpRegion, which clearly show the new behavior to
be correct:
OperationRegion (REGS, 0x8F, Zero, 0x50)
Field (REGS, ByteAcc, NoLock, Preserve)
{
CLNT, 8,
SA, 8,
OFF, 8,
VAL, 8,
RWM, 8
}
Method (GET, 3, Serialized)
{
If ((AVBE == One))
{
CLNT = Arg0
SA = Arg1
OFF = Arg2
RWM = Zero
If ((AVBG == One))
{
GPRW = Zero
}
}
Return (VAL) /* \_SB_.PCI0.I2C7.PMI5.VAL_ */
}
Method (SET, 4, Serialized)
{
If ((AVBE == One))
{
CLNT = Arg0
SA = Arg1
OFF = Arg2
VAL = Arg3
RWM = One
If ((AVBG == One))
{
GPRW = One
}
}
}
Fixes: 0afa877a56 ("ACPI / PMIC: intel: add REGS operation region support")
Signed-off-by: Hans de Goede <[email protected] >
Signed-off-by: Rafael J. Wysocki <[email protected] >
Signed-off-by: Sasha Levin <[email protected] >
2021-11-17 09:48:47 +01:00
..
acpica
ACPICA: Avoid evaluating methods too early during system resume
2021-11-17 09:48:30 +01:00
apei
x86/mm: split vmalloc_sync_all()
2020-03-25 08:25:58 +01:00
arm64
acpi/arm64: fix next_platform_timer() section mismatch error
2021-10-20 11:40:17 +02:00
dptf
hmat
ACPI: HMAT: Fix handling of changes from ACPI 6.2 to ACPI 6.3
2020-11-05 11:43:19 +01:00
nfit
ACPI: NFIT: Fix support for virtual SPA ranges
2021-08-18 08:56:57 +02:00
pmic
ACPI: PMIC: Fix intel_pmic_regs_handler() read accesses
2021-11-17 09:48:47 +01:00
x86
ac.c
acpi_adxl.c
acpi_amba.c
ACPI: AMBA: Fix resource name in /proc/iomem
2021-07-20 16:10:48 +02:00
acpi_apd.c
acpi_cmos_rtc.c
acpi_configfs.c
ACPI: configfs: add missing check after configfs_register_default_group()
2021-03-04 10:26:40 +01:00
acpi_dbg.c
ACPI: debug: don't allow debugging when ACPI is disabled
2020-11-05 11:43:25 +01:00
acpi_extlog.c
ACPI / extlog: Check for RDMSR failure
2020-11-05 11:43:24 +01:00
acpi_ipmi.c
acpi_lpat.c
acpi_lpit.c
acpi_lpss.c
acpi_memhotplug.c
acpi_pad.c
ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros
2021-07-14 16:53:25 +02:00
acpi_platform.c
acpi_pnp.c
ACPI: PNP: compare the string length in the matching_id()
2020-12-30 11:51:32 +01:00
acpi_processor.c
acpi_tad.c
ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros
2021-07-14 16:53:25 +02:00
acpi_video.c
ACPI: video: Add quirk for the Dell Vostro 3350
2021-07-20 16:10:48 +02:00
acpi_watchdog.c
battery.c
ACPI: battery: Accept charges over the design capacity as full
2021-11-17 09:48:30 +01:00
bgrt.c
ACPI: bgrt: Fix CFI violation
2021-07-14 16:53:25 +02:00
blacklist.c
bus.c
ACPI: bus: Call kobject_put() in acpi_init() error path
2021-07-14 16:53:17 +02:00
button.c
ACPI: button: Add DMI quirk for Medion Akoya E2228T
2020-11-24 13:29:00 +01:00
cm_sbs.c
container.c
cppc_acpi.c
ACPI: CPPC: Replace cppc_attr with kobj_attribute
2021-05-14 09:44:20 +02:00
custom_method.c
ACPI: custom_method: fix a possible memory leak
2021-05-11 14:04:01 +02:00
debugfs.c
device_pm.c
PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup()
2020-12-30 11:51:32 +01:00
device_sysfs.c
ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros
2021-07-14 16:53:25 +02:00
dock.c
ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros
2021-07-14 16:53:25 +02:00
ec.c
ACPI: EC: Make more Asus laptops use ECDT _GPE
2021-07-14 16:53:16 +02:00
ec_sys.c
event.c
evged.c
ACPI: GED: fix -Wformat
2020-11-22 10:14:12 +01:00
fan.c
glue.c
hed.c
internal.h
ACPI: scan: Use unique number for instance_no
2021-03-30 14:35:28 +02:00
ioapic.c
irq.c
Kconfig
Makefile
ACPI: tables: Add custom DSDT file as makefile prerequisite
2021-07-14 16:53:19 +02:00
numa.c
ACPI: Add out of bounds and numa_off protections to pxm_to_node()
2020-11-05 11:43:18 +01:00
nvs.c
osi.c
osl.c
pci_irq.c
pci_link.c
pci_mcfg.c
PCI/ACPI: Add Ampere Altra SOC MCFG quirk
2021-09-26 14:07:05 +02:00
pci_root.c
pci_slot.c
power.c
ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros
2021-07-14 16:53:25 +02:00
pptt.c
proc.c
processor_core.c
processor_driver.c
processor_idle.c
ACPI: processor idle: Fix up C-state latency if not ordered
2021-07-14 16:53:16 +02:00
processor_pdc.c
processor_perflib.c
processor_thermal.c
processor_throttling.c
x86: ACPI: fix CPU hotplug deadlock
2020-04-23 10:36:38 +02:00
property.c
ACPI: property: Fix fwnode string properties matching
2021-03-04 10:26:40 +01:00
reboot.c
resource.c
Revert "ACPI: resources: Add checks for ACPI IRQ override"
2021-08-04 12:27:37 +02:00
sbs.c
sbshc.c
sbshc.h
scan.c
ACPI: scan: Fix a memory leak in an error handling path
2021-05-19 10:08:30 +02:00
sleep.c
ACPI: EC: PM: Avoid flushing EC work when EC GPE is inactive
2020-05-27 17:46:10 +02:00
sleep.h
ACPI: PM: Add acpi_[un]register_wakeup_handler()
2020-04-13 10:48:08 +02:00
spcr.c
sysfs.c
ACPI: sysfs: Fix pm_profile_attr type
2020-06-30 15:37:06 -04:00
tables.c
ACPI: tables: x86: Reserve memory occupied by ACPI tables
2021-05-07 10:51:36 +02:00
thermal.c
ACPI: thermal: Do not call acpi_thermal_check() directly
2021-02-07 15:35:47 +01:00
utils.c
video_detect.c
ACPI: video: Add missing callback back for Sony VPCEH3U1E
2021-03-30 14:35:23 +02:00
wakeup.c
ACPI: PM: Add acpi_[un]register_wakeup_handler()
2020-04-13 10:48:08 +02:00