From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Cc: Liam Girdwood <liam.r.girdwood@linux.intel.com>,
Mark Brown <broonie@kernel.org>,
Jie Yang <yang.jie@linux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: [PATCH 3/7] ALSA: hda/intel: Drop superfluous AZX_DCAPS_I915_POWERWELL checks
Date: Sun, 9 Dec 2018 10:33:14 +0100 [thread overview]
Message-ID: <20181209093318.27829-4-tiwai@suse.de> (raw)
In-Reply-To: <20181209093318.27829-1-tiwai@suse.de>
Since snd_hdac_display_power() can be called even for a HDA controller
without DRM binding, lots of superfluous AZX_DCAPS_I915_POWERWELL
checks in hda_intel.c can be dropped. This simplifies the code a
lot.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/pci/hda/hda_intel.c | 43 +++++++++++++++------------------------
1 file changed, 16 insertions(+), 27 deletions(-)
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 151c6ca85ec6..cacee33a74a8 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -948,9 +948,7 @@ static void __azx_runtime_suspend(struct azx *chip)
azx_stop_chip(chip);
azx_enter_link_reset(chip);
azx_clear_irq_pending(chip);
- if ((chip->driver_caps & AZX_DCAPS_I915_POWERWELL) &&
- hda->need_i915_power)
- display_power(chip, false);
+ display_power(chip, false);
}
static void __azx_runtime_resume(struct azx *chip)
@@ -960,11 +958,9 @@ static void __azx_runtime_resume(struct azx *chip)
struct hda_codec *codec;
int status;
- if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
- display_power(chip, true);
- if (hda->need_i915_power)
- snd_hdac_i915_set_bclk(bus);
- }
+ display_power(chip, true);
+ if (hda->need_i915_power)
+ snd_hdac_i915_set_bclk(bus);
/* Read STATESTS before controller reset */
status = azx_readw(chip, STATESTS);
@@ -980,8 +976,7 @@ static void __azx_runtime_resume(struct azx *chip)
}
/* power down again for link-controlled chips */
- if ((chip->driver_caps & AZX_DCAPS_I915_POWERWELL) &&
- !hda->need_i915_power)
+ if (!hda->need_i915_power)
display_power(chip, false);
}
@@ -1345,11 +1340,8 @@ static int azx_free(struct azx *chip)
#ifdef CONFIG_SND_HDA_PATCH_LOADER
release_firmware(chip->fw);
#endif
+ display_power(chip, false);
- if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
- if (hda->need_i915_power)
- display_power(chip, false);
- }
if (chip->driver_caps & AZX_DCAPS_I915_COMPONENT)
snd_hdac_i915_exit(bus);
kfree(hda);
@@ -2219,6 +2211,10 @@ static int azx_probe_continue(struct azx *chip)
~(AZX_DCAPS_I915_COMPONENT | AZX_DCAPS_I915_POWERWELL);
}
}
+
+ /* HSW/BDW controllers need this power */
+ if (CONTROLLER_IN_GPU(pci))
+ hda->need_i915_power = 1;
}
/* Request display power well for the HDA controller or codec. For
@@ -2226,17 +2222,11 @@ static int azx_probe_continue(struct azx *chip)
* this power. For other platforms, like Baytrail/Braswell, only the
* display codec needs the power and it can be released after probe.
*/
- if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
- /* HSW/BDW controllers need this power */
- if (CONTROLLER_IN_GPU(pci))
- hda->need_i915_power = 1;
-
- err = display_power(chip, true);
- if (err < 0) {
- dev_err(chip->card->dev,
- "Cannot turn on display power on i915\n");
- goto i915_power_fail;
- }
+ err = display_power(chip, true);
+ if (err < 0) {
+ dev_err(chip->card->dev,
+ "Cannot turn on display power on i915\n");
+ goto i915_power_fail;
}
err = azx_first_init(chip);
@@ -2285,8 +2275,7 @@ static int azx_probe_continue(struct azx *chip)
pm_runtime_put_autosuspend(&pci->dev);
out_free:
- if ((chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
- && !hda->need_i915_power)
+ if (!hda->need_i915_power)
display_power(chip, false);
i915_power_fail:
--
2.19.2
next prev parent reply other threads:[~2018-12-09 9:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-09 9:33 [PATCH 0/7] ALSA: HD-audio display power fixes Takashi Iwai
2018-12-09 9:33 ` [PATCH 1/7] ALSA: hda/intel: Refactoring PM code Takashi Iwai
2018-12-09 9:33 ` [PATCH 2/7] ALSA: hda: Refactor display power management Takashi Iwai
2018-12-10 20:52 ` Pierre-Louis Bossart
2018-12-11 6:54 ` Takashi Iwai
2018-12-11 13:58 ` Pierre-Louis Bossart
2018-12-11 14:04 ` Takashi Iwai
2018-12-11 14:34 ` Pierre-Louis Bossart
2018-12-09 9:33 ` Takashi Iwai [this message]
2018-12-10 20:56 ` [PATCH 3/7] ALSA: hda/intel: Drop superfluous AZX_DCAPS_I915_POWERWELL checks Pierre-Louis Bossart
2018-12-11 7:00 ` Takashi Iwai
2018-12-09 9:33 ` [PATCH 4/7] ALSA: hda/intel: Properly free the display power at error path Takashi Iwai
2018-12-09 9:33 ` [PATCH 5/7] ALSA: hda: Make snd_hdac_display_power() void function Takashi Iwai
2018-12-09 9:33 ` [PATCH 6/7] ASoC: hdac_hdmi: Add missing display power-off at driver removal Takashi Iwai
2018-12-10 14:33 ` Mark Brown
2018-12-09 9:33 ` [PATCH 7/7] ALSA: hda/hdmi: Always set display_power_control for Intel HSW+ codecs Takashi Iwai
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=20181209093318.27829-4-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=liam.r.girdwood@linux.intel.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=yang.jie@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.