From patchwork Tue Apr 9 05:59:46 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: 15987 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-qe0-f71.google.com (mail-qe0-f71.google.com [209.85.128.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CB2D823900 for ; Tue, 9 Apr 2013 05:41:38 +0000 (UTC) Received: by mail-qe0-f71.google.com with SMTP id b10sf7303854qen.2 for ; Mon, 08 Apr 2013 22:41:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=dm3YmoN0AJSlhEA/rxzurtO63c4qjRXB9WQM86v/UcE=; b=cSzdpj4YnU8h+5xnqQRXrNAcLeg5C1hDOKC2H5Ke0BAg6/Dw+2ALMEHuBixd9zi+gR WwI5AIURKPPtWFyxboKGYpEJF7r7nUtm1kYbcANHwEfq/Jf0aMzz9HNjH21dfxWcxN3j C3zLH1jvXAS4Q3X7pKgn/HPT5vCirMmewqRstb/hKTc7IysKctePwgkKvyWV1zU8qNAk UB2peVwxOYvUyM4NII8mdIeYG2hbsYVgx2o7JSwYTifNsTwlzQIb8exAW5hWRzHwnEtX AX7Ut7LOms2VRiEpo/u09mUkkRrWV8KyCraXjqvfRYMOVxaV6NDExV5Jd3k7dabvHIwE WdiA== X-Received: by 10.236.114.39 with SMTP id b27mr11356211yhh.50.1365486082424; Mon, 08 Apr 2013 22:41:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.127.137 with SMTP id ng9ls3761835qeb.42.gmail; Mon, 08 Apr 2013 22:41:22 -0700 (PDT) X-Received: by 10.221.0.199 with SMTP id nn7mr18338905vcb.14.1365486082251; Mon, 08 Apr 2013 22:41:22 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id b4si20620050vdw.135.2013.04.08.22.41.22 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 22:41:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id kw10so3281103vcb.5 for ; Mon, 08 Apr 2013 22:41:22 -0700 (PDT) X-Received: by 10.52.245.6 with SMTP id xk6mr8103765vdc.114.1365486081885; Mon, 08 Apr 2013 22:41:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.85.136 with SMTP id h8csp47063vez; Mon, 8 Apr 2013 22:41:21 -0700 (PDT) X-Received: by 10.68.9.34 with SMTP id w2mr755460pba.30.1365486080582; Mon, 08 Apr 2013 22:41:20 -0700 (PDT) Received: from mailout3.samsung.com (mailout3.samsung.com. [203.254.224.33]) by mx.google.com with ESMTP id hb2si28270594pac.263.2013.04.08.22.41.19; Mon, 08 Apr 2013 22:41:20 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.33 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.33; Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MKZ003VX3RJZI20@mailout3.samsung.com>; Tue, 09 Apr 2013 14:41:08 +0900 (KST) X-AuditID: cbfee61b-b7f076d0000034b6-14-5163a9f356e7 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 9A.4E.13494.3F9A3615; Tue, 09 Apr 2013 14:41:08 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MKZ008X13S8FNQ0@mmp1.samsung.com>; Tue, 09 Apr 2013 14:41:07 +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, dianders@chromium.org, patches@linaro.org Subject: [PATCH v4] mmc: dw_mmc: let device core setup the default pin configuration Date: Tue, 09 Apr 2013 11:29:46 +0530 Message-id: <1365487186-4587-1-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrALMWRmVeSWpSXmKPExsVy+t9jAd0vK5MDDSbvZbbY/nojm8XZZQfZ LL58PcFm8f/Ra1aLG7/aWC16F1xls5jyZzmTxabH11gtjvzvZ7SYcX4fk8WUw19YLNbPeM1i 8eH+RWYHXo/ZDRdZPA5dWcvocefaHjaPzUvqPfq2rGL02H5tHrPH501yAexRXDYpqTmZZalF +nYJXBltExczF8xUq+hoN2hgnCvfxcjJISFgIrFzWTcrhC0mceHeejYQW0hgEaPE2xc+XYxc QHYbk8SLno1gRWwCBhKPFr5jB7FFBGQlfv65wAZSxCywkUni//EesG5hgTCJb73bgIo4OFgE VCXaVuSBmLwCHhIXZ0VD7FKS2NB7lGkCI/cCRoZVjKKpBckFxUnpuUZ6xYm5xaV56XrJ+bmb GMHh9kx6B+OqBotDjAIcjEo8vBeeJAUKsSaWFVfmHmKU4GBWEuHtNkwOFOJNSaysSi3Kjy8q zUktPsQozcGiJM57sNU6UEggPbEkNTs1tSC1CCbLxMEp1cCoEVL/4u2et29rouVPqP6NVJWZ GdYXF+53fBJ/WpeUev/bSd/VTtxZL+OzbK7dtZyXGRbWZRtnNXrrfQ2Oyg5qf+0uXrL8wy+X Kcwiu12eMb64/cPdwZrj3d+Js79z7q5otpE+d/hhPHN74cOHkztbN66/vGUlW6nfx1tmRSnM Yi/1NwibvPJQYinOSDTUYi4qTgQAHbZc9zMCAAA= X-Gm-Message-State: ALoCoQnmuTfxCIiCs5IcIkVp3/qfzz+iAMqFRIBD0XeQSTXgvIreos6JQgdN5wXxOFh+vO5Cu5sz X-Original-Sender: thomas.abraham@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Acked-by: Seungwon Jeon --- Changes since v3: - Rebased to the latest mmc-next branch, resolving the compilation error with this patch due to changes in commit f2f942ce "mmc: dw_mmc: Check return value of regulator_enable". Thanks to Doug for pointing out this issue with the v3 patch. 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, 3 insertions(+), 52 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 45d9216..5dcef43 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1952,14 +1952,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) if (ret) { dev_err(host->dev, "failed to enable regulator: %d\n", ret); - goto err_setup_bus; + return ret; } } @@ -2015,7 +2007,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); @@ -2032,7 +2024,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_ */