aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/hpet.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/hpet.c')
-rw-r--r--drivers/char/hpet.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 77bf4aa217a8..4c16778e3f84 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -62,6 +62,8 @@
62 62
63static u32 hpet_nhpet, hpet_max_freq = HPET_USER_FREQ; 63static u32 hpet_nhpet, hpet_max_freq = HPET_USER_FREQ;
64 64
65/* This clocksource driver currently only works on ia64 */
66#ifdef CONFIG_IA64
65static void __iomem *hpet_mctr; 67static void __iomem *hpet_mctr;
66 68
67static cycle_t read_hpet(void) 69static cycle_t read_hpet(void)
@@ -79,6 +81,7 @@ static struct clocksource clocksource_hpet = {
79 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 81 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
80}; 82};
81static struct clocksource *hpet_clocksource; 83static struct clocksource *hpet_clocksource;
84#endif
82 85
83/* A lock for concurrent access by app and isr hpet activity. */ 86/* A lock for concurrent access by app and isr hpet activity. */
84static DEFINE_SPINLOCK(hpet_lock); 87static DEFINE_SPINLOCK(hpet_lock);
@@ -909,6 +912,8 @@ int hpet_alloc(struct hpet_data *hdp)
909 912
910 hpetp->hp_delta = hpet_calibrate(hpetp); 913 hpetp->hp_delta = hpet_calibrate(hpetp);
911 914
915/* This clocksource driver currently only works on ia64 */
916#ifdef CONFIG_IA64
912 if (!hpet_clocksource) { 917 if (!hpet_clocksource) {
913 hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc; 918 hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc;
914 CLKSRC_FSYS_MMIO_SET(clocksource_hpet.fsys_mmio, hpet_mctr); 919 CLKSRC_FSYS_MMIO_SET(clocksource_hpet.fsys_mmio, hpet_mctr);
@@ -918,6 +923,7 @@ int hpet_alloc(struct hpet_data *hdp)
918 hpetp->hp_clocksource = &clocksource_hpet; 923 hpetp->hp_clocksource = &clocksource_hpet;
919 hpet_clocksource = &clocksource_hpet; 924 hpet_clocksource = &clocksource_hpet;
920 } 925 }
926#endif
921 927
922 return 0; 928 return 0;
923} 929}
@@ -940,14 +946,14 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
940 printk(KERN_DEBUG "%s: 0x%lx is busy\n", 946 printk(KERN_DEBUG "%s: 0x%lx is busy\n",
941 __FUNCTION__, hdp->hd_phys_address); 947 __FUNCTION__, hdp->hd_phys_address);
942 iounmap(hdp->hd_address); 948 iounmap(hdp->hd_address);
943 return -EBUSY; 949 return AE_ALREADY_EXISTS;
944 } 950 }
945 } else if (res->type == ACPI_RESOURCE_TYPE_FIXED_MEMORY32) { 951 } else if (res->type == ACPI_RESOURCE_TYPE_FIXED_MEMORY32) {
946 struct acpi_resource_fixed_memory32 *fixmem32; 952 struct acpi_resource_fixed_memory32 *fixmem32;
947 953
948 fixmem32 = &res->data.fixed_memory32; 954 fixmem32 = &res->data.fixed_memory32;
949 if (!fixmem32) 955 if (!fixmem32)
950 return -EINVAL; 956 return AE_NO_MEMORY;
951 957
952 hdp->hd_phys_address = fixmem32->address; 958 hdp->hd_phys_address = fixmem32->address;
953 hdp->hd_address = ioremap(fixmem32->address, 959 hdp->hd_address = ioremap(fixmem32->address,
@@ -957,7 +963,7 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
957 printk(KERN_DEBUG "%s: 0x%lx is busy\n", 963 printk(KERN_DEBUG "%s: 0x%lx is busy\n",
958 __FUNCTION__, hdp->hd_phys_address); 964 __FUNCTION__, hdp->hd_phys_address);
959 iounmap(hdp->hd_address); 965 iounmap(hdp->hd_address);
960 return -EBUSY; 966 return AE_ALREADY_EXISTS;
961 } 967 }
962 } else if (res->type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ) { 968 } else if (res->type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ) {
963 struct acpi_resource_extended_irq *irqp; 969 struct acpi_resource_extended_irq *irqp;