Lines Matching full:phc

51 	struct mock_phc *phc = info_to_phc(info);  in mock_phc_adjfine()  local
57 spin_lock(&phc->lock); in mock_phc_adjfine()
58 timecounter_read(&phc->tc); in mock_phc_adjfine()
59 phc->cc.mult = MOCK_PHC_CC_MULT + adj; in mock_phc_adjfine()
60 spin_unlock(&phc->lock); in mock_phc_adjfine()
67 struct mock_phc *phc = info_to_phc(info); in mock_phc_adjtime() local
69 spin_lock(&phc->lock); in mock_phc_adjtime()
70 timecounter_adjtime(&phc->tc, delta); in mock_phc_adjtime()
71 spin_unlock(&phc->lock); in mock_phc_adjtime()
79 struct mock_phc *phc = info_to_phc(info); in mock_phc_settime64() local
82 spin_lock(&phc->lock); in mock_phc_settime64()
83 timecounter_init(&phc->tc, &phc->cc, ns); in mock_phc_settime64()
84 spin_unlock(&phc->lock); in mock_phc_settime64()
91 struct mock_phc *phc = info_to_phc(info); in mock_phc_gettime64() local
94 spin_lock(&phc->lock); in mock_phc_gettime64()
95 ns = timecounter_read(&phc->tc); in mock_phc_gettime64()
96 spin_unlock(&phc->lock); in mock_phc_gettime64()
112 int mock_phc_index(struct mock_phc *phc) in mock_phc_index() argument
114 return ptp_clock_index(phc->clock); in mock_phc_index()
120 struct mock_phc *phc; in mock_phc_create() local
123 phc = kzalloc(sizeof(*phc), GFP_KERNEL); in mock_phc_create()
124 if (!phc) { in mock_phc_create()
129 phc->info = (struct ptp_clock_info) { in mock_phc_create()
140 phc->cc = (struct cyclecounter) { in mock_phc_create()
147 spin_lock_init(&phc->lock); in mock_phc_create()
148 timecounter_init(&phc->tc, &phc->cc, 0); in mock_phc_create()
150 phc->clock = ptp_clock_register(&phc->info, dev); in mock_phc_create()
151 if (IS_ERR(phc->clock)) { in mock_phc_create()
152 err = PTR_ERR(phc->clock); in mock_phc_create()
156 ptp_schedule_worker(phc->clock, MOCK_PHC_REFRESH_INTERVAL); in mock_phc_create()
158 return phc; in mock_phc_create()
161 kfree(phc); in mock_phc_create()
167 void mock_phc_destroy(struct mock_phc *phc) in mock_phc_destroy() argument
169 ptp_clock_unregister(phc->clock); in mock_phc_destroy()
170 kfree(phc); in mock_phc_destroy()