summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorZhangfei Gao <zhangfei.gao@linaro.org>2014-01-13 17:14:29 +0800
committerChris Ball <chris@printf.net>2014-01-17 17:59:17 -0500
commit0e662440e9658163128b71a925dbf6a30d4db625 (patch)
treea456a2ca1f2b57f2be57b394c425a3995e84abdf /drivers/mmc
parent7cf347bd20ec8169add381ad23f9fb25c6c076f0 (diff)
downloadop-kernel-dev-0e662440e9658163128b71a925dbf6a30d4db625.zip
op-kernel-dev-0e662440e9658163128b71a925dbf6a30d4db625.tar.gz
mmc: dw_mmc: k3: remove clk_table
Remove clk_table and directly use ios->clock as clock source rate. Abstract init clock rate and max clock limitation in clk.c Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org> Acked-by: Seungwon Jeon <tgih.jun@samsung.com> Signed-off-by: Chris Ball <chris@printf.net>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/dw_mmc-k3.c41
1 files changed, 2 insertions, 39 deletions
diff --git a/drivers/mmc/host/dw_mmc-k3.c b/drivers/mmc/host/dw_mmc-k3.c
index 3542a03..f567c21 100644
--- a/drivers/mmc/host/dw_mmc-k3.c
+++ b/drivers/mmc/host/dw_mmc-k3.c
@@ -18,56 +18,19 @@
#include "dw_mmc.h"
#include "dw_mmc-pltfm.h"
-#define MAX_NUMS 10
-struct dw_mci_k3_priv_data {
- u32 clk_table[MAX_NUMS];
-};
-
static void dw_mci_k3_set_ios(struct dw_mci *host, struct mmc_ios *ios)
{
- struct dw_mci_k3_priv_data *priv = host->priv;
- u32 rate = priv->clk_table[ios->timing];
int ret;
- if (!rate) {
- dev_warn(host->dev,
- "no specified rate in timing %u\n", ios->timing);
- return;
- }
-
- ret = clk_set_rate(host->ciu_clk, rate);
+ ret = clk_set_rate(host->ciu_clk, ios->clock);
if (ret)
- dev_warn(host->dev, "failed to set clock rate %uHz\n", rate);
+ dev_warn(host->dev, "failed to set rate %uHz\n", ios->clock);
host->bus_hz = clk_get_rate(host->ciu_clk);
}
-static int dw_mci_k3_parse_dt(struct dw_mci *host)
-{
- struct dw_mci_k3_priv_data *priv;
- struct device_node *node = host->dev->of_node;
- struct property *prop;
- const __be32 *cur;
- u32 val, num = 0;
-
- priv = devm_kzalloc(host->dev, sizeof(*priv), GFP_KERNEL);
- if (!priv) {
- dev_err(host->dev, "mem alloc failed for private data\n");
- return -ENOMEM;
- }
- host->priv = priv;
-
- of_property_for_each_u32(node, "clock-freq-table", prop, cur, val) {
- if (num >= MAX_NUMS)
- break;
- priv->clk_table[num++] = val;
- }
- return 0;
-}
-
static const struct dw_mci_drv_data k3_drv_data = {
.set_ios = dw_mci_k3_set_ios,
- .parse_dt = dw_mci_k3_parse_dt,
};
static const struct of_device_id dw_mci_k3_match[] = {
OpenPOWER on IntegriCloud