[Intel-gfx] [RFC PATCH 2/3] drm/i915: add opregion function to enable/disable audio device

Jani Nikula jani.nikula at intel.com
Tue Jul 1 15:49:01 CEST 2014


Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h       |  6 ++++++
 drivers/gpu/drm/i915/intel_opregion.c | 10 ++++++++++
 2 files changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 2feb8215f9fa..f8e7a74a21ff 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2603,6 +2603,7 @@ extern int intel_opregion_notify_encoder(struct intel_encoder *intel_encoder,
 extern int intel_opregion_notify_adapter(struct drm_device *dev,
 					 pci_power_t state);
 extern int intel_opregion_notify_cdclk(struct drm_device *dev, int cdclk);
+extern int intel_opregion_audio_enable(struct drm_device *dev, bool enable);
 #else
 static inline int intel_opregion_setup(struct drm_device *dev) { return 0; }
 static inline void intel_opregion_init(struct drm_device *dev) { return; }
@@ -2623,6 +2624,11 @@ intel_opregion_notify_cdclk(struct drm_device *dev, int cdclk)
 {
 	return 0;
 }
+static inline int
+intel_opregion_audio_enable(struct drm_device *dev, bool enable)
+{
+	return 0;
+}
 #endif
 
 /* intel_acpi.c */
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index 6450d2625624..7482b687ac20 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -424,6 +424,16 @@ int intel_opregion_notify_cdclk(struct drm_device *dev, int cdclk)
 	return swsci(dev, SWSCI_SBCB_CD_CLOCK_CHANGE, parm, NULL);
 }
 
+int intel_opregion_audio_enable(struct drm_device *dev, bool enable)
+{
+	u32 parm = enable ? 1 : 0;
+
+	if (!IS_HASWELL(dev) && !IS_BROADWELL(dev))
+		return 0;
+
+	return swsci(dev, SWSCI_SBCB_ENABLE_DISABLE_AUDIO, parm, NULL);
+}
+
 static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
-- 
2.0.0




More information about the Intel-gfx mailing list