Lines Matching refs:codec
3 * HD audio codec driver for Senary HDA audio codec
66 static int senary_auto_parse_beep(struct hda_codec *codec)
68 struct senary_spec *spec = codec->spec;
71 for_each_hda_codec_node(nid, codec)
72 if ((get_wcaps_type(get_wcaps(codec, nid)) == AC_WID_BEEP) &&
73 (get_wcaps(codec, nid) & (AC_WCAP_OUT_AMP | AC_WCAP_AMP_OVRD)))
78 #define senary_auto_parse_beep(codec) 0
82 static void senary_auto_parse_eapd(struct hda_codec *codec)
84 struct senary_spec *spec = codec->spec;
87 for_each_hda_codec_node(nid, codec) {
88 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN)
90 if (!(snd_hda_query_pin_caps(codec, nid) & AC_PINCAP_EAPD))
98 static void senary_auto_turn_eapd(struct hda_codec *codec, int num_pins,
104 if (snd_hda_query_pin_caps(codec, pins[i]) & AC_PINCAP_EAPD)
105 snd_hda_codec_write(codec, pins[i], 0,
114 struct hda_codec *codec = private_data;
115 struct senary_spec *spec = codec->spec;
117 senary_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, enabled);
120 static void senary_init_gpio_led(struct hda_codec *codec)
122 struct senary_spec *spec = codec->spec;
126 snd_hda_codec_write(codec, SENARY_GPIO_NODE, 0, AC_VERB_SET_GPIO_MASK,
128 snd_hda_codec_write(codec, SENARY_GPIO_NODE, 0, AC_VERB_SET_GPIO_DIRECTION,
130 snd_hda_codec_write(codec, SENARY_GPIO_NODE, 0, AC_VERB_SET_GPIO_DATA,
135 static int senary_init(struct hda_codec *codec)
137 snd_hda_gen_init(codec);
138 senary_init_gpio_led(codec);
139 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT);
144 static void senary_shutdown(struct hda_codec *codec)
146 struct senary_spec *spec = codec->spec;
148 /* Turn the problematic codec into D3 to avoid spurious noises
151 senary_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false);
154 static void senary_remove(struct hda_codec *codec)
156 senary_shutdown(codec);
157 snd_hda_gen_remove(codec);
160 static int senary_suspend(struct hda_codec *codec)
162 senary_shutdown(codec);
166 static int senary_probe(struct hda_codec *codec, const struct hda_device_id *id)
171 codec_info(codec, "%s: BIOS auto-probing.\n", codec->core.chip_name);
177 codec->spec = spec;
179 senary_auto_parse_eapd(codec);
185 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
187 err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL,
192 err = senary_auto_parse_beep(codec);
196 err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
204 if (!codec->bus->core.sync_write) {
205 codec_info(codec,
207 codec->bus->core.sync_write = 1;
208 codec->bus->allow_bus_reset = 1;
211 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
216 senary_remove(codec);
242 MODULE_DESCRIPTION("Senarytech HD-audio codec");