diff options
author | Alex Shi <alex.shi@linaro.org> | 2018-03-26 02:32:53 +0000 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2018-03-26 02:32:53 +0000 |
commit | 38b587878eee8f9f2664135ab76805d0510bb997 (patch) | |
tree | 66f5c8eb8821dc7fa1fe91741b24ff7291ef3bf1 /drivers/rtc/rtc-cmos.c | |
parent | 323174b55ef1de0c70ed0b268fcaf9f2d6f842c6 (diff) | |
parent | 24f70aa804cd7f8fee4353cf4990997d1c8375ae (diff) |
Merge tag 'v4.9.90' into linux-linaro-lsk-v4.9lsk-v4.9-18.03
This is the 4.9.90 stable release
Diffstat (limited to 'drivers/rtc/rtc-cmos.c')
-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 7030d7cd3861..c554e529fc4e 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -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> @@ -1117,17 +1120,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) |