aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.4/0018-bcm2835-i2s-Register-PCM-device.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-01-17 10:42:23 +0000
committerFelix Fietkau <nbd@openwrt.org>2016-01-17 10:42:23 +0000
commit4224b52c3acc7203e7c2535d6806f30432dae5e3 (patch)
tree7a847d3e84dfc3608555587c3b9958474fc17d72 /target/linux/brcm2708/patches-4.4/0018-bcm2835-i2s-Register-PCM-device.patch
parentcad399c87b7739c4b8eeb4119706860818f7d84f (diff)
downloadupstream-4224b52c3acc7203e7c2535d6806f30432dae5e3.tar.gz
upstream-4224b52c3acc7203e7c2535d6806f30432dae5e3.tar.bz2
upstream-4224b52c3acc7203e7c2535d6806f30432dae5e3.zip
brcm2708: add linux 4.4 support
- random-bcm2708 and spi-bcm2708 have been removed. - sound-soc-bcm2708-i2s has been upstreamed as sound-soc-bcm2835-i2s. Let's keep linux 4.1 for a while, since linux 4.4 appears to have some issues with multicast traffic on RPi ethernet: https://gist.github.com/Noltari/5b1cfdecce5ed4bc08fd Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> SVN-Revision: 48266
Diffstat (limited to 'target/linux/brcm2708/patches-4.4/0018-bcm2835-i2s-Register-PCM-device.patch')
-rw-r--r--target/linux/brcm2708/patches-4.4/0018-bcm2835-i2s-Register-PCM-device.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-4.4/0018-bcm2835-i2s-Register-PCM-device.patch b/target/linux/brcm2708/patches-4.4/0018-bcm2835-i2s-Register-PCM-device.patch
new file mode 100644
index 0000000000..eeb7d61b5d
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.4/0018-bcm2835-i2s-Register-PCM-device.patch
@@ -0,0 +1,63 @@
+From b58d4ef09eca4674d1530f0c8e1ca074b269ebea Mon Sep 17 00:00:00 2001
+From: Matthias Reichl <hias@horus.com>
+Date: Sun, 11 Oct 2015 15:35:20 +0200
+Subject: [PATCH 018/127] bcm2835-i2s: Register PCM device
+
+Code ported from bcm2708-i2s driver in Raspberry Pi tree.
+
+RPi commit ba46b4935a23aa2caac1855ead52a035d4776680 ("ASoC: Add
+support for BCM2708")
+
+This driver adds support for digital audio (I2S)
+for the BCM2708 SoC that is used by the
+Raspberry Pi. External audio codecs can be
+connected to the Raspberry Pi via P5 header.
+
+It relies on cyclic DMA engine support for BCM2708.
+
+Signed-off-by: Florian Meier <florian.meier@koalo.de>
+
+Signed-off-by: Matthias Reichl <hias@horus.com>
+---
+ sound/soc/bcm/bcm2835-i2s.c | 23 ++++++++++++++++++++++-
+ 1 file changed, 22 insertions(+), 1 deletion(-)
+
+--- a/sound/soc/bcm/bcm2835-i2s.c
++++ b/sound/soc/bcm/bcm2835-i2s.c
+@@ -799,6 +799,25 @@ static const struct snd_soc_component_dr
+ .name = "bcm2835-i2s-comp",
+ };
+
++static const struct snd_pcm_hardware bcm2835_pcm_hardware = {
++ .info = SNDRV_PCM_INFO_INTERLEAVED |
++ SNDRV_PCM_INFO_JOINT_DUPLEX,
++ .formats = SNDRV_PCM_FMTBIT_S16_LE |
++ SNDRV_PCM_FMTBIT_S24_LE |
++ SNDRV_PCM_FMTBIT_S32_LE,
++ .period_bytes_min = 32,
++ .period_bytes_max = 64 * PAGE_SIZE,
++ .periods_min = 2,
++ .periods_max = 255,
++ .buffer_bytes_max = 128 * PAGE_SIZE,
++};
++
++static const struct snd_dmaengine_pcm_config bcm2835_dmaengine_pcm_config = {
++ .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
++ .pcm_hardware = &bcm2835_pcm_hardware,
++ .prealloc_buffer_size = 256 * PAGE_SIZE,
++};
++
+ static int bcm2835_i2s_probe(struct platform_device *pdev)
+ {
+ struct bcm2835_i2s_dev *dev;
+@@ -870,7 +889,9 @@ static int bcm2835_i2s_probe(struct plat
+ return ret;
+ }
+
+- ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
++ ret = devm_snd_dmaengine_pcm_register(&pdev->dev,
++ &bcm2835_dmaengine_pcm_config,
++ SND_DMAENGINE_PCM_FLAG_COMPAT);
+ if (ret) {
+ dev_err(&pdev->dev, "Could not register PCM: %d\n", ret);
+ return ret;