Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ptp_qoriq: make ptp operations global

This patch is to make functions of ptp operations global,
so that ENETC PTP driver which is a PCI driver for same
1588 timer IP block could reuse them.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Yangbo Lu and committed by
David S. Miller
73356e4e 1e562c81

+25 -11
+16 -11
drivers/ptp/ptp_qoriq.c
··· 22 22 23 23 #include <linux/device.h> 24 24 #include <linux/hrtimer.h> 25 - #include <linux/interrupt.h> 26 25 #include <linux/kernel.h> 27 26 #include <linux/module.h> 28 27 #include <linux/of.h> ··· 134 135 * Interrupt service routine 135 136 */ 136 137 137 - static irqreturn_t isr(int irq, void *priv) 138 + irqreturn_t ptp_qoriq_isr(int irq, void *priv) 138 139 { 139 140 struct ptp_qoriq *ptp_qoriq = priv; 140 141 struct ptp_qoriq_registers *regs = &ptp_qoriq->regs; ··· 199 200 } else 200 201 return IRQ_NONE; 201 202 } 203 + EXPORT_SYMBOL_GPL(ptp_qoriq_isr); 202 204 203 205 /* 204 206 * PTP clock operations 205 207 */ 206 208 207 - static int ptp_qoriq_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) 209 + int ptp_qoriq_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) 208 210 { 209 211 u64 adj, diff; 210 212 u32 tmr_add; ··· 233 233 234 234 return 0; 235 235 } 236 + EXPORT_SYMBOL_GPL(ptp_qoriq_adjfine); 236 237 237 - static int ptp_qoriq_adjtime(struct ptp_clock_info *ptp, s64 delta) 238 + int ptp_qoriq_adjtime(struct ptp_clock_info *ptp, s64 delta) 238 239 { 239 240 s64 now; 240 241 unsigned long flags; ··· 252 251 253 252 return 0; 254 253 } 254 + EXPORT_SYMBOL_GPL(ptp_qoriq_adjtime); 255 255 256 - static int ptp_qoriq_gettime(struct ptp_clock_info *ptp, 257 - struct timespec64 *ts) 256 + int ptp_qoriq_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) 258 257 { 259 258 u64 ns; 260 259 unsigned long flags; ··· 270 269 271 270 return 0; 272 271 } 272 + EXPORT_SYMBOL_GPL(ptp_qoriq_gettime); 273 273 274 - static int ptp_qoriq_settime(struct ptp_clock_info *ptp, 275 - const struct timespec64 *ts) 274 + int ptp_qoriq_settime(struct ptp_clock_info *ptp, 275 + const struct timespec64 *ts) 276 276 { 277 277 u64 ns; 278 278 unsigned long flags; ··· 290 288 291 289 return 0; 292 290 } 291 + EXPORT_SYMBOL_GPL(ptp_qoriq_settime); 293 292 294 - static int ptp_qoriq_enable(struct ptp_clock_info *ptp, 295 - struct ptp_clock_request *rq, int on) 293 + int ptp_qoriq_enable(struct ptp_clock_info *ptp, 294 + struct ptp_clock_request *rq, int on) 296 295 { 297 296 struct ptp_qoriq *ptp_qoriq = container_of(ptp, struct ptp_qoriq, caps); 298 297 struct ptp_qoriq_registers *regs = &ptp_qoriq->regs; ··· 339 336 spin_unlock_irqrestore(&ptp_qoriq->lock, flags); 340 337 return 0; 341 338 } 339 + EXPORT_SYMBOL_GPL(ptp_qoriq_enable); 342 340 343 341 static const struct ptp_clock_info ptp_qoriq_caps = { 344 342 .owner = THIS_MODULE, ··· 512 508 pr_err("irq not in device tree\n"); 513 509 goto no_node; 514 510 } 515 - if (request_irq(ptp_qoriq->irq, isr, IRQF_SHARED, DRIVER, ptp_qoriq)) { 511 + if (request_irq(ptp_qoriq->irq, ptp_qoriq_isr, IRQF_SHARED, 512 + DRIVER, ptp_qoriq)) { 516 513 pr_err("request_irq failed\n"); 517 514 goto no_node; 518 515 }
+9
include/linux/fsl/ptp_qoriq.h
··· 7 7 #define __PTP_QORIQ_H__ 8 8 9 9 #include <linux/io.h> 10 + #include <linux/interrupt.h> 10 11 #include <linux/ptp_clock_kernel.h> 11 12 12 13 /* ··· 172 171 iowrite32be(val, addr); 173 172 } 174 173 174 + irqreturn_t ptp_qoriq_isr(int irq, void *priv); 175 + int ptp_qoriq_adjfine(struct ptp_clock_info *ptp, long scaled_ppm); 176 + int ptp_qoriq_adjtime(struct ptp_clock_info *ptp, s64 delta); 177 + int ptp_qoriq_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts); 178 + int ptp_qoriq_settime(struct ptp_clock_info *ptp, 179 + const struct timespec64 *ts); 180 + int ptp_qoriq_enable(struct ptp_clock_info *ptp, 181 + struct ptp_clock_request *rq, int on); 175 182 #ifdef CONFIG_DEBUG_FS 176 183 void ptp_qoriq_create_debugfs(struct ptp_qoriq *ptp_qoriq); 177 184 void ptp_qoriq_remove_debugfs(struct ptp_qoriq *ptp_qoriq);