]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/tty/serdev/core.c
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
[linux.git] / drivers / tty / serdev / core.c
index 42345e79920c229285cf95cf4c150690a5dfb04c..c5f0d936b003ae597c7ac05cce724793311e7492 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/sched.h>
 #include <linux/serdev.h>
 #include <linux/slab.h>
+#include <linux/platform_data/x86/apple.h>
 
 static bool is_registered;
 static DEFINE_IDA(ctrl_ida);
@@ -631,6 +632,15 @@ static int acpi_serdev_check_resources(struct serdev_controller *ctrl,
        if (ret)
                return ret;
 
+       /*
+        * Apple machines provide an empty resource template, so on those
+        * machines just look for immediate children with a "baud" property
+        * (from the _DSM method) instead.
+        */
+       if (!lookup.controller_handle && x86_apple_machine &&
+           !acpi_dev_get_property(adev, "baud", ACPI_TYPE_BUFFER, NULL))
+               acpi_get_parent(adev->handle, &lookup.controller_handle);
+
        /* Make sure controller and ResourceSource handle match */
        if (ACPI_HANDLE(ctrl->dev.parent) != lookup.controller_handle)
                return -ENODEV;