ALSA: hda: Nuke unused reboot_notify callback
authorTakashi Iwai <tiwai@suse.de>
Fri, 13 Aug 2021 08:12:30 +0000 (10:12 +0200)
committerTakashi Iwai <tiwai@suse.de>
Sat, 14 Aug 2021 06:39:38 +0000 (08:39 +0200)
As reboot_notify callback is no longer used by the codec core, let's
get rid of the unused code.  Conexant codec needs a slight code change
as it used to call the reboot_notify at the codec removal, too.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=214045
Link: https://lore.kernel.org/r/20210813081230.4268-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/hda_codec.h
sound/pci/hda/hda_generic.c
sound/pci/hda/hda_generic.h
sound/pci/hda/patch_analog.c
sound/pci/hda/patch_ca0132.c
sound/pci/hda/patch_conexant.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_sigmatel.c

index 2e8d51937acdf0bf178d696a69ae9c9ed0236b41..01570dbda503850a0a7eb5fb2da4cc3d806401e1 100644 (file)
@@ -114,7 +114,6 @@ struct hda_codec_ops {
        int (*resume)(struct hda_codec *codec);
        int (*check_power_status)(struct hda_codec *codec, hda_nid_t nid);
 #endif
-       void (*reboot_notify)(struct hda_codec *codec);
        void (*stream_pm)(struct hda_codec *codec, hda_nid_t nid, bool on);
 };
 
index e97d00585e8ec219a63e4e8e086b9861a51cd3df..f46d4e7f499c8bd17a843a003bfffba68c706350 100644 (file)
@@ -6000,24 +6000,6 @@ void snd_hda_gen_free(struct hda_codec *codec)
 }
 EXPORT_SYMBOL_GPL(snd_hda_gen_free);
 
-/**
- * snd_hda_gen_reboot_notify - Make codec enter D3 before rebooting
- * @codec: the HDA codec
- *
- * This can be put as patch_ops reboot_notify function.
- */
-void snd_hda_gen_reboot_notify(struct hda_codec *codec)
-{
-       /* Make the codec enter D3 to avoid spurious noises from the internal
-        * speaker during (and after) reboot
-        */
-       snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3);
-       snd_hda_codec_write(codec, codec->core.afg, 0,
-                           AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
-       msleep(10);
-}
-EXPORT_SYMBOL_GPL(snd_hda_gen_reboot_notify);
-
 #ifdef CONFIG_PM
 /**
  * snd_hda_gen_check_power_status - check the loopback power save state
@@ -6045,7 +6027,6 @@ static const struct hda_codec_ops generic_patch_ops = {
        .init = snd_hda_gen_init,
        .free = snd_hda_gen_free,
        .unsol_event = snd_hda_jack_unsol_event,
-       .reboot_notify = snd_hda_gen_reboot_notify,
 #ifdef CONFIG_PM
        .check_power_status = snd_hda_gen_check_power_status,
 #endif
index d4dd1b8a2e7ecb02b7a24eb099f0e7dca02193dd..c43bd0f0338ea9fa47772eff3befce991d9fdaa5 100644 (file)
@@ -324,7 +324,6 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec,
                                  struct auto_pin_cfg *cfg);
 int snd_hda_gen_build_controls(struct hda_codec *codec);
 int snd_hda_gen_build_pcms(struct hda_codec *codec);
-void snd_hda_gen_reboot_notify(struct hda_codec *codec);
 
 /* standard jack event callbacks */
 void snd_hda_gen_hp_automute(struct hda_codec *codec,
index 2132b2acec4d3a8f82a2a4a3dea3f2058b5d0b96..a356e16629292bf3a2c1ce394a4957163770c4a3 100644 (file)
@@ -168,7 +168,6 @@ static const struct hda_codec_ops ad198x_auto_patch_ops = {
        .check_power_status = snd_hda_gen_check_power_status,
        .suspend = ad198x_suspend,
 #endif
-       .reboot_notify = ad198x_shutup,
 };
 
 
index 50ca72ee586e8ade17c7b0667c156a312403bf2c..208933792787dd27d480db2b4b75fb050360c000 100644 (file)
@@ -9682,11 +9682,6 @@ static void dbpro_free(struct hda_codec *codec)
        kfree(codec->spec);
 }
 
-static void ca0132_reboot_notify(struct hda_codec *codec)
-{
-       codec->patch_ops.free(codec);
-}
-
 #ifdef CONFIG_PM
 static int ca0132_suspend(struct hda_codec *codec)
 {
@@ -9706,7 +9701,6 @@ static const struct hda_codec_ops ca0132_patch_ops = {
 #ifdef CONFIG_PM
        .suspend = ca0132_suspend,
 #endif
-       .reboot_notify = ca0132_reboot_notify,
 };
 
 static const struct hda_codec_ops dbpro_patch_ops = {
index 6d2bdef7f0176aeb7cce804cdb77f84417b20a3a..0515137a75b0fdf64c94c1db3bb814e89968860d 100644 (file)
@@ -186,15 +186,9 @@ static void cx_auto_shutdown(struct hda_codec *codec)
        cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false);
 }
 
-static void cx_auto_reboot_notify(struct hda_codec *codec)
-{
-       cx_auto_shutdown(codec);
-       snd_hda_gen_reboot_notify(codec);
-}
-
 static void cx_auto_free(struct hda_codec *codec)
 {
-       cx_auto_reboot_notify(codec);
+       cx_auto_shutdown(codec);
        snd_hda_gen_free(codec);
 }
 
@@ -210,7 +204,6 @@ static const struct hda_codec_ops cx_auto_patch_ops = {
        .build_controls = snd_hda_gen_build_controls,
        .build_pcms = snd_hda_gen_build_pcms,
        .init = cx_auto_init,
-       .reboot_notify = cx_auto_reboot_notify,
        .free = cx_auto_free,
        .unsol_event = snd_hda_jack_unsol_event,
 #ifdef CONFIG_PM
index 4043a2362f27f5049e1489a78b86c9150832c6d1..4f2296d062d53087f5aa039db22c5d53cc7c9d0f 100644 (file)
@@ -109,7 +109,6 @@ struct alc_spec {
        void (*power_hook)(struct hda_codec *codec);
 #endif
        void (*shutup)(struct hda_codec *codec);
-       void (*reboot_notify)(struct hda_codec *codec);
 
        int init_amp;
        int codec_variant;      /* flag for other variants */
@@ -897,16 +896,6 @@ static inline void alc_shutup(struct hda_codec *codec)
                alc_shutup_pins(codec);
 }
 
-static void alc_reboot_notify(struct hda_codec *codec)
-{
-       struct alc_spec *spec = codec->spec;
-
-       if (spec && spec->reboot_notify)
-               spec->reboot_notify(codec);
-       else
-               alc_shutup(codec);
-}
-
 #define alc_free       snd_hda_gen_free
 
 #ifdef CONFIG_PM
@@ -952,7 +941,6 @@ static const struct hda_codec_ops alc_patch_ops = {
        .suspend = alc_suspend,
        .check_power_status = snd_hda_gen_check_power_status,
 #endif
-       .reboot_notify = alc_reboot_notify,
 };
 
 
@@ -5773,7 +5761,6 @@ static void alc_fixup_tpt440_dock(struct hda_codec *codec,
        struct alc_spec *spec = codec->spec;
 
        if (action == HDA_FIXUP_ACT_PRE_PROBE) {
-               spec->reboot_notify = snd_hda_gen_reboot_notify; /* reduce noise */
                spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
                codec->power_save_node = 0; /* avoid click noises */
                snd_hda_apply_pincfgs(codec, pincfgs);
index 3bd592e126a3eaf2f098e99ea791dab71ce0716d..3e00116db86e974da322b84bc0bba966bba96d75 100644 (file)
@@ -4460,7 +4460,6 @@ static const struct hda_codec_ops stac_patch_ops = {
 #ifdef CONFIG_PM
        .suspend = stac_suspend,
 #endif
-       .reboot_notify = stac_shutup,
 };
 
 static int alloc_stac_spec(struct hda_codec *codec)