ARM: mmc: davinci: Small fixes on host davinci driver
RFC PATCH 2/3 ARM: mmc: davinci: Remove cast to the same type
In reply to Michael Trimarchi--- drivers/mmc/host/davinci_mmc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/mmc/host/davinci_mmc.c +4 -6
@@ -212,7 +212,7 @@ struct mmc_davinci_host {bool active_request;/* For PIO we walk scatterlists one segment at a time. */ -unsigned int sg_len; +unsigned int sg_len;struct scatterlist *sg;/* Version of the MMC/SD controller */
@@ -660,13 +660,11 @@ static unsigned int calculate_freq_for_card(struct mmc_davinci_host *host, mmc_pclk = host->mmc_input_clk;if (mmc_req_freq && mmc_pclk > (2 * mmc_req_freq)) - mmc_push_pull_divisor = ((unsigned int )mmc_pclk - / (2 * mmc_req_freq)) -1 ; + mmc_push_pull_divisor = (mmc_pclk / (2 * mmc_req_freq)) -1 ;else mmc_push_pull_divisor =0 ; - mmc_freq = (unsigned int )mmc_pclk - / (2 * (mmc_push_pull_divisor +1 )); + mmc_freq = mmc_pclk / (2 * (mmc_push_pull_divisor +1 ));if (mmc_freq > mmc_req_freq) mmc_push_pull_divisor = mmc_push_pull_divisor +1 ;
@@ -693,7 +691,7 @@ static void calculate_clk_divider(struct mmc_host *mmc, struct mmc_ios *ios)/* Ignoring the init clock value passed for fixing the inter * operability with different cards. */ - open_drain_freq = ((unsigned int )host->mmc_input_clk + open_drain_freq = (host->mmc_input_clk / (2 *MMCSD_INIT_CLOCK )) -1 ;if (open_drain_freq >0xFF )
Signature · 1 line
1.8.1.2
RFC PATCH 3/3 ARM: mmc: davinci: clock rate is an unsigned long
In reply to Michael Trimarchi--- drivers/mmc/host/davinci_mmc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/mmc/host/davinci_mmc.c +5 -4
@@ -183,7 +183,7 @@ struct mmc_davinci_host {struct mmc_data *data;struct mmc_host *mmc;struct clk *clk; -unsigned int mmc_input_clk; +unsigned long mmc_input_clk;void __iomem *base;struct resource *mem_res;int mmc_irq, sdio_irq;
@@ -654,9 +654,10 @@ static void mmc_davinci_request(struct mmc_host *mmc, struct mmc_request *req) }static unsigned int calculate_freq_for_card (struct mmc_davinci_host *host, -unsigned int mmc_req_freq) +unsigned long mmc_req_freq) { -unsigned int mmc_freq =0 , mmc_pclk =0 , mmc_push_pull_divisor =0 ; +unsigned long mmc_freq =0 , mmc_pclk =0 ; +unsigned int mmc_push_pull_divisor =0 ; mmc_pclk = host->mmc_input_clk;if (mmc_req_freq && mmc_pclk > (2 * mmc_req_freq))
@@ -1105,7 +1106,7 @@ static int mmc_davinci_cpufreq_transition(struct notifier_block *nb, unsigned long val, void *data) { struct mmc_davinci_host *host; -unsigned int mmc_pclk; +unsigned long mmc_pclk;struct mmc_host *mmc;unsigned long flags;
Signature · 1 line
1.8.1.2
cover ARM: mmc: davinci: Small fixes on host davinci driver
Hi all,
I had the omapl138 board for one day.
Looking at the code I have noticed that opendrain mmc configuration is buggy. I don't have the possibility to test but it should be correct to use host clock variable information. The other two patches are small style cleanup
Michael Trimarchi (3):
ARM: mmc: davinci: remove unused variable mmc_pclk and fix opendrain
clock calculation
ARM: mmc: davinci: Remove cast to the same type
ARM: mmc: davinci: clock rate is an unsigned long
drivers/mmc/host/davinci_mmc.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-)
Signature · 1 line
1.8.1.2
RFC PATCH 1/3 ARM: mmc: davinci: remove unused variable mmc_pclk and fix opendrain clock calculation
--- drivers/mmc/host/davinci_mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/davinci_mmc.c +2 -2
@@ -683,7 +683,7 @@ static unsigned int calculate_freq_for_card(struct mmc_davinci_host *host,static void calculate_clk_divider (struct mmc_host *mmc,struct mmc_ios *ios) { -unsigned int open_drain_freq =0 , mmc_pclk =0 ; +unsigned int open_drain_freq =0 ;unsigned int mmc_push_pull_freq =0 ;struct mmc_davinci_host *host =mmc_priv (mmc);
@@ -693,7 +693,7 @@ static void calculate_clk_divider(struct mmc_host *mmc, struct mmc_ios *ios)/* Ignoring the init clock value passed for fixing the inter * operability with different cards. */ - open_drain_freq = ((unsigned int )mmc_pclk + open_drain_freq = ((unsigned int )host->mmc_input_clk / (2 *MMCSD_INIT_CLOCK )) -1 ;if (open_drain_freq >0xFF )
Signature · 1 line
1.8.1.2