Skip to content

Commit 41c722d

Browse files
James Hughespelwell
James Hughes
authored andcommitted
Add HDMI1 facility to the driver.
For generic ALSA, all you need is the bcm2835.h change, but have also added structures for IEC958 HDMI. Not sure how to test those.
1 parent 8c54e77 commit 41c722d

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

drivers/staging/vc04_services/bcm2835-audio/bcm2835.c

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ static int bcm2835_audio_alsa_newpcm(struct bcm2835_chip *chip,
7979
if (err)
8080
return err;
8181

82-
err = snd_bcm2835_new_pcm(chip, "bcm2835 IEC958/HDMI", 1, 0, 1, true);
82+
err = snd_bcm2835_new_pcm(chip, "bcm2835 IEC958/HDMI", 1, AUDIO_DEST_HDMI0, 1, true);
83+
if (err)
84+
return err;
85+
86+
err = snd_bcm2835_new_pcm(chip, "bcm2835 IEC958/HDMI1", 2, AUDIO_DEST_HDMI1, 1, true);
8387
if (err)
8488
return err;
8589

@@ -106,7 +110,7 @@ static struct bcm2835_audio_driver bcm2835_audio_alsa = {
106110
.newctl = snd_bcm2835_new_ctl,
107111
};
108112

109-
static struct bcm2835_audio_driver bcm2835_audio_hdmi = {
113+
static struct bcm2835_audio_driver bcm2835_audio_hdmi0 = {
110114
.driver = {
111115
.name = "bcm2835_hdmi",
112116
.owner = THIS_MODULE,
@@ -116,7 +120,20 @@ static struct bcm2835_audio_driver bcm2835_audio_hdmi = {
116120
.minchannels = 1,
117121
.newpcm = bcm2835_audio_simple_newpcm,
118122
.newctl = snd_bcm2835_new_hdmi_ctl,
119-
.route = AUDIO_DEST_HDMI
123+
.route = AUDIO_DEST_HDMI0
124+
};
125+
126+
static struct bcm2835_audio_driver bcm2835_audio_hdmi1 = {
127+
.driver = {
128+
.name = "bcm2835_hdmi",
129+
.owner = THIS_MODULE,
130+
},
131+
.shortname = "bcm2835 HDMI 1",
132+
.longname = "bcm2835 HDMI 1",
133+
.minchannels = 1,
134+
.newpcm = bcm2835_audio_simple_newpcm,
135+
.newctl = snd_bcm2835_new_hdmi_ctl,
136+
.route = AUDIO_DEST_HDMI1
120137
};
121138

122139
static struct bcm2835_audio_driver bcm2835_audio_headphones = {
@@ -143,7 +160,11 @@ static struct bcm2835_audio_drivers children_devices[] = {
143160
.is_enabled = &enable_compat_alsa,
144161
},
145162
{
146-
.audio_driver = &bcm2835_audio_hdmi,
163+
.audio_driver = &bcm2835_audio_hdmi0,
164+
.is_enabled = &enable_hdmi,
165+
},
166+
{
167+
.audio_driver = &bcm2835_audio_hdmi1,
147168
.is_enabled = &enable_hdmi,
148169
},
149170
{

drivers/staging/vc04_services/bcm2835-audio/bcm2835.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ enum {
3333
enum snd_bcm2835_route {
3434
AUDIO_DEST_AUTO = 0,
3535
AUDIO_DEST_HEADPHONES = 1,
36-
AUDIO_DEST_HDMI = 2,
36+
AUDIO_DEST_HDMI = 2, // for backwards compatibility.
37+
AUDIO_DEST_HDMI0 = 2,
38+
AUDIO_DEST_HDMI1 = 3,
3739
AUDIO_DEST_MAX,
3840
};
3941

0 commit comments

Comments
 (0)