Skip to content

Commit

Permalink
ALSA: hda - compute checksum in HDMI audio infoframe
Browse files Browse the repository at this point in the history
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Wu Fengguang authored and Takashi Iwai committed Feb 11, 2009
1 parent 606c0ce commit 9a957a2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sound/pci/hda/patch_intelhdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,16 @@ static void hdmi_fill_audio_infoframe(struct hda_codec *codec,
struct hdmi_audio_infoframe *ai)
{
u8 *params = (u8 *)ai;
u8 sum = 0;
int i;

hdmi_debug_dip_size(codec);
hdmi_clear_dip_buffers(codec); /* be paranoid */

for (i = 0; i < sizeof(ai); i++)
sum += params[i];
ai->checksum = - sum;

hdmi_set_dip_index(codec, PIN_NID, 0x0, 0x0);
for (i = 0; i < sizeof(ai); i++)
hdmi_write_dip_byte(codec, PIN_NID, params[i]);
Expand Down

0 comments on commit 9a957a2

Please sign in to comment.