]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: fall back to requesting only the ports we actually use
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Thu, 15 Nov 2007 00:59:57 +0000 (16:59 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 15 Nov 2007 02:45:41 +0000 (18:45 -0800)
commit19f7eb2bb1cef35c37ea37ddd4c7b1fa076915cf
tree259ba0c9362924d1a7e21a6befcc43e23f9fa9d5
parent006bfc9e9099b5a9023aaa413eec521f0e703b73
rtc: fall back to requesting only the ports we actually use

Firmware like PNPBIOS or ACPI can report the address space consumed by the
RTC.  The actual space consumed may be less than the size (RTC_IO_EXTENT)
assumed by the RTC driver.

The PNP core doesn't request resources yet, but I'd like to make it do so.
If/when it does, the RTC_IO_EXTENT request may fail, which prevents the RTC
driver from loading.

Since we only use the RTC index and data registers at RTC_PORT(0) and
RTC_PORT(1), we can fall back to requesting just enough space for those.

If the PNP core requests resources, this results in typical I/O port usage
like this:

    0070-0073 : 00:06 <-- PNP device 00:06 responds to 70-73
      0070-0071 : rtc <-- RTC driver uses only 70-71

instead of the current:

    0070-0077 : rtc <-- RTC_IO_EXTENT == 8

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/rtc.c
include/linux/mc146818rtc.h