]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/rtc/rtc-cmos.c
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[karo-tx-linux.git] / drivers / rtc / rtc-cmos.c
index f4a96dbdabf21ec4bdf8017e524ea42b9b0ce5c7..9dca53df35845cc64366a5428d9927bff7f28220 100644 (file)
@@ -41,6 +41,9 @@
 #include <linux/pm.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
+#ifdef CONFIG_X86
+#include <asm/i8259.h>
+#endif
 
 /* this is for "generic access to PC-style RTC" using CMOS_READ/CMOS_WRITE */
 #include <linux/mc146818rtc.h>
@@ -1085,7 +1088,7 @@ static u32 rtc_handler(void *context)
        }
        spin_unlock_irqrestore(&rtc_lock, flags);
 
-       pm_wakeup_event(dev, 0);
+       pm_wakeup_hard_event(dev);
        acpi_clear_event(ACPI_EVENT_RTC);
        acpi_disable_event(ACPI_EVENT_RTC, 0);
        return ACPI_INTERRUPT_HANDLED;
@@ -1193,17 +1196,23 @@ static int cmos_pnp_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
 {
        cmos_wake_setup(&pnp->dev);
 
-       if (pnp_port_start(pnp, 0) == 0x70 && !pnp_irq_valid(pnp, 0))
+       if (pnp_port_start(pnp, 0) == 0x70 && !pnp_irq_valid(pnp, 0)) {
+               unsigned int irq = 0;
+#ifdef CONFIG_X86
                /* Some machines contain a PNP entry for the RTC, but
                 * don't define the IRQ. It should always be safe to
-                * hardcode it in these cases
+                * hardcode it on systems with a legacy PIC.
                 */
+               if (nr_legacy_irqs())
+                       irq = 8;
+#endif
                return cmos_do_probe(&pnp->dev,
-                               pnp_get_resource(pnp, IORESOURCE_IO, 0), 8);
-       else
+                               pnp_get_resource(pnp, IORESOURCE_IO, 0), irq);
+       } else {
                return cmos_do_probe(&pnp->dev,
                                pnp_get_resource(pnp, IORESOURCE_IO, 0),
                                pnp_irq(pnp, 0));
+       }
 }
 
 static void cmos_pnp_remove(struct pnp_dev *pnp)