summaryrefslogtreecommitdiffstats
path: root/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
diff options
context:
space:
mode:
authorMichael Zoran2017-03-15 01:01:25 +0100
committerGreg Kroah-Hartman2017-03-21 08:38:33 +0100
commit325b5b6c96a863989078df402d1670d061f52d88 (patch)
treee0fd2152f21ba6a6952b7fc0b7629acf9e8ead8b /drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
parentbcm2835-v4l2: Fix buffer overflow problem (diff)
downloadkernel-qcow2-linux-325b5b6c96a863989078df402d1670d061f52d88.tar.gz
kernel-qcow2-linux-325b5b6c96a863989078df402d1670d061f52d88.tar.xz
kernel-qcow2-linux-325b5b6c96a863989078df402d1670d061f52d88.zip
staging: bcm2835-audio: Add support for simultanous HDMI and Headphone audio
The firmware for the Raspberry PI already supports simultanous output of audio through both the HDMI and the Headphone jack. The current implementation of ALSA doesn't expose this well to user mode since the firmware audio is represented as a single card. A newer approach is taken here and a virtual card is created for each output(HDMI, Headphones, and Traditional ALSA). The firmware has the concept of channels or streams for which the number to use is passed in the device tree. These streams are allocated to each of the virtual cards. As a side effect of this change, since each output is represented independenly it's now very easy to use PulseAudio to control the priorities of the outputs. Testing: Audacity and VLC were both loaded at the same time. Each application was assigned to a different card. With this change I was able to play different music files at the same time through the HDMI and Headphones jacks and control the audio independently. Signed-off-by: Michael Zoran <mzoran@crowfest.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vc04_services/bcm2835-audio/bcm2835.h')
-rw-r--r--drivers/staging/vc04_services/bcm2835-audio/bcm2835.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
index c53c2bdd8494..379604d3554e 100644
--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
+++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.h
@@ -104,7 +104,7 @@ struct bcm2835_chip {
struct snd_pcm *pcm_spdif;
/* Bitmat for valid reg_base and irq numbers */
unsigned int avail_substreams;
- struct platform_device *pdev[MAX_SUBSTREAMS];
+ struct device *dev;
struct bcm2835_alsa_stream *alsa_stream[MAX_SUBSTREAMS];
int volume;
@@ -145,8 +145,15 @@ struct bcm2835_alsa_stream {
};
int snd_bcm2835_new_ctl(struct bcm2835_chip *chip);
-int snd_bcm2835_new_pcm(struct bcm2835_chip *chip);
+int snd_bcm2835_new_pcm(struct bcm2835_chip *chip, u32 numchannels);
int snd_bcm2835_new_spdif_pcm(struct bcm2835_chip *chip);
+int snd_bcm2835_new_simple_pcm(struct bcm2835_chip *chip,
+ const char *name,
+ enum snd_bcm2835_route route,
+ u32 numchannels);
+
+int snd_bcm2835_new_hdmi_ctl(struct bcm2835_chip *chip);
+int snd_bcm2835_new_headphones_ctl(struct bcm2835_chip *chip);
int bcm2835_audio_open(struct bcm2835_alsa_stream *alsa_stream);
int bcm2835_audio_close(struct bcm2835_alsa_stream *alsa_stream);