Lines Matching defs:buf
382 static int ptp_ocp_sma_store(struct ptp_ocp *bp, const char *buf, int sma_nr);
963 ptp_ocp_select_table_show(const struct ocp_selector *tbl, char *buf)
970 count += sysfs_emit_at(buf, count, "%s ", tbl[i].name);
973 count += sysfs_emit_at(buf, count, "\n");
1214 char buf[16];
1218 snprintf(buf, sizeof(buf), "IN: None");
1228 snprintf(buf, sizeof(buf), "OUT: GEN%d", chan);
1230 snprintf(buf, sizeof(buf), "OUT: PHC");
1236 return ptp_ocp_sma_store(bp, buf, pin + 1);
1654 char buf[32];
1658 sprintf(buf, "%d.%d", bp->fw_tag, bp->fw_version);
1659 err = devlink_info_version_running_put(req, fw_image, buf);
1669 sprintf(buf, "%pM", bp->serial);
1670 err = devlink_info_serial_number_put(req, buf);
1772 char buf[32];
1778 sprintf(buf, "AXI.%d", id);
1779 clk = clk_hw_register_fixed_rate(&pdev->dev, buf, NULL, 0,
1785 sprintf(buf, "%s.%d", info->name, id);
1786 devm_clk_hw_register_clkdev(&pdev->dev, clk, NULL, buf);
2568 ptp_ocp_show_output(const struct ocp_selector *tbl, u32 val, char *buf,
2574 count = sysfs_emit(buf, "OUT: ");
2578 count += sysfs_emit_at(buf, count, "%s\n", name);
2583 ptp_ocp_show_inputs(const struct ocp_selector *tbl, u32 val, char *buf,
2590 count = sysfs_emit(buf, "IN: ");
2594 count += sysfs_emit_at(buf, count, "%s ", name);
2599 count += sysfs_emit_at(buf, count, "%s ", name);
2603 count += sysfs_emit_at(buf, count, "\n");
2608 sma_parse_inputs(const struct ocp_selector * const tbl[], const char *buf,
2615 argv = argv_split(GFP_KERNEL, buf, &count);
2647 ptp_ocp_sma_show(struct ptp_ocp *bp, int sma_nr, char *buf,
2660 return ptp_ocp_show_inputs(tbl[0], val, buf, default_in_val);
2663 return ptp_ocp_show_output(tbl[1], val, buf, default_out_val);
2667 sma1_show(struct device *dev, struct device_attribute *attr, char *buf)
2671 return ptp_ocp_sma_show(bp, 1, buf, 0, 1);
2675 sma2_show(struct device *dev, struct device_attribute *attr, char *buf)
2679 return ptp_ocp_sma_show(bp, 2, buf, -1, 1);
2683 sma3_show(struct device *dev, struct device_attribute *attr, char *buf)
2687 return ptp_ocp_sma_show(bp, 3, buf, -1, 0);
2691 sma4_show(struct device *dev, struct device_attribute *attr, char *buf)
2695 return ptp_ocp_sma_show(bp, 4, buf, -1, 1);
2699 ptp_ocp_sma_store(struct ptp_ocp *bp, const char *buf, int sma_nr)
2706 val = sma_parse_inputs(bp->sma_op->tbl, buf, &mode);
2745 const char *buf, size_t count)
2750 err = ptp_ocp_sma_store(bp, buf, 1);
2756 const char *buf, size_t count)
2761 err = ptp_ocp_sma_store(bp, buf, 2);
2767 const char *buf, size_t count)
2772 err = ptp_ocp_sma_store(bp, buf, 3);
2778 const char *buf, size_t count)
2783 err = ptp_ocp_sma_store(bp, buf, 4);
2793 struct device_attribute *attr, char *buf)
2797 return ptp_ocp_select_table_show(bp->sma_op->tbl[0], buf);
2803 struct device_attribute *attr, char *buf)
2807 return ptp_ocp_select_table_show(bp->sma_op->tbl[1], buf);
2822 const char *buf, size_t count)
2831 argv = argv_split(GFP_KERNEL, buf, &argc);
2882 signal_show(struct device *dev, struct device_attribute *attr, char *buf)
2894 count = sysfs_emit(buf, "%llu %d %llu %d", signal->period,
2898 count += sysfs_emit_at(buf, count, " %ptT TAI\n", &ts);
2908 duty_show(struct device *dev, struct device_attribute *attr, char *buf)
2914 return sysfs_emit(buf, "%d\n", bp->signal[i].duty);
2922 period_show(struct device *dev, struct device_attribute *attr, char *buf)
2928 return sysfs_emit(buf, "%llu\n", bp->signal[i].period);
2936 phase_show(struct device *dev, struct device_attribute *attr, char *buf)
2942 return sysfs_emit(buf, "%llu\n", bp->signal[i].phase);
2951 char *buf)
2957 return sysfs_emit(buf, "%d\n", bp->signal[i].polarity);
2965 running_show(struct device *dev, struct device_attribute *attr, char *buf)
2971 return sysfs_emit(buf, "%d\n", bp->signal[i].running);
2979 start_show(struct device *dev, struct device_attribute *attr, char *buf)
2987 return sysfs_emit(buf, "%llu.%lu\n", ts.tv_sec, ts.tv_nsec);
2996 const char *buf, size_t count)
3004 err = kstrtou32(buf, 0, &val);
3019 seconds_show(struct device *dev, struct device_attribute *attr, char *buf)
3032 return sysfs_emit(buf, "%u\n", val);
3040 frequency_show(struct device *dev, struct device_attribute *attr, char *buf)
3049 return sysfs_emit(buf, "error\n");
3051 return sysfs_emit(buf, "overrun\n");
3053 return sysfs_emit(buf, "%lu\n", val & FREQ_STATUS_MASK);
3062 serialnum_show(struct device *dev, struct device_attribute *attr, char *buf)
3069 return sysfs_emit(buf, "%pM\n", bp->serial);
3074 gnss_sync_show(struct device *dev, struct device_attribute *attr, char *buf)
3080 ret = sysfs_emit(buf, "LOST @ %ptT\n", &bp->gnss_lost);
3082 ret = sysfs_emit(buf, "SYNC\n");
3090 struct device_attribute *attr, char *buf)
3094 return sysfs_emit(buf, "%d\n", bp->utc_tai_offset);
3100 const char *buf, size_t count)
3106 err = kstrtou32(buf, 0, &val);
3118 struct device_attribute *attr, char *buf)
3122 return sysfs_emit(buf, "%d\n", bp->ts_window_adjust);
3128 const char *buf, size_t count)
3134 err = kstrtou32(buf, 0, &val);
3145 irig_b_mode_show(struct device *dev, struct device_attribute *attr, char *buf)
3152 return sysfs_emit(buf, "%d\n", val);
3158 const char *buf, size_t count)
3166 err = kstrtou8(buf, 0, &val);
3185 clock_source_show(struct device *dev, struct device_attribute *attr, char *buf)
3194 return sysfs_emit(buf, "%s\n", p);
3199 const char *buf, size_t count)
3205 val = ptp_ocp_select_val_from_name(ptp_ocp_clock, buf);
3219 struct device_attribute *attr, char *buf)
3221 return ptp_ocp_select_table_show(ptp_ocp_clock, buf);
3227 struct device_attribute *attr, char *buf)
3236 return sysfs_emit(buf, "%d\n", res);
3242 struct device_attribute *attr, char *buf)
3251 return sysfs_emit(buf, "%d\n", res);
3257 struct device_attribute *attr, char *buf)
3266 return sysfs_emit(buf, "%d\n", res);
3271 const char *buf, size_t count)
3278 err = kstrtos32(buf, 0, &res);
3342 struct bin_attribute *bin_attr, char *buf,
3363 err = nvmem_device_read(nvmem, off, count, buf);
3377 struct bin_attribute *bin_attr, char *buf,
3392 err = nvmem_device_write(nvmem, 0x00, count, buf);
3404 struct bin_attribute *bin_attr, char *buf,
3425 err = nvmem_device_read(nvmem, 0x90 + off, count, buf);
3439 struct bin_attribute *bin_attr, char *buf,
3454 err = nvmem_device_write(nvmem, 0x90, count, buf);
3533 gpio_input_map(char *buf, struct ptp_ocp *bp, u16 map[][2], u16 bit,
3542 sprintf(buf, "sma%d", i + 1);
3548 strcpy(buf, def);
3552 gpio_output_map(char *buf, struct ptp_ocp *bp, u16 map[][2], u16 bit)
3554 char *ans = buf;
3629 char *buf, *src, *mac_src;
3637 buf = (char *)__get_free_page(GFP_KERNEL);
3638 if (!buf)
3676 sma1_show(dev, NULL, buf);
3678 sma_val[0][0], sma_val[0][1], buf);
3680 sma2_show(dev, NULL, buf);
3682 sma_val[1][0], sma_val[1][1], buf);
3684 sma3_show(dev, NULL, buf);
3686 sma_val[2][0], sma_val[2][1], buf);
3688 sma4_show(dev, NULL, buf);
3690 sma_val[3][0], sma_val[3][1], buf);
3703 gpio_input_map(buf, bp, sma_val, 2, NULL);
3705 on ? " ON" : "OFF", buf);
3711 gpio_input_map(buf, bp, sma_val, 3, NULL);
3713 on ? " ON" : "OFF", buf);
3719 gpio_input_map(buf, bp, sma_val, 6, NULL);
3721 on ? " ON" : "OFF", buf);
3727 gpio_input_map(buf, bp, sma_val, 7, NULL);
3729 on ? " ON" : "OFF", buf);
3757 gpio_output_map(buf, bp, sma_val, 4);
3759 on ? " ON" : "OFF", val, (ctrl >> 16), buf);
3765 gpio_input_map(buf, bp, sma_val, 4, NULL);
3767 on ? " ON" : "OFF", val, buf);
3773 gpio_output_map(buf, bp, sma_val, 5);
3775 on ? " ON" : "OFF", val, buf);
3781 gpio_input_map(buf, bp, sma_val, 5, NULL);
3783 on ? " ON" : "OFF", val, buf);
3796 src = &buf[80];
3815 gpio_input_map(buf, bp, sma_val, 1, "GNSS2");
3816 seq_printf(s, "MAC PPS2 src: %s\n", buf);
3822 sprintf(buf, "----");
3825 sprintf(buf, "IRIG");
3828 sprintf(buf, "%s via PPS1", src);
3831 sprintf(buf, "DCF");
3834 strcpy(buf, "unknown");
3838 seq_printf(s, "%7s: %s, state: %s\n", "PHC src", buf,
3861 free_page((unsigned long)buf);
4035 char buf[32];
4038 sprintf(buf, "ttyS%d", bp->gnss_port.line);
4039 ptp_ocp_link_child(bp, buf, "ttyGNSS");
4042 sprintf(buf, "ttyS%d", bp->gnss2_port.line);
4043 ptp_ocp_link_child(bp, buf, "ttyGNSS2");
4046 sprintf(buf, "ttyS%d", bp->mac_port.line);
4047 ptp_ocp_link_child(bp, buf, "ttyMAC");
4050 sprintf(buf, "ttyS%d", bp->nmea_port.line);
4051 ptp_ocp_link_child(bp, buf, "ttyNMEA");
4053 sprintf(buf, "ptp%d", ptp_clock_index(bp->ptp));
4054 ptp_ocp_link_child(bp, buf, "ptp");