Lines Matching refs:hpetp
161 struct hpets *hpetp = devp->hd_hpets; in hpet_interrupt() local
182 k = (mc - base + hpetp->hp_delta) / t; in hpet_interrupt()
260 struct hpets *hpetp; in hpet_open() local
269 for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) in hpet_open()
270 for (i = 0; i < hpetp->hp_ntimer; i++) in hpet_open()
271 if (hpetp->hp_dev[i].hd_flags & HPET_OPEN) in hpet_open()
274 devp = &hpetp->hp_dev[i]; in hpet_open()
457 struct hpets *hpetp; in hpet_ioctl_ieon() local
464 hpetp = devp->hd_hpets; in hpet_ioctl_ieon()
502 sprintf(devp->hd_name, "hpet%d", (int)(devp - hpetp->hp_dev)); in hpet_ioctl_ieon()
541 write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); in hpet_ioctl_ieon()
550 write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); in hpet_ioctl_ieon()
578 struct hpets *hpetp; in hpet_ioctl_common() local
589 hpetp = devp->hd_hpets; in hpet_ioctl_common()
617 hpet_time_div(hpetp, devp->hd_ireqfreq); in hpet_ioctl_common()
620 info->hi_hpet = hpetp->hp_which; in hpet_ioctl_common()
621 info->hi_timer = devp - hpetp->hp_dev; in hpet_ioctl_common()
658 devp->hd_ireqfreq = hpet_time_div(hpetp, arg); in hpet_ioctl_common()
729 struct hpets *hpetp; in hpet_is_known() local
731 for (hpetp = hpets; hpetp; hpetp = hpetp->hp_next) in hpet_is_known()
732 if (hpetp->hp_hpet_phys == hdp->hd_phys_address) in hpet_is_known()
778 static unsigned long __hpet_calibrate(struct hpets *hpetp) in __hpet_calibrate() argument
786 for (j = 0, devp = hpetp->hp_dev; j < hpetp->hp_ntimer; j++, devp++) in __hpet_calibrate()
795 hpet = hpetp->hp_hpet; in __hpet_calibrate()
799 count = hpet_time_div(hpetp, TICK_CALIBRATE); in __hpet_calibrate()
807 write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); in __hpet_calibrate()
815 static unsigned long hpet_calibrate(struct hpets *hpetp) in hpet_calibrate() argument
826 tmp = __hpet_calibrate(hpetp); in hpet_calibrate()
840 struct hpets *hpetp; in hpet_alloc() local
858 hpetp = kzalloc(struct_size(hpetp, hp_dev, hdp->hd_nirqs), in hpet_alloc()
861 if (!hpetp) in hpet_alloc()
864 hpetp->hp_which = hpet_nhpet++; in hpet_alloc()
865 hpetp->hp_hpet = hdp->hd_address; in hpet_alloc()
866 hpetp->hp_hpet_phys = hdp->hd_phys_address; in hpet_alloc()
868 hpetp->hp_ntimer = hdp->hd_nirqs; in hpet_alloc()
871 hpetp->hp_dev[i].hd_hdwirq = hdp->hd_irq[i]; in hpet_alloc()
873 hpet = hpetp->hp_hpet; in hpet_alloc()
879 if (hpetp->hp_ntimer != ntimer) { in hpet_alloc()
882 kfree(hpetp); in hpet_alloc()
887 last->hp_next = hpetp; in hpet_alloc()
889 hpets = hpetp; in hpet_alloc()
891 last = hpetp; in hpet_alloc()
898 hpetp->hp_tick_freq = temp; /* ticks per second */ in hpet_alloc()
901 hpetp->hp_which, hdp->hd_phys_address, in hpet_alloc()
902 hpetp->hp_ntimer > 1 ? "s" : ""); in hpet_alloc()
903 for (i = 0; i < hpetp->hp_ntimer; i++) in hpet_alloc()
907 temp = hpetp->hp_tick_freq; in hpet_alloc()
911 hpetp->hp_which, hpetp->hp_ntimer, in hpet_alloc()
922 for (i = 0, devp = hpetp->hp_dev; i < hpetp->hp_ntimer; i++, devp++) { in hpet_alloc()
925 timer = &hpet->hpet_timers[devp - hpetp->hp_dev]; in hpet_alloc()
927 devp->hd_hpets = hpetp; in hpet_alloc()
943 hpetp->hp_delta = hpet_calibrate(hpetp); in hpet_alloc()
948 hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc; in hpet_alloc()
950 clocksource_register_hz(&clocksource_hpet, hpetp->hp_tick_freq); in hpet_alloc()
951 hpetp->hp_clocksource = &clocksource_hpet; in hpet_alloc()