All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Ortiz <sameo@linux.intel.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: "linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>,
	linux-mmc@vger.kernel.org,
	Dan Williams <dan.j.williams@intel.com>,
	Ian Molton <ian@mnementh.co.uk>,
	Magnus Damm <magnus.damm@gmail.com>
Subject: Re: [PATCH 4a/9 v3] sh: prepare the SDHI MFD driver to pass DMA configuration to tmio_mmc.c
Date: Tue, 11 May 2010 01:04:47 +0200	[thread overview]
Message-ID: <20100510230446.GE3288@sortiz.org> (raw)
In-Reply-To: <Pine.LNX.4.64.1005071630320.4777@axis700.grange>

Hi Guennadi,

On Fri, May 07, 2010 at 04:32:29PM +0200, Guennadi Liakhovetski wrote:
> Pass DMA slave IDs from platform down to the tmio_mmc driver, to be used for
> dmaengine configuration.
I guess this should go through Dan's tree. If that's so, please add my:

Acked-by: Samuel Ortiz <sameo@linux.intel.com>

Cheers,
Samuel.

> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
>  drivers/mfd/sh_mobile_sdhi.c       |   24 ++++++++++++++++++++----
>  include/linux/mfd/sh_mobile_sdhi.h |    2 ++
>  include/linux/mfd/tmio.h           |    6 ++++++
>  3 files changed, 28 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mfd/sh_mobile_sdhi.c b/drivers/mfd/sh_mobile_sdhi.c
> index 468fd36..dafa988 100644
> --- a/drivers/mfd/sh_mobile_sdhi.c
> +++ b/drivers/mfd/sh_mobile_sdhi.c
> @@ -25,11 +25,15 @@
>  #include <linux/mfd/core.h>
>  #include <linux/mfd/tmio.h>
>  #include <linux/mfd/sh_mobile_sdhi.h>
> +#include <linux/sh_dma.h>
>  
>  struct sh_mobile_sdhi {
>  	struct clk *clk;
>  	struct tmio_mmc_data mmc_data;
>  	struct mfd_cell cell_mmc;
> +	struct sh_dmae_slave param_tx;
> +	struct sh_dmae_slave param_rx;
> +	struct tmio_mmc_dma dma_priv;
>  };
>  
>  static struct resource sh_mobile_sdhi_resources[] = {
> @@ -63,6 +67,8 @@ static void sh_mobile_sdhi_set_pwr(struct platform_device *tmio, int state)
>  static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
>  {
>  	struct sh_mobile_sdhi *priv;
> +	struct tmio_mmc_data *mmc_data;
> +	struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
>  	struct resource *mem;
>  	char clk_name[8];
>  	int ret, irq;
> @@ -84,6 +90,8 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  	}
>  
> +	mmc_data = &priv->mmc_data;
> +
>  	snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id);
>  	priv->clk = clk_get(&pdev->dev, clk_name);
>  	if (IS_ERR(priv->clk)) {
> @@ -95,12 +103,20 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
>  
>  	clk_enable(priv->clk);
>  
> -	priv->mmc_data.hclk = clk_get_rate(priv->clk);
> -	priv->mmc_data.set_pwr = sh_mobile_sdhi_set_pwr;
> -	priv->mmc_data.capabilities = MMC_CAP_MMC_HIGHSPEED;
> +	mmc_data->hclk = clk_get_rate(priv->clk);
> +	mmc_data->set_pwr = sh_mobile_sdhi_set_pwr;
> +	mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED;
> +
> +	if (p && p->dma_slave_tx >= 0 && p->dma_slave_rx >= 0) {
> +		priv->param_tx.slave_id = p->dma_slave_tx;
> +		priv->param_rx.slave_id = p->dma_slave_rx;
> +		priv->dma_priv.chan_priv_tx = &priv->param_tx;
> +		priv->dma_priv.chan_priv_rx = &priv->param_rx;
> +		mmc_data->dma = &priv->dma_priv;
> +	}
>  
>  	memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc));
> -	priv->cell_mmc.driver_data = &priv->mmc_data;
> +	priv->cell_mmc.driver_data = mmc_data;
>  	priv->cell_mmc.platform_data = &priv->cell_mmc;
>  	priv->cell_mmc.data_size = sizeof(priv->cell_mmc);
>  
> diff --git a/include/linux/mfd/sh_mobile_sdhi.h b/include/linux/mfd/sh_mobile_sdhi.h
> index 3bcd716..c305461 100644
> --- a/include/linux/mfd/sh_mobile_sdhi.h
> +++ b/include/linux/mfd/sh_mobile_sdhi.h
> @@ -2,6 +2,8 @@
>  #define __SH_MOBILE_SDHI_H__
>  
>  struct sh_mobile_sdhi_info {
> +	int dma_slave_tx;
> +	int dma_slave_rx;
>  	void (*set_pwr)(struct platform_device *pdev, int state);
>  };
>  
> diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
> index c3f7dff..360fc95 100644
> --- a/include/linux/mfd/tmio.h
> +++ b/include/linux/mfd/tmio.h
> @@ -55,12 +55,18 @@ int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
>  void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
>  void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state);
>  
> +struct tmio_mmc_dma {
> +	void *chan_priv_tx;
> +	void *chan_priv_rx;
> +};
> +
>  /*
>   * data for the MMC controller
>   */
>  struct tmio_mmc_data {
>  	unsigned int			hclk;
>  	unsigned long			capabilities;
> +	struct tmio_mmc_dma		*dma;
>  	void (*set_pwr)(struct platform_device *host, int state);
>  	void (*set_clk_div)(struct platform_device *host, int state);
>  };
> -- 
> 1.6.2.4
> 

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

WARNING: multiple messages have this Message-ID (diff)
From: Samuel Ortiz <sameo@linux.intel.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: "linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>,
	linux-mmc@vger.kernel.org,
	Dan Williams <dan.j.williams@intel.com>,
	Ian Molton <ian@mnementh.co.uk>,
	Magnus Damm <magnus.damm@gmail.com>
Subject: Re: [PATCH 4a/9 v3] sh: prepare the SDHI MFD driver to pass DMA
Date: Mon, 10 May 2010 23:04:47 +0000	[thread overview]
Message-ID: <20100510230446.GE3288@sortiz.org> (raw)
In-Reply-To: <Pine.LNX.4.64.1005071630320.4777@axis700.grange>

Hi Guennadi,

On Fri, May 07, 2010 at 04:32:29PM +0200, Guennadi Liakhovetski wrote:
> Pass DMA slave IDs from platform down to the tmio_mmc driver, to be used for
> dmaengine configuration.
I guess this should go through Dan's tree. If that's so, please add my:

Acked-by: Samuel Ortiz <sameo@linux.intel.com>

Cheers,
Samuel.

> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
>  drivers/mfd/sh_mobile_sdhi.c       |   24 ++++++++++++++++++++----
>  include/linux/mfd/sh_mobile_sdhi.h |    2 ++
>  include/linux/mfd/tmio.h           |    6 ++++++
>  3 files changed, 28 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mfd/sh_mobile_sdhi.c b/drivers/mfd/sh_mobile_sdhi.c
> index 468fd36..dafa988 100644
> --- a/drivers/mfd/sh_mobile_sdhi.c
> +++ b/drivers/mfd/sh_mobile_sdhi.c
> @@ -25,11 +25,15 @@
>  #include <linux/mfd/core.h>
>  #include <linux/mfd/tmio.h>
>  #include <linux/mfd/sh_mobile_sdhi.h>
> +#include <linux/sh_dma.h>
>  
>  struct sh_mobile_sdhi {
>  	struct clk *clk;
>  	struct tmio_mmc_data mmc_data;
>  	struct mfd_cell cell_mmc;
> +	struct sh_dmae_slave param_tx;
> +	struct sh_dmae_slave param_rx;
> +	struct tmio_mmc_dma dma_priv;
>  };
>  
>  static struct resource sh_mobile_sdhi_resources[] = {
> @@ -63,6 +67,8 @@ static void sh_mobile_sdhi_set_pwr(struct platform_device *tmio, int state)
>  static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
>  {
>  	struct sh_mobile_sdhi *priv;
> +	struct tmio_mmc_data *mmc_data;
> +	struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
>  	struct resource *mem;
>  	char clk_name[8];
>  	int ret, irq;
> @@ -84,6 +90,8 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  	}
>  
> +	mmc_data = &priv->mmc_data;
> +
>  	snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id);
>  	priv->clk = clk_get(&pdev->dev, clk_name);
>  	if (IS_ERR(priv->clk)) {
> @@ -95,12 +103,20 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
>  
>  	clk_enable(priv->clk);
>  
> -	priv->mmc_data.hclk = clk_get_rate(priv->clk);
> -	priv->mmc_data.set_pwr = sh_mobile_sdhi_set_pwr;
> -	priv->mmc_data.capabilities = MMC_CAP_MMC_HIGHSPEED;
> +	mmc_data->hclk = clk_get_rate(priv->clk);
> +	mmc_data->set_pwr = sh_mobile_sdhi_set_pwr;
> +	mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED;
> +
> +	if (p && p->dma_slave_tx >= 0 && p->dma_slave_rx >= 0) {
> +		priv->param_tx.slave_id = p->dma_slave_tx;
> +		priv->param_rx.slave_id = p->dma_slave_rx;
> +		priv->dma_priv.chan_priv_tx = &priv->param_tx;
> +		priv->dma_priv.chan_priv_rx = &priv->param_rx;
> +		mmc_data->dma = &priv->dma_priv;
> +	}
>  
>  	memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc));
> -	priv->cell_mmc.driver_data = &priv->mmc_data;
> +	priv->cell_mmc.driver_data = mmc_data;
>  	priv->cell_mmc.platform_data = &priv->cell_mmc;
>  	priv->cell_mmc.data_size = sizeof(priv->cell_mmc);
>  
> diff --git a/include/linux/mfd/sh_mobile_sdhi.h b/include/linux/mfd/sh_mobile_sdhi.h
> index 3bcd716..c305461 100644
> --- a/include/linux/mfd/sh_mobile_sdhi.h
> +++ b/include/linux/mfd/sh_mobile_sdhi.h
> @@ -2,6 +2,8 @@
>  #define __SH_MOBILE_SDHI_H__
>  
>  struct sh_mobile_sdhi_info {
> +	int dma_slave_tx;
> +	int dma_slave_rx;
>  	void (*set_pwr)(struct platform_device *pdev, int state);
>  };
>  
> diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
> index c3f7dff..360fc95 100644
> --- a/include/linux/mfd/tmio.h
> +++ b/include/linux/mfd/tmio.h
> @@ -55,12 +55,18 @@ int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
>  void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
>  void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state);
>  
> +struct tmio_mmc_dma {
> +	void *chan_priv_tx;
> +	void *chan_priv_rx;
> +};
> +
>  /*
>   * data for the MMC controller
>   */
>  struct tmio_mmc_data {
>  	unsigned int			hclk;
>  	unsigned long			capabilities;
> +	struct tmio_mmc_dma		*dma;
>  	void (*set_pwr)(struct platform_device *host, int state);
>  	void (*set_clk_div)(struct platform_device *host, int state);
>  };
> -- 
> 1.6.2.4
> 

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

  reply	other threads:[~2010-05-10 23:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-07 14:32 [PATCH 0/9 v3] add DMA support to tmio_mmc, using dmaengine API, use it on SH Guennadi Liakhovetski
2010-05-07 14:32 ` [PATCH 0/9 v3] add DMA support to tmio_mmc, using dmaengine API, Guennadi Liakhovetski
2010-05-07 14:32 ` [PATCH 4a/9 v3] sh: prepare the SDHI MFD driver to pass DMA configuration to tmio_mmc.c Guennadi Liakhovetski
2010-05-07 14:32   ` [PATCH 4a/9 v3] sh: prepare the SDHI MFD driver to pass DMA Guennadi Liakhovetski
2010-05-10 23:04   ` Samuel Ortiz [this message]
2010-05-10 23:04     ` Samuel Ortiz
2010-05-07 14:32 ` [PATCH 4b/9 v3] MMC: add DMA support to tmio_mmc driver, when used on SuperH Guennadi Liakhovetski
2010-05-07 14:32   ` [PATCH 4b/9 v3] MMC: add DMA support to tmio_mmc driver, when used Guennadi Liakhovetski
2010-05-11 10:07 ` [PATCH 0/9 v3] add DMA support to tmio_mmc, using dmaengine API, use it on SH Guennadi Liakhovetski
2010-05-11 10:07   ` [PATCH 0/9 v3] add DMA support to tmio_mmc, using dmaengine API, Guennadi Liakhovetski
2010-05-11 12:38   ` [PATCH 0/9 v3] add DMA support to tmio_mmc, using dmaengine API, use it on SH Paul Mundt
2010-05-11 12:38     ` Paul Mundt
2010-05-12 22:55   ` Andrew Morton
2010-05-12 22:55     ` [PATCH 0/9 v3] add DMA support to tmio_mmc, using dmaengine Andrew Morton
2010-05-13  6:42     ` [PATCH 0/9 v3] add DMA support to tmio_mmc, using dmaengine API, use it on SH Guennadi Liakhovetski
2010-05-13  6:42       ` [PATCH 0/9 v3] add DMA support to tmio_mmc, using dmaengine API, Guennadi Liakhovetski
2010-05-13  6:44       ` [PATCH 0/9 v3] add DMA support to tmio_mmc, using dmaengine API, use it on SH Paul Mundt
2010-05-13  6:44         ` Paul Mundt
2010-05-13  4:06         ` Andrew Morton
2010-05-13  4:06           ` [PATCH 0/9 v3] add DMA support to tmio_mmc, using dmaengine Andrew Morton
2010-05-13  7:18           ` [PATCH 0/9 v3] add DMA support to tmio_mmc, using dmaengine API, use it on SH Guennadi Liakhovetski
2010-05-13  7:18             ` [PATCH 0/9 v3] add DMA support to tmio_mmc, using dmaengine API, Guennadi Liakhovetski

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=20100510230446.GE3288@sortiz.org \
    --to=sameo@linux.intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=ian@mnementh.co.uk \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@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 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.