From patchwork Thu Nov 3 06:21:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9410369 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 717C260573 for ; Thu, 3 Nov 2016 06:23:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62F5F2A4AD for ; Thu, 3 Nov 2016 06:23:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 556D42A4FF; Thu, 3 Nov 2016 06:23:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0CBE2A4AD for ; Thu, 3 Nov 2016 06:23:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753610AbcKCGXH (ORCPT ); Thu, 3 Nov 2016 02:23:07 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:36274 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754290AbcKCGV5 (ORCPT ); Thu, 3 Nov 2016 02:21:57 -0400 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OG101XOKYZVP780@mailout1.samsung.com>; Thu, 03 Nov 2016 15:21:54 +0900 (KST) X-AuditID: cbfee61b-f796f6d000004092-e3-581ad782e6f3 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id C7.3B.16530.287DA185; Thu, 3 Nov 2016 15:21:54 +0900 (KST) Received: from localhost.localdomain ([10.113.62.216]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OG100J7YZ02LAA0@mmp1.samsung.com>; Thu, 03 Nov 2016 15:21:54 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, ulf.hansson@linaro.org, robh+dt@kernel.org, krzk@kernel.org, heiko@sntech.de, shawn.lin@rock-chips.com, Jaehoon Chung Subject: [PATCH 09/13] mmc: dw_mmc: remove the "clock-freq-min-max" property Date: Thu, 03 Nov 2016 15:21:31 +0900 Message-id: <20161103062135.10697-10-jh80.chung@samsung.com> X-Mailer: git-send-email 2.10.1 In-reply-to: <20161103062135.10697-1-jh80.chung@samsung.com> References: <20161103062135.10697-1-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42I5/e+xgG7TdakIgw+3zCzmHznHavH/0WtW ixu/2lgtzp/fwG6x6fE1VovLu+awWRz5389o8enBf2aLGef3MVm07j3CbnHnyXpWi+Nrwx14 PDat6mTzuHNtD5vH5iX1Hn9n7Wfx6NuyitFj+7V5zB6fN8kFsEe52WSkJqakFimk5iXnp2Tm pdsqhYa46VooKeQl5qbaKkXo+oYEKSmUJeaUAnlGBmjAwTnAPVhJ3y7BLePdlQ62goeiFW9O GzUwvhDsYuTkkBAwkWg5PpsRwhaTuHBvPRuILSSwlFHi0z2WLkYuIPsHo8Tf3q1gRWwCOhLb vx1nArFFBGQlfv65wAZSxCxwkEni/6TdLCAJYQEfiWWL1wAVcXCwCKhK7HheABLmFbCRaD11 jQ1imbzEhaunwMo5geITjzSzQiy2lrh1eCXTBEbeBYwMqxglUguSC4qT0nON8lLL9YoTc4tL 89L1kvNzNzGCY+KZ9A7Gw7vcDzEKcDAq8fA+SJSKEGJNLCuuzD3EKMHBrCTCu+sKUIg3JbGy KrUoP76oNCe1+BCjKdBdE5mlRJPzgfGaVxJvaGJuYm5sYGFuaWlipCTO2zj7WbiQQHpiSWp2 ampBahFMHxMHp1QDo4x5hcyV/w1PIqbLLjr9IWNLqP+j1D0BasXtMqUzF+2OOBWVKh4sXxdo PaPoCUeMSOfNvsl+FmlRGdcY/cPWsiw++uzKKQmW3RGrLlt8Lqia0ah88oVg5DbH89Mrnq2J fTXx58W8Y101NjKZm3ZbqlV/U2y0Le42fp3Ld4Z/75wkO6eiRzcblFiKMxINtZiLihMBvGTQ lp8CAAA= X-MTR: 20000000000000000@CPGS Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove the "clock-freq-min-max" property. There is "max-frequency" property in drivers/mmc/core/host.c It can be used for getting maximum frequency. And minimum clock value is assigned to 100K by default. Because MMC core should check the initial clock value from 400K to 100K until finding correct value. It's why Minimum value puts 100K by default. Signed-off-by: Jaehoon Chung --- Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt | 3 --- drivers/mmc/host/dw_mmc.c | 13 ++++--------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt index 4e00e85..21c8251 100644 --- a/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt +++ b/Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt @@ -56,9 +56,6 @@ Optional properties: is specified and the ciu clock is specified then we'll try to set the ciu clock to this at probe time. -* clock-freq-min-max: Minimum and Maximum clock frequency for card output - clock(cclk_out). If it's not specified, max is 200MHZ and min is 400KHz by default. - * num-slots: specifies the number of slots supported by the controller. The number of physical slots actually used could be equal or less than the value specified by num-slots. If this property is not specified, the value diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index bd8c5ea..a0c5a85 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2589,7 +2589,6 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) struct dw_mci_slot *slot; const struct dw_mci_drv_data *drv_data = host->drv_data; int ctrl_id, ret; - u32 freq[2]; mmc = mmc_alloc_host(sizeof(struct dw_mci_slot), host->dev); if (!mmc) @@ -2603,14 +2602,6 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) host->slot[id] = slot; mmc->ops = &dw_mci_ops; - if (of_property_read_u32_array(host->dev->of_node, - "clock-freq-min-max", freq, 2)) { - mmc->f_min = DW_MCI_FREQ_MIN; - mmc->f_max = DW_MCI_FREQ_MAX; - } else { - mmc->f_min = freq[0]; - mmc->f_max = freq[1]; - } /*if there are external regulators, get them*/ ret = mmc_regulator_get_supply(mmc); @@ -2649,6 +2640,10 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) if (ret) goto err_host_allocated; + mmc->f_min = DW_MCI_FREQ_MIN; + if (!mmc->f_max) + mmc->f_max = DW_MCI_FREQ_MAX; + /* Useful defaults if platform data is unset. */ if (host->use_dma == TRANS_MODE_IDMAC) { mmc->max_segs = host->ring_size;