Lines Matching refs:hpetp

146 		struct hpets *hpetp = devp->hd_hpets;  in hpet_interrupt()  local
167 k = (mc - base + hpetp->hp_delta) / t; in hpet_interrupt()
245 struct hpets *hpetp; in hpet_open() local
254 for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) in hpet_open()
255 for (i = 0; i < hpetp->hp_ntimer; i++) in hpet_open()
256 if (hpetp->hp_dev[i].hd_flags & HPET_OPEN) { in hpet_open()
259 devp = &hpetp->hp_dev[i]; in hpet_open()
454 struct hpets *hpetp; in hpet_ioctl_ieon() local
461 hpetp = devp->hd_hpets; in hpet_ioctl_ieon()
499 sprintf(devp->hd_name, "hpet%d", (int)(devp - hpetp->hp_dev)); in hpet_ioctl_ieon()
538 write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); in hpet_ioctl_ieon()
547 write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); in hpet_ioctl_ieon()
575 struct hpets *hpetp; in hpet_ioctl_common() local
586 hpetp = devp->hd_hpets; in hpet_ioctl_common()
614 hpet_time_div(hpetp, devp->hd_ireqfreq); in hpet_ioctl_common()
617 info->hi_hpet = hpetp->hp_which; in hpet_ioctl_common()
618 info->hi_timer = devp - hpetp->hp_dev; in hpet_ioctl_common()
655 devp->hd_ireqfreq = hpet_time_div(hpetp, arg); in hpet_ioctl_common()
738 struct hpets *hpetp; in hpet_is_known() local
740 for (hpetp = hpets; hpetp; hpetp = hpetp->hp_next) in hpet_is_known()
741 if (hpetp->hp_hpet_phys == hdp->hd_phys_address) in hpet_is_known()
767 static unsigned long __hpet_calibrate(struct hpets *hpetp) in __hpet_calibrate() argument
775 for (j = 0, devp = hpetp->hp_dev; j < hpetp->hp_ntimer; j++, devp++) in __hpet_calibrate()
784 hpet = hpetp->hp_hpet; in __hpet_calibrate()
788 count = hpet_time_div(hpetp, TICK_CALIBRATE); in __hpet_calibrate()
796 write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); in __hpet_calibrate()
804 static unsigned long hpet_calibrate(struct hpets *hpetp) in hpet_calibrate() argument
815 tmp = __hpet_calibrate(hpetp); in hpet_calibrate()
829 struct hpets *hpetp; in hpet_alloc() local
847 hpetp = kzalloc(struct_size(hpetp, hp_dev, hdp->hd_nirqs), in hpet_alloc()
850 if (!hpetp) in hpet_alloc()
853 hpetp->hp_which = hpet_nhpet++; in hpet_alloc()
854 hpetp->hp_hpet = hdp->hd_address; in hpet_alloc()
855 hpetp->hp_hpet_phys = hdp->hd_phys_address; in hpet_alloc()
857 hpetp->hp_ntimer = hdp->hd_nirqs; in hpet_alloc()
860 hpetp->hp_dev[i].hd_hdwirq = hdp->hd_irq[i]; in hpet_alloc()
862 hpet = hpetp->hp_hpet; in hpet_alloc()
868 if (hpetp->hp_ntimer != ntimer) { in hpet_alloc()
871 kfree(hpetp); in hpet_alloc()
876 last->hp_next = hpetp; in hpet_alloc()
878 hpets = hpetp; in hpet_alloc()
880 last = hpetp; in hpet_alloc()
887 hpetp->hp_tick_freq = temp; /* ticks per second */ in hpet_alloc()
890 hpetp->hp_which, hdp->hd_phys_address, in hpet_alloc()
891 hpetp->hp_ntimer > 1 ? "s" : ""); in hpet_alloc()
892 for (i = 0; i < hpetp->hp_ntimer; i++) in hpet_alloc()
896 temp = hpetp->hp_tick_freq; in hpet_alloc()
900 hpetp->hp_which, hpetp->hp_ntimer, in hpet_alloc()
911 for (i = 0, devp = hpetp->hp_dev; i < hpetp->hp_ntimer; i++, devp++) { in hpet_alloc()
914 timer = &hpet->hpet_timers[devp - hpetp->hp_dev]; in hpet_alloc()
916 devp->hd_hpets = hpetp; in hpet_alloc()
932 hpetp->hp_delta = hpet_calibrate(hpetp); in hpet_alloc()
937 hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc; in hpet_alloc()
939 clocksource_register_hz(&clocksource_hpet, hpetp->hp_tick_freq); in hpet_alloc()
940 hpetp->hp_clocksource = &clocksource_hpet; in hpet_alloc()