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()
583 struct hpets *hpetp; in hpet_ioctl_common() local
595 hpetp = devp->hd_hpets; in hpet_ioctl_common()
623 hpet_time_div(hpetp, devp->hd_ireqfreq); in hpet_ioctl_common()
626 info->hi_hpet = hpetp->hp_which; in hpet_ioctl_common()
627 info->hi_timer = devp - hpetp->hp_dev; in hpet_ioctl_common()
664 devp->hd_ireqfreq = hpet_time_div(hpetp, arg); in hpet_ioctl_common()
735 struct hpets *hpetp; in hpet_is_known() local
737 for (hpetp = hpets; hpetp; hpetp = hpetp->hp_next) in hpet_is_known()
738 if (hpetp->hp_hpet_phys == hdp->hd_phys_address) in hpet_is_known()
784 static unsigned long __hpet_calibrate(struct hpets *hpetp) in __hpet_calibrate() argument
792 for (j = 0, devp = hpetp->hp_dev; j < hpetp->hp_ntimer; j++, devp++) in __hpet_calibrate()
801 hpet = hpetp->hp_hpet; in __hpet_calibrate()
805 count = hpet_time_div(hpetp, TICK_CALIBRATE); in __hpet_calibrate()
813 write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); in __hpet_calibrate()
821 static unsigned long hpet_calibrate(struct hpets *hpetp) in hpet_calibrate() argument
832 tmp = __hpet_calibrate(hpetp); in hpet_calibrate()
846 struct hpets *hpetp; in hpet_alloc() local
868 hpetp = kzalloc(siz, GFP_KERNEL); in hpet_alloc()
870 if (!hpetp) in hpet_alloc()
873 hpetp->hp_which = hpet_nhpet++; in hpet_alloc()
874 hpetp->hp_hpet = hdp->hd_address; in hpet_alloc()
875 hpetp->hp_hpet_phys = hdp->hd_phys_address; in hpet_alloc()
877 hpetp->hp_ntimer = hdp->hd_nirqs; in hpet_alloc()
880 hpetp->hp_dev[i].hd_hdwirq = hdp->hd_irq[i]; in hpet_alloc()
882 hpet = hpetp->hp_hpet; in hpet_alloc()
888 if (hpetp->hp_ntimer != ntimer) { in hpet_alloc()
891 kfree(hpetp); in hpet_alloc()
896 last->hp_next = hpetp; in hpet_alloc()
898 hpets = hpetp; in hpet_alloc()
900 last = hpetp; in hpet_alloc()
907 hpetp->hp_tick_freq = temp; /* ticks per second */ in hpet_alloc()
910 hpetp->hp_which, hdp->hd_phys_address, in hpet_alloc()
911 hpetp->hp_ntimer > 1 ? "s" : ""); in hpet_alloc()
912 for (i = 0; i < hpetp->hp_ntimer; i++) in hpet_alloc()
916 temp = hpetp->hp_tick_freq; in hpet_alloc()
920 hpetp->hp_which, hpetp->hp_ntimer, in hpet_alloc()
931 for (i = 0, devp = hpetp->hp_dev; i < hpetp->hp_ntimer; i++, devp++) { in hpet_alloc()
934 timer = &hpet->hpet_timers[devp - hpetp->hp_dev]; in hpet_alloc()
936 devp->hd_hpets = hpetp; in hpet_alloc()
952 hpetp->hp_delta = hpet_calibrate(hpetp); in hpet_alloc()
957 hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc; in hpet_alloc()
959 clocksource_register_hz(&clocksource_hpet, hpetp->hp_tick_freq); in hpet_alloc()
960 hpetp->hp_clocksource = &clocksource_hpet; in hpet_alloc()