mmc: sdhci-msm: Addresses minor cleanups
Subsystems (3)
cover mmc: sdhci-msm: Addresses minor cleanups
Hi Ulf/Adrian,
I see that patch series at [1] was already taken by Ulf in next branch. So as requested by Ulf, please find the below two patch fixes/cleanup on top of next branch.
Patch 1:- Addresses comment from Adrian [2]
Patch 2:- Addresses comment from Stephen [3]
links
[1]:- https://lkml.org/lkml/2017/1/10/70
[2]:- https://lkml.org/lkml/2017/1/19/153
[3]:- https://lkml.org/lkml/2017/1/20/542
Ritesh Harjani (2):
mmc: sdhci-msm: Remove platform_execute_tuning from sdhci_msm_ops
mmc: sdhci-msm: Remove unnecessary comments of CDC init sequence
drivers/mmc/host/sdhci-msm.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
PATCH 1/2 mmc: sdhci-msm: Remove platform_execute_tuning from sdhci_msm_ops
platform_execute_tuning should not really exist as it does not do anything useful.
So remove this ops and directly plug sdhci_msm_execute_tuning with mmc_host_ops.
Also in case of HS400 tuning clear SDHCI_HS400_TUNING flag once HS400 related mode selection is done.
--- drivers/mmc/host/sdhci-msm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci-msm.c +4 -3
@@ -827,12 +827,12 @@ static int sdhci_msm_hs400_dll_calibration(struct sdhci_host *host)return ret; } -static int sdhci_msm_execute_tuning (struct sdhci_host *host,u32 opcode) +static int sdhci_msm_execute_tuning (struct mmc_host *mmc,u32 opcode) { +struct sdhci_host *host =mmc_priv (mmc);int tuning_seq_cnt =3 ;u8 phase, tuned_phases[16 ], tuned_phase_cnt =0 ;int rc; -struct mmc_host *mmc = host->mmc;struct mmc_ios ios = host->mmc->ios;struct sdhci_pltfm_host *pltfm_host =sdhci_priv (host);struct sdhci_msm_host *msm_host =sdhci_pltfm_priv (pltfm_host);
@@ -855,6 +855,7 @@ static int sdhci_msm_execute_tuning(struct sdhci_host *host, u32 opcode)if (host->flags &SDHCI_HS400_TUNING ) {sdhci_msm_hc_select_mode (host);msm_set_clock_rate_for_bus_mode (host, ios.clock); + host->flags &= ~SDHCI_HS400_TUNING ; } retry:
@@ -1119,7 +1120,6 @@ static void sdhci_msm_set_clock(struct sdhci_host *host, unsigned int clock)MODULE_DEVICE_TABLE (of, sdhci_msm_dt_match);static const struct sdhci_ops sdhci_msm_ops = { - .platform_execute_tuning = sdhci_msm_execute_tuning, .reset = sdhci_reset, .set_clock = sdhci_msm_set_clock, .get_min_clock = sdhci_msm_get_min_clock,
@@ -1294,6 +1294,7 @@ static int sdhci_msm_probe(struct platform_device *pdev) MSM_MMC_AUTOSUSPEND_DELAY_MS);pm_runtime_use_autosuspend (&pdev->dev); + host->mmc_host_ops.execute_tuning = sdhci_msm_execute_tuning; ret =sdhci_add_host (host);if (ret) goto pm_runtime_disable;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
PATCH 2/2 mmc: sdhci-msm: Remove unnecessary comments of CDC init sequence
In reply to Ritesh HarjaniThis removes CDC init sequence comments which are
not useful anyway.
--- drivers/mmc/host/sdhci-msm.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/mmc/host/sdhci-msm.c +1 -13
@@ -664,19 +664,7 @@ static int sdhci_msm_cdclp533_calibration(struct sdhci_host *host) config &= ~CORE_START_CDC_TRAFFIC ;writel_relaxed (config, host->ioaddr +CORE_DDR_200_CFG ); -/* -* Perform CDC Register Initialization Sequence -* -* CORE_CSR_CDC_CTLR_CFG0 0x11800EC -* CORE_CSR_CDC_CTLR_CFG1 0x3011111 -* CORE_CSR_CDC_CAL_TIMER_CFG0 0x1201000 -* CORE_CSR_CDC_CAL_TIMER_CFG1 0x4 -* CORE_CSR_CDC_REFCOUNT_CFG 0xCB732020 -* CORE_CSR_CDC_COARSE_CAL_CFG 0xB19 -* CORE_CSR_CDC_DELAY_CFG 0x3AC -* CORE_CDC_OFFSET_CFG 0x0 -* CORE_CDC_SLAVE_DDA_CFG 0x16334 -*/ +/* Perform CDC Register Initialization Sequence */ writel_relaxed (0x11800EC , host->ioaddr +CORE_CSR_CDC_CTLR_CFG0 );writel_relaxed (0x3011111 , host->ioaddr +CORE_CSR_CDC_CTLR_CFG1 );
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Re: [PATCHv1 1/2] mmc: sdhci-msm: Remove platform_execute_tuning from sdhci_msm_ops
In reply to Ritesh HarjaniQuoted 10 lines · Ritesh Harjani
platform_execute_tuningshould not really exist as it does not do anything useful.So remove this ops and directly plug
sdhci_msm_execute_tuningwithmmc_host_ops.Also in case of HS400 tuning clear
SDHCI_HS400_TUNINGflag once HS400 related mode selection is done.Signed-off-by Ritesh Harjani <[email protected]>
Quoted 48 lines
--- drivers/mmc/host/sdhci-msm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/mmc/host/sdhci-msm.c +4
-3@@ -827,12 +827,12 @@ static int sdhci_msm_hs400_dll_calibration(struct sdhci_host *host)return ret; } -static int sdhci_msm_execute_tuning (struct sdhci_host *host,u32 opcode) +static int sdhci_msm_execute_tuning (struct mmc_host *mmc,u32 opcode) { +struct sdhci_host *host =mmc_priv (mmc);int tuning_seq_cnt =3 ;u8 phase, tuned_phases[16 ], tuned_phase_cnt =0 ;int rc; -struct mmc_host *mmc = host->mmc;struct mmc_ios ios = host->mmc->ios;struct sdhci_pltfm_host *pltfm_host =sdhci_priv (host);struct sdhci_msm_host *msm_host =sdhci_pltfm_priv (pltfm_host);@@ -855,6 +855,7 @@ static int sdhci_msm_execute_tuning(struct sdhci_host *host, u32 opcode)if (host->flags &SDHCI_HS400_TUNING ) {sdhci_msm_hc_select_mode (host);msm_set_clock_rate_for_bus_mode (host, ios.clock); + host->flags &= ~SDHCI_HS400_TUNING ; } retry:@@ -1119,7 +1120,6 @@ static void sdhci_msm_set_clock(struct sdhci_host *host, unsigned int clock)MODULE_DEVICE_TABLE (of, sdhci_msm_dt_match);static const struct sdhci_ops sdhci_msm_ops = { - .platform_execute_tuning = sdhci_msm_execute_tuning, .reset = sdhci_reset, .set_clock = sdhci_msm_set_clock, .get_min_clock = sdhci_msm_get_min_clock,@@ -1294,6 +1294,7 @@ static int sdhci_msm_probe(struct platform_device *pdev) MSM_MMC_AUTOSUSPEND_DELAY_MS);pm_runtime_use_autosuspend (&pdev->dev); + host->mmc_host_ops.execute_tuning = sdhci_msm_execute_tuning; ret =sdhci_add_host (host);if (ret) goto pm_runtime_disable;
Re: [PATCHv1 2/2] mmc: sdhci-msm: Remove unnecessary comments of CDC init sequence
In reply to Ritesh HarjaniQuoted 4 lines · Ritesh Harjani
This removes CDC init sequence comments which are
not useful anyway.Signed-off-by Ritesh Harjani <[email protected]>
Quoted 30 lines
--- drivers/mmc/host/sdhci-msm.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)drivers/mmc/host/sdhci-msm.c +1
-13@@ -664,19 +664,7 @@ static int sdhci_msm_cdclp533_calibration(struct sdhci_host *host) config &= ~CORE_START_CDC_TRAFFIC ;writel_relaxed (config, host->ioaddr +CORE_DDR_200_CFG ); -/* -* Perform CDC Register Initialization Sequence -* -* CORE_CSR_CDC_CTLR_CFG0 0x11800EC -* CORE_CSR_CDC_CTLR_CFG1 0x3011111 -* CORE_CSR_CDC_CAL_TIMER_CFG0 0x1201000 -* CORE_CSR_CDC_CAL_TIMER_CFG1 0x4 -* CORE_CSR_CDC_REFCOUNT_CFG 0xCB732020 -* CORE_CSR_CDC_COARSE_CAL_CFG 0xB19 -* CORE_CSR_CDC_DELAY_CFG 0x3AC -* CORE_CDC_OFFSET_CFG 0x0 -* CORE_CDC_SLAVE_DDA_CFG 0x16334 -*/ +/* Perform CDC Register Initialization Sequence */ writel_relaxed (0x11800EC , host->ioaddr +CORE_CSR_CDC_CTLR_CFG0 );writel_relaxed (0x3011111 , host->ioaddr +CORE_CSR_CDC_CTLR_CFG1 );
Ulf Hansson
AppliedRe: [PATCHv1 1/2] mmc: sdhci-msm: Remove platform_execute_tuning from sdhci_msm_ops
In reply to Ritesh HarjaniQuoted 10 lines · Ritesh Harjani
platform_execute_tuningshould not really exist as it does not do anything useful.So remove this ops and directly plug
sdhci_msm_execute_tuningwithmmc_host_ops.Also in case of HS400 tuning clear
SDHCI_HS400_TUNINGflag once HS400 related mode selection is done.Signed-off-by Ritesh Harjani <[email protected]>
Thanks, applied for next!
Kind regards
Uffe
Quoted 51 lines
--- drivers/mmc/host/sdhci-msm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/mmc/host/sdhci-msm.c +4
-4@@ -827,12 +827,12 @@ static int sdhci_msm_hs400_dll_calibration(struct sdhci_host *host)return ret; } -static int sdhci_msm_execute_tuning (struct sdhci_host *host,u32 opcode) +static int sdhci_msm_execute_tuning (struct mmc_host *mmc,u32 opcode) { +struct sdhci_host *host =mmc_priv (mmc);int tuning_seq_cnt =3 ;u8 phase, tuned_phases[16 ], tuned_phase_cnt =0 ;int rc; -struct mmc_host *mmc = host->mmc;struct mmc_ios ios = host->mmc->ios;struct sdhci_pltfm_host *pltfm_host =sdhci_priv (host);struct sdhci_msm_host *msm_host =sdhci_pltfm_priv (pltfm_host);@@ -855,6 +855,7 @@ static int sdhci_msm_execute_tuning(struct sdhci_host *host, u32 opcode)if (host->flags &SDHCI_HS400_TUNING ) {sdhci_msm_hc_select_mode (host);msm_set_clock_rate_for_bus_mode (host, ios.clock); + host->flags &= ~SDHCI_HS400_TUNING ; } retry:@@ -1119,7 +1120,6 @@ static void sdhci_msm_set_clock(struct sdhci_host *host, unsigned int clock)MODULE_DEVICE_TABLE (of, sdhci_msm_dt_match);static const struct sdhci_ops sdhci_msm_ops = { - .platform_execute_tuning = sdhci_msm_execute_tuning, .reset = sdhci_reset, .set_clock = sdhci_msm_set_clock, .get_min_clock = sdhci_msm_get_min_clock,@@ -1294,6 +1294,7 @@ static int sdhci_msm_probe(struct platform_device *pdev) MSM_MMC_AUTOSUSPEND_DELAY_MS);pm_runtime_use_autosuspend (&pdev->dev); + host->mmc_host_ops.execute_tuning = sdhci_msm_execute_tuning; ret =sdhci_add_host (host);if (ret) goto pm_runtime_disable; --The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.
Ulf Hansson
AppliedRe: [PATCHv1 2/2] mmc: sdhci-msm: Remove unnecessary comments of CDC init sequence
In reply to Ritesh HarjaniQuoted 4 lines · Ritesh Harjani
This removes CDC init sequence comments which are
not useful anyway.Signed-off-by Ritesh Harjani <[email protected]>
Thanks, applied for next!
Kind regards
Uffe
Quoted 33 lines
--- drivers/mmc/host/sdhci-msm.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)drivers/mmc/host/sdhci-msm.c +1
-14@@ -664,19 +664,7 @@ static int sdhci_msm_cdclp533_calibration(struct sdhci_host *host) config &= ~CORE_START_CDC_TRAFFIC ;writel_relaxed (config, host->ioaddr +CORE_DDR_200_CFG ); -/* -* Perform CDC Register Initialization Sequence -* -* CORE_CSR_CDC_CTLR_CFG0 0x11800EC -* CORE_CSR_CDC_CTLR_CFG1 0x3011111 -* CORE_CSR_CDC_CAL_TIMER_CFG0 0x1201000 -* CORE_CSR_CDC_CAL_TIMER_CFG1 0x4 -* CORE_CSR_CDC_REFCOUNT_CFG 0xCB732020 -* CORE_CSR_CDC_COARSE_CAL_CFG 0xB19 -* CORE_CSR_CDC_DELAY_CFG 0x3AC -* CORE_CDC_OFFSET_CFG 0x0 -* CORE_CDC_SLAVE_DDA_CFG 0x16334 -*/ +/* Perform CDC Register Initialization Sequence */ writel_relaxed (0x11800EC , host->ioaddr +CORE_CSR_CDC_CTLR_CFG0 );writel_relaxed (0x3011111 , host->ioaddr +CORE_CSR_CDC_CTLR_CFG1 ); --The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.