mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
hdmitx: parsing basic audio [1/1]
PD#SWPL-12779 Problem: For some RX, the audio block of its EDID contains other audio type(eg. DD), without PCM. Solution: Check the parsed EDID data, add default PCM type when it contains other audio type w/o PCM. Verify: G12/U212 Change-Id: Ia343149ffd4e73970fd76c08a5fde4ee1fe78656 Signed-off-by: Zongdong Jiao <zongdong.jiao@amlogic.com>
This commit is contained in:
@@ -1532,7 +1532,6 @@ static int hdmitx_edid_block_parse(struct hdmitx_dev *hdmitx_device,
|
||||
pRXCap->number_of_dtd += BlockBuf[3] & 0xf;
|
||||
|
||||
pRXCap->native_VIC = 0xff;
|
||||
pRXCap->AUD_count = 0;
|
||||
|
||||
Edid_Y420CMDB_Reset(&(hdmitx_device->hdmi_info));
|
||||
|
||||
@@ -1746,7 +1745,7 @@ static void hdmitx_edid_set_default_aud(struct hdmitx_dev *hdev)
|
||||
pRXCap->RxAudioCap[0].audio_format_code = 1; /* PCM */
|
||||
pRXCap->RxAudioCap[0].channel_num_max = 1; /* 2ch */
|
||||
pRXCap->RxAudioCap[0].freq_cc = 7; /* 32/44.1/48 kHz */
|
||||
pRXCap->RxAudioCap[0].cc3 = 7; /* 16/20/24 bit */
|
||||
pRXCap->RxAudioCap[0].cc3 = 1; /* 16bit */
|
||||
}
|
||||
|
||||
/* add default VICs for DVI case */
|
||||
@@ -2045,6 +2044,35 @@ next:
|
||||
dump_dtd_info(t);
|
||||
}
|
||||
|
||||
static void edid_check_pcm_declare(struct rx_cap *pRXCap)
|
||||
{
|
||||
int idx_pcm = 0;
|
||||
int i;
|
||||
|
||||
if (!pRXCap->AUD_count)
|
||||
return;
|
||||
|
||||
/* Try to find more than 1 PCMs, RxAudioCap[0] is always basic audio */
|
||||
for (i = 1; i < pRXCap->AUD_count; i++) {
|
||||
if (pRXCap->RxAudioCap[i].audio_format_code ==
|
||||
pRXCap->RxAudioCap[0].audio_format_code) {
|
||||
idx_pcm = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove basic audio */
|
||||
if (idx_pcm) {
|
||||
for (i = 0; i < pRXCap->AUD_count - 1; i++)
|
||||
memcpy(&pRXCap->RxAudioCap[i],
|
||||
&pRXCap->RxAudioCap[i + 1],
|
||||
sizeof(struct rx_audiocap));
|
||||
/* Clear the last audio declaration */
|
||||
memset(&pRXCap->RxAudioCap[i], 0, sizeof(struct rx_audiocap));
|
||||
pRXCap->AUD_count--;
|
||||
}
|
||||
}
|
||||
|
||||
static void hdrinfo_to_vinfo(struct vinfo_s *info, struct rx_cap *pRXCap)
|
||||
{
|
||||
unsigned int k, l;
|
||||
@@ -2313,7 +2341,7 @@ int hdmitx_edid_parse(struct hdmitx_dev *hdmitx_device)
|
||||
|
||||
hdmitx_edid_block_parse(hdmitx_device, &(EDID_buf[i*128]));
|
||||
}
|
||||
|
||||
edid_check_pcm_declare(&hdmitx_device->RXCap);
|
||||
/*
|
||||
* Because DTDs are not able to represent some Video Formats, which can be
|
||||
* represented as SVDs and might be preferred by Sinks, the first DTD in the
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
|
||||
/* HDMITX driver version */
|
||||
#define HDMITX_VER "20190715"
|
||||
#define HDMITX_VER "20190815"
|
||||
|
||||
/* chip type */
|
||||
#define MESON_CPU_ID_M8B 0
|
||||
|
||||
Reference in New Issue
Block a user