diff options
Diffstat (limited to 'include/linux/ptp_clock_kernel.h')
| -rw-r--r-- | include/linux/ptp_clock_kernel.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h index a026bfd089db..51349d124ee5 100644 --- a/include/linux/ptp_clock_kernel.h +++ b/include/linux/ptp_clock_kernel.h | |||
| @@ -99,6 +99,11 @@ struct system_device_crosststamp; | |||
| 99 | * parameter func: the desired function to use. | 99 | * parameter func: the desired function to use. |
| 100 | * parameter chan: the function channel index to use. | 100 | * parameter chan: the function channel index to use. |
| 101 | * | 101 | * |
| 102 | * @do_work: Request driver to perform auxiliary (periodic) operations | ||
| 103 | * Driver should return delay of the next auxiliary work scheduling | ||
| 104 | * time (>=0) or negative value in case further scheduling | ||
| 105 | * is not required. | ||
| 106 | * | ||
| 102 | * Drivers should embed their ptp_clock_info within a private | 107 | * Drivers should embed their ptp_clock_info within a private |
| 103 | * structure, obtaining a reference to it using container_of(). | 108 | * structure, obtaining a reference to it using container_of(). |
| 104 | * | 109 | * |
| @@ -126,6 +131,7 @@ struct ptp_clock_info { | |||
| 126 | struct ptp_clock_request *request, int on); | 131 | struct ptp_clock_request *request, int on); |
| 127 | int (*verify)(struct ptp_clock_info *ptp, unsigned int pin, | 132 | int (*verify)(struct ptp_clock_info *ptp, unsigned int pin, |
| 128 | enum ptp_pin_function func, unsigned int chan); | 133 | enum ptp_pin_function func, unsigned int chan); |
| 134 | long (*do_aux_work)(struct ptp_clock_info *ptp); | ||
| 129 | }; | 135 | }; |
| 130 | 136 | ||
| 131 | struct ptp_clock; | 137 | struct ptp_clock; |
| @@ -211,6 +217,16 @@ extern int ptp_clock_index(struct ptp_clock *ptp); | |||
| 211 | int ptp_find_pin(struct ptp_clock *ptp, | 217 | int ptp_find_pin(struct ptp_clock *ptp, |
| 212 | enum ptp_pin_function func, unsigned int chan); | 218 | enum ptp_pin_function func, unsigned int chan); |
| 213 | 219 | ||
| 220 | /** | ||
| 221 | * ptp_schedule_worker() - schedule ptp auxiliary work | ||
| 222 | * | ||
| 223 | * @ptp: The clock obtained from ptp_clock_register(). | ||
| 224 | * @delay: number of jiffies to wait before queuing | ||
| 225 | * See kthread_queue_delayed_work() for more info. | ||
| 226 | */ | ||
| 227 | |||
| 228 | int ptp_schedule_worker(struct ptp_clock *ptp, unsigned long delay); | ||
| 229 | |||
| 214 | #else | 230 | #else |
| 215 | static inline struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, | 231 | static inline struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info, |
| 216 | struct device *parent) | 232 | struct device *parent) |
| @@ -225,6 +241,10 @@ static inline int ptp_clock_index(struct ptp_clock *ptp) | |||
| 225 | static inline int ptp_find_pin(struct ptp_clock *ptp, | 241 | static inline int ptp_find_pin(struct ptp_clock *ptp, |
| 226 | enum ptp_pin_function func, unsigned int chan) | 242 | enum ptp_pin_function func, unsigned int chan) |
| 227 | { return -1; } | 243 | { return -1; } |
| 244 | static inline int ptp_schedule_worker(struct ptp_clock *ptp, | ||
| 245 | unsigned long delay) | ||
| 246 | { return -EOPNOTSUPP; } | ||
| 247 | |||
| 228 | #endif | 248 | #endif |
| 229 | 249 | ||
| 230 | #endif | 250 | #endif |
