From patchwork Fri Oct 7 09:23:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 679184 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3sr3xW24q3z9s3v for ; Fri, 7 Oct 2016 20:24:15 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=q+s/Ajoh; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ED1B6A7638; Fri, 7 Oct 2016 11:24:12 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TtKaOPZqkjk7; Fri, 7 Oct 2016 11:24:12 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6DD0EA75E9; Fri, 7 Oct 2016 11:24:12 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8F46BA75E9 for ; Fri, 7 Oct 2016 11:24:09 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1gR4MfzgyIif for ; Fri, 7 Oct 2016 11:24:09 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by theia.denx.de (Postfix) with ESMTPS id 11C17A75D6 for ; Fri, 7 Oct 2016 11:24:05 +0200 (CEST) Received: by mail-pf0-f196.google.com with SMTP id t25so2574753pfg.2 for ; Fri, 07 Oct 2016 02:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=yFL6V9ZwDGLAakNQiJ2VCRtAprQRuhDddwB3nH/J2QE=; b=q+s/AjohCNM9KGVCDYfRC4cPTldbvZ5sdUnanGif15PQnd+sn88YJqzq6eK1Yn33qG r8veoNvfnKeux7P3ukFGreN8H+0Cs48Fo4Ib8qrRsnF/ePO612qy7yDxUSzWhkHIcxjU oqXm3pmb4a5Y21wl9b7CDS9wse6X3Mjrjqd4y8n0yO/50MHxwJPWqH22deRa3pink1Ow cJGkXaIqt0HOPjVoHA4LP2phMFnsQkB1I3jD2i5AGe5MxIdsZ/gbiGdfG7OGbkjfuLy2 5Ni2YThrLK/UzLeuHdLarZyXJpfsFxDpEIGRi29vNZ5KS9Gkr0noa9GGbfnjy4nnCDLo x+/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=yFL6V9ZwDGLAakNQiJ2VCRtAprQRuhDddwB3nH/J2QE=; b=Z7dMG3EnRMLEs0QK6hlltrN4C1oJ8EQtb0JD0Fjh4o0aQCTnd2MUoyy01eMUJ5N7/g WtIiqyy2eF85V0YClbF+ii4WcUcKjkpTlyyKxSNlOvk9yiVWq139kuzrAZmkTtEryvx8 sns4wp0q/53E6pSMlGSTw9Jc31WAkE9QziLNl7uKGul/FkIK+m/sdBSQe5+An9cbSo2n tgz0dBPVtLBpSL2fchR6AqMM6k+09yOioePz0BdS2qH1SOZEQq7ENH/04LAZordFneBj IBKGXqrTL23nwBKRy+VpLEdqILOaxOpyUQv/UPkr9hEu5s4w4EfMmvNpiqwxJ+HLTqwg 7Wrw== X-Gm-Message-State: AA6/9RnXz0/UOXLF3px11oWyyxXynvR4JfHG1m7pvcToVAKUgvKhwZJb7tyItp0qDTbt1g== X-Received: by 10.98.219.2 with SMTP id f2mr7116595pfg.39.1475832244298; Fri, 07 Oct 2016 02:24:04 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id xo5sm21960554pab.13.2016.10.07.02.24.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Oct 2016 02:24:03 -0700 (PDT) From: Kever Yang To: sjg@chromium.org Date: Fri, 7 Oct 2016 17:23:51 +0800 Message-Id: <1475832231-3575-1-git-send-email-kever.yang@rock-chips.com> X-Mailer: git-send-email 1.9.1 Cc: u-boot@lists.denx.de, eddie.cai@rock-chips.com Subject: [U-Boot] [PATCH] mmc: rockchip_sdhci: add clock init for mmc X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Init the clock rate to CONFIG_ROCKCHIP_SDHCI_MAX_FREQ with clock driver api. Signed-off-by: Kever Yang --- drivers/mmc/rockchip_sdhci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c index c56e1a3..e787343 100644 --- a/drivers/mmc/rockchip_sdhci.c +++ b/drivers/mmc/rockchip_sdhci.c @@ -12,6 +12,7 @@ #include #include #include +#include /* 400KHz is max freq for card ID etc. Use that as min */ #define EMMC_MIN_FREQ 400000 @@ -33,7 +34,10 @@ static int arasan_sdhci_probe(struct udevice *dev) struct rockchip_sdhc *prv = dev_get_priv(dev); struct sdhci_host *host = &prv->host; int ret; + struct clk clk; + ret = clk_get_by_index(dev, 0, &clk); + clk_set_rate(&clk, CONFIG_ROCKCHIP_SDHCI_MAX_FREQ); host->quirks = SDHCI_QUIRK_WAIT_SEND_CMD; ret = sdhci_setup_cfg(&plat->cfg, host, CONFIG_ROCKCHIP_SDHCI_MAX_FREQ,