From patchwork Tue Jan 28 08:24:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 3545641 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B5312C02DC for ; Tue, 28 Jan 2014 08:24:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 965F720138 for ; Tue, 28 Jan 2014 08:24:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B8592015B for ; Tue, 28 Jan 2014 08:24:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754653AbaA1IYa (ORCPT ); Tue, 28 Jan 2014 03:24:30 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:52622 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754321AbaA1IY2 (ORCPT ); Tue, 28 Jan 2014 03:24:28 -0500 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N0300H7WRCOECA0@mailout1.samsung.com> for linux-mmc@vger.kernel.org; Tue, 28 Jan 2014 17:24:24 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.113]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id C4.2F.14803.63967E25; Tue, 28 Jan 2014 17:24:22 +0900 (KST) X-AuditID: cbfee691-b7efc6d0000039d3-e0-52e76936ceb5 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 38.8E.28157.63967E25; Tue, 28 Jan 2014 17:24:22 +0900 (KST) Received: from [10.252.81.186] by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N030013XRCMD620@mmp1.samsung.com>; Tue, 28 Jan 2014 17:24:22 +0900 (KST) Message-id: <52E76955.2030701@samsung.com> Date: Tue, 28 Jan 2014 17:24:53 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-version: 1.0 To: "linux-mmc@vger.kernel.org" Cc: 'Chris Ball' , Olof Johansson , Seungwon Jeon Subject: [PATCH v2 2/8] mmc: dw_mmc: use the mmc_of_parse() instead of local parser Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRmVeSWpSXmKPExsWyRsSkUNcs83mQwbv1qhbbX29kszjyv5/R 4tT1z2wWH+5fZHZg8Th0ZS2jx5UTTawefVtWMXp83iQXwBLFZZOSmpNZllqkb5fAlXHgbnJB t1xF99sVzA2MvyS6GDk5JARMJI5NusQKYYtJXLi3nq2LkYtDSGApo8SXr/NZYIoO/53DCJFY xCgx6/FbqKrXjBIzpp1jA6niFdCSmHxmL1gHi4CqxKOnN8BsNgEdie3fjjOB2KICYRJTT1xl gagXlPgx+R6QzcEhImAt0fxbFiTMLJAlsWJ1M9hIYYFQibXN09kg4joS+1unQdnyEpvXvGUG uUFCYDK7RNesP4wQewUkvk0+BDZTQkBWYtMBZogHJCUOrrjBMoFRZBaSzbOQjJ2FZOwCRuZV jKKpBckFxUnpRaZ6xYm5xaV56XrJ+bmbGIHRcfrfs4k7GO8fsD7EmAy0ciKzlGhyPjC68kri DY3NjCxMTUyNjcwtzUgTVhLnTX+UFCQkkJ5YkpqdmlqQWhRfVJqTWnyIkYmDU6qBsVd6Oo/a 6T+7jNVO/UkulM4qreRI8cx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-CFilter-Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP mmc_of_parse() have been already parsed the general capability. Didn't need to use the local parser. Signed-off-by: Jaehoon Chung --- Changelog V2: - None drivers/mmc/core/host.c | 4 ++-- drivers/mmc/host/dw_mmc.c | 49 +-------------------------------------------- 2 files changed, 3 insertions(+), 50 deletions(-) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 5a82e81..4b81c93 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -429,9 +429,9 @@ int mmc_of_parse(struct mmc_host *host) host->pm_caps |= MMC_PM_KEEP_POWER; if (of_find_property(np, "enable-sdio-wakeup", &len)) host->pm_caps |= MMC_PM_WAKE_SDIO_IRQ; - if (of_find_property(np, "mmc-hs200-1_8v", NULL)) + if (of_find_property(np, "mmc-hs200-1_8v", &len)) host->caps2 |= MMC_CAP2_HS200_1_8V_SDR; - if (of_find_property(np, "mmc-hs200-1_2v", NULL)) + if (of_find_property(np, "mmc-hs200-1_2v", &len)) host->caps2 |= MMC_CAP2_HS200_1_2V_SDR; return 0; diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 55cd110..8193e21 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2046,21 +2046,6 @@ static int dw_mci_of_get_slot_quirks(struct device *dev, u8 slot) return quirks; } -/* find out bus-width for a given slot */ -static u32 dw_mci_of_get_bus_wd(struct device *dev, u8 slot) -{ - struct device_node *np = dw_mci_of_find_slot_node(dev, slot); - u32 bus_wd = 1; - - if (!np) - return 1; - - if (of_property_read_u32(np, "bus-width", &bus_wd)) - dev_err(dev, "bus-width property not found, assuming width" - " as 1\n"); - return bus_wd; -} - /* find the write protect gpio for a given slot; or -1 if none specified */ static int dw_mci_of_get_wp_gpio(struct device *dev, u8 slot) { @@ -2108,10 +2093,6 @@ static int dw_mci_of_get_slot_quirks(struct device *dev, u8 slot) { return 0; } -static u32 dw_mci_of_get_bus_wd(struct device *dev, u8 slot) -{ - return 1; -} static struct device_node *dw_mci_of_find_slot_node(struct device *dev, u8 slot) { return NULL; @@ -2134,7 +2115,6 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) const struct dw_mci_drv_data *drv_data = host->drv_data; int ctrl_id, ret; u32 freq[2]; - u8 bus_width; mmc = mmc_alloc_host(sizeof(struct dw_mci_slot), host->dev); if (!mmc) @@ -2189,19 +2169,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) if (host->pdata->caps2) mmc->caps2 = host->pdata->caps2; - if (host->pdata->get_bus_wd) - bus_width = host->pdata->get_bus_wd(slot->id); - else if (host->dev->of_node) - bus_width = dw_mci_of_get_bus_wd(host->dev, slot->id); - else - bus_width = 1; - - switch (bus_width) { - case 8: - mmc->caps |= MMC_CAP_8_BIT_DATA; - case 4: - mmc->caps |= MMC_CAP_4_BIT_DATA; - } + mmc_of_parse(mmc); if (host->pdata->blk_settings) { mmc->max_segs = host->pdata->blk_settings->max_segs; @@ -2399,24 +2367,9 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host) return ERR_PTR(ret); } - if (of_find_property(np, "keep-power-in-suspend", NULL)) - pdata->pm_caps |= MMC_PM_KEEP_POWER; - - if (of_find_property(np, "enable-sdio-wakeup", NULL)) - pdata->pm_caps |= MMC_PM_WAKE_SDIO_IRQ; - if (of_find_property(np, "supports-highspeed", NULL)) pdata->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; - if (of_find_property(np, "caps2-mmc-hs200-1_8v", NULL)) - pdata->caps2 |= MMC_CAP2_HS200_1_8V_SDR; - - if (of_find_property(np, "caps2-mmc-hs200-1_2v", NULL)) - pdata->caps2 |= MMC_CAP2_HS200_1_2V_SDR; - - if (of_get_property(np, "cd-inverted", NULL)) - pdata->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH; - return pdata; }