From: Lee Jones <lee.jones@linaro.org>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Chris Ball <cjb@laptop.org>, Simon <horms@verge.net.au>,
Linux-SH <linux-sh@vger.kernel.org>,
linux-mmc <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH 02/17] mmc: tmio: tmio_mmc_host has .dma
Date: Tue, 20 Jan 2015 09:37:59 +0000 [thread overview]
Message-ID: <20150120093759.GJ5767@x1> (raw)
In-Reply-To: <CAPDyKFqQ8+cDZjwgooDAVG++sBtg+58-hXHwpDNgbKDa9R7Ntg@mail.gmail.com>
On Tue, 20 Jan 2015, Ulf Hansson wrote:
> + MFD maintainer
>
> On 13 January 2015 at 05:57, Kuninori Morimoto
> <kuninori.morimoto.gx@renesas.com> wrote:
> > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> >
> > Current .dma is implemented under tmio_mmc_data.
> > It goes to tmio_mmc_host by this patch.
> >
> > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > ---
> > drivers/mmc/host/sh_mobile_sdhi.c | 4 ++--
> > drivers/mmc/host/tmio_mmc.h | 11 +++++++++++
> > drivers/mmc/host/tmio_mmc_dma.c | 24 +++++++++++-------------
> > include/linux/mfd/tmio.h | 11 -----------
Acked-by: Lee Jones <lee.jones@linaro.org>
> > 4 files changed, 24 insertions(+), 26 deletions(-)
> >
> > diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
> > index cf062c4..288e78d 100644
> > --- a/drivers/mmc/host/sh_mobile_sdhi.c
> > +++ b/drivers/mmc/host/sh_mobile_sdhi.c
> > @@ -213,6 +213,8 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
> > goto eprobe;
> > }
> >
> > + host->dma = dma_priv;
> > +
> > mmc_data->clk_enable = sh_mobile_sdhi_clk_enable;
> > mmc_data->clk_disable = sh_mobile_sdhi_clk_disable;
> > mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED;
> > @@ -241,8 +243,6 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
> > dma_priv->alignment_shift = 1; /* 2-byte alignment */
> > dma_priv->filter = shdma_chan_filter;
> >
> > - mmc_data->dma = dma_priv;
> > -
> > /*
> > * All SDHI blocks support 2-byte and larger block sizes in 4-bit
> > * bus width mode.
> > diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
> > index 60d6747..49a2559 100644
> > --- a/drivers/mmc/host/tmio_mmc.h
> > +++ b/drivers/mmc/host/tmio_mmc.h
> > @@ -40,6 +40,16 @@
> >
> > struct tmio_mmc_data;
> >
> > +struct tmio_mmc_dma {
> > + void *chan_priv_tx;
> > + void *chan_priv_rx;
> > + int slave_id_tx;
> > + int slave_id_rx;
> > + int alignment_shift;
> > + dma_addr_t dma_rx_offset;
> > + bool (*filter)(struct dma_chan *chan, void *arg);
> > +};
> > +
> > struct tmio_mmc_host {
> > void __iomem *ctl;
> > struct mmc_command *cmd;
> > @@ -59,6 +69,7 @@ struct tmio_mmc_host {
> >
> > struct platform_device *pdev;
> > struct tmio_mmc_data *pdata;
> > + struct tmio_mmc_dma *dma;
> >
> > /* DMA support */
> > bool force_pio;
> > diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
> > index 7d07738..6c214d6 100644
> > --- a/drivers/mmc/host/tmio_mmc_dma.c
> > +++ b/drivers/mmc/host/tmio_mmc_dma.c
> > @@ -49,11 +49,10 @@ static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host)
> > struct scatterlist *sg = host->sg_ptr, *sg_tmp;
> > struct dma_async_tx_descriptor *desc = NULL;
> > struct dma_chan *chan = host->chan_rx;
> > - struct tmio_mmc_data *pdata = host->pdata;
> > dma_cookie_t cookie;
> > int ret, i;
> > bool aligned = true, multiple = true;
> > - unsigned int align = (1 << pdata->dma->alignment_shift) - 1;
> > + unsigned int align = (1 << host->dma->alignment_shift) - 1;
> >
> > for_each_sg(sg, sg_tmp, host->sg_len, i) {
> > if (sg_tmp->offset & align)
> > @@ -126,11 +125,10 @@ static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host)
> > struct scatterlist *sg = host->sg_ptr, *sg_tmp;
> > struct dma_async_tx_descriptor *desc = NULL;
> > struct dma_chan *chan = host->chan_tx;
> > - struct tmio_mmc_data *pdata = host->pdata;
> > dma_cookie_t cookie;
> > int ret, i;
> > bool aligned = true, multiple = true;
> > - unsigned int align = (1 << pdata->dma->alignment_shift) - 1;
> > + unsigned int align = (1 << host->dma->alignment_shift) - 1;
> >
> > for_each_sg(sg, sg_tmp, host->sg_len, i) {
> > if (sg_tmp->offset & align)
> > @@ -262,8 +260,8 @@ out:
> > void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdata)
> > {
> > /* We can only either use DMA for both Tx and Rx or not use it at all */
> > - if (!pdata->dma || (!host->pdev->dev.of_node &&
> > - (!pdata->dma->chan_priv_tx || !pdata->dma->chan_priv_rx)))
> > + if (!host->dma || (!host->pdev->dev.of_node &&
> > + (!host->dma->chan_priv_tx || !host->dma->chan_priv_rx)))
> > return;
> >
> > if (!host->chan_tx && !host->chan_rx) {
> > @@ -280,7 +278,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
> > dma_cap_set(DMA_SLAVE, mask);
> >
> > host->chan_tx = dma_request_slave_channel_compat(mask,
> > - pdata->dma->filter, pdata->dma->chan_priv_tx,
> > + host->dma->filter, host->dma->chan_priv_tx,
> > &host->pdev->dev, "tx");
> > dev_dbg(&host->pdev->dev, "%s: TX: got channel %p\n", __func__,
> > host->chan_tx);
> > @@ -288,8 +286,8 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
> > if (!host->chan_tx)
> > return;
> >
> > - if (pdata->dma->chan_priv_tx)
> > - cfg.slave_id = pdata->dma->slave_id_tx;
> > + if (host->dma->chan_priv_tx)
> > + cfg.slave_id = host->dma->slave_id_tx;
> > cfg.direction = DMA_MEM_TO_DEV;
> > cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->pdata->bus_shift);
> > cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
> > @@ -299,7 +297,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
> > goto ecfgtx;
> >
> > host->chan_rx = dma_request_slave_channel_compat(mask,
> > - pdata->dma->filter, pdata->dma->chan_priv_rx,
> > + host->dma->filter, host->dma->chan_priv_rx,
> > &host->pdev->dev, "rx");
> > dev_dbg(&host->pdev->dev, "%s: RX: got channel %p\n", __func__,
> > host->chan_rx);
> > @@ -307,10 +305,10 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdat
> > if (!host->chan_rx)
> > goto ereqrx;
> >
> > - if (pdata->dma->chan_priv_rx)
> > - cfg.slave_id = pdata->dma->slave_id_rx;
> > + if (host->dma->chan_priv_rx)
> > + cfg.slave_id = host->dma->slave_id_rx;
> > cfg.direction = DMA_DEV_TO_MEM;
> > - cfg.src_addr = cfg.dst_addr + pdata->dma->dma_rx_offset;
> > + cfg.src_addr = cfg.dst_addr + host->dma->dma_rx_offset;
> > cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
> > cfg.dst_addr = 0;
> > ret = dmaengine_slave_config(host->chan_rx, &cfg);
> > diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
> > index c7d9af0..8d708c7 100644
> > --- a/include/linux/mfd/tmio.h
> > +++ b/include/linux/mfd/tmio.h
> > @@ -112,16 +112,6 @@ void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state);
> >
> > struct dma_chan;
> >
> > -struct tmio_mmc_dma {
> > - void *chan_priv_tx;
> > - void *chan_priv_rx;
> > - int slave_id_tx;
> > - int slave_id_rx;
> > - int alignment_shift;
> > - dma_addr_t dma_rx_offset;
> > - bool (*filter)(struct dma_chan *chan, void *arg);
> > -};
> > -
> > struct tmio_mmc_host;
> >
> > /*
> > @@ -134,7 +124,6 @@ struct tmio_mmc_data {
> > unsigned long flags;
> > unsigned long bus_shift;
> > u32 ocr_mask; /* available voltages */
> > - struct tmio_mmc_dma *dma;
> > unsigned int cd_gpio;
> > void (*set_pwr)(struct platform_device *host, int state);
> > void (*set_clk_div)(struct platform_device *host, int state);
> >
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2015-01-20 9:37 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201501131902.WqokttpY%fengguang.wu@intel.com>
2015-01-13 4:56 ` [PATCH 0/17 v2] tmio: mmc: header cleanup / sh_mobile_cleanup Kuninori Morimoto
2015-01-13 4:57 ` [PATCH 01/17] mmc: tmio: add tmio_mmc_host_alloc/free() Kuninori Morimoto
2015-01-20 9:10 ` Ulf Hansson
2015-01-20 9:38 ` Lee Jones
2015-01-13 4:57 ` [PATCH 02/17] mmc: tmio: tmio_mmc_host has .dma Kuninori Morimoto
2015-01-20 9:10 ` Ulf Hansson
2015-01-20 9:37 ` Lee Jones [this message]
2015-01-13 4:57 ` [PATCH 03/17] mmc: tmio: tmio_mmc_host has .write16_hook Kuninori Morimoto
2015-01-20 9:11 ` Ulf Hansson
2015-01-20 9:37 ` Lee Jones
2015-01-13 4:57 ` [PATCH 04/17] mmc: tmio: tmio_mmc_host has .clk_enable Kuninori Morimoto
2015-01-20 9:11 ` Ulf Hansson
2015-01-20 9:36 ` Lee Jones
2015-01-13 4:58 ` [PATCH 05/17] mmc: tmio: tmio_mmc_host has .clk_disable Kuninori Morimoto
2015-01-20 9:11 ` Ulf Hansson
2015-01-20 9:36 ` Lee Jones
2015-01-13 4:58 ` [PATCH 06/17] mmc: tmio: tmio_mmc_host has .multi_io_quirk Kuninori Morimoto
2015-01-20 9:12 ` Ulf Hansson
2015-01-20 9:35 ` Lee Jones
2015-01-13 4:58 ` [PATCH 07/17] mmc: tmio: tmio_mmc_host has .bus_shift Kuninori Morimoto
2015-01-20 9:12 ` Ulf Hansson
2015-01-20 9:35 ` Lee Jones
2015-01-13 4:58 ` [PATCH 08/17] mmc: tmio: tmio_mmc_data has .alignment_shift Kuninori Morimoto
2015-01-20 9:13 ` Ulf Hansson
2015-01-20 9:34 ` Lee Jones
2015-01-13 4:58 ` [PATCH 09/17] mmc: tmio: tmio_mmc_data has .dma_rx_offset Kuninori Morimoto
2015-01-20 9:13 ` Ulf Hansson
2015-01-20 9:34 ` Lee Jones
2015-01-13 4:59 ` [PATCH 10/17] mmc: tmio: add .enable_dma on tmio_mmc_data Kuninori Morimoto
2015-01-13 4:59 ` [PATCH 11/17] mmc: tmio: enable SoC specific DMA buswidth settings Kuninori Morimoto
2015-01-13 4:59 ` [PATCH 12/17] mmc: sh_mobile_sdhi: remove .init/.cleanup Kuninori Morimoto
2015-01-13 4:59 ` [PATCH 13/17] mmc: sh_mobile_sdhi: tidyup mmc_data->bus_shift for latest SoC Kuninori Morimoto
2015-01-13 4:59 ` [PATCH 14/17] mmc: sh_mobile_sdhi: add new macro for mmc_host to sh_mobile_sdhi Kuninori Morimoto
2015-01-13 4:59 ` [PATCH 15/17] mmc: sh_mobile_sdhi: use .enable_dma Kuninori Morimoto
2015-01-13 5:00 ` [PATCH 16/17] mmc: sh_mobile_sdhi: enable 32bit DMA access Kuninori Morimoto
2015-01-13 5:00 ` [PATCH 17/17] mmc: tmio: remove TMIO_MMC_HAVE_CTL_DMA_REG flag Kuninori Morimoto
2015-01-20 9:14 ` Ulf Hansson
2015-01-20 9:33 ` Lee Jones
2015-01-13 9:35 ` [PATCH 0/17 v2] tmio: mmc: header cleanup / sh_mobile_cleanup Ulf Hansson
2015-01-14 8:30 ` [PATCH] mmc: tmio: add missing EXPORT_SYMBOL for tmio_mmc_host_alloc/free Ulf Hansson
2015-01-14 8:57 ` Kuninori Morimoto
2015-01-20 9:15 ` Ulf Hansson
2015-01-20 9:09 ` [PATCH 0/17 v2] tmio: mmc: header cleanup / sh_mobile_cleanup Ulf Hansson
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=20150120093759.GJ5767@x1 \
--to=lee.jones@linaro.org \
--cc=arnd@arndb.de \
--cc=cjb@laptop.org \
--cc=horms@verge.net.au \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
/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