Lines Matching defs:pps

41 static void pps_echo_client_default(struct pps_device *pps, int event,
44 dev_info(pps->dev, "echo %s %s\n",
68 struct pps_device *pps;
86 pps = kzalloc(sizeof(struct pps_device), GFP_KERNEL);
87 if (pps == NULL) {
95 pps->params.api_version = PPS_API_VERS;
96 pps->params.mode = default_params;
97 pps->info = *info;
100 if ((pps->info.mode & (PPS_ECHOASSERT | PPS_ECHOCLEAR)) &&
101 pps->info.echo == NULL)
102 pps->info.echo = pps_echo_client_default;
104 init_waitqueue_head(&pps->queue);
105 spin_lock_init(&pps->lock);
108 err = pps_register_cdev(pps);
115 dev_info(pps->dev, "new PPS source %s\n", info->name);
117 return pps;
120 kfree(pps);
130 * @pps: the PPS source
136 void pps_unregister_source(struct pps_device *pps)
138 pps_kc_remove(pps);
139 pps_unregister_cdev(pps);
141 /* don't have to kfree(pps) here because it will be done on
147 * @pps: the PPS device
157 * pps->info.echo(pps, event, data);
159 void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event,
169 dev_dbg(pps->dev, "PPS event at %lld.%09ld\n",
174 spin_lock_irqsave(&pps->lock, flags);
177 if ((pps->params.mode & (PPS_ECHOASSERT | PPS_ECHOCLEAR)))
178 pps->info.echo(pps, event, data);
181 pps->current_mode = pps->params.mode;
182 if (event & pps->params.mode & PPS_CAPTUREASSERT) {
184 if (pps->params.mode & PPS_OFFSETASSERT)
186 &pps->params.assert_off_tu);
189 pps->assert_tu = ts_real;
190 pps->assert_sequence++;
191 dev_dbg(pps->dev, "capture assert seq #%u\n",
192 pps->assert_sequence);
196 if (event & pps->params.mode & PPS_CAPTURECLEAR) {
198 if (pps->params.mode & PPS_OFFSETCLEAR)
200 &pps->params.clear_off_tu);
203 pps->clear_tu = ts_real;
204 pps->clear_sequence++;
205 dev_dbg(pps->dev, "capture clear seq #%u\n",
206 pps->clear_sequence);
211 pps_kc_event(pps, ts, event);
215 pps->last_ev++;
216 wake_up_interruptible_all(&pps->queue);
218 kill_fasync(&pps->async_queue, SIGIO, POLL_IN);
221 spin_unlock_irqrestore(&pps->lock, flags);