summaryrefslogtreecommitdiff
path: root/target/arm/raspberry-pi/patches/3.12.33/0002-enable-MMAP-by-default-allow-overide-via-use_mmap.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/arm/raspberry-pi/patches/3.12.33/0002-enable-MMAP-by-default-allow-overide-via-use_mmap.patch')
-rw-r--r--target/arm/raspberry-pi/patches/3.12.33/0002-enable-MMAP-by-default-allow-overide-via-use_mmap.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/target/arm/raspberry-pi/patches/3.12.33/0002-enable-MMAP-by-default-allow-overide-via-use_mmap.patch b/target/arm/raspberry-pi/patches/3.12.33/0002-enable-MMAP-by-default-allow-overide-via-use_mmap.patch
new file mode 100644
index 000000000..a8af27d9f
--- /dev/null
+++ b/target/arm/raspberry-pi/patches/3.12.33/0002-enable-MMAP-by-default-allow-overide-via-use_mmap.patch
@@ -0,0 +1,53 @@
+From f1290350dc2cc8defb2d613a32f1a7bd4400de65 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbrodkorb@conet.de>
+Date: Fri, 28 Nov 2014 16:18:36 +0100
+Subject: [PATCH 2/2] enable MMAP by default, allow overide via use_mmap
+
+Add a bool module parameter to control availability of MMAP
+in the driver.
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+---
+ sound/soc/bcm/bcm2708-i2s.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/sound/soc/bcm/bcm2708-i2s.c b/sound/soc/bcm/bcm2708-i2s.c
+index 3fcb740..ddf9796 100644
+--- a/sound/soc/bcm/bcm2708-i2s.c
++++ b/sound/soc/bcm/bcm2708-i2s.c
+@@ -171,6 +171,11 @@ static const unsigned int bcm2708_clk_freq[BCM2708_CLK_SRC_HDMI+1] = {
+ /* I2S pin configuration */
+ static int bcm2708_i2s_gpio=BCM2708_I2S_GPIO_AUTO;
+
++static bool use_mmap = 1;
++module_param(use_mmap, bool, S_IRUGO);
++MODULE_PARM_DESC(use_mmap, "Use MMAP");
++
++
+ /* General device struct */
+ struct bcm2708_i2s_dev {
+ struct device *dev;
+@@ -870,7 +875,7 @@ static const struct snd_soc_component_driver bcm2708_i2s_component = {
+ .name = "bcm2708-i2s-comp",
+ };
+
+-static const struct snd_pcm_hardware bcm2708_pcm_hardware = {
++static struct snd_pcm_hardware bcm2708_pcm_hardware = {
+ .info = SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_JOINT_DUPLEX,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE |
+@@ -962,6 +967,11 @@ static int bcm2708_i2s_probe(struct platform_device *pdev)
+ return ret;
+ }
+
++ if (use_mmap) {
++ bcm2708_pcm_hardware.info |= SNDRV_PCM_INFO_MMAP;
++ bcm2708_pcm_hardware.info |= SNDRV_PCM_INFO_MMAP_VALID;
++ }
++
+ ret = snd_dmaengine_pcm_register(&pdev->dev,
+ &bcm2708_dmaengine_pcm_config,
+ SND_DMAENGINE_PCM_FLAG_COMPAT);
+--
+1.7.10.4
+