Linux Sound subsystem development
 help / color / mirror / Atom feed
From: "Jarosław Janik" <jaroslaw.janik@gmail.com>
To: Takashi Iwai <tiwai@suse.com>
Cc: linux-sound@vger.kernel.org, "Jarosław Janik" <jaroslaw.janik@gmail.com>
Subject: [PATCH 2/2] Revert "ALSA: hda/generic: Add a helper to mute speakers at suspend/shutdown"
Date: Wed, 30 Oct 2024 18:18:13 +0100	[thread overview]
Message-ID: <20241030171813.18941-3-jaroslaw.janik@gmail.com> (raw)
In-Reply-To: <20241030171813.18941-1-jaroslaw.janik@gmail.com>

This reverts commit 6cd23b26b348fa52c88e1adf9c0e48d68e13f95e.

snd_hda_gen_shutup_speakers() no longer has users in the kernel; revert
a commit that introduced it then.

Signed-off-by: Jarosław Janik <jaroslaw.janik@gmail.com>
---
 sound/pci/hda/hda_generic.c | 63 -------------------------------------
 sound/pci/hda/hda_generic.h |  1 -
 2 files changed, 64 deletions(-)

diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index b34d84fedcc8..e4accb70ecf4 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -4955,69 +4955,6 @@ void snd_hda_gen_stream_pm(struct hda_codec *codec, hda_nid_t nid, bool on)
 }
 EXPORT_SYMBOL_GPL(snd_hda_gen_stream_pm);
 
-/* forcibly mute the speaker output without caching; return true if updated */
-static bool force_mute_output_path(struct hda_codec *codec, hda_nid_t nid)
-{
-	if (!nid)
-		return false;
-	if (!nid_has_mute(codec, nid, HDA_OUTPUT))
-		return false; /* no mute, skip */
-	if (snd_hda_codec_amp_read(codec, nid, 0, HDA_OUTPUT, 0) &
-	    snd_hda_codec_amp_read(codec, nid, 1, HDA_OUTPUT, 0) &
-	    HDA_AMP_MUTE)
-		return false; /* both channels already muted, skip */
-
-	/* direct amp update without caching */
-	snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE,
-			    AC_AMP_SET_OUTPUT | AC_AMP_SET_LEFT |
-			    AC_AMP_SET_RIGHT | HDA_AMP_MUTE);
-	return true;
-}
-
-/**
- * snd_hda_gen_shutup_speakers - Forcibly mute the speaker outputs
- * @codec: the HDA codec
- *
- * Forcibly mute the speaker outputs, to be called at suspend or shutdown.
- *
- * The mute state done by this function isn't cached, hence the original state
- * will be restored at resume.
- *
- * Return true if the mute state has been changed.
- */
-bool snd_hda_gen_shutup_speakers(struct hda_codec *codec)
-{
-	struct hda_gen_spec *spec = codec->spec;
-	const int *paths;
-	const struct nid_path *path;
-	int i, p, num_paths;
-	bool updated = false;
-
-	/* if already powered off, do nothing */
-	if (!snd_hdac_is_power_on(&codec->core))
-		return false;
-
-	if (spec->autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) {
-		paths = spec->out_paths;
-		num_paths = spec->autocfg.line_outs;
-	} else {
-		paths = spec->speaker_paths;
-		num_paths = spec->autocfg.speaker_outs;
-	}
-
-	for (i = 0; i < num_paths; i++) {
-		path = snd_hda_get_path_from_idx(codec, paths[i]);
-		if (!path)
-			continue;
-		for (p = 0; p < path->depth; p++)
-			if (force_mute_output_path(codec, path->path[p]))
-				updated = true;
-	}
-
-	return updated;
-}
-EXPORT_SYMBOL_GPL(snd_hda_gen_shutup_speakers);
-
 /**
  * snd_hda_gen_parse_auto_config - Parse the given BIOS configuration and
  * set up the hda_gen_spec
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
index 9612afaa61c2..9201c852173f 100644
--- a/sound/pci/hda/hda_generic.h
+++ b/sound/pci/hda/hda_generic.h
@@ -352,6 +352,5 @@ int snd_hda_gen_add_mute_led_cdev(struct hda_codec *codec,
 int snd_hda_gen_add_micmute_led_cdev(struct hda_codec *codec,
 				     int (*callback)(struct led_classdev *,
 						     enum led_brightness));
-bool snd_hda_gen_shutup_speakers(struct hda_codec *codec);
 
 #endif /* __SOUND_HDA_GENERIC_H */
-- 
2.39.5


  parent reply	other threads:[~2024-10-30 17:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-30 17:18 [PATCH 0/2] Fix beep notifications by Thinkpad's ACPI firmware Jarosław Janik
2024-10-30 17:18 ` [PATCH 1/2] Revert "ALSA: hda/conexant: Mute speakers at suspend / shutdown" Jarosław Janik
2024-10-30 17:18 ` Jarosław Janik [this message]
2024-10-31  9:15 ` [PATCH 0/2] Fix beep notifications by Thinkpad's ACPI firmware Takashi Iwai
2024-10-31 16:12   ` Jarosław Janik
2024-10-31 16:21     ` Takashi Iwai
2024-10-31 16:43       ` Jarosław Janik
2024-11-01  8:18         ` Takashi Iwai
2024-11-01 23:15           ` Jarosław Janik
2024-11-02  8:27             ` Takashi Iwai
2024-11-02 22:45               ` Jarosław Janik
2024-11-08 14:17                 ` Takashi Iwai
2024-11-14  0:04                   ` Jarosław Janik
2024-11-14 13:42                     ` Takashi Iwai
2024-11-15  4:34                       ` Jarosław Janik
2024-11-19 15:21                         ` Takashi Iwai
2024-11-20  1:29                           ` Jarosław Janik
2024-11-20  7:04                             ` Takashi Iwai
2024-11-20 15:00                               ` Jarosław Janik
2024-11-20 15:09                                 ` Takashi Iwai
2024-11-21  1:15                                   ` Jarosław Janik
2024-11-21 15:39                                     ` Takashi Iwai
2024-10-31 18:53   ` Thorsten Leemhuis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241030171813.18941-3-jaroslaw.janik@gmail.com \
    --to=jaroslaw.janik@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox