• Home
  • Raw
  • Download

Lines Matching refs:codec

34 	struct hda_codec *codec = dev_get_drvdata(dev);  in power_on_acct_show()  local
35 snd_hda_update_power_acct(codec); in power_on_acct_show()
36 return sprintf(buf, "%u\n", jiffies_to_msecs(codec->power_on_acct)); in power_on_acct_show()
43 struct hda_codec *codec = dev_get_drvdata(dev); in power_off_acct_show() local
44 snd_hda_update_power_acct(codec); in power_off_acct_show()
45 return sprintf(buf, "%u\n", jiffies_to_msecs(codec->power_off_acct)); in power_off_acct_show()
57 struct hda_codec *codec = dev_get_drvdata(dev); \
58 return sprintf(buf, "0x%x\n", codec->field); \
66 struct hda_codec *codec = dev_get_drvdata(dev); \
68 codec->field ? codec->field : ""); \
80 static ssize_t pin_configs_show(struct hda_codec *codec, in pin_configs_show() argument
86 mutex_lock(&codec->user_mutex); in pin_configs_show()
91 mutex_unlock(&codec->user_mutex); in pin_configs_show()
99 struct hda_codec *codec = dev_get_drvdata(dev); in init_pin_configs_show() local
100 return pin_configs_show(codec, &codec->init_pins, buf); in init_pin_configs_show()
107 struct hda_codec *codec = dev_get_drvdata(dev); in driver_pin_configs_show() local
108 return pin_configs_show(codec, &codec->driver_pins, buf); in driver_pin_configs_show()
117 static int clear_codec(struct hda_codec *codec) in clear_codec() argument
121 err = snd_hda_codec_reset(codec); in clear_codec()
123 codec_err(codec, "The codec is being used, can't free.\n"); in clear_codec()
126 snd_hda_sysfs_clear(codec); in clear_codec()
130 static int reconfig_codec(struct hda_codec *codec) in reconfig_codec() argument
134 snd_hda_power_up(codec); in reconfig_codec()
135 codec_info(codec, "hda-codec: reconfiguring\n"); in reconfig_codec()
136 err = snd_hda_codec_reset(codec); in reconfig_codec()
138 codec_err(codec, in reconfig_codec()
142 err = device_reprobe(hda_codec_dev(codec)); in reconfig_codec()
145 err = snd_card_register(codec->card); in reconfig_codec()
147 snd_hda_power_down(codec); in reconfig_codec()
171 struct hda_codec *codec = dev_get_drvdata(dev); \
176 codec->field = val; \
185 struct hda_codec *codec = dev_get_drvdata(dev); \
189 kfree(codec->field); \
190 codec->field = s; \
206 struct hda_codec *codec = dev_get_drvdata(dev); \
209 err = type##_codec(codec); \
220 struct hda_codec *codec = dev_get_drvdata(dev); in init_verbs_show() local
223 mutex_lock(&codec->user_mutex); in init_verbs_show()
224 snd_array_for_each(&codec->init_verbs, i, v) { in init_verbs_show()
229 mutex_unlock(&codec->user_mutex); in init_verbs_show()
233 static int parse_init_verbs(struct hda_codec *codec, const char *buf) in parse_init_verbs() argument
242 mutex_lock(&codec->user_mutex); in parse_init_verbs()
243 v = snd_array_new(&codec->init_verbs); in parse_init_verbs()
245 mutex_unlock(&codec->user_mutex); in parse_init_verbs()
251 mutex_unlock(&codec->user_mutex); in parse_init_verbs()
259 struct hda_codec *codec = dev_get_drvdata(dev); in init_verbs_store() local
260 int err = parse_init_verbs(codec, buf); in init_verbs_store()
270 struct hda_codec *codec = dev_get_drvdata(dev); in hints_show() local
273 mutex_lock(&codec->user_mutex); in hints_show()
274 snd_array_for_each(&codec->hints, i, hint) { in hints_show()
278 mutex_unlock(&codec->user_mutex); in hints_show()
282 static struct hda_hint *get_hint(struct hda_codec *codec, const char *key) in get_hint() argument
287 snd_array_for_each(&codec->hints, i, hint) { in get_hint()
309 static int parse_hints(struct hda_codec *codec, const char *buf) in parse_hints() argument
333 mutex_lock(&codec->user_mutex); in parse_hints()
334 hint = get_hint(codec, key); in parse_hints()
343 if (codec->hints.used >= MAX_HINTS) in parse_hints()
346 hint = snd_array_new(&codec->hints); in parse_hints()
354 mutex_unlock(&codec->user_mutex); in parse_hints()
364 struct hda_codec *codec = dev_get_drvdata(dev); in hints_store() local
365 int err = parse_hints(codec, buf); in hints_store()
375 struct hda_codec *codec = dev_get_drvdata(dev); in user_pin_configs_show() local
376 return pin_configs_show(codec, &codec->user_pins, buf); in user_pin_configs_show()
381 static int parse_user_pin_configs(struct hda_codec *codec, const char *buf) in parse_user_pin_configs() argument
389 mutex_lock(&codec->user_mutex); in parse_user_pin_configs()
390 err = snd_hda_add_pincfg(codec, &codec->user_pins, nid, cfg); in parse_user_pin_configs()
391 mutex_unlock(&codec->user_mutex); in parse_user_pin_configs()
399 struct hda_codec *codec = dev_get_drvdata(dev); in user_pin_configs_store() local
400 int err = parse_user_pin_configs(codec, buf); in user_pin_configs_store()
421 const char *snd_hda_get_hint(struct hda_codec *codec, const char *key) in snd_hda_get_hint() argument
423 struct hda_hint *hint = get_hint(codec, key); in snd_hda_get_hint()
437 int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key) in snd_hda_get_bool_hint() argument
442 mutex_lock(&codec->user_mutex); in snd_hda_get_bool_hint()
443 p = snd_hda_get_hint(codec, key); in snd_hda_get_bool_hint()
458 mutex_unlock(&codec->user_mutex); in snd_hda_get_bool_hint()
473 int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp) in snd_hda_get_int_hint() argument
479 mutex_lock(&codec->user_mutex); in snd_hda_get_int_hint()
480 p = snd_hda_get_hint(codec, key); in snd_hda_get_int_hint()
489 mutex_unlock(&codec->user_mutex); in snd_hda_get_int_hint()
544 struct hda_codec *codec; in parse_codec_mode() local
548 list_for_each_codec(codec, bus) { in parse_codec_mode()
549 if ((vendorid <= 0 || codec->core.vendor_id == vendorid) && in parse_codec_mode()
550 (subid <= 0 || codec->core.subsystem_id == subid) && in parse_codec_mode()
551 codec->core.addr == caddr) { in parse_codec_mode()
552 *codecp = codec; in parse_codec_mode()
718 struct hda_codec *codec; in snd_hda_load_patch() local
722 codec = NULL; in snd_hda_load_patch()
729 (codec || line_mode <= LINE_MODE_CODEC)) in snd_hda_load_patch()
730 patch_items[line_mode].parser(buf, bus, &codec); in snd_hda_load_patch()
774 void snd_hda_sysfs_init(struct hda_codec *codec) in snd_hda_sysfs_init() argument
776 mutex_init(&codec->user_mutex); in snd_hda_sysfs_init()
778 snd_array_init(&codec->init_verbs, sizeof(struct hda_verb), 32); in snd_hda_sysfs_init()
779 snd_array_init(&codec->hints, sizeof(struct hda_hint), 32); in snd_hda_sysfs_init()
780 snd_array_init(&codec->user_pins, sizeof(struct hda_pincfg), 16); in snd_hda_sysfs_init()
784 void snd_hda_sysfs_clear(struct hda_codec *codec) in snd_hda_sysfs_clear() argument
791 snd_array_free(&codec->init_verbs); in snd_hda_sysfs_clear()
793 snd_array_for_each(&codec->hints, i, hint) { in snd_hda_sysfs_clear()
796 snd_array_free(&codec->hints); in snd_hda_sysfs_clear()
797 snd_array_free(&codec->user_pins); in snd_hda_sysfs_clear()