Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170346
b: refs/heads/master
c: 978be6d
h: refs/heads/master
v: v3
  • Loading branch information
Wu Fengguang authored and Takashi Iwai committed Nov 18, 2009
1 parent 97fb982 commit f0f05c2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3f54aa5091f48e9d8ce6e99b248449d08acccb26
refs/heads/master: 978be6d711be237e0344eca21c3922ae88a240bc
23 changes: 17 additions & 6 deletions trunk/sound/pci/hda/patch_intelhdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,24 +508,35 @@ static void hdmi_clear_dip_buffers(struct hda_codec *codec, hda_nid_t pin_nid)
#endif
}

static void hdmi_checksum_audio_infoframe(struct hdmi_audio_infoframe *ai)
{
u8 *bytes = (u8 *)ai;
u8 sum = 0;
int i;

ai->checksum = 0;

for (i = 0; i < sizeof(*ai); i++)
sum += bytes[i];

ai->checksum = - sum;
}

static void hdmi_fill_audio_infoframe(struct hda_codec *codec,
hda_nid_t pin_nid,
struct hdmi_audio_infoframe *ai)
{
u8 *params = (u8 *)ai;
u8 sum = 0;
u8 *bytes = (u8 *)ai;
int i;

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

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

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]);
hdmi_write_dip_byte(codec, pin_nid, bytes[i]);
}

/*
Expand Down

0 comments on commit f0f05c2

Please sign in to comment.