1 From 0a37470a112260ef1c9a016a400fdf1f8792eadc Mon Sep 17 00:00:00 2001
2 From: James Hughes <james.hughes@raspberrypi.org>
3 Date: Tue, 16 Jul 2019 12:18:21 +0100
4 Subject: [PATCH] Add HDMI1 facility to the driver.
6 For generic ALSA, all you need is the bcm2835.h change, but
7 have also added structures for IEC958 HDMI. Not sure how to
10 .../vc04_services/bcm2835-audio/bcm2835.c | 29 ++++++++++++++++---
11 .../vc04_services/bcm2835-audio/bcm2835.h | 4 ++-
12 2 files changed, 28 insertions(+), 5 deletions(-)
14 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
15 +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
16 @@ -79,7 +79,11 @@ static int bcm2835_audio_alsa_newpcm(str
20 - err = snd_bcm2835_new_pcm(chip, "bcm2835 IEC958/HDMI", 1, 0, 1, true);
21 + err = snd_bcm2835_new_pcm(chip, "bcm2835 IEC958/HDMI", 1, AUDIO_DEST_HDMI0, 1, true);
25 + err = snd_bcm2835_new_pcm(chip, "bcm2835 IEC958/HDMI1", 2, AUDIO_DEST_HDMI1, 1, true);
29 @@ -106,7 +110,7 @@ static struct bcm2835_audio_driver bcm28
30 .newctl = snd_bcm2835_new_ctl,
33 -static struct bcm2835_audio_driver bcm2835_audio_hdmi = {
34 +static struct bcm2835_audio_driver bcm2835_audio_hdmi0 = {
36 .name = "bcm2835_hdmi",
38 @@ -116,7 +120,20 @@ static struct bcm2835_audio_driver bcm28
40 .newpcm = bcm2835_audio_simple_newpcm,
41 .newctl = snd_bcm2835_new_hdmi_ctl,
42 - .route = AUDIO_DEST_HDMI
43 + .route = AUDIO_DEST_HDMI0
46 +static struct bcm2835_audio_driver bcm2835_audio_hdmi1 = {
48 + .name = "bcm2835_hdmi",
49 + .owner = THIS_MODULE,
51 + .shortname = "bcm2835 HDMI 1",
52 + .longname = "bcm2835 HDMI 1",
54 + .newpcm = bcm2835_audio_simple_newpcm,
55 + .newctl = snd_bcm2835_new_hdmi_ctl,
56 + .route = AUDIO_DEST_HDMI1
59 static struct bcm2835_audio_driver bcm2835_audio_headphones = {
60 @@ -143,7 +160,11 @@ static struct bcm2835_audio_drivers chil
61 .is_enabled = &enable_compat_alsa,
64 - .audio_driver = &bcm2835_audio_hdmi,
65 + .audio_driver = &bcm2835_audio_hdmi0,
66 + .is_enabled = &enable_hdmi,
69 + .audio_driver = &bcm2835_audio_hdmi1,
70 .is_enabled = &enable_hdmi,
73 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
74 +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
75 @@ -33,7 +33,9 @@ enum {
76 enum snd_bcm2835_route {
78 AUDIO_DEST_HEADPHONES = 1,
79 - AUDIO_DEST_HDMI = 2,
80 + AUDIO_DEST_HDMI = 2, // for backwards compatibility.
81 + AUDIO_DEST_HDMI0 = 2,
82 + AUDIO_DEST_HDMI1 = 3,