diff for duplicates of <506D552A.2000506@gmail.com> diff --git a/a/1.txt b/N1/1.txt index 1cadba2..850d246 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -87,3 +87,18 @@ discussion here (which isn't applied to the asoc tree yet). Daniel + +-------------- next part -------------- +A non-text attachment was scrubbed... +Name: 0001-ARM-davinci-pass-SRAM-gen_pool-to-mcasp-platform-dat.patch +Type: text/x-patch +Size: 8048 bytes +Desc: not available +URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121004/c5c4e92c/attachment-0002.bin> +-------------- next part -------------- +A non-text attachment was scrubbed... +Name: 0002-ALSA-ASoC-McASP-use-gen_pool-from-platform-data.patch +Type: text/x-patch +Size: 4201 bytes +Desc: not available +URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121004/c5c4e92c/attachment-0003.bin> diff --git a/a/2.hdr b/a/2.hdr deleted file mode 100644 index 200ffaf..0000000 --- a/a/2.hdr +++ /dev/null @@ -1,6 +0,0 @@ -Content-Type: text/x-patch; - name="0001-ARM-davinci-pass-SRAM-gen_pool-to-mcasp-platform-dat.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: attachment; - filename*0="0001-ARM-davinci-pass-SRAM-gen_pool-to-mcasp-platform-dat.pa"; - filename*1="tch" diff --git a/a/2.txt b/a/2.txt deleted file mode 100644 index 373d668..0000000 --- a/a/2.txt +++ /dev/null @@ -1,257 +0,0 @@ ->From 7b55ed59364e7798586fc4d3692919741c164b3f Mon Sep 17 00:00:00 2001 -From: Daniel Mack <zonque@gmail.com> -Date: Thu, 4 Oct 2012 11:11:07 +0200 -Subject: [PATCH 1/2] ARM: davinci: pass SRAM gen_pool to mcasp platform data - -This is needed to decouple the Davinci specific parts from the McASP -driver. - -Signed-off-by: Daniel Mack <zonque@gmail.com> ---- - arch/arm/mach-davinci/board-da830-evm.c | 2 ++ - arch/arm/mach-davinci/board-da850-evm.c | 2 ++ - arch/arm/mach-davinci/board-dm355-evm.c | 5 ++++- - arch/arm/mach-davinci/board-dm365-evm.c | 2 ++ - arch/arm/mach-davinci/board-dm644x-evm.c | 5 ++++- - arch/arm/mach-davinci/board-dm646x-evm.c | 3 +++ - arch/arm/mach-davinci/board-neuros-osd2.c | 5 ++++- - arch/arm/mach-davinci/include/mach/sram.h | 1 + - arch/arm/mach-davinci/sram.c | 17 +++++++++-------- - include/linux/platform_data/davinci_asp.h | 1 + - 10 files changed, 32 insertions(+), 11 deletions(-) - -diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c -index 0031864..47973b2 100644 ---- a/arch/arm/mach-davinci/board-da830-evm.c -+++ b/arch/arm/mach-davinci/board-da830-evm.c -@@ -33,6 +33,7 @@ - #include <mach/usb.h> - #include <mach/aemif.h> - #include <mach/spi.h> -+#include <mach/sram.h> - - #define DA830_EVM_PHY_ID "" - /* -@@ -214,6 +215,7 @@ static struct snd_platform_data da830_evm_snd_data = { - .version = MCASP_VERSION_2, - .txnumevt = 1, - .rxnumevt = 1, -+ .sram_pool = davinci_sram_pool, - }; - - /* -diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c -index 0149fb4..b74db6c 100644 ---- a/arch/arm/mach-davinci/board-da850-evm.c -+++ b/arch/arm/mach-davinci/board-da850-evm.c -@@ -44,6 +44,7 @@ - #include <mach/mux.h> - #include <mach/aemif.h> - #include <mach/spi.h> -+#include <mach/sram.h> - - #define DA850_EVM_PHY_ID "davinci_mdio-0:00" - #define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8) -@@ -758,6 +759,7 @@ static struct snd_platform_data da850_evm_snd_data = { - .version = MCASP_VERSION_2, - .txnumevt = 1, - .rxnumevt = 1, -+ .sram_pool = davinci_sram_pool, - }; - - static const short da850_evm_mcasp_pins[] __initconst = { -diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c -index 1c7b1f4..9b0c6df 100644 ---- a/arch/arm/mach-davinci/board-dm355-evm.c -+++ b/arch/arm/mach-davinci/board-dm355-evm.c -@@ -31,6 +31,7 @@ - #include <mach/nand.h> - #include <mach/mmc.h> - #include <mach/usb.h> -+#include <mach/sram.h> - - #include "davinci.h" - -@@ -113,7 +114,9 @@ static struct davinci_i2c_platform_data i2c_pdata = { - .scl_pin = 14, - }; - --static struct snd_platform_data dm355_evm_snd_data; -+static struct snd_platform_data dm355_evm_snd_data = { -+ .sram_pool = davinci_sram_pool, -+}; - - static int dm355evm_mmc_gpios = -EINVAL; - -diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c -index 688a9c5..9eaec56 100644 ---- a/arch/arm/mach-davinci/board-dm365-evm.c -+++ b/arch/arm/mach-davinci/board-dm365-evm.c -@@ -38,6 +38,7 @@ - #include <mach/mmc.h> - #include <mach/nand.h> - #include <mach/keyscan.h> -+#include <mach/sram.h> - - #include <media/tvp514x.h> - -@@ -176,6 +177,7 @@ static struct at24_platform_data eeprom_info = { - - static struct snd_platform_data dm365_evm_snd_data = { - .asp_chan_q = EVENTQ_3, -+ .sram_pool = davinci_sram_pool, - }; - - static struct i2c_board_info i2c_info[] = { -diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c -index d34ed55..448341f 100644 ---- a/arch/arm/mach-davinci/board-dm644x-evm.c -+++ b/arch/arm/mach-davinci/board-dm644x-evm.c -@@ -38,6 +38,7 @@ - #include <mach/mmc.h> - #include <mach/usb.h> - #include <mach/aemif.h> -+#include <mach/sram.h> - - #include "davinci.h" - -@@ -262,7 +263,9 @@ static struct platform_device rtc_dev = { - .id = -1, - }; - --static struct snd_platform_data dm644x_evm_snd_data; -+static struct snd_platform_data dm644x_evm_snd_data = { -+ .sram_pool = davinci_sram_pool, -+}; - - /*----------------------------------------------------------------------*/ - -diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c -index 958679a..1ee6d1f 100644 ---- a/arch/arm/mach-davinci/board-dm646x-evm.c -+++ b/arch/arm/mach-davinci/board-dm646x-evm.c -@@ -43,6 +43,7 @@ - #include <mach/clock.h> - #include <mach/cdce949.h> - #include <mach/aemif.h> -+#include <mach/sram.h> - - #include "davinci.h" - #include "clock.h" -@@ -336,6 +337,7 @@ static struct snd_platform_data dm646x_evm_snd_data[] = { - .tdm_slots = 2, - .serial_dir = dm646x_iis_serializer_direction, - .asp_chan_q = EVENTQ_0, -+ .sram_pool = davinci_sram_pool, - }, - { - .tx_dma_offset = 0x400, -@@ -345,6 +347,7 @@ static struct snd_platform_data dm646x_evm_snd_data[] = { - .tdm_slots = 32, - .serial_dir = dm646x_dit_serializer_direction, - .asp_chan_q = EVENTQ_0, -+ .sram_pool = davinci_sram_pool, - }, - }; - -diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c -index f6b9fc7..74b31b9 100644 ---- a/arch/arm/mach-davinci/board-neuros-osd2.c -+++ b/arch/arm/mach-davinci/board-neuros-osd2.c -@@ -37,6 +37,7 @@ - #include <mach/nand.h> - #include <mach/mmc.h> - #include <mach/usb.h> -+#include <mach/sram.h> - - #include "davinci.h" - -@@ -125,7 +126,9 @@ static struct platform_device davinci_fb_device = { - .num_resources = 0, - }; - --static struct snd_platform_data dm644x_ntosd2_snd_data; -+static struct snd_platform_data dm644x_ntosd2_snd_data = { -+ .sram_pool = davinci_sram_pool, -+}; - - static struct gpio_led ntosd2_leds[] = { - { .name = "led1_green", .gpio = GPIO(10), }, -diff --git a/arch/arm/mach-davinci/include/mach/sram.h b/arch/arm/mach-davinci/include/mach/sram.h -index 111f7cc..0394121 100644 ---- a/arch/arm/mach-davinci/include/mach/sram.h -+++ b/arch/arm/mach-davinci/include/mach/sram.h -@@ -23,5 +23,6 @@ - */ - extern void *sram_alloc(size_t len, dma_addr_t *dma); - extern void sram_free(void *addr, size_t len); -+extern struct gen_pool *davinci_sram_pool; - - #endif /* __MACH_SRAM_H */ -diff --git a/arch/arm/mach-davinci/sram.c b/arch/arm/mach-davinci/sram.c -index db0f778..a938361 100644 ---- a/arch/arm/mach-davinci/sram.c -+++ b/arch/arm/mach-davinci/sram.c -@@ -15,7 +15,8 @@ - #include <mach/common.h> - #include <mach/sram.h> - --static struct gen_pool *sram_pool; -+struct gen_pool *davinci_sram_pool; -+EXPORT_SYMBOL_GPL(davinci_sram_pool); - - void *sram_alloc(size_t len, dma_addr_t *dma) - { -@@ -24,10 +25,10 @@ void *sram_alloc(size_t len, dma_addr_t *dma) - - if (dma) - *dma = 0; -- if (!sram_pool || (dma && !dma_base)) -+ if (!davinci_sram_pool || (dma && !dma_base)) - return NULL; - -- vaddr = gen_pool_alloc(sram_pool, len); -+ vaddr = gen_pool_alloc(davinci_sram_pool, len); - if (!vaddr) - return NULL; - -@@ -40,7 +41,7 @@ EXPORT_SYMBOL(sram_alloc); - - void sram_free(void *addr, size_t len) - { -- gen_pool_free(sram_pool, (unsigned long) addr, len); -+ gen_pool_free(davinci_sram_pool, (unsigned long) addr, len); - } - EXPORT_SYMBOL(sram_free); - -@@ -58,12 +59,12 @@ static int __init sram_init(void) - - if (len) { - len = min_t(unsigned, len, SRAM_SIZE); -- sram_pool = gen_pool_create(ilog2(SRAM_GRANULARITY), -1); -- if (!sram_pool) -+ davinci_sram_pool = gen_pool_create(ilog2(SRAM_GRANULARITY), -1); -+ if (!davinci_sram_pool) - status = -ENOMEM; - } -- if (sram_pool) -- status = gen_pool_add(sram_pool, SRAM_VIRT, len, -1); -+ if (davinci_sram_pool) -+ status = gen_pool_add(davinci_sram_pool, SRAM_VIRT, len, -1); - WARN_ON(status < 0); - return status; - } -diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h -index 8c618e1..0cd22f7 100644 ---- a/include/linux/platform_data/davinci_asp.h -+++ b/include/linux/platform_data/davinci_asp.h -@@ -73,6 +73,7 @@ struct snd_platform_data { - * when compared to previous behavior. - */ - unsigned enable_channel_combine:1; -+ struct gen_pool *sram_pool; - unsigned sram_size_playback; - unsigned sram_size_capture; - --- -1.7.11.4 diff --git a/a/3.hdr b/a/3.hdr deleted file mode 100644 index 2fbf0c2..0000000 --- a/a/3.hdr +++ /dev/null @@ -1,5 +0,0 @@ -Content-Type: text/x-patch; - name="0002-ALSA-ASoC-McASP-use-gen_pool-from-platform-data.patch" -Content-Transfer-Encoding: 7bit -Content-Disposition: attachment; - filename*0="0002-ALSA-ASoC-McASP-use-gen_pool-from-platform-data.patch" diff --git a/a/3.txt b/a/3.txt deleted file mode 100644 index 1148f8d..0000000 --- a/a/3.txt +++ /dev/null @@ -1,139 +0,0 @@ ->From 465846f6fd1ea39534f32b984d352b5bc6928889 Mon Sep 17 00:00:00 2001 -From: Daniel Mack <zonque@gmail.com> -Date: Thu, 4 Oct 2012 11:12:28 +0200 -Subject: [PATCH 2/2] ALSA: ASoC: McASP: use gen_pool from platform data - -This makes the gen_pool SRAM usage a runtime decision. - -Signed-off-by: Daniel Mack <zonque@gmail.com> ---- - sound/soc/davinci/davinci-pcm.c | 59 +++++++++++++++++++++++++++++------------ - 1 file changed, 42 insertions(+), 17 deletions(-) - -diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c -index 7ac5a19..f47b8f3 100644 ---- a/sound/soc/davinci/davinci-pcm.c -+++ b/sound/soc/davinci/davinci-pcm.c -@@ -16,6 +16,7 @@ - #include <linux/slab.h> - #include <linux/dma-mapping.h> - #include <linux/kernel.h> -+#include <linux/genalloc.h> - - #include <sound/core.h> - #include <sound/pcm.h> -@@ -261,26 +262,27 @@ static void davinci_pcm_dma_irq(unsigned link, u16 ch_status, void *data) - } - } - --#if defined(CONFIG_SND_DAVINCI_HAVE_SRAM) -+#ifdef CONFIG_GENERIC_ALLOCATOR - static int allocate_sram(struct snd_pcm_substream *substream, unsigned size, -- struct snd_pcm_hardware *ppcm) -+ struct snd_pcm_hardware *ppcm, struct gen_pool *pool) - { - struct snd_dma_buffer *buf = &substream->dma_buffer; - struct snd_dma_buffer *iram_dma = NULL; -+ unsigned long iram_virt = 0; - dma_addr_t iram_phys = 0; -- void *iram_virt = NULL; - - if (buf->private_data || !size) - return 0; - - ppcm->period_bytes_max = size; -- iram_virt = sram_alloc(size, &iram_phys); -+ iram_virt = gen_pool_alloc(pool, size); - if (!iram_virt) - goto exit1; -+ iram_phys = gen_pool_virt_to_phys(pool, iram_virt); - iram_dma = kzalloc(sizeof(*iram_dma), GFP_KERNEL); - if (!iram_dma) - goto exit2; -- iram_dma->area = iram_virt; -+ iram_dma->area = (void *) iram_virt; - iram_dma->addr = iram_phys; - memset(iram_dma->area, 0, size); - iram_dma->bytes = size; -@@ -288,12 +290,40 @@ static int allocate_sram(struct snd_pcm_substream *substream, unsigned size, - return 0; - exit2: - if (iram_virt) -- sram_free(iram_virt, size); -+ gen_pool_free(pool, iram_virt, size); - exit1: - return -ENOMEM; - } -+ -+static void free_sram(struct snd_pcm_substream *substream) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_dma_buffer *buf = &substream->dma_buffer; -+ struct snd_dma_buffer *iram_dma = buf->private_data; -+ struct davinci_pcm_dma_params *params, *pa; -+ -+ if (!buf || !rtd || !iram_dma) -+ return; -+ -+ pa = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); -+ params = &pa[substream->stream]; -+ -+ gen_pool_free(params->sram_pool, (unsigned long) iram_dma->area, -+ iram_dma->bytes); -+} -+#else -+static int allocate_sram(struct snd_pcm_substream *substream, unsigned size, -+ struct snd_pcm_hardware *ppcm, struct gen_pool *pool) -+{ -+ return 0; -+} -+ -+static void free_sram(struct snd_pcm_substream *substream) -+{ -+} - #endif - -+ - /* - * Only used with ping/pong. - * This is called after runtime->dma_addr, period_bytes and data_type are valid -@@ -680,9 +710,11 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream) - - ppcm = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? - &pcm_hardware_playback : &pcm_hardware_capture; --#if defined(CONFIG_SND_DAVINCI_HAVE_SRAM) -- allocate_sram(substream, params->sram_size, ppcm); --#endif -+ -+ if (params->sram_pool) -+ allocate_sram(substream, params->sram_size, ppcm, -+ params->sram_pool); -+ - snd_soc_set_runtime_hwparams(substream, ppcm); - /* ensure that buffer size is a multiple of period size */ - ret = snd_pcm_hw_constraint_integer(runtime, -@@ -811,7 +843,6 @@ static void davinci_pcm_free(struct snd_pcm *pcm) - int stream; - - for (stream = 0; stream < 2; stream++) { -- struct snd_dma_buffer *iram_dma; - substream = pcm->streams[stream].substream; - if (!substream) - continue; -@@ -823,13 +854,7 @@ static void davinci_pcm_free(struct snd_pcm *pcm) - dma_free_writecombine(pcm->card->dev, buf->bytes, - buf->area, buf->addr); - buf->area = NULL; --#if defined(CONFIG_SND_DAVINCI_HAVE_SRAM) -- iram_dma = buf->private_data; -- if (iram_dma) { -- sram_free(iram_dma->area, iram_dma->bytes); -- kfree(iram_dma); -- } --#endif -+ free_sram(substream); - } - } - --- -1.7.11.4 diff --git a/a/4.hdr b/a/4.hdr deleted file mode 100644 index 4b86001..0000000 --- a/a/4.hdr +++ /dev/null @@ -1,4 +0,0 @@ -Content-Type: text/plain; charset="us-ascii" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Content-Disposition: inline diff --git a/a/4.txt b/a/4.txt deleted file mode 100644 index 8b13789..0000000 --- a/a/4.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/a/content_digest b/N1/content_digest index c3ec520..77c7191 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -8,19 +8,11 @@ "ref\0506AEF57.2000306@gmail.com\0" "ref\020121002164116.GT5641@beef\0" "ref\0506B1B46.2070006@gmail.com\0" - "From\0Daniel Mack <zonque@gmail.com>\0" - "Subject\0Re: [PATCH 2/3] ASoC: Davinci: pcm: add support for sram-support-less platforms\0" + "From\0zonque@gmail.com (Daniel Mack)\0" + "Subject\0[alsa-devel] [PATCH 2/3] ASoC: Davinci: pcm: add support for sram-support-less platforms\0" "Date\0Thu, 04 Oct 2012 11:21:46 +0200\0" - "To\0Matt Porter <mporter@ti.com>\0" - "Cc\0alsa-devel@alsa-project.org" - tony@atomide.com - Mark Brown <broonie@opensource.wolfsonmicro.com> - Sekhar Nori <nsekhar@ti.com> - davinci-linux-open-source@linux.davincidsp.com - Peter Ujfalusi <peter.ujfalusi@ti.com> - lrg@ti.com - " linux-arm-kernel@lists.infradead.org\0" - "\01:1\0" + "To\0linux-arm-kernel@lists.infradead.org\0" + "\00:1\0" "b\0" "On 02.10.2012 18:50, Daniel Mack wrote:\n" "> On 02.10.2012 18:41, Matt Porter wrote:\n" @@ -110,410 +102,21 @@ "discussion here (which isn't applied to the asoc tree yet).\n" "\n" "\n" - Daniel - "\01:2\0" - "fn\00001-ARM-davinci-pass-SRAM-gen_pool-to-mcasp-platform-dat.patch\0" - "b\0" - ">From 7b55ed59364e7798586fc4d3692919741c164b3f Mon Sep 17 00:00:00 2001\n" - "From: Daniel Mack <zonque@gmail.com>\n" - "Date: Thu, 4 Oct 2012 11:11:07 +0200\n" - "Subject: [PATCH 1/2] ARM: davinci: pass SRAM gen_pool to mcasp platform data\n" - "\n" - "This is needed to decouple the Davinci specific parts from the McASP\n" - "driver.\n" - "\n" - "Signed-off-by: Daniel Mack <zonque@gmail.com>\n" - "---\n" - " arch/arm/mach-davinci/board-da830-evm.c | 2 ++\n" - " arch/arm/mach-davinci/board-da850-evm.c | 2 ++\n" - " arch/arm/mach-davinci/board-dm355-evm.c | 5 ++++-\n" - " arch/arm/mach-davinci/board-dm365-evm.c | 2 ++\n" - " arch/arm/mach-davinci/board-dm644x-evm.c | 5 ++++-\n" - " arch/arm/mach-davinci/board-dm646x-evm.c | 3 +++\n" - " arch/arm/mach-davinci/board-neuros-osd2.c | 5 ++++-\n" - " arch/arm/mach-davinci/include/mach/sram.h | 1 +\n" - " arch/arm/mach-davinci/sram.c | 17 +++++++++--------\n" - " include/linux/platform_data/davinci_asp.h | 1 +\n" - " 10 files changed, 32 insertions(+), 11 deletions(-)\n" - "\n" - "diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c\n" - "index 0031864..47973b2 100644\n" - "--- a/arch/arm/mach-davinci/board-da830-evm.c\n" - "+++ b/arch/arm/mach-davinci/board-da830-evm.c\n" - "@@ -33,6 +33,7 @@\n" - " #include <mach/usb.h>\n" - " #include <mach/aemif.h>\n" - " #include <mach/spi.h>\n" - "+#include <mach/sram.h>\n" - " \n" - " #define DA830_EVM_PHY_ID\t\t\"\"\n" - " /*\n" - "@@ -214,6 +215,7 @@ static struct snd_platform_data da830_evm_snd_data = {\n" - " \t.version\t= MCASP_VERSION_2,\n" - " \t.txnumevt\t= 1,\n" - " \t.rxnumevt\t= 1,\n" - "+\t.sram_pool\t= davinci_sram_pool,\n" - " };\n" - " \n" - " /*\n" - "diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c\n" - "index 0149fb4..b74db6c 100644\n" - "--- a/arch/arm/mach-davinci/board-da850-evm.c\n" - "+++ b/arch/arm/mach-davinci/board-da850-evm.c\n" - "@@ -44,6 +44,7 @@\n" - " #include <mach/mux.h>\n" - " #include <mach/aemif.h>\n" - " #include <mach/spi.h>\n" - "+#include <mach/sram.h>\n" - " \n" - " #define DA850_EVM_PHY_ID\t\t\"davinci_mdio-0:00\"\n" - " #define DA850_LCD_PWR_PIN\t\tGPIO_TO_PIN(2, 8)\n" - "@@ -758,6 +759,7 @@ static struct snd_platform_data da850_evm_snd_data = {\n" - " \t.version\t= MCASP_VERSION_2,\n" - " \t.txnumevt\t= 1,\n" - " \t.rxnumevt\t= 1,\n" - "+\t.sram_pool\t= davinci_sram_pool,\n" - " };\n" - " \n" - " static const short da850_evm_mcasp_pins[] __initconst = {\n" - "diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c\n" - "index 1c7b1f4..9b0c6df 100644\n" - "--- a/arch/arm/mach-davinci/board-dm355-evm.c\n" - "+++ b/arch/arm/mach-davinci/board-dm355-evm.c\n" - "@@ -31,6 +31,7 @@\n" - " #include <mach/nand.h>\n" - " #include <mach/mmc.h>\n" - " #include <mach/usb.h>\n" - "+#include <mach/sram.h>\n" - " \n" - " #include \"davinci.h\"\n" - " \n" - "@@ -113,7 +114,9 @@ static struct davinci_i2c_platform_data i2c_pdata = {\n" - " \t.scl_pin = 14,\n" - " };\n" - " \n" - "-static struct snd_platform_data dm355_evm_snd_data;\n" - "+static struct snd_platform_data dm355_evm_snd_data = {\n" - "+\t.sram_pool = davinci_sram_pool,\n" - "+};\n" - " \n" - " static int dm355evm_mmc_gpios = -EINVAL;\n" - " \n" - "diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c\n" - "index 688a9c5..9eaec56 100644\n" - "--- a/arch/arm/mach-davinci/board-dm365-evm.c\n" - "+++ b/arch/arm/mach-davinci/board-dm365-evm.c\n" - "@@ -38,6 +38,7 @@\n" - " #include <mach/mmc.h>\n" - " #include <mach/nand.h>\n" - " #include <mach/keyscan.h>\n" - "+#include <mach/sram.h>\n" - " \n" - " #include <media/tvp514x.h>\n" - " \n" - "@@ -176,6 +177,7 @@ static struct at24_platform_data eeprom_info = {\n" - " \n" - " static struct snd_platform_data dm365_evm_snd_data = {\n" - " \t.asp_chan_q = EVENTQ_3,\n" - "+\t.sram_pool = davinci_sram_pool,\n" - " };\n" - " \n" - " static struct i2c_board_info i2c_info[] = {\n" - "diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c\n" - "index d34ed55..448341f 100644\n" - "--- a/arch/arm/mach-davinci/board-dm644x-evm.c\n" - "+++ b/arch/arm/mach-davinci/board-dm644x-evm.c\n" - "@@ -38,6 +38,7 @@\n" - " #include <mach/mmc.h>\n" - " #include <mach/usb.h>\n" - " #include <mach/aemif.h>\n" - "+#include <mach/sram.h>\n" - " \n" - " #include \"davinci.h\"\n" - " \n" - "@@ -262,7 +263,9 @@ static struct platform_device rtc_dev = {\n" - " \t.id = -1,\n" - " };\n" - " \n" - "-static struct snd_platform_data dm644x_evm_snd_data;\n" - "+static struct snd_platform_data dm644x_evm_snd_data = {\n" - "+\t.sram_pool = davinci_sram_pool,\n" - "+};\n" - " \n" - " /*----------------------------------------------------------------------*/\n" - " \n" - "diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c\n" - "index 958679a..1ee6d1f 100644\n" - "--- a/arch/arm/mach-davinci/board-dm646x-evm.c\n" - "+++ b/arch/arm/mach-davinci/board-dm646x-evm.c\n" - "@@ -43,6 +43,7 @@\n" - " #include <mach/clock.h>\n" - " #include <mach/cdce949.h>\n" - " #include <mach/aemif.h>\n" - "+#include <mach/sram.h>\n" - " \n" - " #include \"davinci.h\"\n" - " #include \"clock.h\"\n" - "@@ -336,6 +337,7 @@ static struct snd_platform_data dm646x_evm_snd_data[] = {\n" - " \t\t.tdm_slots = 2,\n" - " \t\t.serial_dir = dm646x_iis_serializer_direction,\n" - " \t\t.asp_chan_q = EVENTQ_0,\n" - "+\t\t.sram_pool\t= davinci_sram_pool,\n" - " \t},\n" - " \t{\n" - " \t\t.tx_dma_offset = 0x400,\n" - "@@ -345,6 +347,7 @@ static struct snd_platform_data dm646x_evm_snd_data[] = {\n" - " \t\t.tdm_slots = 32,\n" - " \t\t.serial_dir = dm646x_dit_serializer_direction,\n" - " \t\t.asp_chan_q = EVENTQ_0,\n" - "+\t\t.sram_pool\t= davinci_sram_pool,\n" - " \t},\n" - " };\n" - " \n" - "diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c\n" - "index f6b9fc7..74b31b9 100644\n" - "--- a/arch/arm/mach-davinci/board-neuros-osd2.c\n" - "+++ b/arch/arm/mach-davinci/board-neuros-osd2.c\n" - "@@ -37,6 +37,7 @@\n" - " #include <mach/nand.h>\n" - " #include <mach/mmc.h>\n" - " #include <mach/usb.h>\n" - "+#include <mach/sram.h>\n" - " \n" - " #include \"davinci.h\"\n" - " \n" - "@@ -125,7 +126,9 @@ static struct platform_device davinci_fb_device = {\n" - " \t.num_resources = 0,\n" - " };\n" - " \n" - "-static struct snd_platform_data dm644x_ntosd2_snd_data;\n" - "+static struct snd_platform_data dm644x_ntosd2_snd_data = {\n" - "+\t.sram_pool\t= davinci_sram_pool,\n" - "+};\n" - " \n" - " static struct gpio_led ntosd2_leds[] = {\n" - " \t{ .name = \"led1_green\", .gpio = GPIO(10), },\n" - "diff --git a/arch/arm/mach-davinci/include/mach/sram.h b/arch/arm/mach-davinci/include/mach/sram.h\n" - "index 111f7cc..0394121 100644\n" - "--- a/arch/arm/mach-davinci/include/mach/sram.h\n" - "+++ b/arch/arm/mach-davinci/include/mach/sram.h\n" - "@@ -23,5 +23,6 @@\n" - " */\n" - " extern void *sram_alloc(size_t len, dma_addr_t *dma);\n" - " extern void sram_free(void *addr, size_t len);\n" - "+extern struct gen_pool *davinci_sram_pool;\n" - " \n" - " #endif /* __MACH_SRAM_H */\n" - "diff --git a/arch/arm/mach-davinci/sram.c b/arch/arm/mach-davinci/sram.c\n" - "index db0f778..a938361 100644\n" - "--- a/arch/arm/mach-davinci/sram.c\n" - "+++ b/arch/arm/mach-davinci/sram.c\n" - "@@ -15,7 +15,8 @@\n" - " #include <mach/common.h>\n" - " #include <mach/sram.h>\n" - " \n" - "-static struct gen_pool *sram_pool;\n" - "+struct gen_pool *davinci_sram_pool;\n" - "+EXPORT_SYMBOL_GPL(davinci_sram_pool);\n" - " \n" - " void *sram_alloc(size_t len, dma_addr_t *dma)\n" - " {\n" - "@@ -24,10 +25,10 @@ void *sram_alloc(size_t len, dma_addr_t *dma)\n" - " \n" - " \tif (dma)\n" - " \t\t*dma = 0;\n" - "-\tif (!sram_pool || (dma && !dma_base))\n" - "+\tif (!davinci_sram_pool || (dma && !dma_base))\n" - " \t\treturn NULL;\n" - " \n" - "-\tvaddr = gen_pool_alloc(sram_pool, len);\n" - "+\tvaddr = gen_pool_alloc(davinci_sram_pool, len);\n" - " \tif (!vaddr)\n" - " \t\treturn NULL;\n" - " \n" - "@@ -40,7 +41,7 @@ EXPORT_SYMBOL(sram_alloc);\n" - " \n" - " void sram_free(void *addr, size_t len)\n" - " {\n" - "-\tgen_pool_free(sram_pool, (unsigned long) addr, len);\n" - "+\tgen_pool_free(davinci_sram_pool, (unsigned long) addr, len);\n" - " }\n" - " EXPORT_SYMBOL(sram_free);\n" - " \n" - "@@ -58,12 +59,12 @@ static int __init sram_init(void)\n" - " \n" - " \tif (len) {\n" - " \t\tlen = min_t(unsigned, len, SRAM_SIZE);\n" - "-\t\tsram_pool = gen_pool_create(ilog2(SRAM_GRANULARITY), -1);\n" - "-\t\tif (!sram_pool)\n" - "+\t\tdavinci_sram_pool = gen_pool_create(ilog2(SRAM_GRANULARITY), -1);\n" - "+\t\tif (!davinci_sram_pool)\n" - " \t\t\tstatus = -ENOMEM;\n" - " \t}\n" - "-\tif (sram_pool)\n" - "-\t\tstatus = gen_pool_add(sram_pool, SRAM_VIRT, len, -1);\n" - "+\tif (davinci_sram_pool)\n" - "+\t\tstatus = gen_pool_add(davinci_sram_pool, SRAM_VIRT, len, -1);\n" - " \tWARN_ON(status < 0);\n" - " \treturn status;\n" - " }\n" - "diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h\n" - "index 8c618e1..0cd22f7 100644\n" - "--- a/include/linux/platform_data/davinci_asp.h\n" - "+++ b/include/linux/platform_data/davinci_asp.h\n" - "@@ -73,6 +73,7 @@ struct snd_platform_data {\n" - " \t * when compared to previous behavior.\n" - " \t */\n" - " \tunsigned enable_channel_combine:1;\n" - "+\tstruct gen_pool *sram_pool;\n" - " \tunsigned sram_size_playback;\n" - " \tunsigned sram_size_capture;\n" - " \n" - "-- \n" - 1.7.11.4 - "\01:3\0" - "fn\00002-ALSA-ASoC-McASP-use-gen_pool-from-platform-data.patch\0" - "b\0" - ">From 465846f6fd1ea39534f32b984d352b5bc6928889 Mon Sep 17 00:00:00 2001\n" - "From: Daniel Mack <zonque@gmail.com>\n" - "Date: Thu, 4 Oct 2012 11:12:28 +0200\n" - "Subject: [PATCH 2/2] ALSA: ASoC: McASP: use gen_pool from platform data\n" - "\n" - "This makes the gen_pool SRAM usage a runtime decision.\n" + "Daniel\n" "\n" - "Signed-off-by: Daniel Mack <zonque@gmail.com>\n" - "---\n" - " sound/soc/davinci/davinci-pcm.c | 59 +++++++++++++++++++++++++++++------------\n" - " 1 file changed, 42 insertions(+), 17 deletions(-)\n" - "\n" - "diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c\n" - "index 7ac5a19..f47b8f3 100644\n" - "--- a/sound/soc/davinci/davinci-pcm.c\n" - "+++ b/sound/soc/davinci/davinci-pcm.c\n" - "@@ -16,6 +16,7 @@\n" - " #include <linux/slab.h>\n" - " #include <linux/dma-mapping.h>\n" - " #include <linux/kernel.h>\n" - "+#include <linux/genalloc.h>\n" - " \n" - " #include <sound/core.h>\n" - " #include <sound/pcm.h>\n" - "@@ -261,26 +262,27 @@ static void davinci_pcm_dma_irq(unsigned link, u16 ch_status, void *data)\n" - " \t}\n" - " }\n" - " \n" - "-#if defined(CONFIG_SND_DAVINCI_HAVE_SRAM)\n" - "+#ifdef CONFIG_GENERIC_ALLOCATOR\n" - " static int allocate_sram(struct snd_pcm_substream *substream, unsigned size,\n" - "-\t\tstruct snd_pcm_hardware *ppcm)\n" - "+\t\t\t struct snd_pcm_hardware *ppcm, struct gen_pool *pool)\n" - " {\n" - " \tstruct snd_dma_buffer *buf = &substream->dma_buffer;\n" - " \tstruct snd_dma_buffer *iram_dma = NULL;\n" - "+\tunsigned long iram_virt = 0;\n" - " \tdma_addr_t iram_phys = 0;\n" - "-\tvoid *iram_virt = NULL;\n" - " \n" - " \tif (buf->private_data || !size)\n" - " \t\treturn 0;\n" - " \n" - " \tppcm->period_bytes_max = size;\n" - "-\tiram_virt = sram_alloc(size, &iram_phys);\n" - "+\tiram_virt = gen_pool_alloc(pool, size);\n" - " \tif (!iram_virt)\n" - " \t\tgoto exit1;\n" - "+\tiram_phys = gen_pool_virt_to_phys(pool, iram_virt);\n" - " \tiram_dma = kzalloc(sizeof(*iram_dma), GFP_KERNEL);\n" - " \tif (!iram_dma)\n" - " \t\tgoto exit2;\n" - "-\tiram_dma->area = iram_virt;\n" - "+\tiram_dma->area = (void *) iram_virt;\n" - " \tiram_dma->addr = iram_phys;\n" - " \tmemset(iram_dma->area, 0, size);\n" - " \tiram_dma->bytes = size;\n" - "@@ -288,12 +290,40 @@ static int allocate_sram(struct snd_pcm_substream *substream, unsigned size,\n" - " \treturn 0;\n" - " exit2:\n" - " \tif (iram_virt)\n" - "-\t\tsram_free(iram_virt, size);\n" - "+\t\tgen_pool_free(pool, iram_virt, size);\n" - " exit1:\n" - " \treturn -ENOMEM;\n" - " }\n" - "+\n" - "+static void free_sram(struct snd_pcm_substream *substream)\n" - "+{\n" - "+\tstruct snd_soc_pcm_runtime *rtd = substream->private_data;\n" - "+\tstruct snd_dma_buffer *buf = &substream->dma_buffer;\n" - "+\tstruct snd_dma_buffer *iram_dma = buf->private_data;\n" - "+\tstruct davinci_pcm_dma_params *params, *pa;\n" - "+\n" - "+\tif (!buf || !rtd || !iram_dma)\n" - "+\t\treturn;\n" - "+\n" - "+\tpa = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);\n" - "+\tparams = &pa[substream->stream];\n" - "+\n" - "+\tgen_pool_free(params->sram_pool, (unsigned long) iram_dma->area,\n" - "+\t\t iram_dma->bytes);\n" - "+}\n" - "+#else\n" - "+static int allocate_sram(struct snd_pcm_substream *substream, unsigned size,\n" - "+\t\t\t struct snd_pcm_hardware *ppcm, struct gen_pool *pool)\n" - "+{\n" - "+\treturn 0;\n" - "+}\n" - "+\n" - "+static void free_sram(struct snd_pcm_substream *substream)\n" - "+{\n" - "+}\n" - " #endif\n" - " \n" - "+\n" - " /*\n" - " * Only used with ping/pong.\n" - " * This is called after runtime->dma_addr, period_bytes and data_type are valid\n" - "@@ -680,9 +710,11 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream)\n" - " \n" - " \tppcm = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ?\n" - " \t\t\t&pcm_hardware_playback : &pcm_hardware_capture;\n" - "-#if defined(CONFIG_SND_DAVINCI_HAVE_SRAM)\n" - "-\tallocate_sram(substream, params->sram_size, ppcm);\n" - "-#endif\n" - "+\n" - "+\tif (params->sram_pool)\n" - "+\t\tallocate_sram(substream, params->sram_size, ppcm,\n" - "+\t\t\t params->sram_pool);\n" - "+\n" - " \tsnd_soc_set_runtime_hwparams(substream, ppcm);\n" - " \t/* ensure that buffer size is a multiple of period size */\n" - " \tret = snd_pcm_hw_constraint_integer(runtime,\n" - "@@ -811,7 +843,6 @@ static void davinci_pcm_free(struct snd_pcm *pcm)\n" - " \tint stream;\n" - " \n" - " \tfor (stream = 0; stream < 2; stream++) {\n" - "-\t\tstruct snd_dma_buffer *iram_dma;\n" - " \t\tsubstream = pcm->streams[stream].substream;\n" - " \t\tif (!substream)\n" - " \t\t\tcontinue;\n" - "@@ -823,13 +854,7 @@ static void davinci_pcm_free(struct snd_pcm *pcm)\n" - " \t\tdma_free_writecombine(pcm->card->dev, buf->bytes,\n" - " \t\t\t\t buf->area, buf->addr);\n" - " \t\tbuf->area = NULL;\n" - "-#if defined(CONFIG_SND_DAVINCI_HAVE_SRAM)\n" - "-\t\tiram_dma = buf->private_data;\n" - "-\t\tif (iram_dma) {\n" - "-\t\t\tsram_free(iram_dma->area, iram_dma->bytes);\n" - "-\t\t\tkfree(iram_dma);\n" - "-\t\t}\n" - "-#endif\n" - "+\t\tfree_sram(substream);\n" - " \t}\n" - " }\n" - " \n" - "-- \n" - 1.7.11.4 - "\01:4\0" - "b\0" + "-------------- next part --------------\n" + "A non-text attachment was scrubbed...\n" + "Name: 0001-ARM-davinci-pass-SRAM-gen_pool-to-mcasp-platform-dat.patch\n" + "Type: text/x-patch\n" + "Size: 8048 bytes\n" + "Desc: not available\n" + "URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121004/c5c4e92c/attachment-0002.bin>\n" + "-------------- next part --------------\n" + "A non-text attachment was scrubbed...\n" + "Name: 0002-ALSA-ASoC-McASP-use-gen_pool-from-platform-data.patch\n" + "Type: text/x-patch\n" + "Size: 4201 bytes\n" + "Desc: not available\n" + URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121004/c5c4e92c/attachment-0003.bin> -f98aa47dd9ef170d78dbc0b33c17d4bbba9ba25ce737fd1bb31ab57cefa6a4f5 +61cbb4826d0398d00f129ce8f9208a7c612282b69b19e6df3a34d52a9f12a004
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.