From patchwork Mon Feb 3 11:15:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 3568851 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 7E369C02DC for ; Mon, 3 Feb 2014 11:15:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7894320131 for ; Mon, 3 Feb 2014 11:15:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7366C201FE for ; Mon, 3 Feb 2014 11:15:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751339AbaBCLPl (ORCPT ); Mon, 3 Feb 2014 06:15:41 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:9422 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750764AbaBCLPj (ORCPT ); Mon, 3 Feb 2014 06:15:39 -0500 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N0F0019V3A0MT80@mailout3.samsung.com> for linux-mmc@vger.kernel.org; Mon, 03 Feb 2014 20:15:36 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.115]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id EE.93.10364.75A7FE25; Mon, 03 Feb 2014 20:15:36 +0900 (KST) X-AuditID: cbfee690-b7f266d00000287c-db-52ef7a57aa68 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 74.4A.29263.75A7FE25; Mon, 03 Feb 2014 20:15:35 +0900 (KST) Received: from [10.252.81.186] by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N0F000U339ZVX60@mmp2.samsung.com>; Mon, 03 Feb 2014 20:15:35 +0900 (KST) Message-id: <52EF7A57.5020103@samsung.com> Date: Mon, 03 Feb 2014 20:15:35 +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' , Seungwon Jeon Subject: [PATCH v3 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+NgFmpnkeLIzCtJLcpLzFFi42JZI2JSrBtR9T7IYNkuZovtrzeyWRz5389o 8eH+RWYHZo9DV9YyevRtWcXo8XmTXABzFJdNSmpOZllqkb5dAldGb/tLloJnChX9C/6yNDD+ lOpi5OSQEDCRWPfxEiOELSZx4d56ti5GLg4hgaWMEufmNjLCFPWvbWeESExnlNhzZDozSEJI 4DWjxJr3MiA2r4CWxIIbfWwgNouAqsTU/4vAmtkEdCS2fzvOBGKLCoRJTD1xlQWiXlDix+R7 QDYHh4iAtUTzb1mQMLOAu8TL4/fAyoUFQiWaZ+xjhIjrSOxvncYGYctLbF7zlhnkHgmBdnaJ rW9uQu0VkPg2+RDYTAkBWYlNB5gh7peUOLjiBssERpFZSDbPQjJ2FpKxCxiZVzGKphYkFxQn pReZ6BUn5haX5qXrJefnbmIERsLpf88m7GC8d8D6EGMy0MqJzFKiyfnASMoriTc0NjOyMDUx NTYytzQjTVhJnFftUVKQkEB6YklqdmpqQWpRfFFpTmrxIUYmDk6pBsbcsEtSsWq3mh9efNGo n8lefjl4tVm+01HBG75PS7mNv/YcZPsrrL2Nn2vrn+3Wkt+/NyYssv2rvfNg1ySbWwuau7lK lsh4n7evb5lRxmze+K7eUaz8zvabfMFH2GdP3MDCv2KNxuY2z8U7NoezMjD5K+2pXLCsPOuW paXC2lO2fZwOs15qZymxFGckGmoxFxUnAgDFoyLnmgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCIsWRmVeSWpSXmKPExsVy+t9jQd3wqvdBBgcXWlhsf72RzeLI/35G iw/3LzI7MHscurKW0aNvyypGj8+b5AKYoxoYbTJSE1NSixRS85LzUzLz0m2VvIPjneNNzQwM dQ0tLcyVFPISc1NtlVx8AnTdMnOANikplCXmlAKFAhKLi5X07TBNCA1x07WAaYzQ9Q0Jgusx MkADCWsYM3rbX7IUPFOo6F/wl6WB8adUFyMnh4SAiUT/2nZGCFtM4sK99WxdjFwcQgLTGSX2 HJnODJIQEnjNKLHmvQyIzSugJbHgRh8biM0ioCox9f8isGY2AR2J7d+OM4HYogJhElNPXGWB qBeU+DH5HpDNwSEiYC3R/FsWJMws4C7x8vg9sHJhgVCJ5hn7GCHiOhL7W6exQdjyEpvXvGWe wMg3C8mkWUjKZiEpW8DIvIpRNLUguaA4KT3XUK84Mbe4NC9dLzk/dxMjOM6eSe1gXNlgcYhR gINRiYe3Y++7ICHWxLLiytxDjBIczEoivGmV74OEeFMSK6tSi/Lji0pzUosPMSYDPTqRWUo0 OR+YAvJK4g2NTcyMLI3MDS2MjM1JE1YS5z3Qah0oJJCeWJKanZpakFoEs4WJg1OqgVHb5e3e yvt1+xm+dejo3UpPVvVfeXJbusST15XlV753B3519Jga6FfD9ssjaJlCdZLuVWUV4X4GluCt nFsrdFUe39nGJvblXojQrZVVZk93yE35f5GxI0/wc/il0A9db5ZqbVfpatJbf2NeX65wxqZn dhs39AaETw3KFWdp541cfpyTc+/SE0osxRmJhlrMRcWJAETPnkv3AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-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 V3: - Remove the caps2-mmc-hs-1_8v/1_2v into synopsys-dw-mshc.txt Changelog V2: - None .../devicetree/bindings/mmc/synopsys-dw-mshc.txt | 5 -- drivers/mmc/host/dw_mmc.c | 49 +------------------- 2 files changed, 1 insertion(+), 53 deletions(-) diff --git a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt index 8f3f133..2d4a725 100644 --- a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt +++ b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt @@ -69,10 +69,6 @@ Optional properties: * supports-highspeed: Enables support for high speed cards (up to 50MHz) -* caps2-mmc-hs200-1_8v: Supports mmc HS200 SDR 1.8V mode - -* caps2-mmc-hs200-1_2v: Supports mmc HS200 SDR 1.2V mode - * broken-cd: as documented in mmc core bindings. * vmmc-supply: The phandle to the regulator to use for vmmc. If this is @@ -103,7 +99,6 @@ board specific portions as listed below. clock-freq-min-max = <400000 200000000>; num-slots = <1>; supports-highspeed; - caps2-mmc-hs200-1_8v; broken-cd; fifo-depth = <0x80>; card-detect-delay = <200>; 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; }