Skip to content

Commit db0e4d5

Browse files
committed
Merge branches 'acpi-resource', 'acpi-pm', 'acpi-platform-profile' and 'acpi-docs'
Merge an ACPI resources management update, ACPI power management updates, an ACPI platform profile driver fix and an ACPI documentation update related to device properties for 6.16-rc1: - Fix a typo for MECHREVO in irq1_edge_low_force_override[] (Mingcong Bai). - Add an LPS0 check() callback to the AMD pinctrl driver and fix up config symbol dependencies in it (Mario Limonciello, Rafael Wysocki). - Avoid initializing the ACPI platform profile driver on non-ACPI platforms (Alexandre Ghiti). - Document that references to ACPI data (non-device) nodes should use string-only references in hierarchical data node packages (Sakari Ailus). * acpi-resource: ACPI: resource: fix a typo for MECHREVO in irq1_edge_low_force_override[] * acpi-pm: pinctrl: amd: Fix hibernation support with CONFIG_SUSPEND unset pinctrl: amd: Fix use of undeclared identifier 'pinctrl_amd_s2idle_dev_ops' pinctrl: amd: Add an LPS0 check() callback ACPI: Add missing prototype for non CONFIG_SUSPEND/CONFIG_X86 case * acpi-platform-profile: ACPI: platform_profile: Avoid initializing on non-ACPI platforms * acpi-docs: Documentation: ACPI: Use all-string data node references
5 parents f5b4df9 + 113e042 + dc918c3 + dd13316 + 6db0261 commit db0e4d5

File tree

7 files changed

+77
-30
lines changed

7 files changed

+77
-30
lines changed

Documentation/firmware-guide/acpi/dsd/data-node-references.rst

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ ACPI in general allows referring to device objects in the tree only.
1212
Hierarchical data extension nodes may not be referred to directly, hence this
1313
document defines a scheme to implement such references.
1414

15-
A reference consist of the device object name followed by one or more
16-
hierarchical data extension [dsd-guide] keys. Specifically, the hierarchical
17-
data extension node which is referred to by the key shall lie directly under
18-
the parent object i.e. either the device object or another hierarchical data
19-
extension node.
15+
A reference to a _DSD hierarchical data node is a string consisting of a
16+
device object reference followed by a dot (".") and a relative path to a data
17+
node object. Do not use non-string references as this will produce a copy of
18+
the hierarchical data node, not a reference!
19+
20+
The hierarchical data extension node which is referred to shall be located
21+
directly under its parent object i.e. either the device object or another
22+
hierarchical data extension node [dsd-guide].
2023

2124
The keys in the hierarchical data nodes shall consist of the name of the node,
2225
"@" character and the number of the node in hexadecimal notation (without pre-
@@ -33,11 +36,9 @@ extension key.
3336
Example
3437
=======
3538

36-
In the ASL snippet below, the "reference" _DSD property contains a
37-
device object reference to DEV0 and under that device object, a
38-
hierarchical data extension key "node@1" referring to the NOD1 object
39-
and lastly, a hierarchical data extension key "anothernode" referring to
40-
the ANOD object which is also the final target node of the reference.
39+
In the ASL snippet below, the "reference" _DSD property contains a string
40+
reference to a hierarchical data extension node ANOD under DEV0 under the parent
41+
of DEV1. ANOD is also the final target node of the reference.
4142
::
4243

4344
Device (DEV0)
@@ -76,10 +77,7 @@ the ANOD object which is also the final target node of the reference.
7677
Name (_DSD, Package () {
7778
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
7879
Package () {
79-
Package () {
80-
"reference", Package () {
81-
^DEV0, "node@1", "anothernode"
82-
}
80+
Package () { "reference", "^DEV0.ANOD" }
8381
},
8482
}
8583
})

Documentation/firmware-guide/acpi/dsd/graph.rst

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,9 @@ of that port shall be zero. Similarly, if a port may only have a single
6666
endpoint, the number of that endpoint shall be zero.
6767

6868
The endpoint reference uses property extension with "remote-endpoint" property
69-
name followed by a reference in the same package. Such references consist of
70-
the remote device reference, the first package entry of the port data extension
71-
reference under the device and finally the first package entry of the endpoint
72-
data extension reference under the port. Individual references thus appear as::
69+
name followed by a string reference in the same package. [data-node-ref]::
7370

74-
Package() { device, "port@X", "endpoint@Y" }
71+
"device.datanode"
7572

7673
In the above example, "X" is the number of the port and "Y" is the number of
7774
the endpoint.
@@ -109,7 +106,7 @@ A simple example of this is show below::
109106
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
110107
Package () {
111108
Package () { "reg", 0 },
112-
Package () { "remote-endpoint", Package() { \_SB.PCI0.ISP, "port@4", "endpoint@0" } },
109+
Package () { "remote-endpoint", "\\_SB.PCI0.ISP.EP40" },
113110
}
114111
})
115112
}
@@ -141,7 +138,7 @@ A simple example of this is show below::
141138
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
142139
Package () {
143140
Package () { "reg", 0 },
144-
Package () { "remote-endpoint", Package () { \_SB.PCI0.I2C2.CAM0, "port@0", "endpoint@0" } },
141+
Package () { "remote-endpoint", "\\_SB.PCI0.I2C2.CAM0.EP00" },
145142
}
146143
})
147144
}

Documentation/firmware-guide/acpi/dsd/leds.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ Referring to LEDs in Device tree is documented in [video-interfaces], in
1515
"flash-leds" property documentation. In short, LEDs are directly referred to by
1616
using phandles.
1717

18-
While Device tree allows referring to any node in the tree [devicetree], in
19-
ACPI references are limited to device nodes only [acpi]. For this reason using
20-
the same mechanism on ACPI is not possible. A mechanism to refer to non-device
21-
ACPI nodes is documented in [data-node-ref].
22-
2318
ACPI allows (as does DT) using integer arguments after the reference. A
2419
combination of the LED driver device reference and an integer argument,
2520
referring to the "reg" property of the relevant LED, is used to identify
@@ -74,7 +69,7 @@ omitted. ::
7469
Package () {
7570
Package () {
7671
"flash-leds",
77-
Package () { ^LED, "led@0", ^LED, "led@1" },
72+
Package () { "^LED.LED0", "^LED.LED1" },
7873
}
7974
}
8075
})

drivers/acpi/platform_profile.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,9 @@ static int __init platform_profile_init(void)
688688
{
689689
int err;
690690

691+
if (acpi_disabled)
692+
return -EOPNOTSUPP;
693+
691694
err = class_register(&platform_profile_class);
692695
if (err)
693696
return err;

drivers/acpi/resource.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ static const struct dmi_system_id irq1_level_low_skip_override[] = {
534534
*/
535535
static const struct dmi_system_id irq1_edge_low_force_override[] = {
536536
{
537-
/* MECHREV Jiaolong17KS Series GM7XG0M */
537+
/* MECHREVO Jiaolong17KS Series GM7XG0M */
538538
.matches = {
539539
DMI_MATCH(DMI_BOARD_NAME, "GM7XG0M"),
540540
},

drivers/pinctrl/pinctrl-amd.c

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
#include "pinctrl-utils.h"
3838
#include "pinctrl-amd.h"
3939

40+
#ifdef CONFIG_SUSPEND
41+
static struct amd_gpio *pinctrl_dev;
42+
#endif
43+
4044
static int amd_gpio_get_direction(struct gpio_chip *gc, unsigned offset)
4145
{
4246
unsigned long flags;
@@ -890,6 +894,44 @@ static void amd_gpio_irq_init(struct amd_gpio *gpio_dev)
890894
}
891895
}
892896

897+
#if defined(CONFIG_SUSPEND) && defined(CONFIG_ACPI)
898+
static void amd_gpio_check_pending(void)
899+
{
900+
struct amd_gpio *gpio_dev = pinctrl_dev;
901+
struct pinctrl_desc *desc = gpio_dev->pctrl->desc;
902+
int i;
903+
904+
if (!pm_debug_messages_on)
905+
return;
906+
907+
for (i = 0; i < desc->npins; i++) {
908+
int pin = desc->pins[i].number;
909+
u32 tmp;
910+
911+
tmp = readl(gpio_dev->base + pin * 4);
912+
if (tmp & PIN_IRQ_PENDING)
913+
pm_pr_dbg("%s: GPIO %d is active: 0x%x.\n", __func__, pin, tmp);
914+
}
915+
}
916+
917+
static struct acpi_s2idle_dev_ops pinctrl_amd_s2idle_dev_ops = {
918+
.check = amd_gpio_check_pending,
919+
};
920+
921+
static void amd_gpio_register_s2idle_ops(void)
922+
{
923+
acpi_register_lps0_dev(&pinctrl_amd_s2idle_dev_ops);
924+
}
925+
926+
static void amd_gpio_unregister_s2idle_ops(void)
927+
{
928+
acpi_unregister_lps0_dev(&pinctrl_amd_s2idle_dev_ops);
929+
}
930+
#else
931+
static inline void amd_gpio_register_s2idle_ops(void) {}
932+
static inline void amd_gpio_unregister_s2idle_ops(void) {}
933+
#endif
934+
893935
#ifdef CONFIG_PM_SLEEP
894936
static bool amd_gpio_should_save(struct amd_gpio *gpio_dev, unsigned int pin)
895937
{
@@ -942,6 +984,9 @@ static int amd_gpio_suspend_hibernate_common(struct device *dev, bool is_suspend
942984

943985
static int amd_gpio_suspend(struct device *dev)
944986
{
987+
#ifdef CONFIG_SUSPEND
988+
pinctrl_dev = dev_get_drvdata(dev);
989+
#endif
945990
return amd_gpio_suspend_hibernate_common(dev, true);
946991
}
947992

@@ -1115,7 +1160,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
11151160
if (gpio_dev->irq < 0)
11161161
return gpio_dev->irq;
11171162

1118-
#ifdef CONFIG_PM_SLEEP
1163+
#ifdef CONFIG_SUSPEND
11191164
gpio_dev->saved_regs = devm_kcalloc(&pdev->dev, amd_pinctrl_desc.npins,
11201165
sizeof(*gpio_dev->saved_regs),
11211166
GFP_KERNEL);
@@ -1181,6 +1226,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
11811226

11821227
platform_set_drvdata(pdev, gpio_dev);
11831228
acpi_register_wakeup_handler(gpio_dev->irq, amd_gpio_check_wake, gpio_dev);
1229+
amd_gpio_register_s2idle_ops();
11841230

11851231
dev_dbg(&pdev->dev, "amd gpio driver loaded\n");
11861232
return ret;
@@ -1199,6 +1245,7 @@ static void amd_gpio_remove(struct platform_device *pdev)
11991245

12001246
gpiochip_remove(&gpio_dev->gc);
12011247
acpi_unregister_wakeup_handler(amd_gpio_check_wake, gpio_dev);
1248+
amd_gpio_unregister_s2idle_ops();
12021249
}
12031250

12041251
#ifdef CONFIG_ACPI

include/linux/acpi.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,13 +1134,13 @@ void acpi_os_set_prepare_extended_sleep(int (*func)(u8 sleep_state,
11341134

11351135
acpi_status acpi_os_prepare_extended_sleep(u8 sleep_state,
11361136
u32 val_a, u32 val_b);
1137-
#if defined(CONFIG_SUSPEND) && defined(CONFIG_X86)
11381137
struct acpi_s2idle_dev_ops {
11391138
struct list_head list_node;
11401139
void (*prepare)(void);
11411140
void (*check)(void);
11421141
void (*restore)(void);
11431142
};
1143+
#if defined(CONFIG_SUSPEND) && defined(CONFIG_X86)
11441144
int acpi_register_lps0_dev(struct acpi_s2idle_dev_ops *arg);
11451145
void acpi_unregister_lps0_dev(struct acpi_s2idle_dev_ops *arg);
11461146
int acpi_get_lps0_constraint(struct acpi_device *adev);
@@ -1149,6 +1149,13 @@ static inline int acpi_get_lps0_constraint(struct device *dev)
11491149
{
11501150
return ACPI_STATE_UNKNOWN;
11511151
}
1152+
static inline int acpi_register_lps0_dev(struct acpi_s2idle_dev_ops *arg)
1153+
{
1154+
return -ENODEV;
1155+
}
1156+
static inline void acpi_unregister_lps0_dev(struct acpi_s2idle_dev_ops *arg)
1157+
{
1158+
}
11521159
#endif /* CONFIG_SUSPEND && CONFIG_X86 */
11531160
void arch_reserve_mem_area(acpi_physical_address addr, size_t size);
11541161
#else

0 commit comments

Comments
 (0)