Loading sound/pci/hda/hda_codec.c +17 −17 Original line number Diff line number Diff line Loading @@ -932,7 +932,7 @@ int snd_hda_bus_new(struct snd_card *card, } EXPORT_SYMBOL_GPL(snd_hda_bus_new); #ifdef CONFIG_SND_HDA_GENERIC #if IS_ENABLED(CONFIG_SND_HDA_GENERIC) #define is_generic_config(codec) \ (codec->modelname && !strcmp(codec->modelname, "generic")) #else Loading Loading @@ -1339,24 +1339,16 @@ get_hda_cvt_setup(struct hda_codec *codec, hda_nid_t nid) /* * Dynamic symbol binding for the codec parsers */ #ifdef MODULE #define load_parser_sym(sym) ((int (*)(struct hda_codec *))symbol_request(sym)) #define unload_parser_addr(addr) symbol_put_addr(addr) #else #define load_parser_sym(sym) (sym) #define unload_parser_addr(addr) do {} while (0) #endif #define load_parser(codec, sym) \ ((codec)->parser = load_parser_sym(sym)) ((codec)->parser = (int (*)(struct hda_codec *))symbol_request(sym)) static void unload_parser(struct hda_codec *codec) { if (codec->parser) { unload_parser_addr(codec->parser); if (codec->parser) symbol_put_addr(codec->parser); codec->parser = NULL; } } /* * codec destructor Loading Loading @@ -1570,7 +1562,7 @@ int snd_hda_codec_update_widgets(struct hda_codec *codec) EXPORT_SYMBOL_GPL(snd_hda_codec_update_widgets); #ifdef CONFIG_SND_HDA_CODEC_HDMI #if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) /* if all audio out widgets are digital, let's assume the codec as a HDMI/DP */ static bool is_likely_hdmi_codec(struct hda_codec *codec) { Loading Loading @@ -1620,12 +1612,20 @@ int snd_hda_codec_configure(struct hda_codec *codec) patch = codec->preset->patch; if (!patch) { unload_parser(codec); /* to be sure */ if (is_likely_hdmi_codec(codec)) if (is_likely_hdmi_codec(codec)) { #if IS_MODULE(CONFIG_SND_HDA_CODEC_HDMI) patch = load_parser(codec, snd_hda_parse_hdmi_codec); #ifdef CONFIG_SND_HDA_GENERIC if (!patch) #elif IS_BUILTIN(CONFIG_SND_HDA_CODEC_HDMI) patch = snd_hda_parse_hdmi_codec; #endif } if (!patch) { #if IS_MODULE(CONFIG_SND_HDA_GENERIC) patch = load_parser(codec, snd_hda_parse_generic_codec); #elif IS_BUILTIN(CONFIG_SND_HDA_GENERIC) patch = snd_hda_parse_generic_codec; #endif } if (!patch) { printk(KERN_ERR "hda-codec: No codec parser is available\n"); return -ENODEV; Loading sound/pci/hda/hda_generic.c +4 −4 Original line number Diff line number Diff line Loading @@ -3268,7 +3268,7 @@ static int cap_put_caller(struct snd_kcontrol *kcontrol, mutex_unlock(&codec->control_mutex); snd_hda_codec_flush_cache(codec); /* flush the updates */ if (err >= 0 && spec->cap_sync_hook) spec->cap_sync_hook(codec, ucontrol); spec->cap_sync_hook(codec, kcontrol, ucontrol); return err; } Loading Loading @@ -3389,7 +3389,7 @@ static int cap_single_sw_put(struct snd_kcontrol *kcontrol, return ret; if (spec->cap_sync_hook) spec->cap_sync_hook(codec, ucontrol); spec->cap_sync_hook(codec, kcontrol, ucontrol); return ret; } Loading Loading @@ -3794,7 +3794,7 @@ static int mux_select(struct hda_codec *codec, unsigned int adc_idx, return 0; snd_hda_activate_path(codec, path, true, false); if (spec->cap_sync_hook) spec->cap_sync_hook(codec, NULL); spec->cap_sync_hook(codec, NULL, NULL); path_power_down_sync(codec, old_path); return 1; } Loading Loading @@ -5269,7 +5269,7 @@ static void init_input_src(struct hda_codec *codec) } if (spec->cap_sync_hook) spec->cap_sync_hook(codec, NULL); spec->cap_sync_hook(codec, NULL, NULL); } /* set right pin controls for digital I/O */ Loading sound/pci/hda/hda_generic.h +1 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,7 @@ struct hda_gen_spec { void (*init_hook)(struct hda_codec *codec); void (*automute_hook)(struct hda_codec *codec); void (*cap_sync_hook)(struct hda_codec *codec, struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); /* PCM hooks */ Loading sound/pci/hda/hda_intel.c +1 −1 Original line number Diff line number Diff line Loading @@ -198,7 +198,7 @@ MODULE_DESCRIPTION("Intel HDA driver"); #endif #if defined(CONFIG_PM) && defined(CONFIG_VGA_SWITCHEROO) #ifdef CONFIG_SND_HDA_CODEC_HDMI #if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) #define SUPPORT_VGA_SWITCHEROO #endif #endif Loading sound/pci/hda/patch_analog.c +27 −0 Original line number Diff line number Diff line Loading @@ -244,6 +244,19 @@ static void ad_fixup_inv_jack_detect(struct hda_codec *codec, } } /* Toshiba Satellite L40 implements EAPD in a standard way unlike others */ static void ad1986a_fixup_eapd(struct hda_codec *codec, const struct hda_fixup *fix, int action) { struct ad198x_spec *spec = codec->spec; if (action == HDA_FIXUP_ACT_PRE_PROBE) { codec->inv_eapd = 0; spec->gen.keep_eapd_on = 1; spec->eapd_nid = 0x1b; } } enum { AD1986A_FIXUP_INV_JACK_DETECT, AD1986A_FIXUP_ULTRA, Loading @@ -251,6 +264,7 @@ enum { AD1986A_FIXUP_3STACK, AD1986A_FIXUP_LAPTOP, AD1986A_FIXUP_LAPTOP_IMIC, AD1986A_FIXUP_EAPD, }; static const struct hda_fixup ad1986a_fixups[] = { Loading Loading @@ -311,6 +325,10 @@ static const struct hda_fixup ad1986a_fixups[] = { .chained_before = 1, .chain_id = AD1986A_FIXUP_LAPTOP, }, [AD1986A_FIXUP_EAPD] = { .type = HDA_FIXUP_FUNC, .v.func = ad1986a_fixup_eapd, }, }; static const struct snd_pci_quirk ad1986a_fixup_tbl[] = { Loading @@ -318,6 +336,7 @@ static const struct snd_pci_quirk ad1986a_fixup_tbl[] = { SND_PCI_QUIRK_MASK(0x1043, 0xff00, 0x8100, "ASUS P5", AD1986A_FIXUP_3STACK), SND_PCI_QUIRK_MASK(0x1043, 0xff00, 0x8200, "ASUS M2", AD1986A_FIXUP_3STACK), SND_PCI_QUIRK(0x10de, 0xcb84, "ASUS A8N-VM", AD1986A_FIXUP_3STACK), SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba Satellite L40", AD1986A_FIXUP_EAPD), SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_FIXUP_LAPTOP), SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc000, "Samsung", AD1986A_FIXUP_SAMSUNG), SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_FIXUP_ULTRA), Loading Loading @@ -472,6 +491,8 @@ static int ad1983_add_spdif_mux_ctl(struct hda_codec *codec) static int patch_ad1983(struct hda_codec *codec) { struct ad198x_spec *spec; static hda_nid_t conn_0c[] = { 0x08 }; static hda_nid_t conn_0d[] = { 0x09 }; int err; err = alloc_ad_spec(codec); Loading @@ -479,8 +500,14 @@ static int patch_ad1983(struct hda_codec *codec) return err; spec = codec->spec; spec->gen.mixer_nid = 0x0e; spec->gen.beep_nid = 0x10; set_beep_amp(spec, 0x10, 0, HDA_OUTPUT); /* limit the loopback routes not to confuse the parser */ snd_hda_override_conn_list(codec, 0x0c, ARRAY_SIZE(conn_0c), conn_0c); snd_hda_override_conn_list(codec, 0x0d, ARRAY_SIZE(conn_0d), conn_0d); err = ad198x_parse_auto_config(codec, false); if (err < 0) goto error; Loading Loading
sound/pci/hda/hda_codec.c +17 −17 Original line number Diff line number Diff line Loading @@ -932,7 +932,7 @@ int snd_hda_bus_new(struct snd_card *card, } EXPORT_SYMBOL_GPL(snd_hda_bus_new); #ifdef CONFIG_SND_HDA_GENERIC #if IS_ENABLED(CONFIG_SND_HDA_GENERIC) #define is_generic_config(codec) \ (codec->modelname && !strcmp(codec->modelname, "generic")) #else Loading Loading @@ -1339,24 +1339,16 @@ get_hda_cvt_setup(struct hda_codec *codec, hda_nid_t nid) /* * Dynamic symbol binding for the codec parsers */ #ifdef MODULE #define load_parser_sym(sym) ((int (*)(struct hda_codec *))symbol_request(sym)) #define unload_parser_addr(addr) symbol_put_addr(addr) #else #define load_parser_sym(sym) (sym) #define unload_parser_addr(addr) do {} while (0) #endif #define load_parser(codec, sym) \ ((codec)->parser = load_parser_sym(sym)) ((codec)->parser = (int (*)(struct hda_codec *))symbol_request(sym)) static void unload_parser(struct hda_codec *codec) { if (codec->parser) { unload_parser_addr(codec->parser); if (codec->parser) symbol_put_addr(codec->parser); codec->parser = NULL; } } /* * codec destructor Loading Loading @@ -1570,7 +1562,7 @@ int snd_hda_codec_update_widgets(struct hda_codec *codec) EXPORT_SYMBOL_GPL(snd_hda_codec_update_widgets); #ifdef CONFIG_SND_HDA_CODEC_HDMI #if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) /* if all audio out widgets are digital, let's assume the codec as a HDMI/DP */ static bool is_likely_hdmi_codec(struct hda_codec *codec) { Loading Loading @@ -1620,12 +1612,20 @@ int snd_hda_codec_configure(struct hda_codec *codec) patch = codec->preset->patch; if (!patch) { unload_parser(codec); /* to be sure */ if (is_likely_hdmi_codec(codec)) if (is_likely_hdmi_codec(codec)) { #if IS_MODULE(CONFIG_SND_HDA_CODEC_HDMI) patch = load_parser(codec, snd_hda_parse_hdmi_codec); #ifdef CONFIG_SND_HDA_GENERIC if (!patch) #elif IS_BUILTIN(CONFIG_SND_HDA_CODEC_HDMI) patch = snd_hda_parse_hdmi_codec; #endif } if (!patch) { #if IS_MODULE(CONFIG_SND_HDA_GENERIC) patch = load_parser(codec, snd_hda_parse_generic_codec); #elif IS_BUILTIN(CONFIG_SND_HDA_GENERIC) patch = snd_hda_parse_generic_codec; #endif } if (!patch) { printk(KERN_ERR "hda-codec: No codec parser is available\n"); return -ENODEV; Loading
sound/pci/hda/hda_generic.c +4 −4 Original line number Diff line number Diff line Loading @@ -3268,7 +3268,7 @@ static int cap_put_caller(struct snd_kcontrol *kcontrol, mutex_unlock(&codec->control_mutex); snd_hda_codec_flush_cache(codec); /* flush the updates */ if (err >= 0 && spec->cap_sync_hook) spec->cap_sync_hook(codec, ucontrol); spec->cap_sync_hook(codec, kcontrol, ucontrol); return err; } Loading Loading @@ -3389,7 +3389,7 @@ static int cap_single_sw_put(struct snd_kcontrol *kcontrol, return ret; if (spec->cap_sync_hook) spec->cap_sync_hook(codec, ucontrol); spec->cap_sync_hook(codec, kcontrol, ucontrol); return ret; } Loading Loading @@ -3794,7 +3794,7 @@ static int mux_select(struct hda_codec *codec, unsigned int adc_idx, return 0; snd_hda_activate_path(codec, path, true, false); if (spec->cap_sync_hook) spec->cap_sync_hook(codec, NULL); spec->cap_sync_hook(codec, NULL, NULL); path_power_down_sync(codec, old_path); return 1; } Loading Loading @@ -5269,7 +5269,7 @@ static void init_input_src(struct hda_codec *codec) } if (spec->cap_sync_hook) spec->cap_sync_hook(codec, NULL); spec->cap_sync_hook(codec, NULL, NULL); } /* set right pin controls for digital I/O */ Loading
sound/pci/hda/hda_generic.h +1 −0 Original line number Diff line number Diff line Loading @@ -274,6 +274,7 @@ struct hda_gen_spec { void (*init_hook)(struct hda_codec *codec); void (*automute_hook)(struct hda_codec *codec); void (*cap_sync_hook)(struct hda_codec *codec, struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); /* PCM hooks */ Loading
sound/pci/hda/hda_intel.c +1 −1 Original line number Diff line number Diff line Loading @@ -198,7 +198,7 @@ MODULE_DESCRIPTION("Intel HDA driver"); #endif #if defined(CONFIG_PM) && defined(CONFIG_VGA_SWITCHEROO) #ifdef CONFIG_SND_HDA_CODEC_HDMI #if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) #define SUPPORT_VGA_SWITCHEROO #endif #endif Loading
sound/pci/hda/patch_analog.c +27 −0 Original line number Diff line number Diff line Loading @@ -244,6 +244,19 @@ static void ad_fixup_inv_jack_detect(struct hda_codec *codec, } } /* Toshiba Satellite L40 implements EAPD in a standard way unlike others */ static void ad1986a_fixup_eapd(struct hda_codec *codec, const struct hda_fixup *fix, int action) { struct ad198x_spec *spec = codec->spec; if (action == HDA_FIXUP_ACT_PRE_PROBE) { codec->inv_eapd = 0; spec->gen.keep_eapd_on = 1; spec->eapd_nid = 0x1b; } } enum { AD1986A_FIXUP_INV_JACK_DETECT, AD1986A_FIXUP_ULTRA, Loading @@ -251,6 +264,7 @@ enum { AD1986A_FIXUP_3STACK, AD1986A_FIXUP_LAPTOP, AD1986A_FIXUP_LAPTOP_IMIC, AD1986A_FIXUP_EAPD, }; static const struct hda_fixup ad1986a_fixups[] = { Loading Loading @@ -311,6 +325,10 @@ static const struct hda_fixup ad1986a_fixups[] = { .chained_before = 1, .chain_id = AD1986A_FIXUP_LAPTOP, }, [AD1986A_FIXUP_EAPD] = { .type = HDA_FIXUP_FUNC, .v.func = ad1986a_fixup_eapd, }, }; static const struct snd_pci_quirk ad1986a_fixup_tbl[] = { Loading @@ -318,6 +336,7 @@ static const struct snd_pci_quirk ad1986a_fixup_tbl[] = { SND_PCI_QUIRK_MASK(0x1043, 0xff00, 0x8100, "ASUS P5", AD1986A_FIXUP_3STACK), SND_PCI_QUIRK_MASK(0x1043, 0xff00, 0x8200, "ASUS M2", AD1986A_FIXUP_3STACK), SND_PCI_QUIRK(0x10de, 0xcb84, "ASUS A8N-VM", AD1986A_FIXUP_3STACK), SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba Satellite L40", AD1986A_FIXUP_EAPD), SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_FIXUP_LAPTOP), SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc000, "Samsung", AD1986A_FIXUP_SAMSUNG), SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_FIXUP_ULTRA), Loading Loading @@ -472,6 +491,8 @@ static int ad1983_add_spdif_mux_ctl(struct hda_codec *codec) static int patch_ad1983(struct hda_codec *codec) { struct ad198x_spec *spec; static hda_nid_t conn_0c[] = { 0x08 }; static hda_nid_t conn_0d[] = { 0x09 }; int err; err = alloc_ad_spec(codec); Loading @@ -479,8 +500,14 @@ static int patch_ad1983(struct hda_codec *codec) return err; spec = codec->spec; spec->gen.mixer_nid = 0x0e; spec->gen.beep_nid = 0x10; set_beep_amp(spec, 0x10, 0, HDA_OUTPUT); /* limit the loopback routes not to confuse the parser */ snd_hda_override_conn_list(codec, 0x0c, ARRAY_SIZE(conn_0c), conn_0c); snd_hda_override_conn_list(codec, 0x0d, ARRAY_SIZE(conn_0d), conn_0d); err = ad198x_parse_auto_config(codec, false); if (err < 0) goto error; Loading