From patchwork Fri May 7 14:32:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 97727 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o47EWMD3007983 for ; Fri, 7 May 2010 14:32:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754739Ab0EGOcW (ORCPT ); Fri, 7 May 2010 10:32:22 -0400 Received: from mail.gmx.net ([213.165.64.20]:49199 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754687Ab0EGOcV (ORCPT ); Fri, 7 May 2010 10:32:21 -0400 Received: (qmail invoked by alias); 07 May 2010 14:32:19 -0000 Received: from p57BD1BFA.dip0.t-ipconnect.de (EHLO axis700.grange) [87.189.27.250] by mail.gmx.net (mp017) with SMTP; 07 May 2010 16:32:19 +0200 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX189igRzLmE9JqxugstX4DGiAkItiDofo8y6nC8Xvo huuziaUbOSmIg6 Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1OAObN-0002DJ-7G; Fri, 07 May 2010 16:32:29 +0200 Date: Fri, 7 May 2010 16:32:29 +0200 (CEST) From: Guennadi Liakhovetski To: "linux-sh@vger.kernel.org" cc: linux-mmc@vger.kernel.org, Dan Williams , Ian Molton , Magnus Damm , Samuel Ortiz Subject: [PATCH 4a/9 v3] sh: prepare the SDHI MFD driver to pass DMA configuration to tmio_mmc.c In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Y-GMX-Trusted: 0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 07 May 2010 14:32:23 +0000 (UTC) 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 #include #include +#include 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); };