[alsa-devel] [PATCH 3/5] ALSA: hda: pass chip to all i915 interface functions

Imre Deak imre.deak at intel.com
Mon Dec 8 17:42:07 CET 2014


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 at 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



More information about the Alsa-devel mailing list