Lines Matching refs:hpetp
163 struct hpets *hpetp = devp->hd_hpets; in hpet_interrupt() local
184 k = (mc - base + hpetp->hp_delta) / t; in hpet_interrupt()
262 struct hpets *hpetp; in hpet_open() local
271 for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) in hpet_open()
272 for (i = 0; i < hpetp->hp_ntimer; i++) in hpet_open()
273 if (hpetp->hp_dev[i].hd_flags & HPET_OPEN) in hpet_open()
276 devp = &hpetp->hp_dev[i]; in hpet_open()
459 struct hpets *hpetp; in hpet_ioctl_ieon() local
466 hpetp = devp->hd_hpets; in hpet_ioctl_ieon()
504 sprintf(devp->hd_name, "hpet%d", (int)(devp - hpetp->hp_dev)); in hpet_ioctl_ieon()
543 write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); in hpet_ioctl_ieon()
552 write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); in hpet_ioctl_ieon()
582 struct hpets *hpetp; in hpet_ioctl_common() local
594 hpetp = devp->hd_hpets; in hpet_ioctl_common()
622 hpet_time_div(hpetp, devp->hd_ireqfreq); in hpet_ioctl_common()
625 info->hi_hpet = hpetp->hp_which; in hpet_ioctl_common()
626 info->hi_timer = devp - hpetp->hp_dev; in hpet_ioctl_common()
663 devp->hd_ireqfreq = hpet_time_div(hpetp, arg); in hpet_ioctl_common()
734 struct hpets *hpetp; in hpet_is_known() local
736 for (hpetp = hpets; hpetp; hpetp = hpetp->hp_next) in hpet_is_known()
737 if (hpetp->hp_hpet_phys == hdp->hd_phys_address) in hpet_is_known()
783 static unsigned long __hpet_calibrate(struct hpets *hpetp) in __hpet_calibrate() argument
791 for (j = 0, devp = hpetp->hp_dev; j < hpetp->hp_ntimer; j++, devp++) in __hpet_calibrate()
800 hpet = hpetp->hp_hpet; in __hpet_calibrate()
804 count = hpet_time_div(hpetp, TICK_CALIBRATE); in __hpet_calibrate()
812 write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare); in __hpet_calibrate()
820 static unsigned long hpet_calibrate(struct hpets *hpetp) in hpet_calibrate() argument
831 tmp = __hpet_calibrate(hpetp); in hpet_calibrate()
845 struct hpets *hpetp; in hpet_alloc() local
867 hpetp = kzalloc(siz, GFP_KERNEL); in hpet_alloc()
869 if (!hpetp) in hpet_alloc()
872 hpetp->hp_which = hpet_nhpet++; in hpet_alloc()
873 hpetp->hp_hpet = hdp->hd_address; in hpet_alloc()
874 hpetp->hp_hpet_phys = hdp->hd_phys_address; in hpet_alloc()
876 hpetp->hp_ntimer = hdp->hd_nirqs; in hpet_alloc()
879 hpetp->hp_dev[i].hd_hdwirq = hdp->hd_irq[i]; in hpet_alloc()
881 hpet = hpetp->hp_hpet; in hpet_alloc()
887 if (hpetp->hp_ntimer != ntimer) { in hpet_alloc()
890 kfree(hpetp); in hpet_alloc()
895 last->hp_next = hpetp; in hpet_alloc()
897 hpets = hpetp; in hpet_alloc()
899 last = hpetp; in hpet_alloc()
906 hpetp->hp_tick_freq = temp; /* ticks per second */ in hpet_alloc()
909 hpetp->hp_which, hdp->hd_phys_address, in hpet_alloc()
910 hpetp->hp_ntimer > 1 ? "s" : ""); in hpet_alloc()
911 for (i = 0; i < hpetp->hp_ntimer; i++) in hpet_alloc()
915 temp = hpetp->hp_tick_freq; in hpet_alloc()
919 hpetp->hp_which, hpetp->hp_ntimer, in hpet_alloc()
930 for (i = 0, devp = hpetp->hp_dev; i < hpetp->hp_ntimer; i++, devp++) { in hpet_alloc()
933 timer = &hpet->hpet_timers[devp - hpetp->hp_dev]; in hpet_alloc()
935 devp->hd_hpets = hpetp; in hpet_alloc()
951 hpetp->hp_delta = hpet_calibrate(hpetp); in hpet_alloc()
956 hpet_mctr = (void __iomem *)&hpetp->hp_hpet->hpet_mc; in hpet_alloc()
958 clocksource_register_hz(&clocksource_hpet, hpetp->hp_tick_freq); in hpet_alloc()
959 hpetp->hp_clocksource = &clocksource_hpet; in hpet_alloc()