From patchwork Fri Jul 27 02:33:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 173546 X-Patchwork-Delegate: afleming@freescale.com 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 46A3D2C0087 for ; Fri, 27 Jul 2012 12:34:31 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CDE9F28100; Fri, 27 Jul 2012 04:34:17 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 fpYUv3lXcnV1; Fri, 27 Jul 2012 04:34:17 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3B67A280DF; Fri, 27 Jul 2012 04:33:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 75649280D1 for ; Fri, 27 Jul 2012 04:33:52 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 UAmgal0+DT-l for ; Fri, 27 Jul 2012 04:33:51 +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 mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by theia.denx.de (Postfix) with ESMTP id 1F471280C9 for ; Fri, 27 Jul 2012 04:33:50 +0200 (CEST) Received: from epcpsbgm2.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M7S00B4NSG6Y0D0@mailout2.samsung.com> for u-boot@lists.denx.de; Fri, 27 Jul 2012 11:33:49 +0900 (KST) X-AuditID: cbfee61b-b7f566d000005c8a-8f-5011fe0c2fd2 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id A0.05.23690.C0EF1105; Fri, 27 Jul 2012 11:33:48 +0900 (KST) Received: from [10.90.51.55] by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M7S00BOUSGCZS10@mmp1.samsung.com> for u-boot@lists.denx.de; Fri, 27 Jul 2012 11:33:48 +0900 (KST) Message-id: <5011FDFA.2090301@samsung.com> Date: Fri, 27 Jul 2012 11:33:30 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-version: 1.0 To: "u-boot@lists.denx.de" X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCLMWRmVeSWpSXmKPExsVy+t9jAV2ef4IBBp1TbSze7u1kd2D0OHtn B2MAYxSXTUpqTmZZapG+XQJXxsvun0wFs/gqps05xdrAeJ67i5GTQ0LARKLjwxU2CFtM4sK9 9UA2F4eQwCJGiWfHPzNDOE1MEtcvrmABqeIV0JKYdeAmWAeLgKrEjhPTweJsAjoS278dZwKx RQXCJF7d/ckGUS8o8WPyPbAaEQFDib+7d7OADGUWOMcosefDTbCEsIC3xO4zS9hBbGagQftb p7FB2PISm9e8ZZ7AyDcLyaxZSMpmISlbwMi8ilE0tSC5oDgpPddIrzgxt7g0L10vOT93EyM4 rJ5J72Bc1WBxiFGAg1GJh3dhpECAEGtiWXFl7iFGCQ5mJRFe7+WCAUK8KYmVValF+fFFpTmp xYcYpTlYlMR5Tby/+gsJpCeWpGanphakFsFkmTg4pRoYoyd3sTrt42ErvFDxl2v1M4t9vypU rdce3iOndIk9Z+8s2ROPm0PPyM0sPWNnJXWkY3l/gXzlpMjYzLlp/M/MzLY43j6m+uUn3ySx sOgz7yfIsusnnlh3YoXdhANb98p32yXdErNdNClb5rl5xDTl49+ONSWXxRQvnrslbat/7HLj lzKP/LfPUGIpzkg01GIuKk4EAKM+2/UnAgAA X-TM-AS-MML: No Cc: Lei Wen , Kyungmin Park , afleming@freescale.com Subject: [U-Boot] [PATCH v2 3/4] mmc: s5p_sdhci: add the set_mmc_clk for cmu control X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Samsung SoC use the cmu control to set clock. Signed-off-by: Jaehoon Chung --- drivers/mmc/s5p_sdhci.c | 3 +++ drivers/mmc/sdhci.c | 3 +++ include/sdhci.h | 2 ++ 3 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c index d7e92a4..d98c8cb 100644 --- a/drivers/mmc/s5p_sdhci.c +++ b/drivers/mmc/s5p_sdhci.c @@ -21,6 +21,7 @@ #include #include #include +#include static char *S5P_NAME = "SAMSUNG SDHCI"; static void s5p_sdhci_set_control_reg(struct sdhci_host *host) @@ -90,6 +91,8 @@ int s5p_sdhci_init(u32 regbase, int index, int bus_width) host->version = sdhci_readw(host, SDHCI_HOST_VERSION); host->set_control_reg = &s5p_sdhci_set_control_reg; + host->set_clock = set_mmc_clk; + host->index = index; host->host_caps = MMC_MODE_HC; diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 1709643..ac39e48 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -279,6 +279,9 @@ static int sdhci_set_clock(struct mmc *mmc, unsigned int clock) } div >>= 1; + if (host->set_clock) + host->set_clock(host->index, div); + clk = (div & SDHCI_DIV_MASK) << SDHCI_DIVIDER_SHIFT; clk |= ((div & SDHCI_DIV_HI_MASK) >> SDHCI_DIV_MASK_LEN) << SDHCI_DIVIDER_HI_SHIFT; diff --git a/include/sdhci.h b/include/sdhci.h index 9d37183..4351a62 100644 --- a/include/sdhci.h +++ b/include/sdhci.h @@ -248,8 +248,10 @@ struct sdhci_host { unsigned int clock; struct mmc *mmc; const struct sdhci_ops *ops; + int index; void (*set_control_reg)(struct sdhci_host *host); + void (*set_clock)(int dev_index, unsigned int div); uint voltages; };