Skip to contentSkip to conversation

dm: mmc: dwmmc: fix the minor things

PATCH New Jaehoon Chung 3 participants 9 messages Jun 28, 2016 – Jul 7, 2016 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

cover dm: mmc: dwmmc: fix the minor things

It's working on converting from legacy to DM.
It's also in progessing. There are some minor wrongs.
These patches are fixed wrong explanations and removing unnecessary defined.

These patchese are based on u-boot-dm. (blk-working branch)

Jaehoon Chung (2):
dm: mmc: dwmmc: fix the wrong explanation for clock values
dm: mmc: dwmmc: use the callback functions as static

 drivers/mmc/dw_mmc.c |  4 ++--
 include/dwmmc.h      | 11 ++++-------
 2 files changed, 6 insertions(+), 9 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 dm: mmc: dwmmc: fix the wrong explanation for clock values

This e,g is wrong. Maximum/minimum e.g values are swapped each other.

---
 include/dwmmc.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/dwmmc.h +4 -4
index 6aebe96..164d1dc 100644
@@ -256,8 +256,8 @@ static inline u8 dwmci_readb(struct dwmci_host *host, int reg)
  * @name:	Device name (normally dev->name)
  * @buswidth:	Bus width (in bits, such as 4 or 8)
  * @caps:	Host capabilities (MMC_MODE_...)
- * @max_clk:	Maximum supported clock speed in HZ (e.g. 400000)
- * @min_clk:	Minimum supported clock speed in HZ (e.g. 150000000)
+ * @max_clk:	Maximum supported clock speed in HZ (e.g. 150000000)
+ * @min_clk:	Minimum supported clock speed in HZ (e.g. 400000)
  */
 void dwmci_setup_cfg(struct mmc_config *cfg, const char *name, int buswidth,
 		     uint caps, u32 max_clk, u32 min_clk);
@@ -286,8 +286,8 @@ int dwmci_bind(struct udevice *dev, struct mmc *mmc, struct mmc_config *cfg);
  * This is used when you are not using CONFIG_BLK. Convert your driver over!
  *
  * @host:	DWMMC host structure
- * @max_clk:	Maximum supported clock speed in HZ (e.g. 400000)
- * @min_clk:	Minimum supported clock speed in HZ (e.g. 150000000)
+ * @max_clk:	Maximum supported clock speed in HZ (e.g. 150000000)
+ * @min_clk:	Minimum supported clock speed in HZ (e.g. 400000)
  * @return 0 if OK, -ve on error
  */
 int add_dwmci(struct dwmci_host *host, u32 max_clk, u32 min_clk);
Signature · 1 line
1.9.1
#3 lore raw

PATCH 2/2 dm: mmc: dwmmc: use the callback functions as static

In reply to Jaehoon Chung

There are no places to call these functions.
It should be used the callback function.
Then it can be used as static functions.

---
 drivers/mmc/dw_mmc.c | 4 ++--
 include/dwmmc.h      | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/mmc/dw_mmc.c +2 -2
index 3411f95..f83a6bc 100644
@@ -182,7 +182,7 @@ static int dwmci_set_transfer_mode(struct dwmci_host *host,
 }
 
 #ifdef CONFIG_DM_MMC_OPS
-int dwmci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
+static int dwmci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
 		   struct mmc_data *data)
 {
 	struct mmc *mmc = mmc_get_mmc_dev(dev);
@@ -381,7 +381,7 @@ static int dwmci_setup_bus(struct dwmci_host *host, u32 freq)
 }
 
 #ifdef CONFIG_DM_MMC_OPS
-int dwmci_set_ios(struct udevice *dev)
+static int dwmci_set_ios(struct udevice *dev)
 {
 	struct mmc *mmc = mmc_get_mmc_dev(dev);
 #else
include/dwmmc.h +0 -3
index 164d1dc..d18ec84 100644
@@ -295,9 +295,6 @@ int add_dwmci(struct dwmci_host *host, u32 max_clk, u32 min_clk);
 
 #ifdef CONFIG_DM_MMC_OPS
 /* Export the operations to drivers */
-int dwmci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
-		   struct mmc_data *data);
-int dwmci_set_ios(struct udevice *dev);
 int dwmci_probe(struct udevice *dev);
 extern const struct dm_mmc_ops dm_dwmci_ops;
 #endif
Signature · 1 line
1.9.1
#4 lore raw

PATCH 2/2 dm: mmc: dwmmc: use the callback functions as static

Hi Jaehoon,

Quoted 15 lines · Jaehoon Chung

There are no places to call these functions.
It should be used the callback function.
Then it can be used as static functions.

---
 drivers/mmc/dw_mmc.c | 4 ++--
 include/dwmmc.h      | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/mmc/dw_mmc.c +0 -0
index 3411f95..f83a6bc 100644

drivers/mmc/dw_mmc.c static int dwmci_set_transfer_mode(struct dwmci_host *host, · line 185

Quoted 4 lines
drivers/mmc/dw_mmc.c +0 -1
@@ -182,7 +182,7 @@ static int dwmci_set_transfer_mode(struct dwmci_host *host,
 }
 
 #ifdef CONFIG_DM_MMC_OPS
-int dwmci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,

From what I can see this is already static. Which commit are you basing off?

Quoted 28 lines
drivers/mmc/dw_mmc.c +2 -1
+static int dwmci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
                   struct mmc_data *data)
 {
        struct mmc *mmc = mmc_get_mmc_dev(dev);
@@ -381,7 +381,7 @@ static int dwmci_setup_bus(struct dwmci_host *host, u32 freq)
 }
 
 #ifdef CONFIG_DM_MMC_OPS
-int dwmci_set_ios(struct udevice *dev)
+static int dwmci_set_ios(struct udevice *dev)
 {
        struct mmc *mmc = mmc_get_mmc_dev(dev);
 #else
include/dwmmc.h +0 -4
index 164d1dc..d18ec84 100644
@@ -295,9 +295,6 @@ int add_dwmci(struct dwmci_host *host, u32 max_clk, u32 min_clk);
 
 #ifdef CONFIG_DM_MMC_OPS
 /* Export the operations to drivers */
-int dwmci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
-                  struct mmc_data *data);
-int dwmci_set_ios(struct udevice *dev);
 int dwmci_probe(struct udevice *dev);
 extern const struct dm_mmc_ops dm_dwmci_ops;
 #endif
--
Quoted 2 lines

1.9.1

Regards,
Simon

#5 lore raw

PATCH 2/2 dm: mmc: dwmmc: use the callback functions as static

Hi Simon,

Quoted 24 lines · Simon Glass

Hi Jaehoon,

Quoted 21 lines · Jaehoon Chung

There are no places to call these functions.
It should be used the callback function.
Then it can be used as static functions.

---
 drivers/mmc/dw_mmc.c | 4 ++--
 include/dwmmc.h      | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/mmc/dw_mmc.c +0 -1
index 3411f95..f83a6bc 100644
@@ -182,7 +182,7 @@ static int dwmci_set_transfer_mode(struct dwmci_host *host,
 }
 
 #ifdef CONFIG_DM_MMC_OPS
-int dwmci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
 

From what I can see this is already static. Which commit are you basing off?

I'm checking with your 'blk-working' branch. I'm not sure what's correct.

commit dee390a1250c17a4e71e359d6e461319a7cdea54

Author: Simon Glass <[email protected]>
Date:   Sat Jun 11 19:01:49 2016 -0600

dm: blk: Enable CONFIG_BLK if DM_MMC is enabled

If i need to work with other branch, let me know,plz. I have tested the DM with dw_mmc_exynos.c. (It's working fine.)

I will send the patch-set for exynos dwmmc and sdhci controller. So i need to know which repository and branch are correct. :)

Then it's helpful to me for working dm. I think that i can help you for checking on mmc side with DM.

Best Regards,
Jaehoon Chung

Quoted 37 lines
Quoted 29 lines
drivers/mmc/dw_mmc.c +2 -1
+static int dwmci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
                   struct mmc_data *data)
 {
        struct mmc *mmc = mmc_get_mmc_dev(dev);
@@ -381,7 +381,7 @@ static int dwmci_setup_bus(struct dwmci_host *host, u32 freq)
 }
 
 #ifdef CONFIG_DM_MMC_OPS
-int dwmci_set_ios(struct udevice *dev)
+static int dwmci_set_ios(struct udevice *dev)
 {
        struct mmc *mmc = mmc_get_mmc_dev(dev);
 #else
include/dwmmc.h +0 -4
index 164d1dc..d18ec84 100644
@@ -295,9 +295,6 @@ int add_dwmci(struct dwmci_host *host, u32 max_clk, u32 min_clk);
 
 #ifdef CONFIG_DM_MMC_OPS
 /* Export the operations to drivers */
-int dwmci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
-                  struct mmc_data *data);
-int dwmci_set_ios(struct udevice *dev);
 int dwmci_probe(struct udevice *dev);
 extern const struct dm_mmc_ops dm_dwmci_ops;
 #endif
--
Quoted 2 lines

1.9.1

Regards,
Simon

#6 lore raw

PATCH 2/2 dm: mmc: dwmmc: use the callback functions as static

Hi Jaehoon,

Quoted 36 lines · Jaehoon Chung

Hi Simon,

Quoted 24 lines · Simon Glass

Hi Jaehoon,

Quoted 21 lines · Jaehoon Chung

There are no places to call these functions.
It should be used the callback function.
Then it can be used as static functions.

---
 drivers/mmc/dw_mmc.c | 4 ++--
 include/dwmmc.h      | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/mmc/dw_mmc.c +0 -1
index 3411f95..f83a6bc 100644
@@ -182,7 +182,7 @@ static int dwmci_set_transfer_mode(struct dwmci_host *host,
 }
 
 #ifdef CONFIG_DM_MMC_OPS
-int dwmci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
 

From what I can see this is already static. Which commit are you basing off?

I'm checking with your 'blk-working' branch. I'm not sure what's correct.

commit dee390a1250c17a4e71e359d6e461319a7cdea54

Author: Simon Glass <[email protected]>
Date:   Sat Jun 11 19:01:49 2016 -0600

dm: blk: Enable CONFIG_BLK if DM_MMC is enabled

Quoted 7 lines

If i need to work with other branch, let me know,plz. I have tested the DM with dw_mmc_exynos.c. (It's working fine.)

I will send the patch-set for exynos dwmmc and sdhci controller. So i need to know which repository and branch are correct. :)

Then it's helpful to me for working dm. I think that i can help you for checking on mmc side with DM.

OK I see, thanks.

[snip

Regards,
Simon

#7 lore raw

PATCH 2/2 dm: mmc: dwmmc: use the callback functions as static

Hi,

Quoted 42 lines · Simon Glass

Hi Jaehoon,

Quoted 39 lines · Jaehoon Chung

Hi Simon,

Quoted 24 lines · Simon Glass

Hi Jaehoon,

Quoted 21 lines · Jaehoon Chung

There are no places to call these functions.
It should be used the callback function.
Then it can be used as static functions.

---
 drivers/mmc/dw_mmc.c | 4 ++--
 include/dwmmc.h      | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/mmc/dw_mmc.c +0 -1
index 3411f95..f83a6bc 100644
@@ -182,7 +182,7 @@ static int dwmci_set_transfer_mode(struct dwmci_host *host,
 }
 
 #ifdef CONFIG_DM_MMC_OPS
-int dwmci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
 

From what I can see this is already static. Which commit are you basing off?

I'm checking with your 'blk-working' branch. I'm not sure what's correct.

commit dee390a1250c17a4e71e359d6e461319a7cdea54

Author: Simon Glass <[email protected]>
Date:   Sat Jun 11 19:01:49 2016 -0600

dm: blk: Enable CONFIG_BLK if DM_MMC is enabled

If i need to work with other branch, let me know,plz. I have tested the DM with dw_mmc_exynos.c. (It's working fine.)

Quoted 9 lines
Quoted 4 lines

I will send the patch-set for exynos dwmmc and sdhci controller. So i need to know which repository and branch are correct. :)

Then it's helpful to me for working dm. I think that i can help you for checking on mmc side with DM.

OK I see, thanks.

This patch has been delegated to me, but cannot apply to u-boot-samsung. should go to dm tree?

Thanks,
Minkyu Kang.

#8 lore raw

PATCH 2/2 dm: mmc: dwmmc: use the callback functions as static

Hi Minkyu,

Quoted 50 lines · Minkyu Kang

Hi,

Quoted 47 lines · Simon Glass

Hi Jaehoon,

Quoted 43 lines · Jaehoon Chung

Hi Simon,

Quoted 24 lines · Simon Glass

Hi Jaehoon,

Quoted 21 lines · Jaehoon Chung

There are no places to call these functions.
It should be used the callback function.
Then it can be used as static functions.

---
 drivers/mmc/dw_mmc.c | 4 ++--
 include/dwmmc.h      | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
drivers/mmc/dw_mmc.c +0 -1
index 3411f95..f83a6bc 100644
@@ -182,7 +182,7 @@ static int dwmci_set_transfer_mode(struct dwmci_host *host,
 }
 
 #ifdef CONFIG_DM_MMC_OPS
-int dwmci_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
 

From what I can see this is already static. Which commit are you basing off?

I'm checking with your 'blk-working' branch. I'm not sure what's correct.

commit dee390a1250c17a4e71e359d6e461319a7cdea54

Author: Simon Glass <[email protected]>
Date:   Sat Jun 11 19:01:49 2016 -0600

dm: blk: Enable CONFIG_BLK if DM_MMC is enabled

If i need to work with other branch, let me know,plz. I have tested the DM with dw_mmc_exynos.c. (It's working fine.)

I will send the patch-set for exynos dwmmc and sdhci controller. So i need to know which repository and branch are correct. :)

Then it's helpful to me for working dm. I think that i can help you for checking on mmc side with DM.

Quoted 7 lines
Quoted 4 lines

OK I see, thanks.

This patch has been delegated to me, but cannot apply to u-boot-samsung. should go to dm tree?

Yes, it depends on dm/next. I'll assign those to patches to myself.

Regards,
Simon