summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/display/intel_audio.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2022-10-26 20:01:40 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2022-10-27 20:18:55 +0300
commit011aa42ef6ae7809249eaacca78081d357ffc95a (patch)
tree43d6ab48f12751855c80e1eb5146e31cab8399de /drivers/gpu/drm/i915/display/intel_audio.c
parent669d7fd64099b400759a9b0ca54d92da8330d1a1 (diff)
downloadlinux-011aa42ef6ae7809249eaacca78081d357ffc95a.tar.xz
drm/i915/audio: Use REG_BIT() & co.
Switch the audio registers to REG_BIT() & co. Cc: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com> Cc: Takashi Iwai <tiwai@suse.de> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221026170150.2654-6-ville.syrjala@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_audio.c')
-rw-r--r--drivers/gpu/drm/i915/display/intel_audio.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c
index e35fabf8d86e..29f2820c94c3 100644
--- a/drivers/gpu/drm/i915/display/intel_audio.c
+++ b/drivers/gpu/drm/i915/display/intel_audio.c
@@ -362,7 +362,7 @@ static void g4x_audio_codec_enable(struct intel_encoder *encoder,
tmp = intel_de_read(i915, G4X_AUD_CNTL_ST);
tmp &= ~(G4X_ELDV | G4X_ELD_ADDR_MASK);
- len = (tmp >> 9) & 0x1f; /* ELD buffer size */
+ len = REG_FIELD_GET(G4X_ELD_BUFFER_SIZE_MASK, tmp);
intel_de_write(i915, G4X_AUD_CNTL_ST, tmp);
len = min(drm_eld_size(eld) / 4, len);
@@ -700,7 +700,7 @@ static void ilk_audio_codec_disable(struct intel_encoder *encoder,
enum pipe pipe = crtc->pipe;
enum port port = encoder->port;
struct ilk_audio_regs regs;
- u32 tmp, eldv;
+ u32 tmp;
if (drm_WARN_ON(&i915->drm, port == PORT_A))
return;
@@ -717,11 +717,9 @@ static void ilk_audio_codec_disable(struct intel_encoder *encoder,
tmp |= AUD_CONFIG_N_VALUE_INDEX;
intel_de_write(i915, regs.aud_config, tmp);
- eldv = IBX_ELD_VALID(port);
-
/* Invalidate ELD */
tmp = intel_de_read(i915, regs.aud_cntrl_st2);
- tmp &= ~eldv;
+ tmp &= ~IBX_ELD_VALID(port);
intel_de_write(i915, regs.aud_cntrl_st2, tmp);
}
@@ -736,8 +734,8 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder,
enum port port = encoder->port;
const u8 *eld = connector->eld;
struct ilk_audio_regs regs;
- u32 tmp, eldv;
int len, i;
+ u32 tmp;
if (drm_WARN_ON(&i915->drm, port == PORT_A))
return;
@@ -751,11 +749,10 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder,
ilk_audio_regs_init(i915, pipe, &regs);
- eldv = IBX_ELD_VALID(port);
/* Invalidate ELD */
tmp = intel_de_read(i915, regs.aud_cntrl_st2);
- tmp &= ~eldv;
+ tmp &= ~IBX_ELD_VALID(port);
intel_de_write(i915, regs.aud_cntrl_st2, tmp);
/* Reset ELD write address */
@@ -771,7 +768,7 @@ static void ilk_audio_codec_enable(struct intel_encoder *encoder,
/* ELD valid */
tmp = intel_de_read(i915, regs.aud_cntrl_st2);
- tmp |= eldv;
+ tmp |= IBX_ELD_VALID(port);
intel_de_write(i915, regs.aud_cntrl_st2, tmp);
/* Enable timestamps */