Commit 7f2e9ab5 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: x86: Drop global ELD copy

Similarly like the previous patch, drop the global variable to keep
the ELD copy.  It can be embedded in hdmi_lpe_audio_ctx as well.

And this makes easier to code, it's just a memcpy(), after all.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 055610b0
...@@ -36,9 +36,6 @@ ...@@ -36,9 +36,6 @@
#include "intel_hdmi_lpe_audio.h" #include "intel_hdmi_lpe_audio.h"
#include "intel_hdmi_audio.h" #include "intel_hdmi_audio.h"
/* globals*/
static union otm_hdmi_eld_t hlpe_eld;
struct hdmi_lpe_audio_ctx { struct hdmi_lpe_audio_ctx {
struct platform_device *pdev; struct platform_device *pdev;
int irq; int irq;
...@@ -51,29 +48,9 @@ struct hdmi_lpe_audio_ctx { ...@@ -51,29 +48,9 @@ struct hdmi_lpe_audio_ctx {
int hdmi_audio_interrupt_mask; int hdmi_audio_interrupt_mask;
struct work_struct hdmi_audio_wq; struct work_struct hdmi_audio_wq;
int state; /* connection state */ int state; /* connection state */
union otm_hdmi_eld_t eld; /* ELD copy */
}; };
static void hdmi_set_eld(void *eld)
{
int size;
BUILD_BUG_ON(sizeof(hlpe_eld) > HDMI_MAX_ELD_BYTES);
size = sizeof(hlpe_eld);
memcpy((void *)&hlpe_eld, eld, size);
}
static int hdmi_get_eld(void *eld)
{
u8 *eld_data = (u8 *)&hlpe_eld;
memcpy(eld, (void *)&hlpe_eld, sizeof(hlpe_eld));
print_hex_dump_bytes("eld: ", DUMP_PREFIX_NONE, eld_data,
sizeof(hlpe_eld));
return 0;
}
static void mid_hdmi_audio_signal_event(struct platform_device *pdev, static void mid_hdmi_audio_signal_event(struct platform_device *pdev,
enum had_event_type event) enum had_event_type event)
{ {
...@@ -159,7 +136,9 @@ int mid_hdmi_audio_get_caps(struct platform_device *pdev, ...@@ -159,7 +136,9 @@ int mid_hdmi_audio_get_caps(struct platform_device *pdev,
switch (get_element) { switch (get_element) {
case HAD_GET_ELD: case HAD_GET_ELD:
ret = hdmi_get_eld(capabilities); memcpy(capabilities, &ctx->eld, sizeof(ctx->eld));
print_hex_dump_bytes("eld: ", DUMP_PREFIX_NONE,
(u8 *)&ctx->eld, sizeof(ctx->eld));
break; break;
case HAD_GET_DISPLAY_RATE: case HAD_GET_DISPLAY_RATE:
/* ToDo: Verify if sampling freq logic is correct */ /* ToDo: Verify if sampling freq logic is correct */
...@@ -292,7 +271,7 @@ static void notify_audio_lpe(struct platform_device *pdev) ...@@ -292,7 +271,7 @@ static void notify_audio_lpe(struct platform_device *pdev)
break; break;
} }
hdmi_set_eld(eld->eld_data); memcpy(&ctx->eld, eld->eld_data, sizeof(ctx->eld));
mid_hdmi_audio_signal_event(pdev, HAD_EVENT_HOT_PLUG); mid_hdmi_audio_signal_event(pdev, HAD_EVENT_HOT_PLUG);
......
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