Commit 846fd126 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Linus Torvalds

[PATCH] announce hpet devices claimed

I think the HPET driver should announce the hardware it claims.  Here's
a patch that prints this:

	hpet0: at MMIO 0xc0000ffffc002000, IRQs 74, 75, 76
	hpet0: 4ns tick, 3 64-bit timers
	hpet1: at MMIO 0xc0000ffffc082000, IRQs 77, 78, 79
	hpet1: 4ns tick, 3 64-bit timers

This has been acked by Bob.  I haven't heard from Venkatesh.

Print basic information (MMIO address, IRQs used, tick rate, number
of timers) when claiming an HPET device.
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1148a9f2
......@@ -789,6 +789,7 @@ int __init hpet_alloc(struct hpet_data *hdp)
size_t siz;
struct hpet *hpet;
static struct hpets *last __initdata = (struct hpets *)0;
unsigned long ns;
/*
* hpet_alloc can be called by platform dependent code.
......@@ -840,6 +841,18 @@ int __init hpet_alloc(struct hpet_data *hdp)
hpetp->hp_period = (cap & HPET_COUNTER_CLK_PERIOD_MASK) >>
HPET_COUNTER_CLK_PERIOD_SHIFT;
printk(KERN_INFO "hpet%d: at MMIO 0x%p, IRQ%s",
hpetp->hp_which, hpet, hpetp->hp_ntimer > 1 ? "s" : "");
for (i = 0; i < hpetp->hp_ntimer; i++)
printk("%s %d", i > 0 ? "," : "", hdp->hd_irq[i]);
printk("\n");
ns = hpetp->hp_period; /* femptoseconds, 10^-15 */
do_div(ns, 1000000); /* convert to nanoseconds, 10^-9 */
printk(KERN_INFO "hpet%d: %ldns tick, %d %d-bit timers\n",
hpetp->hp_which, ns, hpetp->hp_ntimer,
cap & HPET_COUNTER_SIZE_MASK ? 64 : 32);
mcfg = readq(&hpet->hpet_config);
if ((mcfg & HPET_ENABLE_CNF_MASK) == 0) {
write_counter(0L, &hpet->hpet_mc);
......@@ -946,7 +959,6 @@ static int __init hpet_acpi_remove(struct acpi_device *device, int type)
static struct acpi_driver hpet_acpi_driver __initdata = {
.name = "hpet",
.class = "",
.ids = "PNP0103",
.ops = {
.add = hpet_acpi_add,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment