Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HDMI1 facility to the audio driver. #3100

Merged
merged 1 commit into from
Aug 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ static int bcm2835_audio_alsa_newpcm(struct bcm2835_chip *chip,
if (err)
return err;

err = snd_bcm2835_new_pcm(chip, "bcm2835 IEC958/HDMI", 1, 0, 1, true);
err = snd_bcm2835_new_pcm(chip, "bcm2835 IEC958/HDMI", 1, AUDIO_DEST_HDMI0, 1, true);
if (err)
return err;

err = snd_bcm2835_new_pcm(chip, "bcm2835 IEC958/HDMI1", 2, AUDIO_DEST_HDMI1, 1, true);
if (err)
return err;

Expand All @@ -106,7 +110,7 @@ static struct bcm2835_audio_driver bcm2835_audio_alsa = {
.newctl = snd_bcm2835_new_ctl,
};

static struct bcm2835_audio_driver bcm2835_audio_hdmi = {
static struct bcm2835_audio_driver bcm2835_audio_hdmi0 = {
.driver = {
.name = "bcm2835_hdmi",
.owner = THIS_MODULE,
Expand All @@ -116,7 +120,20 @@ static struct bcm2835_audio_driver bcm2835_audio_hdmi = {
.minchannels = 1,
.newpcm = bcm2835_audio_simple_newpcm,
.newctl = snd_bcm2835_new_hdmi_ctl,
.route = AUDIO_DEST_HDMI
.route = AUDIO_DEST_HDMI0
};

static struct bcm2835_audio_driver bcm2835_audio_hdmi1 = {
.driver = {
.name = "bcm2835_hdmi",
.owner = THIS_MODULE,
},
.shortname = "bcm2835 HDMI 1",
.longname = "bcm2835 HDMI 1",
.minchannels = 1,
.newpcm = bcm2835_audio_simple_newpcm,
.newctl = snd_bcm2835_new_hdmi_ctl,
.route = AUDIO_DEST_HDMI1
};

static struct bcm2835_audio_driver bcm2835_audio_headphones = {
Expand All @@ -143,7 +160,11 @@ static struct bcm2835_audio_drivers children_devices[] = {
.is_enabled = &enable_compat_alsa,
},
{
.audio_driver = &bcm2835_audio_hdmi,
.audio_driver = &bcm2835_audio_hdmi0,
.is_enabled = &enable_hdmi,
},
{
.audio_driver = &bcm2835_audio_hdmi1,
.is_enabled = &enable_hdmi,
},
{
Expand Down
4 changes: 3 additions & 1 deletion drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ enum {
enum snd_bcm2835_route {
AUDIO_DEST_AUTO = 0,
AUDIO_DEST_HEADPHONES = 1,
AUDIO_DEST_HDMI = 2,
AUDIO_DEST_HDMI = 2, // for backwards compatibility.
AUDIO_DEST_HDMI0 = 2,
AUDIO_DEST_HDMI1 = 3,
AUDIO_DEST_MAX,
};

Expand Down