From patchwork Sun Mar 11 12:46:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas.abraham@linaro.org X-Patchwork-Id: 7208 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C435923E0E for ; Sun, 11 Mar 2012 12:42:00 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 895DAA182D9 for ; Sun, 11 Mar 2012 12:42:00 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so6818970iag.11 for ; Sun, 11 Mar 2012 05:42:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:x-gm-message-state; bh=x+iNuXA3zPnDy4qx7qoxu43K/xw52J7+pp5iem+80KU=; b=A9acl7YRUkU9rNxvv4CtFGP4jJD/tWXkFFBfeHkBoz6vwbwijpZSQJyFYAOperUl4O MiMkAaoDBNuTL24FMreGQXcYK0dvi588o//ohe2bMfqTgsepRUt1/uCDPvCCrs3u8wdY MWY2p9rg3PVX9YfqzjEt/kFafclmWVOUDE2wCYwEiHd1nxq+SxQ8IB71maDJSZvBfJLx 1fQjQ293fexuztgcn5jxAKALwxW0zxmcnUZSb8rz3DVfga820bjvYveCmwx273J7tQ6m 8wjQPI3isGkD0vb8oRY1oAOCMn5SiOsdz4f2PxSrqVZdLEruvoDOI6I3kWs6tvbjadHn RDYQ== Received: by 10.42.145.72 with SMTP id e8mr11390864icv.0.1331469720348; Sun, 11 Mar 2012 05:42:00 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp22222ibg; Sun, 11 Mar 2012 05:42:00 -0700 (PDT) Received: by 10.68.228.228 with SMTP id sl4mr14448063pbc.16.1331469719657; Sun, 11 Mar 2012 05:41:59 -0700 (PDT) Received: from mailout4.samsung.com (mailout4.samsung.com. [203.254.224.34]) by mx.google.com with ESMTP id 4si13282925pbw.259.2012.03.11.05.41.59; Sun, 11 Mar 2012 05:41:59 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.34; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm2.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0M0Q00JJH0LQK690@mailout4.samsung.com>; Sun, 11 Mar 2012 21:41:58 +0900 (KST) X-AuditID: cbfee61b-b7c62ae000000989-83-4f5c9d966503 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (MMPCPMTA) with SMTP id 3D.FC.02441.69D9C5F4; Sun, 11 Mar 2012 21:41:58 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp2.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTPA id <0M0Q0009D0LLZ300@mmp2.samsung.com>; Sun, 11 Mar 2012 21:41:58 +0900 (KST) From: Thomas Abraham To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linus.walleij@linaro.org, kgene.kim@samsung.com, patches@linaro.org Subject: [PATCH 5/5] mmc: sdhci-s3c: setup pins using pinctrl interface Date: Sun, 11 Mar 2012 18:16:05 +0530 Message-id: <1331469965-28846-6-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 In-reply-to: <1331469965-28846-1-git-send-email-thomas.abraham@linaro.org> References: <1331469965-28846-1-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: AAAAAA== X-Gm-Message-State: ALoCoQkumCHdqsMzMqE6nzObSiNGQR3VCRCSZNfJTuHe+DLgeanQ6Z/pPSuSbvbfhi87rGlyyga9 The platform specific callback to setup the sdhci pin mux and pin config is removed and the pinctrl subsystem interface is used to setup the mux and config. Signed-off-by: Thomas Abraham --- drivers/mmc/host/sdhci-s3c.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index ea0767e..76c1c36 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -50,6 +51,7 @@ struct sdhci_s3c { struct platform_device *pdev; struct resource *ioarea; struct s3c_sdhci_platdata *pdata; + struct pinctrl *pinctrl; unsigned int cur_clk; int ext_cd_irq; int ext_cd_gpio; @@ -529,6 +531,9 @@ static inline struct sdhci_s3c_drv_data *sdhci_s3c_get_driver_data( platform_get_device_id(pdev)->driver_data; } +#include +#include + static int __devinit sdhci_s3c_probe(struct platform_device *pdev) { struct s3c_sdhci_platdata *pdata; @@ -538,6 +543,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) struct sdhci_s3c *sc; struct resource *res; int ret, irq, ptr, clks; + char *pstate; if (!pdev->dev.platform_data && !pdev->dev.of_node) { dev_err(dev, "no device data specified\n"); @@ -643,8 +649,13 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) } /* Ensure we have minimal gpio selected CMD/CLK/Detect */ - if (pdata->cfg_gpio) - pdata->cfg_gpio(pdev, pdata->max_width); + pstate = pdata->max_width ? "sdhci-pcfg8" : "sdhci-pcfg4"; + sc->pinctrl = pinctrl_get_select(&pdev->dev, pstate); + if (IS_ERR(sc->pinctrl)) { + dev_err(dev, "failed to setup pin configuration\n"); + ret = -ENXIO; + goto err_req_regs; + } host->hw_name = "samsung-hsmmc"; host->ops = &sdhci_s3c_ops;