diff options
-rw-r--r-- | drivers/rtc/rtc-cmos.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index f4a96dbdabf2..b3de973a6260 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c | |||
@@ -41,6 +41,9 @@ | |||
41 | #include <linux/pm.h> | 41 | #include <linux/pm.h> |
42 | #include <linux/of.h> | 42 | #include <linux/of.h> |
43 | #include <linux/of_platform.h> | 43 | #include <linux/of_platform.h> |
44 | #ifdef CONFIG_X86 | ||
45 | #include <asm/i8259.h> | ||
46 | #endif | ||
44 | 47 | ||
45 | /* this is for "generic access to PC-style RTC" using CMOS_READ/CMOS_WRITE */ | 48 | /* this is for "generic access to PC-style RTC" using CMOS_READ/CMOS_WRITE */ |
46 | #include <linux/mc146818rtc.h> | 49 | #include <linux/mc146818rtc.h> |
@@ -1193,17 +1196,23 @@ static int cmos_pnp_probe(struct pnp_dev *pnp, const struct pnp_device_id *id) | |||
1193 | { | 1196 | { |
1194 | cmos_wake_setup(&pnp->dev); | 1197 | cmos_wake_setup(&pnp->dev); |
1195 | 1198 | ||
1196 | if (pnp_port_start(pnp, 0) == 0x70 && !pnp_irq_valid(pnp, 0)) | 1199 | if (pnp_port_start(pnp, 0) == 0x70 && !pnp_irq_valid(pnp, 0)) { |
1200 | unsigned int irq = 0; | ||
1201 | #ifdef CONFIG_X86 | ||
1197 | /* Some machines contain a PNP entry for the RTC, but | 1202 | /* Some machines contain a PNP entry for the RTC, but |
1198 | * don't define the IRQ. It should always be safe to | 1203 | * don't define the IRQ. It should always be safe to |
1199 | * hardcode it in these cases | 1204 | * hardcode it on systems with a legacy PIC. |
1200 | */ | 1205 | */ |
1206 | if (nr_legacy_irqs()) | ||
1207 | irq = 8; | ||
1208 | #endif | ||
1201 | return cmos_do_probe(&pnp->dev, | 1209 | return cmos_do_probe(&pnp->dev, |
1202 | pnp_get_resource(pnp, IORESOURCE_IO, 0), 8); | 1210 | pnp_get_resource(pnp, IORESOURCE_IO, 0), irq); |
1203 | else | 1211 | } else { |
1204 | return cmos_do_probe(&pnp->dev, | 1212 | return cmos_do_probe(&pnp->dev, |
1205 | pnp_get_resource(pnp, IORESOURCE_IO, 0), | 1213 | pnp_get_resource(pnp, IORESOURCE_IO, 0), |
1206 | pnp_irq(pnp, 0)); | 1214 | pnp_irq(pnp, 0)); |
1215 | } | ||
1207 | } | 1216 | } |
1208 | 1217 | ||
1209 | static void cmos_pnp_remove(struct pnp_dev *pnp) | 1218 | static void cmos_pnp_remove(struct pnp_dev *pnp) |