Lines Matching refs:buf
31 char *buf) in power_on_acct_show() argument
35 return sprintf(buf, "%u\n", jiffies_to_msecs(codec->power_on_acct)); in power_on_acct_show()
40 char *buf) in power_off_acct_show() argument
44 return sprintf(buf, "%u\n", jiffies_to_msecs(codec->power_off_acct)); in power_off_acct_show()
54 char *buf) \
57 return sprintf(buf, "0x%x\n", codec->field); \
63 char *buf) \
66 return sprintf(buf, "%s\n", \
81 char *buf) in pin_configs_show() argument
87 len += sprintf(buf + len, "0x%02x 0x%08x\n", in pin_configs_show()
96 char *buf) in init_pin_configs_show() argument
99 return pin_configs_show(codec, &codec->init_pins, buf); in init_pin_configs_show()
104 char *buf) in driver_pin_configs_show() argument
107 return pin_configs_show(codec, &codec->driver_pins, buf); in driver_pin_configs_show()
168 const char *buf, size_t count) \
172 int err = kstrtoul(buf, 0, &val); \
182 const char *buf, size_t count) \
185 char *s = kstrndup_noeol(buf, 64); \
203 const char *buf, size_t count) \
207 if (*buf) \
217 char *buf) in init_verbs_show() argument
224 len += snprintf(buf + len, PAGE_SIZE - len, in init_verbs_show()
232 static int parse_init_verbs(struct hda_codec *codec, const char *buf) in parse_init_verbs() argument
237 if (sscanf(buf, "%i %i %i", &nid, &verb, ¶m) != 3) in parse_init_verbs()
256 const char *buf, size_t count) in init_verbs_store() argument
259 int err = parse_init_verbs(codec, buf); in init_verbs_store()
267 char *buf) in hints_show() argument
274 len += snprintf(buf + len, PAGE_SIZE - len, in hints_show()
308 static int parse_hints(struct hda_codec *codec, const char *buf) in parse_hints() argument
314 buf = skip_spaces(buf); in parse_hints()
315 if (!*buf || *buf == '#' || *buf == '\n') in parse_hints()
317 if (*buf == '=') in parse_hints()
319 key = kstrndup_noeol(buf, 1024); in parse_hints()
361 const char *buf, size_t count) in hints_store() argument
364 int err = parse_hints(codec, buf); in hints_store()
372 char *buf) in user_pin_configs_show() argument
375 return pin_configs_show(codec, &codec->user_pins, buf); in user_pin_configs_show()
380 static int parse_user_pin_configs(struct hda_codec *codec, const char *buf) in parse_user_pin_configs() argument
384 if (sscanf(buf, "%i %i", &nid, &cfg) != 2) in parse_user_pin_configs()
396 const char *buf, size_t count) in user_pin_configs_store() argument
399 int err = parse_user_pin_configs(codec, buf); in user_pin_configs_store()
539 static void parse_codec_mode(char *buf, struct hda_bus *bus, in parse_codec_mode() argument
546 if (sscanf(buf, "%i %i %i", &vendorid, &subid, &caddr) == 3) { in parse_codec_mode()
562 static void parse_pincfg_mode(char *buf, struct hda_bus *bus, in parse_pincfg_mode() argument
565 parse_user_pin_configs(*codecp, buf); in parse_pincfg_mode()
568 static void parse_verb_mode(char *buf, struct hda_bus *bus, in parse_verb_mode() argument
571 parse_init_verbs(*codecp, buf); in parse_verb_mode()
574 static void parse_hint_mode(char *buf, struct hda_bus *bus, in parse_hint_mode() argument
577 parse_hints(*codecp, buf); in parse_hint_mode()
580 static void parse_model_mode(char *buf, struct hda_bus *bus, in parse_model_mode() argument
584 (*codecp)->modelname = kstrdup(buf, GFP_KERNEL); in parse_model_mode()
587 static void parse_chip_name_mode(char *buf, struct hda_bus *bus, in parse_chip_name_mode() argument
590 snd_hda_codec_set_name(*codecp, buf); in parse_chip_name_mode()
594 static void parse_##name##_mode(char *buf, struct hda_bus *bus, \
598 if (!kstrtoul(buf, 0, &val)) \
610 void (*parser)(char *buf, struct hda_bus *bus, struct hda_codec **retc);
656 static int parse_line_mode(char *buf, struct hda_bus *bus) in parse_line_mode() argument
662 if (strmatch(buf, patch_items[i].tag)) in parse_line_mode()
664 if (patch_items[i].alias && strmatch(buf, patch_items[i].alias)) in parse_line_mode()
676 static int get_line_from_fw(char *buf, int size, size_t *fw_size_p, in get_line_from_fw() argument
699 *buf++ = *p++; in get_line_from_fw()
701 *buf = 0; in get_line_from_fw()
704 remove_trail_spaces(buf); in get_line_from_fw()
716 char buf[128]; in snd_hda_load_patch() local
722 while (get_line_from_fw(buf, sizeof(buf) - 1, &fw_size, &fw_buf)) { in snd_hda_load_patch()
723 if (!*buf || *buf == '#' || *buf == '\n') in snd_hda_load_patch()
725 if (*buf == '[') in snd_hda_load_patch()
726 line_mode = parse_line_mode(buf, bus); in snd_hda_load_patch()
729 patch_items[line_mode].parser(buf, bus, &codec); in snd_hda_load_patch()