summaryrefslogtreecommitdiff
path: root/drivers/char/hpet.c
diff options
context:
space:
mode:
authorRandy Dunlap <randy_d_dunlap@linux.intel.com>2005-10-30 15:03:42 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 17:37:31 -0800
commit757c4724099a31a61754ea5202802eaa1def851c (patch)
tree19e8d379a50d96f80fc179dc4567449de1eed623 /drivers/char/hpet.c
parent318db8f03bc06e6de98e98a568b6b2fa64233b87 (diff)
[PATCH] hpet: allow HPET FIXED_MEM32 resource type
Allow the ACPI HPET description table to use a resource type of FIXED_MEM32 for the HPET reource. Use the fixed resoure size of 1 KB for the HPET resource as per the HPET spec. Signed-off-by: Randy Dunlap <randy_d_dunlap@linux.intel.com> Acked-by: Bob Picco <bob.picco@hp.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/hpet.c')
-rw-r--r--drivers/char/hpet.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 0159c463f0f9..e605259e3753 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -49,6 +49,8 @@
#define HPET_USER_FREQ (64)
#define HPET_DRIFT (500)
+#define HPET_RANGE_SIZE 1024 /* from HPET spec */
+
static u32 hpet_nhpet, hpet_max_freq = HPET_USER_FREQ;
/* A lock for concurrent access by app and isr hpet activity. */
@@ -922,6 +924,21 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
for (hpetp = hpets; hpetp; hpetp = hpetp->hp_next)
if (hpetp->hp_hpet == hdp->hd_address)
return -EBUSY;
+ } else if (res->id == ACPI_RSTYPE_FIXED_MEM32) {
+ struct acpi_resource_fixed_mem32 *fixmem32;
+
+ fixmem32 = &res->data.fixed_memory32;
+ if (!fixmem32)
+ return -EINVAL;
+
+ hdp->hd_phys_address = fixmem32->range_base_address;
+ hdp->hd_address = ioremap(fixmem32->range_base_address,
+ HPET_RANGE_SIZE);
+
+ for (hpetp = hpets; hpetp; hpetp = hpetp->hp_next)
+ if (hpetp->hp_hpet == hdp->hd_address) {
+ return -EBUSY;
+ }
} else if (res->id == ACPI_RSTYPE_EXT_IRQ) {
struct acpi_resource_ext_irq *irqp;
int i;