Lines Matching full:ptp

3  * PTP 1588 clock support - sysfs interface.
15 struct ptp_clock *ptp = dev_get_drvdata(dev); in clock_name_show() local
16 return snprintf(page, PAGE_SIZE-1, "%s\n", ptp->info->name); in clock_name_show()
24 struct ptp_clock *ptp = dev_get_drvdata(dev); \
25 return snprintf(page, PAGE_SIZE-1, "%d\n", ptp->info->var); \
40 struct ptp_clock *ptp = dev_get_drvdata(dev); in extts_enable_store() local
41 struct ptp_clock_info *ops = ptp->info; in extts_enable_store()
65 struct ptp_clock *ptp = dev_get_drvdata(dev); in extts_fifo_show() local
66 struct timestamp_event_queue *queue = &ptp->tsevq; in extts_fifo_show()
74 if (mutex_lock_interruptible(&ptp->tsevq_mux)) in extts_fifo_show()
91 mutex_unlock(&ptp->tsevq_mux); in extts_fifo_show()
100 struct ptp_clock *ptp = dev_get_drvdata(dev); in period_store() local
101 struct ptp_clock_info *ops = ptp->info; in period_store()
128 struct ptp_clock *ptp = dev_get_drvdata(dev); in pps_enable_store() local
129 struct ptp_clock_info *ops = ptp->info; in pps_enable_store()
172 struct ptp_clock *ptp = dev_get_drvdata(dev); in ptp_is_attribute_visible() local
173 struct ptp_clock_info *info = ptp->info; in ptp_is_attribute_visible()
201 static int ptp_pin_name2index(struct ptp_clock *ptp, const char *name) in ptp_pin_name2index() argument
204 for (i = 0; i < ptp->info->n_pins; i++) { in ptp_pin_name2index()
205 if (!strcmp(ptp->info->pin_config[i].name, name)) in ptp_pin_name2index()
214 struct ptp_clock *ptp = dev_get_drvdata(dev); in ptp_pin_show() local
218 index = ptp_pin_name2index(ptp, attr->attr.name); in ptp_pin_show()
222 if (mutex_lock_interruptible(&ptp->pincfg_mux)) in ptp_pin_show()
225 func = ptp->info->pin_config[index].func; in ptp_pin_show()
226 chan = ptp->info->pin_config[index].chan; in ptp_pin_show()
228 mutex_unlock(&ptp->pincfg_mux); in ptp_pin_show()
236 struct ptp_clock *ptp = dev_get_drvdata(dev); in ptp_pin_store() local
244 index = ptp_pin_name2index(ptp, attr->attr.name); in ptp_pin_store()
248 if (mutex_lock_interruptible(&ptp->pincfg_mux)) in ptp_pin_store()
250 err = ptp_set_pinfunc(ptp, index, func, chan); in ptp_pin_store()
251 mutex_unlock(&ptp->pincfg_mux); in ptp_pin_store()
258 int ptp_populate_pin_groups(struct ptp_clock *ptp) in ptp_populate_pin_groups() argument
260 struct ptp_clock_info *info = ptp->info; in ptp_populate_pin_groups()
266 ptp->pin_dev_attr = kcalloc(n_pins, sizeof(*ptp->pin_dev_attr), in ptp_populate_pin_groups()
268 if (!ptp->pin_dev_attr) in ptp_populate_pin_groups()
271 ptp->pin_attr = kcalloc(1 + n_pins, sizeof(*ptp->pin_attr), GFP_KERNEL); in ptp_populate_pin_groups()
272 if (!ptp->pin_attr) in ptp_populate_pin_groups()
276 struct device_attribute *da = &ptp->pin_dev_attr[i]; in ptp_populate_pin_groups()
282 ptp->pin_attr[i] = &da->attr; in ptp_populate_pin_groups()
285 ptp->pin_attr_group.name = "pins"; in ptp_populate_pin_groups()
286 ptp->pin_attr_group.attrs = ptp->pin_attr; in ptp_populate_pin_groups()
288 ptp->pin_attr_groups[0] = &ptp->pin_attr_group; in ptp_populate_pin_groups()
293 kfree(ptp->pin_dev_attr); in ptp_populate_pin_groups()
298 void ptp_cleanup_pin_groups(struct ptp_clock *ptp) in ptp_cleanup_pin_groups() argument
300 kfree(ptp->pin_attr); in ptp_cleanup_pin_groups()
301 kfree(ptp->pin_dev_attr); in ptp_cleanup_pin_groups()