From patchwork Fri Jan 27 14:42:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 9541979 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9172760429 for ; Fri, 27 Jan 2017 14:43:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83CA227A98 for ; Fri, 27 Jan 2017 14:43:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7863C27D0E; Fri, 27 Jan 2017 14:43:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 865C927A98 for ; Fri, 27 Jan 2017 14:43:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2CA1F6E32F; Fri, 27 Jan 2017 14:43:02 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 06AED6E32F for ; Fri, 27 Jan 2017 14:43:00 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DA134AC5B; Fri, 27 Jan 2017 14:42:56 +0000 (UTC) Date: Fri, 27 Jan 2017 15:42:56 +0100 Message-ID: From: Takashi Iwai To: Ville =?UTF-8?B?U3lyasOkbMOk?= In-Reply-To: <20170127143547.GZ31595@intel.com> References: <1485461141-14023-1-git-send-email-pierre-louis.bossart@linux.intel.com> <1485461141-14023-5-git-send-email-pierre-louis.bossart@linux.intel.com> <87efzo4xxh.fsf@intel.com> <20170127131734.GP31595@intel.com> <20170127143547.GZ31595@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.1 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: alsa-devel@alsa-project.org, Daniel Vetter , intel-gfx@lists.freedesktop.org, broonie@kernel.org Subject: Re: [Intel-gfx] [RFC PATCH 4/5] drm: i915: add DisplayPort amp unmute for LPE audio mode X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP On Fri, 27 Jan 2017 15:35:47 +0100, Ville Syrjälä wrote: > > On Fri, Jan 27, 2017 at 03:17:34PM +0200, Ville Syrjälä wrote: > > On Fri, Jan 27, 2017 at 12:08:58PM +0200, Jani Nikula wrote: > > > On Thu, 26 Jan 2017, Pierre-Louis Bossart wrote: > > > > Enable chicken bit on LPE mode setup and unmute amp on > > > > notification > > > > > > > > FIXME: should these two phases done somewhere else? > > > > > > > > Signed-off-by: Pierre-Louis Bossart > > > > --- > > > > drivers/gpu/drm/i915/i915_reg.h | 12 ++++++++++++ > > > > drivers/gpu/drm/i915/intel_lpe_audio.c | 27 +++++++++++++++++++++++++++ > > > > 2 files changed, 39 insertions(+) > > > > > > > > diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h > > > > index a9ffc8d..ee90f64 100644 > > > > --- a/drivers/gpu/drm/i915/i915_reg.h > > > > +++ b/drivers/gpu/drm/i915/i915_reg.h > > > > @@ -2061,6 +2061,18 @@ enum skl_disp_power_wells { > > > > #define I915_HDMI_LPE_AUDIO_BASE (VLV_DISPLAY_BASE + 0x65000) > > > > #define I915_HDMI_LPE_AUDIO_SIZE 0x1000 > > > > > > > > +/* DisplayPort Audio w/ LPE */ > > > > +#define CHICKEN_BIT_DBG_ENABLE (1 << 0) > > > > +#define AMP_UNMUTE (1 << 1) > > > > That should be called AMP_MUTE I think, > > > > > > > > The convention is to define registers first and the contents/bits for > > > each register immedialy below. For groups of registers (like > > > PORT_EN_B/C/D below) define all registers first and bits immediately > > > below. (But note that the chicken register is not part of the group.) > > > > > > > +#define AUD_CHICKEN_BIT_REG 0x62F38 > > > > Spec calls this AUD_CHICKENBIT_REG. Might as well follow it to the > > letter. > > > > > > +#define AUD_PORT_EN_B_DBG 0x62F20 > > > > +#define AUD_PORT_EN_C_DBG 0x62F28 > > > > +#define AUD_PORT_EN_D_DBG 0x62F2C > > > > These match the spec. But to match the standard i915 convention they > > should be called _AUD_PORT_EN_B_DBG etc. Same forthe chicken bit > > register. > > Actually they just match one version of the spec I had lying around. > Another versions says: > > AUD_PORT_EN_B_DBG 0x62F20 > AUD_PORT_EN_C_DBG 0x62F30 > AUD_PORT_EN_D_DBG 0x62F34 That's it! Now finally I can hear the audio from DP3 with the additional patch below. thanks, Takashi diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index ee90f64b89e8..5c577d242078 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -2066,8 +2066,8 @@ enum skl_disp_power_wells { #define AMP_UNMUTE (1 << 1) #define AUD_CHICKEN_BIT_REG 0x62F38 #define AUD_PORT_EN_B_DBG 0x62F20 -#define AUD_PORT_EN_C_DBG 0x62F28 -#define AUD_PORT_EN_D_DBG 0x62F2C +#define AUD_PORT_EN_C_DBG 0x62F30 +#define AUD_PORT_EN_D_DBG 0x62F34 #define VLV_AUD_CHICKEN_BIT_REG _MMIO(VLV_DISPLAY_BASE + AUD_CHICKEN_BIT_REG) #define VLV_AUD_PORT_EN_B_DBG _MMIO(VLV_DISPLAY_BASE + AUD_PORT_EN_B_DBG) #define VLV_AUD_PORT_EN_C_DBG _MMIO(VLV_DISPLAY_BASE + AUD_PORT_EN_C_DBG)