22 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
24 #include <linux/kernel.h>
25 #include <linux/module.h>
27 #include <linux/sched.h>
28 #include <linux/time.h>
29 #include <linux/timex.h>
33 #include <linux/slab.h>
48 while (ts->
nsec < 0) {
85 if ((info->
mode & default_params) != default_params) {
86 pr_err(
"%s: unsupported default parameters\n",
89 goto pps_register_source_exit;
92 pr_err(
"%s: unspecified time format\n",
95 goto pps_register_source_exit;
102 goto pps_register_source_exit;
109 pps->
params.mode = default_params;
115 pps->
info.echo = pps_echo_client_default;
123 pr_err(
"%s: unable to create char device\n",
135 pps_register_source_exit:
136 pr_err(
"%s: unable to register source\n", info->
name);
177 struct pps_ktime ts_real = { .
sec = 0, .nsec = 0, .flags = 0 };
185 timespec_to_pps_ktime(&ts_real, ts->
ts_real);
191 pps->
info.echo(pps, event, data);
198 pps_add_offset(&ts_real,
199 &pps->
params.assert_off_tu);
212 pps_add_offset(&ts_real,
213 &pps->
params.clear_off_tu);
234 spin_unlock_irqrestore(&pps->
lock, flags);