• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/pps/

Lines Matching defs:pps

75 	struct pps_device *pps;
80 pps = idr_find(&pps_idr, source);
81 if (pps != NULL)
82 atomic_inc(&pps->usage);
86 return pps;
90 * @pps: a pointer to the PPS source.
95 void pps_put_source(struct pps_device *pps)
100 BUG_ON(atomic_read(&pps->usage) == 0);
102 if (!atomic_dec_and_test(&pps->usage)) {
103 pps = NULL;
110 idr_remove(&pps_idr, pps->id);
114 kfree(pps);
130 struct pps_device *pps;
136 printk(KERN_ERR "pps: %s: unsupported default parameters\n",
143 printk(KERN_ERR "pps: %s: echo function is not defined\n",
149 printk(KERN_ERR "pps: %s: unspecified time format\n",
156 pps = kzalloc(sizeof(struct pps_device), GFP_KERNEL);
157 if (pps == NULL) {
165 pps->params.api_version = PPS_API_VERS;
166 pps->params.mode = default_params;
167 pps->info = *info;
169 init_waitqueue_head(&pps->queue);
170 spin_lock_init(&pps->lock);
171 atomic_set(&pps->usage, 1);
185 err = idr_get_new(&pps_idr, pps, &id);
195 printk(KERN_ERR "pps: %s: too many PPS sources in the system\n",
200 pps->id = id;
205 err = pps_register_cdev(pps);
207 printk(KERN_ERR "pps: %s: unable to create char device\n",
222 kfree(pps);
225 printk(KERN_ERR "pps: %s: unable to register source\n", info->name);
240 struct pps_device *pps;
243 pps = idr_find(&pps_idr, source);
245 if (!pps) {
252 pps_unregister_cdev(pps);
253 pps_put_source(pps);
268 * pps->info.echo(source, event, data);
273 struct pps_device *pps;
278 printk(KERN_ERR "pps: unknown event (%x) for source %d\n",
283 pps = pps_get_source(source);
284 if (!pps)
288 pps->id, (unsigned long long) ts->sec, ts->nsec);
290 spin_lock_irqsave(&pps->lock, flags);
293 if ((pps->params.mode & (PPS_ECHOASSERT | PPS_ECHOCLEAR)))
294 pps->info.echo(source, event, data);
297 pps->current_mode = pps->params.mode;
299 (pps->params.mode & PPS_CAPTUREASSERT)) {
301 if (pps->params.mode & PPS_OFFSETASSERT)
302 pps_add_offset(ts, &pps->params.assert_off_tu);
305 pps->assert_tu = *ts;
306 pps->assert_sequence++;
308 pps->assert_sequence, source);
313 (pps->params.mode & PPS_CAPTURECLEAR)) {
315 if (pps->params.mode & PPS_OFFSETCLEAR)
316 pps_add_offset(ts, &pps->params.clear_off_tu);
319 pps->clear_tu = *ts;
320 pps->clear_sequence++;
322 pps->clear_sequence, source);
329 pps->go = ~0;
330 wake_up_interruptible(&pps->queue);
332 kill_fasync(&pps->async_queue, SIGIO, POLL_IN);
335 spin_unlock_irqrestore(&pps->lock, flags);
338 pps_put_source(pps);