diff options
author | Wu Fengguang <wfg@linux.intel.com> | 2008-11-19 00:56:15 (GMT) |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-11-19 06:35:21 (GMT) |
commit | 5457a98039cebf20b564b5c3d73a50615e2b2696 (patch) | |
tree | 86f54293f5939e9adf8803e95d68ddb3026d2a37 /sound/pci/hda/patch_intelhdmi.c | |
parent | cd896c331dd442c43cd9e23de3f1a4f3c111c292 (diff) | |
download | linux-fsl-qoriq-5457a98039cebf20b564b5c3d73a50615e2b2696.tar.xz |
ALSA: hda: make standalone hdmi_fill_audio_infoframe()
code refactor: make a standalone function hdmi_fill_audio_infoframe().
Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_intelhdmi.c')
-rw-r--r-- | sound/pci/hda/patch_intelhdmi.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/sound/pci/hda/patch_intelhdmi.c b/sound/pci/hda/patch_intelhdmi.c index c95abc4..028fce9 100644 --- a/sound/pci/hda/patch_intelhdmi.c +++ b/sound/pci/hda/patch_intelhdmi.c @@ -246,24 +246,31 @@ static void hdmi_clear_dip_buffers(struct hda_codec *codec) #endif } +static void hdmi_fill_audio_infoframe(struct hda_codec *codec, + struct hdmi_audio_infoframe *ai) +{ + u8 *params = (u8 *)ai; + int i; + + hdmi_debug_dip_size(codec); + hdmi_clear_dip_buffers(codec); /* be paranoid */ + + 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]); +} + static void hdmi_setup_audio_infoframe(struct hda_codec *codec, struct snd_pcm_substream *substream) { - struct hdmi_audio_infoframe audio_infoframe = { + struct hdmi_audio_infoframe ai = { .type = 0x84, .ver = 0x01, .len = 0x0a, .CC02_CT47 = substream->runtime->channels - 1, }; - u8 *params = (u8 *)&audio_infoframe; - int i; - - hdmi_debug_dip_size(codec); - hdmi_clear_dip_buffers(codec); /* be paranoid */ - hdmi_set_dip_index(codec, PIN_NID, 0x0, 0x0); - for (i = 0; i < sizeof(audio_infoframe); i++) - hdmi_write_dip_byte(codec, PIN_NID, params[i]); + hdmi_fill_audio_infoframe(codec, &ai); } |