All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Xingchao <xingchao.wang@linux.intel.com>
To: tiwai@suse.de, daniel.vetter@ffwll.ch
Cc: alsa-devel@alsa-project.org, xingchao.wang@intel.com,
	intel-gfx@lists.freedesktop.org, liam.r.girdwood@intel.com,
	david.henningsson@canonical.com
Subject: [PATCH 2/4] ALSA: hda - Move azx_first_init() into azx_probe_continue()
Date: Thu, 30 May 2013 22:07:09 +0800	[thread overview]
Message-ID: <1369922831-727-3-git-send-email-xingchao.wang@linux.intel.com> (raw)
In-Reply-To: <1369922831-727-1-git-send-email-xingchao.wang@linux.intel.com>

From: Takashi Iwai <tiwai@suse.de>

This is a preliminary work for the upcoming Haswell HDMI audio fixes.

azx_first_init() function can be safely called after the f/w loader,
since the f/w loader doesn't require the sound hardware initialization
beforehand.  Moving it into azx_probe_continue() cleans up the code
flow a bit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/hda/hda_intel.c |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index cf3d36c..49cc942 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2977,7 +2977,6 @@ static void azx_notifier_unregister(struct azx *chip)
 		unregister_reboot_notifier(&chip->reboot_notifier);
 }
 
-static int azx_first_init(struct azx *chip);
 static int azx_probe_continue(struct azx *chip);
 
 #ifdef SUPPORT_VGA_SWITCHEROO
@@ -3004,8 +3003,7 @@ static void azx_vs_set_state(struct pci_dev *pci,
 			snd_printk(KERN_INFO SFX
 				   "%s: Start delayed initialization\n",
 				   pci_name(chip->pci));
-			if (azx_first_init(chip) < 0 ||
-			    azx_probe_continue(chip) < 0) {
+			if (azx_probe_continue(chip) < 0) {
 				snd_printk(KERN_ERR SFX
 					   "%s: initialization error\n",
 					   pci_name(chip->pci));
@@ -3706,11 +3704,6 @@ static int azx_probe(struct pci_dev *pci,
 	}
 
 	probe_now = !chip->disabled;
-	if (probe_now) {
-		err = azx_first_init(chip);
-		if (err < 0)
-			goto out_free;
-	}
 
 #ifdef CONFIG_SND_HDA_PATCH_LOADER
 	if (patch[dev] && *patch[dev]) {
@@ -3747,6 +3740,10 @@ static int azx_probe_continue(struct azx *chip)
 	int dev = chip->dev_index;
 	int err;
 
+	err = azx_first_init(chip);
+	if (err < 0)
+		goto out_free;
+
 #ifdef CONFIG_SND_HDA_INPUT_BEEP
 	chip->beep_mode = beep_mode[dev];
 #endif
-- 
1.7.9.5

  parent reply	other threads:[~2013-05-30 14:34 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 14:07 [PATCH 0/4 V7] Power-well API implementation for Haswell Wang Xingchao
2013-05-30 14:07 ` [PATCH 1/4 V7] ALSA: hda - Fix runtime PM check Wang Xingchao
2013-05-30 14:07 ` Wang Xingchao [this message]
2013-05-30 14:07 ` [PATCH 3/4 V7] ALSA: hda - Add power-welll support for haswell HDA Wang Xingchao
2013-05-30 14:07 ` [PATCH 4/4 V7] i915/drm: Add private api for power well usage Wang Xingchao
2013-06-06 15:34 ` [PATCH 0/4 V7] Power-well API implementation for Haswell Daniel Vetter
2013-07-03 20:00   ` Paulo Zanoni
2013-07-04  8:23     ` Wang xingchao
2013-07-04 13:24       ` Paulo Zanoni
2013-07-04 13:13         ` [Intel-gfx] " Wang xingchao
2013-07-05 21:19           ` Paulo Zanoni
2013-07-06  6:20             ` [Intel-gfx] " Takashi Iwai
2013-07-07 23:59               ` Wang xingchao
2013-07-08  8:07                 ` Takashi Iwai
2013-07-17  2:52               ` [Intel-gfx] " Wang, Xingchao
2013-07-17  7:34                 ` [alsa-devel] " Takashi Iwai
2013-07-17  8:03                   ` [Intel-gfx] " Wang, Xingchao
2013-07-17  8:18                     ` Takashi Iwai
2013-07-17  8:25                       ` Wang, Xingchao
2013-07-17 13:31                         ` [alsa-devel] " Paulo Zanoni
2013-07-17 14:00                           ` [Intel-gfx] " Takashi Iwai
2013-07-17 14:05                             ` David Henningsson
2013-07-17 14:21                               ` [alsa-devel] " Takashi Iwai
2013-07-17 23:17                                 ` [Intel-gfx] " Wang, Xingchao
2013-07-18  1:00                                 ` Wang, Xingchao
2013-07-18  6:44                                   ` Daniel Vetter
2013-07-18  9:23                                     ` [alsa-devel] " Wang, Xingchao
2013-07-18  9:34                                       ` Takashi Iwai
2013-07-24 10:31                                         ` [Intel-gfx] " Wang, Xingchao
2013-07-24 11:02                                           ` [alsa-devel] " Takashi Iwai
2013-07-24 11:33                                             ` [Intel-gfx] " Wang, Xingchao
2013-07-24 11:57                                               ` [alsa-devel] " David Henningsson
2013-07-24 12:13                                                 ` [Intel-gfx] " Takashi Iwai
2013-07-24 13:14                                                 ` Rafael J. Wysocki
2013-07-24 13:30                                                   ` Wang, Xingchao
2013-07-24 13:42                                                     ` Takashi Iwai
2013-07-24 13:46                                                       ` Wang, Xingchao
2013-07-24 14:00                                                       ` Wang, Xingchao
2013-07-25  6:50                                                         ` [alsa-devel] " Wang, Xingchao
2013-07-24 14:36                                                       ` [Intel-gfx] " Wang, Xingchao
2013-07-18  6:54                                   ` [alsa-devel] " Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2013-05-27  9:15 [PATCH 0/4 V6] " Wang Xingchao
2013-05-27  9:15 ` [PATCH 2/4] ALSA: hda - Move azx_first_init() into azx_probe_continue() Wang Xingchao

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=1369922831-727-3-git-send-email-xingchao.wang@linux.intel.com \
    --to=xingchao.wang@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=david.henningsson@canonical.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=liam.r.girdwood@intel.com \
    --cc=tiwai@suse.de \
    --cc=xingchao.wang@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.