From patchwork Tue Apr 2 06:09:59 2013 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: 15796 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 B092723E06 for ; Tue, 2 Apr 2013 05:50:46 +0000 (UTC) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by fiordland.canonical.com (Postfix) with ESMTP id 41E183D0005F for ; Tue, 2 Apr 2013 05:50:46 +0000 (UTC) Received: by mail-ve0-f172.google.com with SMTP id oz10so62477veb.3 for ; Mon, 01 Apr 2013 22:50:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-auditid:from:to:cc:subject:date:message-id:x-mailer :x-brightmail-tracker:x-gm-message-state; bh=o7disDpHs8tbC3Snu6sn2ey2IKQ6FMuPePWLmsjSbi4=; b=Zan7VYXMReNqH/qUnjB4VoqYEZHZ/iPC+ptPGX7oWcVYe4z+Ir8RcpFBpZSnNU6gCR LEl9Uqxs0SxvCiqt8zGpoFq40k4U0rZtJSApoII/L7HAtrI6YwFeJo3cQn9bpp2IgQR5 Qrr2ht2BBRKaUXMRbiQBjkWT5bjCTdoaoEHc10xAw6E8nJtIgkd1wZoWsWcYYX1+qAt0 jhUPDEDykwsKrx4s/vb925PbvbpHNsJif8pI5QvwqsKrEiIx1gdkpsU4ftHcJTWzlEg3 DFm1SyxH/xe0PQJFIYWEI4SMWv/gigd/8IbqyF7hGreIBXGA7P4e913Rh5vtKrYI5RJS jStg== X-Received: by 10.220.106.14 with SMTP id v14mr11552561vco.2.1364881845718; Mon, 01 Apr 2013 22:50:45 -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.59.4.204 with SMTP id cg12csp110856ved; Mon, 1 Apr 2013 22:50:44 -0700 (PDT) X-Received: by 10.68.228.199 with SMTP id sk7mr22257673pbc.40.1364881844080; Mon, 01 Apr 2013 22:50:44 -0700 (PDT) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id dp3si240408pbc.261.2013.04.01.22.50.42; Mon, 01 Apr 2013 22:50:44 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.24 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.24; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.24 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 (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MKM007ZD5KHMSN0@mailout1.samsung.com>; Tue, 02 Apr 2013 14:50:42 +0900 (KST) X-AuditID: cbfee61b-b7f076d0000034b6-b3-515a71b22381 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id EF.37.13494.2B17A515; Tue, 02 Apr 2013 14:50:42 +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 <0MKM0024A5K5OAB0@mmp2.samsung.com>; Tue, 02 Apr 2013 14:50:41 +0900 (KST) From: Thomas Abraham To: linux-mmc@vger.kernel.org Cc: cjb@laptop.org, linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com, girish.shivananjappa@linaro.org, jh80.chung@samsung.com, tgih.jun@samsung.com, linux-arm-kernel@lists.infradead.org, t.figa@samsung.com, heiko@sntech.de, linus.walleij@linaro.org, patches@linaro.org, dianders@chromium.org Subject: [PATCH v2] mmc: dwmmc: let device core setup the default pin configuration Date: Tue, 02 Apr 2013 11:39:59 +0530 Message-id: <1364882999-31670-1-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMLMWRmVeSWpSXmKPExsVy+t9jQd1NhVGBBlNWsVlsf72RzeLssoNs Fl++nmCz+P/oNavFjV9trBa9C66yWUz5s5zJYtPja6wWR/73M1rMOL+PyWLK4S8sFutnvGax +HD/IrMDr8fshossHoeurGX0uHNtD5vH5iX1Hn1bVjF6bL82j9nj8ya5APYoLpuU1JzMstQi fbsEroypEwwKpqtXzNy1n7WBcZ5CFyMnh4SAicTW01dYIWwxiQv31rN1MXJxCAlMZ5TYcugR M4TTxiRxau46sCo2AQOJRwvfsYPYIgKyEj//XADrYBbYyCSx9OpNRpCEsECoxPc1a5hAbBYB VYn5pyewgdi8Ap4SC6aeh1qnJLGh9yjTBEbuBYwMqxhFUwuSC4qT0nON9IoTc4tL89L1kvNz NzGCg+6Z9A7GVQ0WhxgFOBiVeHgd5kQGCrEmlhVX5h5ilOBgVhLh3aobFSjEm5JYWZValB9f VJqTWnyIUZqDRUmc92CrdaCQQHpiSWp2ampBahFMlomDU6qBcUW47oqkw9c7U5+svLkl7M+R BxyLlt2KYq3L+M8Wc+4m09H3246l3/107Hd8u4OQpElUAtOqbVor8kxE4164OazWaj97Stus 66Rc4H3hRi9OzqSj2zKLv/MFzg3Yv+zKzLA7uu+3TntY/OzLqil7PRfWWeoL/6iN0xMKmTh5 13PGqIhldUzRWUosxRmJhlrMRcWJAFjLP/Q2AgAA X-Gm-Message-State: ALoCoQlgRx4P9dIk0JmS+o6xqzUGqGjJ89DBaJCslHkMldQeNvmfUecXemtzYyyCrEzmENC+aQlB 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: Linus Walleij Reviewed-by: Doug Anderson Tested-by: Doug Anderson --- Hi Doug, Seungwon, I apologize for the delaying in following up on the review comment. The setup_bus callback support has been removed in this patch. I did intend to retain the support for setup_bus callback in the previous version of this patch since any new platform that might use this driver and need such a callback would have this callback ready for use. But it seems removing the setup_bus callback is preferred, so I am fine with it. Thomas. drivers/mmc/host/dw_mmc-exynos.c | 38 -------------------------------------- drivers/mmc/host/dw_mmc.c | 14 +------------- drivers/mmc/host/dw_mmc.h | 3 --- 3 files changed, 1 insertions(+), 54 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c index 72fd0f2..467d043 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; -} - /* Exynos5250 controller specific capabilities */ static unsigned long exynos5250_dwmmc_caps[4] = { MMC_CAP_UHS_DDR50 | MMC_CAP_1_8V_DDR | @@ -205,7 +168,6 @@ static const struct dw_mci_drv_data exynos5250_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 9834221..adb1b7d 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1878,7 +1878,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) struct mmc_host *mmc; struct dw_mci_slot *slot; const struct dw_mci_drv_data *drv_data = host->drv_data; - int ctrl_id, ret; + int ctrl_id; u8 bus_width; mmc = mmc_alloc_host(sizeof(struct dw_mci_slot), host->dev); @@ -1935,14 +1935,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; @@ -2006,10 +1998,6 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) queue_work(host->card_workqueue, &host->card_work); return 0; - -err_setup_bus: - mmc_free_host(mmc); - return -EINVAL; } static void dw_mci_cleanup_slot(struct dw_mci_slot *slot, unsigned int id) 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_ */