Commit ae053fa2 authored by Sia Jee Heng's avatar Sia Jee Heng Committed by Robert Foss

drm: bridge: adv7511: Support I2S IEC958 encoded PCM format

Support IEC958 encoded PCM format for ADV7511 so that ADV7511 HDMI
audio driver can accept the IEC958 data from the I2S input.
Signed-off-by: default avatarSia Jee Heng <jee.heng.sia@intel.com>
Reviewed-by: default avatarRobert Foss <robert.foss@linaro.org>
Signed-off-by: default avatarRobert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210422064015.15285-1-jee.heng.sia@intel.com
parent 178bdba8
...@@ -191,6 +191,7 @@ ...@@ -191,6 +191,7 @@
#define ADV7511_I2S_FORMAT_I2S 0 #define ADV7511_I2S_FORMAT_I2S 0
#define ADV7511_I2S_FORMAT_RIGHT_J 1 #define ADV7511_I2S_FORMAT_RIGHT_J 1
#define ADV7511_I2S_FORMAT_LEFT_J 2 #define ADV7511_I2S_FORMAT_LEFT_J 2
#define ADV7511_I2S_IEC958_DIRECT 3
#define ADV7511_PACKET(p, x) ((p) * 0x20 + (x)) #define ADV7511_PACKET(p, x) ((p) * 0x20 + (x))
#define ADV7511_PACKET_SDP(x) ADV7511_PACKET(0, x) #define ADV7511_PACKET_SDP(x) ADV7511_PACKET(0, x)
......
...@@ -101,6 +101,10 @@ static int adv7511_hdmi_hw_params(struct device *dev, void *data, ...@@ -101,6 +101,10 @@ static int adv7511_hdmi_hw_params(struct device *dev, void *data,
case 20: case 20:
len = ADV7511_I2S_SAMPLE_LEN_20; len = ADV7511_I2S_SAMPLE_LEN_20;
break; break;
case 32:
if (fmt->bit_fmt != SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE)
return -EINVAL;
fallthrough;
case 24: case 24:
len = ADV7511_I2S_SAMPLE_LEN_24; len = ADV7511_I2S_SAMPLE_LEN_24;
break; break;
...@@ -112,6 +116,8 @@ static int adv7511_hdmi_hw_params(struct device *dev, void *data, ...@@ -112,6 +116,8 @@ static int adv7511_hdmi_hw_params(struct device *dev, void *data,
case HDMI_I2S: case HDMI_I2S:
audio_source = ADV7511_AUDIO_SOURCE_I2S; audio_source = ADV7511_AUDIO_SOURCE_I2S;
i2s_format = ADV7511_I2S_FORMAT_I2S; i2s_format = ADV7511_I2S_FORMAT_I2S;
if (fmt->bit_fmt == SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE)
i2s_format = ADV7511_I2S_IEC958_DIRECT;
break; break;
case HDMI_RIGHT_J: case HDMI_RIGHT_J:
audio_source = ADV7511_AUDIO_SOURCE_I2S; audio_source = ADV7511_AUDIO_SOURCE_I2S;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment