• Home
  • Raw
  • Download

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 sysfs_emit(page, "%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()
92 mutex_unlock(&ptp->tsevq_mux); in extts_fifo_show()
101 struct ptp_clock *ptp = dev_get_drvdata(dev); in period_store() local
102 struct ptp_clock_info *ops = ptp->info; in period_store()
129 struct ptp_clock *ptp = dev_get_drvdata(dev); in pps_enable_store() local
130 struct ptp_clock_info *ops = ptp->info; in pps_enable_store()
173 struct ptp_clock *ptp = dev_get_drvdata(dev); in ptp_is_attribute_visible() local
174 struct ptp_clock_info *info = ptp->info; in ptp_is_attribute_visible()
202 static int ptp_pin_name2index(struct ptp_clock *ptp, const char *name) in ptp_pin_name2index() argument
205 for (i = 0; i < ptp->info->n_pins; i++) { in ptp_pin_name2index()
206 if (!strcmp(ptp->info->pin_config[i].name, name)) in ptp_pin_name2index()
215 struct ptp_clock *ptp = dev_get_drvdata(dev); in ptp_pin_show() local
219 index = ptp_pin_name2index(ptp, attr->attr.name); in ptp_pin_show()
223 if (mutex_lock_interruptible(&ptp->pincfg_mux)) in ptp_pin_show()
226 func = ptp->info->pin_config[index].func; in ptp_pin_show()
227 chan = ptp->info->pin_config[index].chan; in ptp_pin_show()
229 mutex_unlock(&ptp->pincfg_mux); in ptp_pin_show()
237 struct ptp_clock *ptp = dev_get_drvdata(dev); in ptp_pin_store() local
245 index = ptp_pin_name2index(ptp, attr->attr.name); in ptp_pin_store()
249 if (mutex_lock_interruptible(&ptp->pincfg_mux)) in ptp_pin_store()
251 err = ptp_set_pinfunc(ptp, index, func, chan); in ptp_pin_store()
252 mutex_unlock(&ptp->pincfg_mux); in ptp_pin_store()
259 int ptp_populate_pin_groups(struct ptp_clock *ptp) in ptp_populate_pin_groups() argument
261 struct ptp_clock_info *info = ptp->info; in ptp_populate_pin_groups()
267 ptp->pin_dev_attr = kcalloc(n_pins, sizeof(*ptp->pin_dev_attr), in ptp_populate_pin_groups()
269 if (!ptp->pin_dev_attr) in ptp_populate_pin_groups()
272 ptp->pin_attr = kcalloc(1 + n_pins, sizeof(*ptp->pin_attr), GFP_KERNEL); in ptp_populate_pin_groups()
273 if (!ptp->pin_attr) in ptp_populate_pin_groups()
277 struct device_attribute *da = &ptp->pin_dev_attr[i]; in ptp_populate_pin_groups()
283 ptp->pin_attr[i] = &da->attr; in ptp_populate_pin_groups()
286 ptp->pin_attr_group.name = "pins"; in ptp_populate_pin_groups()
287 ptp->pin_attr_group.attrs = ptp->pin_attr; in ptp_populate_pin_groups()
289 ptp->pin_attr_groups[0] = &ptp->pin_attr_group; in ptp_populate_pin_groups()
294 kfree(ptp->pin_dev_attr); in ptp_populate_pin_groups()
299 void ptp_cleanup_pin_groups(struct ptp_clock *ptp) in ptp_cleanup_pin_groups() argument
301 kfree(ptp->pin_attr); in ptp_cleanup_pin_groups()
302 kfree(ptp->pin_dev_attr); in ptp_cleanup_pin_groups()