Lines Matching refs:hpetp

164 		struct hpets *hpetp = devp->hd_hpets;  in hpet_interrupt()  local
185 k = (mc - base + hpetp->hp_delta) / t; in hpet_interrupt()
263 struct hpets *hpetp; in hpet_open() local
272 for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) in hpet_open()
273 for (i = 0; i < hpetp->hp_ntimer; i++) in hpet_open()
274 if (hpetp->hp_dev[i].hd_flags & HPET_OPEN) in hpet_open()
277 devp = &hpetp->hp_dev[i]; in hpet_open()
460 struct hpets *hpetp; in hpet_ioctl_ieon() local
467 hpetp = devp->hd_hpets; in hpet_ioctl_ieon()
505 sprintf(devp->hd_name, "hpet%d", (int)(devp - hpetp->hp_dev)); in hpet_ioctl_ieon()
544 write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); in hpet_ioctl_ieon()
553 write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); in hpet_ioctl_ieon()
581 struct hpets *hpetp; in hpet_ioctl_common() local
592 hpetp = devp->hd_hpets; in hpet_ioctl_common()
620 hpet_time_div(hpetp, devp->hd_ireqfreq); in hpet_ioctl_common()
623 info->hi_hpet = hpetp->hp_which; in hpet_ioctl_common()
624 info->hi_timer = devp - hpetp->hp_dev; in hpet_ioctl_common()
661 devp->hd_ireqfreq = hpet_time_div(hpetp, arg); in hpet_ioctl_common()
732 struct hpets *hpetp; in hpet_is_known() local
734 for (hpetp = hpets; hpetp; hpetp = hpetp->hp_next) in hpet_is_known()
735 if (hpetp->hp_hpet_phys == hdp->hd_phys_address) in hpet_is_known()
781 static unsigned long __hpet_calibrate(struct hpets *hpetp) in __hpet_calibrate() argument
789 for (j = 0, devp = hpetp->hp_dev; j < hpetp->hp_ntimer; j++, devp++) in __hpet_calibrate()
798 hpet = hpetp->hp_hpet; in __hpet_calibrate()
802 count = hpet_time_div(hpetp, TICK_CALIBRATE); in __hpet_calibrate()
810 write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); in __hpet_calibrate()
818 static unsigned long hpet_calibrate(struct hpets *hpetp) in hpet_calibrate() argument
829 tmp = __hpet_calibrate(hpetp); in hpet_calibrate()
843 struct hpets *hpetp; in hpet_alloc() local
865 hpetp = kzalloc(siz, GFP_KERNEL); in hpet_alloc()
867 if (!hpetp) in hpet_alloc()
870 hpetp->hp_which = hpet_nhpet++; in hpet_alloc()
871 hpetp->hp_hpet = hdp->hd_address; in hpet_alloc()
872 hpetp->hp_hpet_phys = hdp->hd_phys_address; in hpet_alloc()
874 hpetp->hp_ntimer = hdp->hd_nirqs; in hpet_alloc()
877 hpetp->hp_dev[i].hd_hdwirq = hdp->hd_irq[i]; in hpet_alloc()
879 hpet = hpetp->hp_hpet; in hpet_alloc()
885 if (hpetp->hp_ntimer != ntimer) { in hpet_alloc()
888 kfree(hpetp); in hpet_alloc()
893 last->hp_next = hpetp; in hpet_alloc()
895 hpets = hpetp; in hpet_alloc()
897 last = hpetp; in hpet_alloc()
904 hpetp->hp_tick_freq = temp; /* ticks per second */ in hpet_alloc()
907 hpetp->hp_which, hdp->hd_phys_address, in hpet_alloc()
908 hpetp->hp_ntimer > 1 ? "s" : ""); in hpet_alloc()
909 for (i = 0; i < hpetp->hp_ntimer; i++) in hpet_alloc()
913 temp = hpetp->hp_tick_freq; in hpet_alloc()
917 hpetp->hp_which, hpetp->hp_ntimer, in hpet_alloc()
928 for (i = 0, devp = hpetp->hp_dev; i < hpetp->hp_ntimer; i++, devp++) { in hpet_alloc()
931 timer = &hpet->hpet_timers[devp - hpetp->hp_dev]; in hpet_alloc()
933 devp->hd_hpets = hpetp; in hpet_alloc()
949 hpetp->hp_delta = hpet_calibrate(hpetp); in hpet_alloc()
954 hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc; in hpet_alloc()
956 clocksource_register_hz(&clocksource_hpet, hpetp->hp_tick_freq); in hpet_alloc()
957 hpetp->hp_clocksource = &clocksource_hpet; in hpet_alloc()