From patchwork Fri Apr 5 13:53:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Abraham X-Patchwork-Id: 2398591 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id B85A73FD8C for ; Fri, 5 Apr 2013 13:36:49 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UO6oy-0000Ic-US for patchwork-linux-arm@patchwork.kernel.org; Fri, 05 Apr 2013 13:36:49 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UO6o2-0005jE-Kb; Fri, 05 Apr 2013 13:35:50 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UO6nx-0005gE-RW for linux-arm-kernel@lists.infradead.org; Fri, 05 Apr 2013 13:35:47 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MKS0018ZB0LW3U0@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 05 Apr 2013 22:35:41 +0900 (KST) X-AuditID: cbfee61a-b7fa86d0000045ae-f9-515ed32d5e5b Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id A6.A9.17838.D23DE515; Fri, 05 Apr 2013 22:35:41 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MKS009UDB1CNH80@mmp2.samsung.com>; Fri, 05 Apr 2013 22:35:41 +0900 (KST) From: Thomas Abraham To: linux-mmc@vger.kernel.org Subject: [PATCH v3] mmc: dw_mmc: let device core setup the default pin configuration Date: Fri, 05 Apr 2013 19:23:35 +0530 Message-id: <1365170015-3009-1-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprBLMWRmVeSWpSXmKPExsVy+t9jQV3dy3GBBn82y1lsf72RzeLL1xNs Fv8fvWa1uPGrjdWid8FVNospf5YzWWx6fI3V4sj/fkaLGef3MVlMOfyFxWL9jNcsFh/uX2R2 4PE4dGUto8eda3vYPDYvqffo27KK0WP7tXnMHp83yQWwRXHZpKTmZJalFunbJXBlrL3BU/BU seLSlZfsDYzXpbsYOTkkBEwkuh8cZIawxSQu3FvP1sXIxSEkMJ1R4sqKx0wQThuTxNHGuYwg VWwCBhKPFr5jB7FFBGQlfv65ANbBLDCLSWL2qYdgCWGBMIn96zcBjeXgYBFQlfh1VQokzCvg IfG4cSLUNiWJDb1HmSYwci9gZFjFKJpakFxQnJSea6hXnJhbXJqXrpecn7uJERxez6R2MK5s sDjEKMDBqMTDm9EXGyjEmlhWXJl7iFGCg1lJhFdoTlygEG9KYmVValF+fFFpTmrxIUZpDhYl cd4DrdaBQgLpiSWp2ampBalFMFkmDk6pBsYMW6ZfBmvvvii/Y5Jfn3xrTb/osvAeAd/8FQIH 1O8+uvr9Ml/3klBu8StdZoec4nwtjp2c3azipbH/XpD3rUfTFl6Yb304cZtQ4+NdYrtaW2+F HZR+6tO3pKq2xELp0Lv4n/1vtwUt47sabuk9J8KlWO7d9CV7f/xfohmZbZRQkOvw75XTxxol luKMREMt5qLiRAAghN2fKwIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130405_093546_175108_4191C0CB X-CRM114-Status: GOOD ( 15.16 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.34 listed in list.dnswl.org] 1.7 KHOP_BIG_TO_CC Sent to 10+ recipients instaed of Bcc or a list -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-samsung-soc@vger.kernel.org, heiko@sntech.de, patches@linaro.org, tgih.jun@samsung.com, t.figa@samsung.com, jh80.chung@samsung.com, kgene.kim@samsung.com, girish.shivananjappa@linaro.org, cjb@laptop.org, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org With device core now able to setup the default pin configuration, the pin configuration code based on the deprecated Samsung specific gpio bindings is removed. Signed-off-by: Thomas Abraham Acked-by: Seungwon Jeon --- Changes since v2: - Changed patch subject from "mmc: dwmmc: let..." to "mmc: dw_mmc: let..." - Rebased to Chris's latest mmc-next branch. drivers/mmc/host/dw_mmc-exynos.c | 38 -------------------------------------- drivers/mmc/host/dw_mmc.c | 12 ++---------- drivers/mmc/host/dw_mmc.h | 3 --- 3 files changed, 2 insertions(+), 51 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c index c7f0976..f013e7e 100644 --- a/drivers/mmc/host/dw_mmc-exynos.c +++ b/drivers/mmc/host/dw_mmc-exynos.c @@ -152,43 +152,6 @@ static int dw_mci_exynos_parse_dt(struct dw_mci *host) return 0; } -static int dw_mci_exynos_setup_bus(struct dw_mci *host, - struct device_node *slot_np, u8 bus_width) -{ - int idx, gpio, ret; - - if (!slot_np) - return -EINVAL; - - /* cmd + clock + bus-width pins */ - for (idx = 0; idx < NUM_PINS(bus_width); idx++) { - gpio = of_get_gpio(slot_np, idx); - if (!gpio_is_valid(gpio)) { - dev_err(host->dev, "invalid gpio: %d\n", gpio); - return -EINVAL; - } - - ret = devm_gpio_request(host->dev, gpio, "dw-mci-bus"); - if (ret) { - dev_err(host->dev, "gpio [%d] request failed\n", gpio); - return -EBUSY; - } - } - - if (host->pdata->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) - return 0; - - gpio = of_get_named_gpio(slot_np, "samsung,cd-pinmux-gpio", 0); - if (gpio_is_valid(gpio)) { - if (devm_gpio_request(host->dev, gpio, "dw-mci-cd")) - dev_err(host->dev, "gpio [%d] request failed\n", gpio); - } else { - dev_info(host->dev, "cd gpio not available"); - } - - return 0; -} - /* Common capabilities of Exynos4/Exynos5 SoC */ static unsigned long exynos_dwmmc_caps[4] = { MMC_CAP_UHS_DDR50 | MMC_CAP_1_8V_DDR | @@ -205,7 +168,6 @@ static const struct dw_mci_drv_data exynos_drv_data = { .prepare_command = dw_mci_exynos_prepare_command, .set_ios = dw_mci_exynos_set_ios, .parse_dt = dw_mci_exynos_parse_dt, - .setup_bus = dw_mci_exynos_setup_bus, }; static const struct of_device_id dw_mci_exynos_match[] = { diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index a443820..2ed9989 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1945,14 +1945,6 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) else bus_width = 1; - if (drv_data && drv_data->setup_bus) { - struct device_node *slot_np; - slot_np = dw_mci_of_find_slot_node(host->dev, slot->id); - ret = drv_data->setup_bus(host, slot_np, bus_width); - if (ret) - goto err_setup_bus; - } - switch (bus_width) { case 8: mmc->caps |= MMC_CAP_8_BIT_DATA; @@ -2002,7 +1994,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) ret = mmc_add_host(mmc); if (ret) - goto err_setup_bus; + goto err_add_host; #if defined(CONFIG_DEBUG_FS) dw_mci_init_debugfs(slot); @@ -2019,7 +2011,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) return 0; -err_setup_bus: +err_add_host: mmc_free_host(mmc); return -EINVAL; } diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h index 53b8fd9..0b74189 100644 --- a/drivers/mmc/host/dw_mmc.h +++ b/drivers/mmc/host/dw_mmc.h @@ -190,7 +190,6 @@ extern int dw_mci_resume(struct dw_mci *host); * @prepare_command: handle CMD register extensions. * @set_ios: handle bus specific extensions. * @parse_dt: parse implementation specific device tree properties. - * @setup_bus: initialize io-interface * * Provide controller implementation specific extensions. The usage of this * data structure is fully optional and usage of each member in this structure @@ -203,7 +202,5 @@ struct dw_mci_drv_data { void (*prepare_command)(struct dw_mci *host, u32 *cmdr); void (*set_ios)(struct dw_mci *host, struct mmc_ios *ios); int (*parse_dt)(struct dw_mci *host); - int (*setup_bus)(struct dw_mci *host, - struct device_node *slot_np, u8 bus_width); }; #endif /* _DW_MMC_H_ */