Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: intel-gfx@lists.freedesktop.org, alsa-devel@alsa-project.org,
	Takashi Iwai <tiwai@suse.de>
Subject: [PATCH 3/5] ALSA: hda: pass chip to all i915 interface functions
Date: Mon,  8 Dec 2014 18:42:07 +0200	[thread overview]
Message-ID: <1418056929-7977-4-git-send-email-imre.deak@intel.com> (raw)
In-Reply-To: <1418056929-7977-1-git-send-email-imre.deak@intel.com>

chip is already passed to most of the i915 interface functions, unify
things by passing it also to the rest. This will be needed by an
upcoming patch adding component support.

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 sound/pci/hda/hda_i915.c  |  6 +++---
 sound/pci/hda/hda_i915.h  | 12 ++++++------
 sound/pci/hda/hda_intel.c | 16 ++++++++--------
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/sound/pci/hda/hda_i915.c b/sound/pci/hda/hda_i915.c
index d4d0375..4e4b733 100644
--- a/sound/pci/hda/hda_i915.c
+++ b/sound/pci/hda/hda_i915.c
@@ -35,7 +35,7 @@ static int (*get_power)(void);
 static int (*put_power)(void);
 static int (*get_cdclk)(void);
 
-int hda_display_power(bool enable)
+int hda_display_power(struct azx *chip, bool enable)
 {
 	if (!get_power || !put_power)
 		return -ENODEV;
@@ -85,7 +85,7 @@ void haswell_set_bclk(struct azx *chip)
 }
 
 
-int hda_i915_init(void)
+int hda_i915_init(struct azx *chip)
 {
 	int err = 0;
 
@@ -111,7 +111,7 @@ int hda_i915_init(void)
 	return err;
 }
 
-int hda_i915_exit(void)
+int hda_i915_exit(struct azx *chip)
 {
 	if (get_power) {
 		symbol_put(i915_request_power_well);
diff --git a/sound/pci/hda/hda_i915.h b/sound/pci/hda/hda_i915.h
index e6072c6..4d77d73 100644
--- a/sound/pci/hda/hda_i915.h
+++ b/sound/pci/hda/hda_i915.h
@@ -17,18 +17,18 @@
 #define __SOUND_HDA_I915_H
 
 #ifdef CONFIG_SND_HDA_I915
-int hda_display_power(bool enable);
+int hda_display_power(struct azx *chip, bool enable);
 void haswell_set_bclk(struct azx *chip);
-int hda_i915_init(void);
-int hda_i915_exit(void);
+int hda_i915_init(struct azx *chip);
+int hda_i915_exit(struct azx *chip);
 #else
-static inline int hda_display_power(bool enable) { return 0; }
+static inline int hda_display_power(struct azx *chip, bool enable) { return 0; }
 static inline void haswell_set_bclk(struct azx *chip) { return; }
-static inline int hda_i915_init(void)
+static inline int hda_i915_init(struct azx *chip);
 {
 	return -ENODEV;
 }
-static inline int hda_i915_exit(void)
+static inline int hda_i915_exit(struct azx *chip)
 {
 	return 0;
 }
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 5ac0d39..f3b5dcd 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -825,7 +825,7 @@ static int azx_suspend(struct device *dev)
 	pci_save_state(pci);
 	pci_set_power_state(pci, PCI_D3hot);
 	if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
-		hda_display_power(false);
+		hda_display_power(chip, false);
 	return 0;
 }
 
@@ -845,7 +845,7 @@ static int azx_resume(struct device *dev)
 		return 0;
 
 	if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
-		hda_display_power(true);
+		hda_display_power(chip, true);
 		haswell_set_bclk(chip);
 	}
 	pci_set_power_state(pci, PCI_D0);
@@ -898,7 +898,7 @@ static int azx_runtime_suspend(struct device *dev)
 	azx_enter_link_reset(chip);
 	azx_clear_irq_pending(chip);
 	if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
-		hda_display_power(false);
+		hda_display_power(chip, false);
 
 	return 0;
 }
@@ -924,7 +924,7 @@ static int azx_runtime_resume(struct device *dev)
 		return 0;
 
 	if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
-		hda_display_power(true);
+		hda_display_power(chip, true);
 		haswell_set_bclk(chip);
 	}
 
@@ -1150,8 +1150,8 @@ static int azx_free(struct azx *chip)
 	release_firmware(chip->fw);
 #endif
 	if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
-		hda_display_power(false);
-		hda_i915_exit();
+		hda_display_power(chip, false);
+		hda_i915_exit(chip);
 	}
 	kfree(hda);
 
@@ -1910,13 +1910,13 @@ static int azx_probe_continue(struct azx *chip)
 	/* Request power well for Haswell HDA controller and codec */
 	if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
 #ifdef CONFIG_SND_HDA_I915
-		err = hda_i915_init();
+		err = hda_i915_init(chip);
 		if (err < 0) {
 			dev_err(chip->card->dev,
 				"Error request power-well from i915\n");
 			goto out_free;
 		}
-		err = hda_display_power(true);
+		err = hda_display_power(chip, true);
 		if (err < 0) {
 			dev_err(chip->card->dev,
 				"Cannot turn on display power on i915\n");
-- 
1.8.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2014-12-08 16:42 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08 16:42 [PATCH 0/5] sanitize hda/i915 interface using the component fw Imre Deak
2014-12-08 16:42 ` [PATCH 1/5] drm/i915: add dev_to_i915_priv helper Imre Deak
2014-12-08 18:36   ` Jani Nikula
2014-12-08 19:54     ` Imre Deak
2014-12-08 20:27   ` Daniel Vetter
2014-12-08 20:40   ` Chris Wilson
2014-12-08 21:26     ` Imre Deak
2014-12-09  9:41   ` [PATCH v2 1/5] drm/i915: add dev_to_i915 helper Imre Deak
2014-12-09 10:08     ` Daniel Vetter
2014-12-09 16:15     ` [PATCH v3 " Imre Deak
2014-12-08 16:42 ` [PATCH 2/5] drm/i915: add component support Imre Deak
2014-12-08 18:44   ` Jani Nikula
2014-12-08 20:23     ` Imre Deak
2014-12-09  9:41   ` [PATCH v2 " Imre Deak
2014-12-09 10:12     ` Daniel Vetter
2014-12-09 10:33       ` Jani Nikula
2014-12-10  9:24         ` Daniel Vetter
2014-12-09 16:15     ` [PATCH v3 " Imre Deak
2014-12-10  8:22       ` Jani Nikula
2014-12-10 13:18         ` Imre Deak
2014-12-08 16:42 ` Imre Deak [this message]
2014-12-08 16:42 ` [PATCH 4/5] ALSA: hda: " Imre Deak
2014-12-09  9:41   ` [PATCH v2 " Imre Deak
2014-12-09 10:19     ` Daniel Vetter
2014-12-09 17:30       ` Takashi Iwai
2014-12-10  9:27         ` Daniel Vetter
2014-12-09 16:15     ` [PATCH v3 " Imre Deak
2014-12-08 16:42 ` [PATCH 5/5] drm/i915: remove unused power_well/get_cdclk_freq api Imre Deak
2014-12-08 18:46   ` Jani Nikula
2014-12-08 20:14 ` [PATCH 0/5] sanitize hda/i915 interface using the component fw Daniel Vetter
2014-12-09  8:59   ` Imre Deak
2014-12-09 10:03     ` Daniel Vetter
2014-12-09 16:56       ` Imre Deak
2014-12-09 17:33         ` Takashi Iwai
2015-01-05 15:29           ` Imre Deak
2015-01-05 15:35             ` Takashi Iwai
2015-01-05 17:25               ` Imre Deak
2015-01-06 10:25                 ` Takashi Iwai
2015-01-07 19:49                   ` Imre Deak
2015-01-08 14:35                     ` 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=1418056929-7977-4-git-send-email-imre.deak@intel.com \
    --to=imre.deak@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tiwai@suse.de \
    /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