ALSA: hda - compute checksum in HDMI audio infoframe
authorWu Fengguang <fengguang.wu@intel.com>
Wed, 11 Feb 2009 07:22:30 +0000 (15:22 +0800)
committerTakashi Iwai <tiwai@suse.de>
Wed, 11 Feb 2009 08:09:07 +0000 (09:09 +0100)
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_intelhdmi.c

index f2610d67e1872ab7775b0bc296f451f37545df09..90b11374a0a8e7498d6e9254eab53b578a22b354 100644 (file)
@@ -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]);