linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: Shawn Lin <shawn.lin@rock-chips.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Seungwon Jeon <tgih.jun@samsung.com>,
	dianders@chromium.org, linux-mips@linux-mips.org,
	Arnd Bergmann <arnd@arndb.de>,
	Alexandre Belloni <alexandre.belloni@free-electrons.com>,
	Alexey Brodkin <abrodkin@synopsys.com>,
	Stefan Agner <stefan@agner.ch>,
	Zhou Wang <wangzhou.bry@gmail.com>,
	Kumar Gala <galak@codeaurora.org>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Wang Long <long.wanglong@huawei.com>,
	Rob Herring <robh+dt@kernel.org>,
	Chaotian Jing <chaotian.jing@mediatek.com>,
	Lukasz Majewski <l.majewski@samsung.com>,
	Jun Nie <jun.nie@linaro.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Kevin Hao <haokexin@gmail.com>,
	Olof
Subject: Re: [RFC PATCH v3 1/5] mmc: dw_mmc: Add external dma interface support
Date: Wed, 05 Aug 2015 10:49:26 +0200	[thread overview]
Message-ID: <8177347.dLpRuMxaEU@diego> (raw)
In-Reply-To: <1438762648-22202-1-git-send-email-shawn.lin@rock-chips.com>

Am Mittwoch, 5. August 2015, 16:17:28 schrieb Shawn Lin:
> DesignWare MMC Controller can supports two types of DMA
> mode: external dma and internal dma. We get a RK312x platform
> integrated dw_mmc and ARM pl330 dma controller. This patch add
> edmac ops to support these platforms. I've tested it on RK312x
> platform with edmac mode and RK3288 platform with idmac mode.
> 
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
> 
> ---

[...]

> diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
> index 5be9767..6c1c7ea 100644
> --- a/include/linux/mmc/dw_mmc.h
> +++ b/include/linux/mmc/dw_mmc.h
> @@ -16,6 +16,7 @@
> 
>  #include <linux/scatterlist.h>
>  #include <linux/mmc/core.h>
> +#include <linux/dmaengine.h>
> 
>  #define MAX_MCI_SLOTS	2
> 
> @@ -40,6 +41,17 @@ enum {
> 
>  struct mmc_data;
> 
> +enum {
> +	TRANS_MODE_PIO = 0,
> +	TRANS_MODE_IDMAC,
> +	TRANS_MODE_EDMAC
> +};
> +
> +struct dw_mci_dma_slave {
> +	struct dma_chan *ch;
> +	enum dma_transfer_direction direction;
> +};
> +
>  /**
>   * struct dw_mci - MMC controller state shared between all slots
>   * @lock: Spinlock protecting the queue and associated data.
> @@ -147,17 +159,23 @@ struct dw_mci {
> 
>  	/* DMA interface members*/
>  	int			use_dma;
> +	int			trans_mode;

you're introducing this new trans_mode, but we have "use_dma" already.

So you could just define

enum {
	TRANS_DMA_PIO = 0,
	TRANS_DMA_IDMAC,
	TRANS_DMA_EDMAC
};

and fill use_dma appropriately. "0" is meaning PIO already, which I also did fix 
up some days ago in "[PATCH] mmc: dw_mmc: fix pio mode when internal dmac is 
enabled" [0].


Heiko

[0] https://lkml.org/lkml/2015/8/3/407

  reply	other threads:[~2015-08-05  8:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05  8:16 [RFC PATCH v3 0/5] Shawn Lin
2015-08-05  8:17 ` [RFC PATCH v3 1/5] mmc: dw_mmc: Add external dma interface support Shawn Lin
2015-08-05  8:49   ` Heiko Stübner [this message]
2015-08-05  9:11     ` Shawn Lin
2015-08-06  2:27   ` Jaehoon Chung
2015-08-06  3:35     ` Shawn Lin
2015-08-05  8:17 ` [RFC PATCH v3 2/5] Documentation: synopsys-dw-mshc: add bindings for idmac and edmac Shawn Lin
2015-08-05  8:27   ` Krzysztof Kozlowski
2015-08-05  8:43     ` Shawn Lin
2015-08-05  8:45       ` Heiko Stübner
2015-08-05  8:56         ` Shawn Lin
2015-08-06  2:16   ` Doug Anderson
2015-08-06  2:20     ` Jaehoon Chung
2015-08-06  3:13       ` Shawn Lin
2015-08-05  8:18 ` [RFC PATCH v3 3/5] arm: configs: remove CONFIG_MMC_DW_IDMAC Shawn Lin
2015-08-05  8:34   ` Vineet Gupta
2015-08-05  8:48     ` Shawn Lin
2015-08-05  8:18 ` [RFC PATCH v3 4/5] mips: " Shawn Lin
2015-08-05  8:18 ` [RFC PATCH v3 5/5] ARM: dts: add supports-idmac property Shawn Lin
2015-08-05  8:52   ` Alexey Brodkin
2015-08-05  9:25     ` Shawn Lin
2015-08-05 23:45 ` [RFC PATCH v3 0/5] Krzysztof Kozlowski
2015-08-06  0:45   ` Shawn Lin
2015-08-06  1:47     ` Jaehoon Chung

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=8177347.dLpRuMxaEU@diego \
    --to=heiko@sntech.de \
    --cc=abrodkin@synopsys.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=alim.akhtar@samsung.com \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=chaotian.jing@mediatek.com \
    --cc=dianders@chromium.org \
    --cc=galak@codeaurora.org \
    --cc=haokexin@gmail.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jh80.chung@samsung.com \
    --cc=jun.nie@linaro.org \
    --cc=l.majewski@samsung.com \
    --cc=linux-mips@linux-mips.org \
    --cc=long.wanglong@huawei.com \
    --cc=robh+dt@kernel.org \
    --cc=shawn.lin@rock-chips.com \
    --cc=stefan@agner.ch \
    --cc=tgih.jun@samsung.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wangzhou.bry@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).