lkml.org 
[lkml]   [2018]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 6/6] mmc: mediatek: drop too much code of tuning method
From
Date


On 13/10/2018 09:20, Chaotian Jing wrote:
> the tuning code is becoming more and more bloated, let's make the
> set cmd/data delay to inline function to avoid too much redundant code.
>
> Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
> ---
> drivers/mmc/host/mtk-sd.c | 133 +++++++++++++---------------------------------
> 1 file changed, 38 insertions(+), 95 deletions(-)
>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
[...]> @@ -1923,17 +1898,8 @@ static int msdc_tune_together(struct mmc_host
*mmc, u32 opcode)
> sdr_clr_bits(host->base + MSDC_IOCON,
> MSDC_IOCON_DSPL | MSDC_IOCON_W_DSPL);
> for (i = 0 ; i < PAD_DELAY_MAX; i++) {
> - if (host->top_base) {
> - sdr_set_field(host->top_base + EMMC_TOP_CMD,
> - PAD_CMD_RXDLY, i);
> - sdr_set_field(host->top_base + EMMC_TOP_CONTROL,
> - PAD_DAT_RD_RXDLY, i);
> - } else {
> - sdr_set_field(host->base + tune_reg,
> - MSDC_PAD_TUNE_CMDRDLY, i);
> - sdr_set_field(host->base + tune_reg,
> - MSDC_PAD_TUNE_DATRRDLY, i);
> - }
> + msdc_set_cmd_delay(host, i);
> + msdc_set_data_delay(host, i);

Put the clean-up before introducing msdc_tune_together, that makes the series
much easier to read.

Thanks,
Matthias

\
 
 \ /
  Last update: 2018-10-19 10:55    [W:0.017 / U:3.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site