All of lore.kernel.org
 help / color / mirror / Atom feed
From: Seungwhan Youn <claude.youn@gmail.com>
To: Sangbeom Kim <sbkim73@samsung.com>
Cc: alsa-devel@alsa-project.org, jassisinghbrar@gmail.com,
	lrg@slimlogic.co.uk, broonie@opensource.wolfsonmicro.com
Subject: Re: [PATCH v5 4/4] ASoC: SAMSUNG: Add I2S0 internal dma driver
Date: Wed, 13 Jul 2011 12:08:43 +0900	[thread overview]
Message-ID: <CA+s+8rc=nwggHhX7qZ0sCsH=z6qTDj9Gc2385xLgK0R+An85wQ@mail.gmail.com> (raw)
In-Reply-To: <1310520321-11106-1-git-send-email-sbkim73@samsung.com>

Hi,

On Wed, Jul 13, 2011 at 10:25 AM, Sangbeom Kim <sbkim73@samsung.com> wrote:
> I2S in Exynos4 and S5PC110(S5PV210) has a internal dma.
> It can be used low power audio mode and 2nd channel transfer.
> This patch can support idma.
>
> Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
> ---
> V2: change idma_new by new pcm_new api
>    add handling different idma address
>    as jassi comments, Modify the idma driver
>
> V3: merge idma_reg_int and idma_addr_init
>
> V4: move idma setting in i2s.c to idma_hw_params in idma.c
>    move idma_reg_addr_init calling
>    modify idma address handling error
>    modify module information
>    delete useless dev_dbg
>
> V5: delete redundant error print and check routine
>    modify irq handler as jassi comment
>    fix the indent error
>
>  sound/soc/samsung/Makefile |    2 +
>  sound/soc/samsung/idma.c   |  453 ++++++++++++++++++++++++++++++++++++++++++++
>  sound/soc/samsung/idma.h   |   26 +++
>  3 files changed, 481 insertions(+), 0 deletions(-)
>  create mode 100644 sound/soc/samsung/idma.c
>  create mode 100644 sound/soc/samsung/idma.h
>
> diff --git a/sound/soc/samsung/Makefile b/sound/soc/samsung/Makefile
> index 00ba557..41becdd 100644
> --- a/sound/soc/samsung/Makefile
> +++ b/sound/soc/samsung/Makefile
> @@ -1,5 +1,6 @@
>  # S3c24XX Platform Support
>  snd-soc-s3c24xx-objs := dma.o
> +snd-soc-idma-objs := idma.o
>  snd-soc-s3c24xx-i2s-objs := s3c24xx-i2s.o
>  snd-soc-s3c2412-i2s-objs := s3c2412-i2s.o
>  snd-soc-ac97-objs := ac97.o
> @@ -16,6 +17,7 @@ obj-$(CONFIG_SND_S3C_I2SV2_SOC) += snd-soc-s3c-i2s-v2.o
>  obj-$(CONFIG_SND_SAMSUNG_SPDIF) += snd-soc-samsung-spdif.o
>  obj-$(CONFIG_SND_SAMSUNG_PCM) += snd-soc-pcm.o
>  obj-$(CONFIG_SND_SAMSUNG_I2S) += snd-soc-i2s.o
> +obj-$(CONFIG_SND_SAMSUNG_I2S) += snd-soc-idma.o
>
>  # S3C24XX Machine Support
>  snd-soc-jive-wm8750-objs := jive_wm8750.o
> diff --git a/sound/soc/samsung/idma.c b/sound/soc/samsung/idma.c
> new file mode 100644
> index 0000000..ebde074
> --- /dev/null
> +++ b/sound/soc/samsung/idma.c
> @@ -0,0 +1,453 @@
> +/*
> + * sound/soc/samsung/idma.c
> + *
> + * Copyright (c) 2011 Samsung Electronics Co., Ltd.
> + *             http://www.samsung.com
> + *
> + * I2S0's Internal DMA driver
> + *
> + * This program is free software; you can redistribute  it and/or modify it
> + * under  the terms of  the GNU General  Public License as published by the
> + * Free Software Foundation;  either version 2 of the  License, or (at your
> + * option) any later version.
> + */
> +#include <linux/interrupt.h>
> +#include <linux/platform_device.h>
> +#include <linux/dma-mapping.h>
> +#include <linux/slab.h>
> +#include <sound/pcm.h>
> +#include <sound/pcm_params.h>
> +#include <sound/soc.h>
> +
> +#include "i2s.h"
> +#include "idma.h"
> +#include "dma.h"
> +#include "i2s-regs.h"
> +
> +#define ST_RUNNING             (1<<0)
> +#define ST_OPENED              (1<<1)
> +
> +static const struct snd_pcm_hardware idma_hardware = {
> +       .info = SNDRV_PCM_INFO_INTERLEAVED |
> +                   SNDRV_PCM_INFO_BLOCK_TRANSFER |
> +                   SNDRV_PCM_INFO_MMAP |
> +                   SNDRV_PCM_INFO_MMAP_VALID |
> +                   SNDRV_PCM_INFO_PAUSE |
> +                   SNDRV_PCM_INFO_RESUME,
> +       .formats = SNDRV_PCM_FMTBIT_S16_LE |
> +                   SNDRV_PCM_FMTBIT_U16_LE |
> +                   SNDRV_PCM_FMTBIT_S24_LE |
> +                   SNDRV_PCM_FMTBIT_U24_LE |
> +                   SNDRV_PCM_FMTBIT_U8 |
> +                   SNDRV_PCM_FMTBIT_S8,
> +       .channels_min = 2,
> +       .channels_max = 2,
> +       .buffer_bytes_max = MAX_IDMA_BUFFER,
> +       .period_bytes_min = 128,
> +       .period_bytes_max = MAX_IDMA_PERIOD,

In this case, MAX_IDMA_BUFFER is 160k and MAX_IDMA_PERIOD is 128k,
buffer is not twice of period. If you set like this, many of general
ALSA applications return error on initial buffers. If this setting is
for best efficient of IDMA, how about set this half of buffer size as
a default and make another interface to modify this value or write a
note which point to be modified to MAX_IDMA_PERIOD for maximum
efficient.

        claude
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2011-07-13  3:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-13  1:25 [PATCH v5 4/4] ASoC: SAMSUNG: Add I2S0 internal dma driver Sangbeom Kim
2011-07-13  3:08 ` Seungwhan Youn [this message]
2011-07-13  5:41   ` Jassi Brar
2011-07-13  5:54     ` Takashi Iwai
2011-07-13  6:14       ` Jassi Brar
2011-07-13  6:18         ` Jassi Brar
2011-07-13  7:57         ` Takashi Iwai
2011-07-13 14:20           ` Jassi Brar
2011-07-18 23:44     ` Seungwhan Youn
2011-07-18 11:49 ` Jassi Brar
2011-07-18 12:38   ` Liam Girdwood
2011-07-19 15:04     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+s+8rc=nwggHhX7qZ0sCsH=z6qTDj9Gc2385xLgK0R+An85wQ@mail.gmail.com' \
    --to=claude.youn@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=lrg@slimlogic.co.uk \
    --cc=sbkim73@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.