Re: [PATCH v2 15/18] drm/i915/audio: add audio codec disable on g4x

Rodrigo Vivi
2014-10-30T19:10:20Z

On Mon, Oct 27, 2014 at 7:26 AM, Jani Nikula <jani.nikula@intel.com> wrote:
> This not based on any documentation...
:(

>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/intel_audio.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
> index 1bd1a51d8d49..86c1f8db7332 100644
> --- a/drivers/gpu/drm/i915/intel_audio.c
> +++ b/drivers/gpu/drm/i915/intel_audio.c
> @@ -93,6 +93,25 @@ static bool intel_eld_uptodate(struct drm_connector *connector,
> return true;
> }
>
> +static void g4x_audio_codec_disable(struct intel_encoder *encoder)
> +{
> + struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
> + uint32_t eldv, tmp;
> +
> + DRM_DEBUG_KMS("Disable audio codec\n");
> +
> + tmp = I915_READ(G4X_AUD_VID_DID);
> + if (tmp == INTEL_AUDIO_DEVBLC || tmp == INTEL_AUDIO_DEVCL)
> + eldv = G4X_ELDV_DEVCL_DEVBLC;
> + else
> + eldv = G4X_ELDV_DEVCTG;
> +
> + /* Invalidate ELD */
> + tmp = I915_READ(G4X_AUD_CNTL_ST);
> + tmp &= ~eldv;
> + I915_WRITE(G4X_AUD_CNTL_ST, tmp);
> +}
> +

Based on other platforms and bits definitions I'll agree in give my
rv-b here to not block the progress.
But I believe that in this case a Tested-by tag is more important than
a rv-b one.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> static void g4x_audio_codec_enable(struct drm_connector *connector,
> struct intel_encoder *encoder,
> struct drm_display_mode *mode)
> @@ -398,6 +417,7 @@ void intel_init_audio(struct drm_device *dev)
>
> if (IS_G4X(dev)) {
> dev_priv->display.audio_codec_enable = g4x_audio_codec_enable;
> + dev_priv->display.audio_codec_disable = g4x_audio_codec_disable;
> } else if (IS_VALLEYVIEW(dev)) {
> dev_priv->display.audio_codec_enable = ilk_audio_codec_enable;
> dev_priv->display.audio_codec_disable = ilk_audio_codec_disable;
> --
> 2.1.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

--
Rodrigo Vivi
Blog: http://blog.vivi.eng.br