This patch is to add debugfs support for ptp_qoriq. Current debugfs supports to control fiper1/fiper2 loopback mode. If the loopback mode is enabled, the fiper1/fiper2 pulse is looped back into trigger1/ trigger2 input. This is very useful for validating hardware and driver without external hardware. Below is an example to enable fiper1 loopback. echo 1 > /sys/kernel/debug/2d10e00.ptp_clock/fiper1-loopback
Showing the changes to include/linux (1 of 5 files). Show all
Unified · Split
| @@ -143,6 +143,8 @@ struct qoriq_ptp { · 142 unmodified lines | ||
| 143 | 143 | struct ptp_clock *clock; |
| 144 | 144 | struct ptp_clock_info caps; |
| 145 | 145 | struct resource *rsrc; |
| 146 | + struct dentry *debugfs_root; | |
| 147 | + struct device *dev; | |
| 146 | 148 | bool extts_fifo_support; |
| 147 | 149 | int irq; |
| 148 | 150 | int phc_index; |
| @@ -169,4 +171,14 @@ static inline void qoriq_write(unsigned __iomem *addr, u32 val) · 20 unmodified lines | ||
| 169 | 171 | iowrite32be(val, addr); |
| 170 | 172 | } |
| 171 | 173 | |
| 174 | +#ifdef CONFIG_DEBUG_FS | |
| 175 | +void ptp_qoriq_create_debugfs(struct qoriq_ptp *qoriq_ptp); | |
| 176 | +void ptp_qoriq_remove_debugfs(struct qoriq_ptp *qoriq_ptp); | |
| 177 | +#else | |
| 178 | +static inline void ptp_qoriq_create_debugfs(struct qoriq_ptp *qoriq_ptp) | |
| 179 | +{ } | |
| 180 | +static inline void ptp_qoriq_remove_debugfs(struct qoriq_ptp *qoriq_ptp) | |
| 181 | +{ } | |
| 182 | +#endif | |
| 183 | + | |
| 172 | 184 | #endif |