From 5334240c30cb0058fa8c373bf0d653337833230d Mon Sep 17 00:00:00 2001 From: Libin Yang Date: Wed, 2 Sep 2015 14:11:38 +0800 Subject: drm/i915: Add audio sync_audio_rate callback Add the sync_audio_rate callback. With the callback, audio driver can trigger i915 driver to set the proper N/CTS or N/M based on different sample rates. Signed-off-by: Libin Yang Reviewed-by: Jani Nikula Signed-off-by: Takashi Iwai --- include/drm/i915_component.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/drm') diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h index b2d56dd483d9..e6d35d7239c0 100644 --- a/include/drm/i915_component.h +++ b/include/drm/i915_component.h @@ -33,6 +33,13 @@ struct i915_audio_component { void (*put_power)(struct device *); void (*codec_wake_override)(struct device *, bool enable); int (*get_cdclk_freq)(struct device *); + /** + * @sync_audio_rate: set n/cts based on the sample rate + * + * Called from audio driver. After audio driver sets the + * sample rate, it will call this function to set n/cts + */ + int (*sync_audio_rate)(struct device *, int port, int rate); } *ops; const struct i915_audio_component_audio_ops { -- cgit v1.2.3 From 7e8275c2f2bbb384e18af37066b8b2f32b7d092f Mon Sep 17 00:00:00 2001 From: Libin Yang Date: Fri, 25 Sep 2015 09:36:12 +0800 Subject: drm/i915: set proper N/CTS in modeset When modeset occurs and the TMDS frequency is set to some speical values, the N/CTS need to be set manually if audio is playing. Signed-off-by: Libin Yang Reviewed-by: Jani Nikula Signed-off-by: Takashi Iwai --- include/drm/i915_component.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/drm') diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h index e6d35d7239c0..89dc7d6bc1cc 100644 --- a/include/drm/i915_component.h +++ b/include/drm/i915_component.h @@ -24,8 +24,18 @@ #ifndef _I915_COMPONENT_H_ #define _I915_COMPONENT_H_ +/* MAX_PORT is the number of port + * It must be sync with I915_MAX_PORTS defined i915_drv.h + * 5 should be enough as only HSW, BDW, SKL need such fix. + */ +#define MAX_PORTS 5 + struct i915_audio_component { struct device *dev; + /** + * @aud_sample_rate: the array of audio sample rate per port + */ + int aud_sample_rate[MAX_PORTS]; const struct i915_audio_component_ops { struct module *owner; -- cgit v1.2.3