2016-03-31 07:35:17

by Shawn Lin

[permalink] [raw]
Subject: [PATCH v2 0/3] Cleanup setup_clock callback from dw_mmc


Hello Jeahoon

Currently dw_mmc is a little too queen-size. As we had cleanup
prepare_command callback some days before, there are also some
ones deserve to remove. Also we should avoid add new quirks or
callbacks into dw_mmc in order to avoid the dilemma sdhci meets
now.

This patchset remove setup_clock callback. Obviously, add a callback
just for one-time-used clk stuff make no sense. We combine what
setup_clock does before into init callback. For exynos platfrom, it
needs call init hook after resume, so we add new argument in init hook
to indicate whether it needs do clk stuff or not.


Changes in v2:
- rebase on linux-mmc next
- remove add setup_clk flag for init callback

Shawn Lin (3):
mmc: dw_mmc-rockchip: remove setup_clock for rockchip
mmc: dw_mmc-exynos: remove dw_mci_exynos_setup_clock
mmc: dw_mmc: remove setup_clock callback

drivers/mmc/host/dw_mmc-exynos.c | 8 --------
drivers/mmc/host/dw_mmc-rockchip.c | 12 ++++--------
drivers/mmc/host/dw_mmc.c | 9 ---------
drivers/mmc/host/dw_mmc.h | 2 --
4 files changed, 4 insertions(+), 27 deletions(-)

--
2.3.7



2016-03-31 07:35:29

by Shawn Lin

[permalink] [raw]
Subject: [PATCH v2 1/3] mmc: dw_mmc-rockchip: remove setup_clock for rockchip

We remove setup_clock hook and combine it into
init hook to simplify the code

Signed-off-by: Shawn Lin <[email protected]>

---

Changes in v2:
- rebase on linux-mmc next
- remove add setup_clk flag for init callback

drivers/mmc/host/dw_mmc-rockchip.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
index 84e50f3..c986f2f 100644
--- a/drivers/mmc/host/dw_mmc-rockchip.c
+++ b/drivers/mmc/host/dw_mmc-rockchip.c
@@ -26,13 +26,6 @@ struct dw_mci_rockchip_priv_data {
int default_sample_phase;
};

-static int dw_mci_rk3288_setup_clock(struct dw_mci *host)
-{
- host->bus_hz /= RK3288_CLKGEN_DIV;
-
- return 0;
-}
-
static void dw_mci_rk3288_set_ios(struct dw_mci *host, struct mmc_ios *ios)
{
struct dw_mci_rockchip_priv_data *priv = host->priv;
@@ -231,6 +224,10 @@ static int dw_mci_rockchip_init(struct dw_mci *host)
/* It needs this quirk on all Rockchip SoCs */
host->pdata->quirks |= DW_MCI_QUIRK_BROKEN_DTO;

+ if (of_device_is_compatible(host->dev->of_node,
+ "rockchip,rk3288-dw-mshc"))
+ host->bus_hz /= RK3288_CLKGEN_DIV;
+
return 0;
}

@@ -242,7 +239,6 @@ static const struct dw_mci_drv_data rk3288_drv_data = {
.set_ios = dw_mci_rk3288_set_ios,
.execute_tuning = dw_mci_rk3288_execute_tuning,
.parse_dt = dw_mci_rk3288_parse_dt,
- .setup_clock = dw_mci_rk3288_setup_clock,
.init = dw_mci_rockchip_init,
};

--
2.3.7


2016-03-31 07:35:34

by Shawn Lin

[permalink] [raw]
Subject: [PATCH v2 2/3] mmc: dw_mmc-exynos: remove dw_mci_exynos_setup_clock

We combine what dw_mci_exynos_setup_clock does with init
hook to simplify the code

Signed-off-by: Shawn Lin <[email protected]>
---

Changes in v2: None

drivers/mmc/host/dw_mmc-exynos.c | 8 --------
1 file changed, 8 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c
index 0e989eb..7e3a324 100644
--- a/drivers/mmc/host/dw_mmc-exynos.c
+++ b/drivers/mmc/host/dw_mmc-exynos.c
@@ -126,13 +126,6 @@ static int dw_mci_exynos_priv_init(struct dw_mci *host)
DQS_CTRL_GET_RD_DELAY(priv->saved_strobe_ctrl);
}

- return 0;
-}
-
-static int dw_mci_exynos_setup_clock(struct dw_mci *host)
-{
- struct dw_mci_exynos_priv_data *priv = host->priv;
-
host->bus_hz /= (priv->ciu_div + 1);

return 0;
@@ -500,7 +493,6 @@ static unsigned long exynos_dwmmc_caps[4] = {
static const struct dw_mci_drv_data exynos_drv_data = {
.caps = exynos_dwmmc_caps,
.init = dw_mci_exynos_priv_init,
- .setup_clock = dw_mci_exynos_setup_clock,
.set_ios = dw_mci_exynos_set_ios,
.parse_dt = dw_mci_exynos_parse_dt,
.execute_tuning = dw_mci_exynos_execute_tuning,
--
2.3.7


2016-03-31 07:35:42

by Shawn Lin

[permalink] [raw]
Subject: [PATCH v2 3/3] mmc: dw_mmc: remove setup_clock callback

Now, no dw_mmc variant drivers use this callback, let's
remove it.

Signed-off-by: Shawn Lin <[email protected]>
---

Changes in v2: None

drivers/mmc/host/dw_mmc.c | 9 ---------
drivers/mmc/host/dw_mmc.h | 2 --
2 files changed, 11 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 242f9a0..e03cc66 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -3003,15 +3003,6 @@ int dw_mci_probe(struct dw_mci *host)
}
}

- if (drv_data && drv_data->setup_clock) {
- ret = drv_data->setup_clock(host);
- if (ret) {
- dev_err(host->dev,
- "implementation specific clock setup failed\n");
- goto err_clk_ciu;
- }
- }
-
setup_timer(&host->cmd11_timer,
dw_mci_cmd11_timer, (unsigned long)host);

diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h
index 68d5da2..1e8d838 100644
--- a/drivers/mmc/host/dw_mmc.h
+++ b/drivers/mmc/host/dw_mmc.h
@@ -277,7 +277,6 @@ struct dw_mci_slot {
* dw_mci driver data - dw-mshc implementation specific driver data.
* @caps: mmc subsystem specified capabilities of the controller(s).
* @init: early implementation specific initialization.
- * @setup_clock: implementation specific clock configuration.
* @set_ios: handle bus specific extensions.
* @parse_dt: parse implementation specific device tree properties.
* @execute_tuning: implementation specific tuning procedure.
@@ -289,7 +288,6 @@ struct dw_mci_slot {
struct dw_mci_drv_data {
unsigned long *caps;
int (*init)(struct dw_mci *host);
- int (*setup_clock)(struct dw_mci *host);
void (*set_ios)(struct dw_mci *host, struct mmc_ios *ios);
int (*parse_dt)(struct dw_mci *host);
int (*execute_tuning)(struct dw_mci_slot *slot, u32 opcode);
--
2.3.7


2016-04-01 00:27:37

by Jaehoon Chung

[permalink] [raw]
Subject: Re: [PATCH v2 0/3] Cleanup setup_clock callback from dw_mmc

Hi,

On 03/31/2016 04:33 PM, Shawn Lin wrote:
> Hello Jeahoon
>
> Currently dw_mmc is a little too queen-size. As we had cleanup
> prepare_command callback some days before, there are also some
> ones deserve to remove. Also we should avoid add new quirks or
> callbacks into dw_mmc in order to avoid the dilemma sdhci meets
> now.
>
> This patchset remove setup_clock callback. Obviously, add a callback
> just for one-time-used clk stuff make no sense. We combine what
> setup_clock does before into init callback. For exynos platfrom, it
> needs call init hook after resume, so we add new argument in init hook
> to indicate whether it needs do clk stuff or not.

Thanks for resending these. This message looks like previous message..
Anyway, i will pick you patch with my patch..

Best Regards,
Jaehoon Chung

>
>
> Changes in v2:
> - rebase on linux-mmc next
> - remove add setup_clk flag for init callback
>
> Shawn Lin (3):
> mmc: dw_mmc-rockchip: remove setup_clock for rockchip
> mmc: dw_mmc-exynos: remove dw_mci_exynos_setup_clock
> mmc: dw_mmc: remove setup_clock callback
>
> drivers/mmc/host/dw_mmc-exynos.c | 8 --------
> drivers/mmc/host/dw_mmc-rockchip.c | 12 ++++--------
> drivers/mmc/host/dw_mmc.c | 9 ---------
> drivers/mmc/host/dw_mmc.h | 2 --
> 4 files changed, 4 insertions(+), 27 deletions(-)
>

2016-04-03 23:46:53

by Jaehoon Chung

[permalink] [raw]
Subject: Re: [PATCH v2 0/3] Cleanup setup_clock callback from dw_mmc

Hi,

Picked this patch-set on my repository.

Best Regards,
Jaehoon Chung

On 03/31/2016 04:33 PM, Shawn Lin wrote:
> Hello Jeahoon
>
> Currently dw_mmc is a little too queen-size. As we had cleanup
> prepare_command callback some days before, there are also some
> ones deserve to remove. Also we should avoid add new quirks or
> callbacks into dw_mmc in order to avoid the dilemma sdhci meets
> now.
>
> This patchset remove setup_clock callback. Obviously, add a callback
> just for one-time-used clk stuff make no sense. We combine what
> setup_clock does before into init callback. For exynos platfrom, it
> needs call init hook after resume, so we add new argument in init hook
> to indicate whether it needs do clk stuff or not.
>
>
> Changes in v2:
> - rebase on linux-mmc next
> - remove add setup_clk flag for init callback
>
> Shawn Lin (3):
> mmc: dw_mmc-rockchip: remove setup_clock for rockchip
> mmc: dw_mmc-exynos: remove dw_mci_exynos_setup_clock
> mmc: dw_mmc: remove setup_clock callback
>
> drivers/mmc/host/dw_mmc-exynos.c | 8 --------
> drivers/mmc/host/dw_mmc-rockchip.c | 12 ++++--------
> drivers/mmc/host/dw_mmc.c | 9 ---------
> drivers/mmc/host/dw_mmc.h | 2 --
> 4 files changed, 4 insertions(+), 27 deletions(-)
>