From: Wolfram Sang <wsa@the-dreams.de>
To: linux-mmc@vger.kernel.org
Cc: Wolfram Sang <wsa@the-dreams.de>,
linux-renesas-soc@vger.kernel.org,
Ben Hutchings <ben.hutchings@codethink.co.uk>
Subject: [PATCH v2 1/9] mmc: tmio, sh_mobile_sdhi: Pass tmio_mmc_host ptr to clk_{enable,disable} ops
Date: Fri, 1 Apr 2016 17:44:31 +0200 [thread overview]
Message-ID: <1459525479-20842-2-git-send-email-wsa@the-dreams.de> (raw)
In-Reply-To: <1459525479-20842-1-git-send-email-wsa@the-dreams.de>
From: Ben Hutchings <ben.hutchings@codethink.co.uk>
Change the clk_enable operation to take a pointer to the struct
tmio_mmc_host and have it set f_max. For consistency, also change the
clk_disable operation to take a pointer to struct tmio_mmc_host.
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/mmc/host/sh_mobile_sdhi.c | 12 +++++-------
drivers/mmc/host/tmio_mmc.h | 4 ++--
drivers/mmc/host/tmio_mmc_pio.c | 4 ++--
3 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 9aa147959276d0..55849350202b7d 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -131,16 +131,15 @@ static void sh_mobile_sdhi_sdbuf_width(struct tmio_mmc_host *host, int width)
sd_ctrl_write16(host, EXT_ACC, val);
}
-static int sh_mobile_sdhi_clk_enable(struct platform_device *pdev, unsigned int *f)
+static int sh_mobile_sdhi_clk_enable(struct tmio_mmc_host *host)
{
- struct mmc_host *mmc = platform_get_drvdata(pdev);
- struct tmio_mmc_host *host = mmc_priv(mmc);
+ struct mmc_host *mmc = host->mmc;
struct sh_mobile_sdhi *priv = host_to_priv(host);
int ret = clk_prepare_enable(priv->clk);
if (ret < 0)
return ret;
- *f = clk_get_rate(priv->clk);
+ mmc->f_max = clk_get_rate(priv->clk);
/* enable 16bit data access on SDBUF as default */
sh_mobile_sdhi_sdbuf_width(host, 16);
@@ -148,11 +147,10 @@ static int sh_mobile_sdhi_clk_enable(struct platform_device *pdev, unsigned int
return 0;
}
-static void sh_mobile_sdhi_clk_disable(struct platform_device *pdev)
+static void sh_mobile_sdhi_clk_disable(struct tmio_mmc_host *host)
{
- struct mmc_host *mmc = platform_get_drvdata(pdev);
- struct tmio_mmc_host *host = mmc_priv(mmc);
struct sh_mobile_sdhi *priv = host_to_priv(host);
+
clk_disable_unprepare(priv->clk);
}
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
index 4a597f5a53e20f..68fd8d791358c1 100644
--- a/drivers/mmc/host/tmio_mmc.h
+++ b/drivers/mmc/host/tmio_mmc.h
@@ -95,8 +95,8 @@ struct tmio_mmc_host {
bool sdio_irq_enabled;
int (*write16_hook)(struct tmio_mmc_host *host, int addr);
- int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
- void (*clk_disable)(struct platform_device *pdev);
+ int (*clk_enable)(struct tmio_mmc_host *host);
+ void (*clk_disable)(struct tmio_mmc_host *host);
int (*multi_io_quirk)(struct mmc_card *card,
unsigned int direction, int blk_size);
};
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 03f6e74c190691..d1160156678ade 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -845,7 +845,7 @@ static int tmio_mmc_clk_update(struct tmio_mmc_host *host)
if (!host->clk_enable)
return -ENOTSUPP;
- ret = host->clk_enable(host->pdev, &mmc->f_max);
+ ret = host->clk_enable(host);
if (!ret)
mmc->f_min = mmc->f_max / 512;
@@ -1251,7 +1251,7 @@ int tmio_mmc_host_runtime_suspend(struct device *dev)
tmio_mmc_clk_stop(host);
if (host->clk_disable)
- host->clk_disable(host->pdev);
+ host->clk_disable(host);
return 0;
}
--
2.7.0
next prev parent reply other threads:[~2016-04-01 15:44 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-01 15:44 [PATCH v2 0/9] r8a7790: add UHS-I (SDR50) support to Lager Wolfram Sang
2016-04-01 15:44 ` Wolfram Sang [this message]
2016-04-01 15:44 ` [PATCH v2 2/9] mmc: tmio, sh_mobile_sdhi: Add support for variable input clock frequency Wolfram Sang
2016-04-12 12:55 ` Geert Uytterhoeven
2016-04-12 16:19 ` Ben Hutchings
2016-04-15 20:28 ` Wolfram Sang
2016-04-15 20:41 ` Wolfram Sang
2016-04-17 12:49 ` Wolfram Sang
2016-04-18 7:33 ` Geert Uytterhoeven
2016-04-26 10:18 ` Geert Uytterhoeven
2016-04-26 17:00 ` Wolfram Sang
2016-04-01 15:44 ` [PATCH v2 3/9] mmc: tmio: Add UHS-I mode support Wolfram Sang
2016-08-16 18:05 ` Geert Uytterhoeven
2016-08-16 19:55 ` Wolfram Sang
2016-08-16 20:21 ` Geert Uytterhoeven
2016-08-17 19:08 ` Wolfram Sang
2016-08-17 20:17 ` Geert Uytterhoeven
2016-08-18 18:41 ` Wolfram Sang
2016-08-23 12:34 ` Geert Uytterhoeven
2016-04-01 15:44 ` [PATCH v2 4/9] mmc: tmio: always start clock after frequency calculation Wolfram Sang
2016-04-01 15:44 ` [PATCH v2 5/9] mmc: tmio: stop clock when 0Hz is requested Wolfram Sang
2016-04-01 15:44 ` [PATCH v2 6/9] mmc: host: add note that set_ios needs to handle 0Hz properly Wolfram Sang
2016-04-01 15:44 ` [PATCH v2 7/9] mmc: sh_mobile_sdhi: Add UHS-I mode support Wolfram Sang
2016-04-04 15:04 ` Ulf Hansson
2016-04-04 15:17 ` Wolfram Sang
2016-04-04 15:52 ` Ulf Hansson
2016-04-04 15:56 ` Wolfram Sang
2016-04-01 15:44 ` [PATCH v2 8/9] ARM: shmobile: r8a7790: Set maximum frequencies for SDHI clocks Wolfram Sang
2016-04-01 15:44 ` [PATCH v2 9/9] ARM: shmobile: r8a7790: lager: Enable UHS-I SDR-50 Wolfram Sang
2016-04-06 0:56 ` [v2,9/9] " Simon Horman
2016-04-06 6:38 ` Geert Uytterhoeven
2016-04-06 7:13 ` Simon Horman
2016-04-04 15:08 ` [PATCH v2 0/9] r8a7790: add UHS-I (SDR50) support to Lager Ulf Hansson
2016-04-04 15:21 ` Wolfram Sang
2016-04-05 11:12 ` Ulf Hansson
2016-04-05 11:19 ` Wolfram Sang
2016-04-06 0:56 ` Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1459525479-20842-2-git-send-email-wsa@the-dreams.de \
--to=wsa@the-dreams.de \
--cc=ben.hutchings@codethink.co.uk \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).