Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
2b203dbb
Commit
2b203dbb
authored
Feb 11, 2011
by
Takashi Iwai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ALSA: hda - Avoid cast with union data for HDMI audio infoframe
Signed-off-by:
Takashi Iwai
<
tiwai@suse.de
>
parent
965b76d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
sound/pci/hda/patch_hdmi.c
sound/pci/hda/patch_hdmi.c
+13
-9
No files found.
sound/pci/hda/patch_hdmi.c
View file @
2b203dbb
...
...
@@ -110,6 +110,12 @@ struct dp_audio_infoframe {
u8
LFEPBL01_LSV36_DM_INH7
;
};
union
audio_infoframe
{
struct
hdmi_audio_infoframe
hdmi
;
struct
dp_audio_infoframe
dp
;
u8
bytes
[
0
];
};
/*
* CEA speaker placement:
*
...
...
@@ -620,8 +626,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, hda_nid_t nid,
int
channels
=
substream
->
runtime
->
channels
;
int
ca
;
int
i
;
u8
ai
[
max
(
sizeof
(
struct
hdmi_audio_infoframe
),
sizeof
(
struct
dp_audio_infoframe
))];
union
audio_infoframe
ai
;
ca
=
hdmi_channel_allocation
(
codec
,
nid
,
channels
);
...
...
@@ -633,11 +638,10 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, hda_nid_t nid,
pin_nid
=
spec
->
pin
[
i
];
memset
(
ai
,
0
,
sizeof
(
ai
));
memset
(
&
ai
,
0
,
sizeof
(
ai
));
if
(
spec
->
sink_eld
[
i
].
conn_type
==
0
)
{
/* HDMI */
struct
hdmi_audio_infoframe
*
hdmi_ai
;
struct
hdmi_audio_infoframe
*
hdmi_ai
=
&
ai
.
hdmi
;
hdmi_ai
=
(
struct
hdmi_audio_infoframe
*
)
ai
;
hdmi_ai
->
type
=
0x84
;
hdmi_ai
->
ver
=
0x01
;
hdmi_ai
->
len
=
0x0a
;
...
...
@@ -645,9 +649,8 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, hda_nid_t nid,
hdmi_ai
->
CA
=
ca
;
hdmi_checksum_audio_infoframe
(
hdmi_ai
);
}
else
if
(
spec
->
sink_eld
[
i
].
conn_type
==
1
)
{
/* DisplayPort */
struct
dp_audio_infoframe
*
dp_ai
;
struct
dp_audio_infoframe
*
dp_ai
=
&
ai
.
dp
;
dp_ai
=
(
struct
dp_audio_infoframe
*
)
ai
;
dp_ai
->
type
=
0x84
;
dp_ai
->
len
=
0x1b
;
dp_ai
->
ver
=
0x11
<<
2
;
...
...
@@ -664,7 +667,8 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, hda_nid_t nid,
* sizeof(*dp_ai) to avoid partial match/update problems when
* the user switches between HDMI/DP monitors.
*/
if
(
!
hdmi_infoframe_uptodate
(
codec
,
pin_nid
,
ai
,
sizeof
(
ai
)))
{
if
(
!
hdmi_infoframe_uptodate
(
codec
,
pin_nid
,
ai
.
bytes
,
sizeof
(
ai
)))
{
snd_printdd
(
"hdmi_setup_audio_infoframe: "
"cvt=%d pin=%d channels=%d
\n
"
,
nid
,
pin_nid
,
...
...
@@ -672,7 +676,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec, hda_nid_t nid,
hdmi_setup_channel_mapping
(
codec
,
pin_nid
,
ca
);
hdmi_stop_infoframe_trans
(
codec
,
pin_nid
);
hdmi_fill_audio_infoframe
(
codec
,
pin_nid
,
ai
,
sizeof
(
ai
));
ai
.
bytes
,
sizeof
(
ai
));
hdmi_start_infoframe_trans
(
codec
,
pin_nid
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment