#include "hdmi_rx_edid.h"
-#define RX_VER0 "ver.2019-01-08"
+#define RX_VER0 "ver.2019-01-22"
/*
*
*
(rx.pre.sw_vic != HDMI_UNKNOWN) &&
(rx.pre.sw_vic != HDMI_UNSUPPORT) &&
(rx.avmute_skip == 0)) {
- aud_sts->aud_rcv_flag =
- (rx.aud_info.aud_packet_received == 0) ? false : true;
+ aud_sts->aud_rcv_packet = rx.aud_info.aud_packet_received;
aud_sts->aud_stb_flag = true;
aud_sts->aud_sr = rx.aud_info.real_sr;
aud_sts->aud_channel_cnt = rx.aud_info.channel_count;
struct rx_audio_stat_s {
/*audio packets received*/
- bool aud_rcv_flag;
+ int aud_rcv_packet;
/*audio stable status*/
bool aud_stb_flag;
/*audio sample rate*/
struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol);
+extern int aml_get_hdmiin_audio_packet(
+ struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol);
+
#endif
#endif
aml_get_hdmiin_audio_format,
NULL),
+ SOC_ENUM_EXT("HDMIIN Audio Packet",
+ hdmi_in_status_enum[4],
+ aml_get_hdmiin_audio_packet,
+ NULL),
+
SOC_SINGLE_BOOL_EXT("HDMI ATMOS EDID Switch",
0,
aml_get_atmos_audio_edid,
"WMA_PRO"
};
+static const char * const hdmi_in_audio_packet[] = {
+ "None",
+ "AUDS",
+ "OBA",
+ "DST",
+ "HBR",
+ "OBM",
+ "MAS"
+};
+
const struct soc_enum hdmi_in_status_enum[] = {
SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(audio_is_stable),
audio_is_stable),
SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(hdmi_in_channels),
hdmi_in_channels),
SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(hdmi_in_format),
- hdmi_in_format)
+ hdmi_in_format),
+ SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, ARRAY_SIZE(hdmi_in_audio_packet),
+ hdmi_in_audio_packet)
};
int aml_get_hdmiin_audio_stable(
struct rx_audio_stat_s aud_sts;
rx_get_audio_status(&aud_sts);
- ucontrol->value.integer.value[0] = aud_sts.aud_rcv_flag;
+ ucontrol->value.integer.value[0] =
+ (aud_sts.aud_rcv_packet == 0) ? 0 : 1;
return 0;
}
return 0;
}
+
/* call HDMI CEC API to enable arc audio */
int aml_set_atmos_audio_edid(
struct snd_kcontrol *kcontrol,
return 0;
}
+int aml_get_hdmiin_audio_packet(
+ struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct rx_audio_stat_s aud_sts;
+ int val;
+
+ rx_get_audio_status(&aud_sts);
+
+ switch (aud_sts.aud_rcv_packet) {
+ case 0:
+ val = 0;
+ break;
+ case 1:
+ val = 1;
+ break;
+ case 2:
+ val = 2;
+ break;
+ case 4:
+ val = 3;
+ break;
+ case 8:
+ val = 4;
+ break;
+ case 16:
+ val = 5;
+ break;
+ case 32:
+ val = 6;
+ break;
+ default:
+ val = 0;
+ break;
+ }
+ ucontrol->value.integer.value[0] = val;
+
+ return 0;
+}
+
#endif
int audio_type = 0;
int i;
int total_num = sizeof(type_texts)/sizeof(struct spdif_audio_info);
- int pc = aml_audin_read(AUDIN_SPDIF_NPCM_PCPD)>>16;
+ int pc_ori = aml_audin_read(AUDIN_SPDIF_NPCM_PCPD)>>16;
+ int pc = 0;
- pc = pc&0xfff;
+ /* data type is 0~4 bit*/
+ pc = pc_ori&0x1f;
+ /* check whether it has stop bit
+ * refer to IEC61937-1 table 9
+ */
+ if (pc == 0) {
+ pc = pc_ori&0xfff;
+ }
for (i = 0; i < total_num; i++) {
if (pc == type_texts[i].pc) {
audio_type = type_texts[i].aud_type;
SOC_ENUM_EXT("HDMIIN audio format", hdmi_in_status_enum[3],
aml_get_hdmiin_audio_format,
NULL),
+ SOC_ENUM_EXT("HDMIIN Audio Packet", hdmi_in_status_enum[4],
+ aml_get_hdmiin_audio_packet,
+ NULL),
SOC_SINGLE_BOOL_EXT("HDMI ATMOS EDID Switch", 0,
aml_get_atmos_audio_edid,
aml_set_atmos_audio_edid),