20 #include <linux/capability.h>
31 #define PTP_SHOW_INT(name) \
32 static ssize_t name##_show(struct device *dev, \
33 struct device_attribute *attr, char *page) \
35 struct ptp_clock *ptp = dev_get_drvdata(dev); \
36 return snprintf(page, PAGE_SIZE-1, "%d\n", ptp->info->name); \
45 #define PTP_RO_ATTR(_var, _name) { \
46 .attr = { .name = __stringify(_name), .mode = 0444 }, \
47 .show = _var##_show, \
70 cnt =
sscanf(buf,
"%u %d", &req.
extts.index, &enable);
76 err = ops->
enable(ops, &req, enable ? 1 : 0);
101 qcnt = queue_cnt(queue);
103 event = queue->
buf[queue->
head];
106 spin_unlock_irqrestore(&queue->
lock, flags);
120 const char *buf,
size_t count)
127 cnt =
sscanf(buf,
"%u %lld %u %lld %u", &req.
perout.index,
135 enable = req.
perout.period.sec || req.
perout.period.nsec;
136 err = ops->
enable(ops, &req, enable);
147 const char *buf,
size_t count)
158 cnt =
sscanf(buf,
"%d", &enable);
162 err = ops->
enable(ops, &req, enable ? 1 : 0);