ACPICA: Namespace: Add String -> ObjectReference conversion support

ACPICA commit 80e60d72959bb51c5d08c8500d978607a42ed81d

BIOS developers may accidently put the quotes around the name strings,
which converts the object references in the packages indicated by the name
strings into the data objects (strings). Such kind of error has been seen
in _DEP control methods on some platforms. This patch implements a
workaround to correct it. Reported by Bastien Nocera. Fixed by Lv Zheng.

Link: https://github.com/acpica/acpica/commit/80e60d72
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=106231
Reported-and-tested-by: Bastien Nocera <bugzilla@hadess.net>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
diff --git a/drivers/acpi/acpica/nsrepair.c b/drivers/acpi/acpica/nsrepair.c
index 4b7dbff..6418863 100644
--- a/drivers/acpi/acpica/nsrepair.c
+++ b/drivers/acpi/acpica/nsrepair.c
@@ -116,6 +116,11 @@
 	 ACPI_NOT_PACKAGE_ELEMENT,
 	 acpi_ns_convert_to_resource},
 
+	/* Object reference conversions */
+
+	{"_DEP", ACPI_RTYPE_STRING, ACPI_ALL_PACKAGE_ELEMENTS,
+	 acpi_ns_convert_to_reference},
+
 	/* Unicode conversions */
 
 	{"_MLS", ACPI_RTYPE_STRING, 1,
@@ -360,7 +365,9 @@
 			/* Check if we can actually repair this name/type combination */
 
 			if ((return_btype & this_name->unexpected_btypes) &&
-			    (package_index == this_name->package_index)) {
+			    (this_name->package_index ==
+			     ACPI_ALL_PACKAGE_ELEMENTS
+			     || package_index == this_name->package_index)) {
 				return (this_name);
 			}