[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <91472c14-3aeb-766a-1716-8219af6e8782@axis.com>
Date: Tue, 28 May 2024 12:04:49 +0200 (CEST)
From: Ricard Wanderlof <ricardw@...s.com>
To: Andrzej Hajda <andrzej.hajda@...el.com>,
Neil Armstrong <neil.armstrong@...aro.org>, Robert Foss <rfoss@...nel.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>, Jernej Skrabec <jernej.skrabec@...il.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>
cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
kernel@...s.com
Subject: [PATCH] drm: bridge: adv7511: Accept audio sample widths of 32 bits
via I2S
Even though data is truncated to 24 bits, the I2S interface does
accept 32 bit data (the slot widths according to the data sheet
can be 16 or 32 bits) so let the hw_params callback reflect this,
even if the lowest 8 bits are not used when 32 bits are specified.
This is normally how 24 bit audio data is handled (i.e. as 32 bit
data, with the LSB:s unused) and this is also reflected in other
bridge drivers which handle audio, for instance sii902x.c and
synopsis/dw-hdmi-i2s-audio.c .
Signed-off-by: Ricard Wanderlof <ricard.wanderlof@...s.com>
---
drivers/gpu/drm/bridge/adv7511/adv7511_audio.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
index 61f4a38e7d2b..4563f5d8136f 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c
@@ -101,11 +101,14 @@ static int adv7511_hdmi_hw_params(struct device *dev, void *data,
case 20:
len = ADV7511_I2S_SAMPLE_LEN_20;
break;
- case 32:
- if (fmt->bit_fmt != SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE)
- return -EINVAL;
- fallthrough;
case 24:
+ case 32:
+ /*
+ * 32 bits are handled like 24 bits, except that the lowest
+ * 8 bits are discarded. In fact, the accepted I2S slot widths
+ * are 16 and 32 bits, so the chip is fully compatible with
+ * 32 bit data.
+ */
len = ADV7511_I2S_SAMPLE_LEN_24;
break;
default:
--
2.30.2
Powered by blists - more mailing lists