devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/3] mmc: fixed the mmc_of_parse for dwmmc
@ 2014-05-26 11:35 Jaehoon Chung
  2014-05-26 11:35 ` [PATCHv2 1/3] mmc: host: add slot argument to mmc_of_parse Jaehoon Chung
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Jaehoon Chung @ 2014-05-26 11:35 UTC (permalink / raw)
  To: linux-mmc
  Cc: chris, ulf.hansson, ludovic.desroches, tgih.jun, devicetree,
	linux-samsung-soc, Jaehoon Chung

This patch-set is fixed the dw-mmc controller problem.
dw-mmc controller have the slot, but mmc_of_parse didn't parse the slot sub-node.
So dw-mmc controller didn't work correctly.

Jaehoon Chung (2):
  mmc: dw_mmc: use the __mmc_of_parse to parse the slot node
  ARM: dts: replace the broken-cd property into slot node for dwmmc.

Ludovic Desroches (1):
  mmc: host: add slot argument to mmc_of_parse

 arch/arm/boot/dts/exynos4412-odroidx.dts      |    2 +-
 arch/arm/boot/dts/exynos4412-origen.dts       |    2 +-
 arch/arm/boot/dts/exynos4412-trats2.dts       |    4 ++--
 arch/arm/boot/dts/exynos5250-arndale.dts      |    2 +-
 arch/arm/boot/dts/exynos5250-cros-common.dtsi |    4 ++--
 arch/arm/boot/dts/exynos5250-smdk5250.dts     |    2 +-
 arch/arm/boot/dts/exynos5420-arndale-octa.dts |    2 +-
 arch/arm/boot/dts/rk3066a-bqcurie2.dts        |    2 +-
 arch/arm/boot/dts/socfpga_arria5.dtsi         |    2 +-
 arch/arm/boot/dts/socfpga_cyclone5.dtsi       |    2 +-
 arch/arm/boot/dts/socfpga_vt.dts              |    2 +-
 drivers/mmc/core/host.c                       |   13 +++++++++----
 drivers/mmc/host/dw_mmc.c                     |   25 ++++++-------------------
 include/linux/mmc/host.h                      |   10 +++++++++-
 14 files changed, 37 insertions(+), 37 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCHv2 1/3] mmc: host: add slot argument to mmc_of_parse
  2014-05-26 11:35 [PATCHv2 0/3] mmc: fixed the mmc_of_parse for dwmmc Jaehoon Chung
@ 2014-05-26 11:35 ` Jaehoon Chung
  2014-05-26 14:37   ` Ulf Hansson
  2014-05-27  9:48   ` Seungwon Jeon
  2014-05-26 11:35 ` [PATCHv2 2/3] mmc: dw_mmc: use the __mmc_of_parse to parse the slot node Jaehoon Chung
  2014-05-26 11:35 ` [PATCHv2 3/3] ARM: dts: replace the broken-cd property into slot node for dwmmc Jaehoon Chung
  2 siblings, 2 replies; 11+ messages in thread
From: Jaehoon Chung @ 2014-05-26 11:35 UTC (permalink / raw)
  To: linux-mmc
  Cc: chris, ulf.hansson, ludovic.desroches, tgih.jun, devicetree,
	linux-samsung-soc, Jaehoon Chung

From: Ludovic Desroches <ludovic.desroches@atmel.com>

Some hosts manage several slots. In these case information such as the
bus width, chip detect and others are into the slot node. So we have to
parse child node. If not NULL, slot node will be used instead of the
device node.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
Changelog V2:
	- Fix the typo.

 drivers/mmc/core/host.c  |   13 +++++++++----
 include/linux/mmc/host.h |   10 +++++++++-
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 95cceae..0f677b3 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -298,15 +298,17 @@ static inline void mmc_host_clk_sysfs_init(struct mmc_host *host)
 #endif
 
 /**
- *	mmc_of_parse() - parse host's device-tree node
+ *	__mmc_of_parse() - parse host's device-tree node
  *	@host: host whose node should be parsed.
+ *	@slot : some device provide several slots so the node to parse
+ *		is not the host one.
  *
  * To keep the rest of the MMC subsystem unaware of whether DT has been
  * used to to instantiate and configure this host instance or not, we
  * parse the properties and set respective generic mmc-host flags and
  * parameters.
  */
-int mmc_of_parse(struct mmc_host *host)
+int __mmc_of_parse(struct mmc_host *host, struct device_node *slot)
 {
 	struct device_node *np;
 	u32 bus_width;
@@ -317,7 +319,10 @@ int mmc_of_parse(struct mmc_host *host)
 	if (!host->parent || !host->parent->of_node)
 		return 0;
 
-	np = host->parent->of_node;
+	if (slot)
+		np = slot;
+	else
+		np = host->parent->of_node;
 
 	/* "bus-width" is translated to MMC_CAP_*_BIT_DATA flags */
 	if (of_property_read_u32(np, "bus-width", &bus_width) < 0) {
@@ -459,7 +464,7 @@ out:
 	return ret;
 }
 
-EXPORT_SYMBOL(mmc_of_parse);
+EXPORT_SYMBOL(__mmc_of_parse);
 
 /**
  *	mmc_alloc_host - initialise the per-host structure.
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 7960424..c62af91 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -372,7 +372,15 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *);
 int mmc_add_host(struct mmc_host *);
 void mmc_remove_host(struct mmc_host *);
 void mmc_free_host(struct mmc_host *);
-int mmc_of_parse(struct mmc_host *host);
+int __mmc_of_parse(struct mmc_host *host, struct device_node *slot);
+/*
+ * mmc_of_parse - parse host's device-tree node
+ *	@host: host whose node should be parsed.
+ */
+static inline int mmc_of_parse(struct mmc_host *host)
+{
+	return __mmc_of_parse(host, NULL);
+}
 
 static inline void *mmc_priv(struct mmc_host *host)
 {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCHv2 2/3] mmc: dw_mmc: use the __mmc_of_parse to parse the slot node
  2014-05-26 11:35 [PATCHv2 0/3] mmc: fixed the mmc_of_parse for dwmmc Jaehoon Chung
  2014-05-26 11:35 ` [PATCHv2 1/3] mmc: host: add slot argument to mmc_of_parse Jaehoon Chung
@ 2014-05-26 11:35 ` Jaehoon Chung
  2014-05-27  9:49   ` Seungwon Jeon
  2014-05-26 11:35 ` [PATCHv2 3/3] ARM: dts: replace the broken-cd property into slot node for dwmmc Jaehoon Chung
  2 siblings, 1 reply; 11+ messages in thread
From: Jaehoon Chung @ 2014-05-26 11:35 UTC (permalink / raw)
  To: linux-mmc
  Cc: chris, ulf.hansson, ludovic.desroches, tgih.jun, devicetree,
	linux-samsung-soc, Jaehoon Chung

dw-mmc controller have the multiple slot.
Then it needs to parse the property for each slot.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
Changelog V2:
	- None

 drivers/mmc/host/dw_mmc.c |   25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 1ac227c..d4800f8 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1015,12 +1015,11 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
 {
 	int present;
 	struct dw_mci_slot *slot = mmc_priv(mmc);
-	struct dw_mci_board *brd = slot->host->pdata;
 	struct dw_mci *host = slot->host;
 	int gpio_cd = mmc_gpio_get_cd(mmc);
 
 	/* Use platform get_cd function, else try onboard card detect */
-	if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
+	if (slot->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
 		present = 1;
 	else if (!IS_ERR_VALUE(gpio_cd))
 		present = gpio_cd;
@@ -2010,6 +2009,9 @@ static struct dw_mci_of_slot_quirks {
 	{
 		.quirk	= "disable-wp",
 		.id	= DW_MCI_SLOT_QUIRK_NO_WRITE_PROTECT,
+	}, {
+		.quirk	= "broken-cd",
+		.id	= DW_MCI_QUIRK_BROKEN_CARD_DETECTION,
 	},
 };
 
@@ -2088,7 +2090,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 	if (host->pdata->caps2)
 		mmc->caps2 = host->pdata->caps2;
 
-	mmc_of_parse(mmc);
+	__mmc_of_parse(mmc, dw_mci_of_find_slot_node(host->dev, slot->id));
 
 	if (host->pdata->blk_settings) {
 		mmc->max_segs = host->pdata->blk_settings->max_segs;
@@ -2231,23 +2233,13 @@ static inline bool dw_mci_ctrl_all_reset(struct dw_mci *host)
 }
 
 #ifdef CONFIG_OF
-static struct dw_mci_of_quirks {
-	char *quirk;
-	int id;
-} of_quirks[] = {
-	{
-		.quirk	= "broken-cd",
-		.id	= DW_MCI_QUIRK_BROKEN_CARD_DETECTION,
-	},
-};
-
 static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
 {
 	struct dw_mci_board *pdata;
 	struct device *dev = host->dev;
 	struct device_node *np = dev->of_node;
 	const struct dw_mci_drv_data *drv_data = host->drv_data;
-	int idx, ret;
+	int ret;
 	u32 clock_frequency;
 
 	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
@@ -2264,11 +2256,6 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
 		pdata->num_slots = 1;
 	}
 
-	/* get quirks */
-	for (idx = 0; idx < ARRAY_SIZE(of_quirks); idx++)
-		if (of_get_property(np, of_quirks[idx].quirk, NULL))
-			pdata->quirks |= of_quirks[idx].id;
-
 	if (of_property_read_u32(np, "fifo-depth", &pdata->fifo_depth))
 		dev_info(dev, "fifo-depth property not found, using "
 				"value of FIFOTH register as default\n");
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCHv2 3/3] ARM: dts: replace the broken-cd property into slot node for dwmmc.
  2014-05-26 11:35 [PATCHv2 0/3] mmc: fixed the mmc_of_parse for dwmmc Jaehoon Chung
  2014-05-26 11:35 ` [PATCHv2 1/3] mmc: host: add slot argument to mmc_of_parse Jaehoon Chung
  2014-05-26 11:35 ` [PATCHv2 2/3] mmc: dw_mmc: use the __mmc_of_parse to parse the slot node Jaehoon Chung
@ 2014-05-26 11:35 ` Jaehoon Chung
  2014-05-27  9:49   ` Seungwon Jeon
  2 siblings, 1 reply; 11+ messages in thread
From: Jaehoon Chung @ 2014-05-26 11:35 UTC (permalink / raw)
  To: linux-mmc
  Cc: chris, ulf.hansson, ludovic.desroches, tgih.jun, devicetree,
	linux-samsung-soc, Jaehoon Chung

dw-mmc controller can be support the multiple slot.
So each slot's property can be difference.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
Changelog V2:
	- None

 arch/arm/boot/dts/exynos4412-odroidx.dts      |    2 +-
 arch/arm/boot/dts/exynos4412-origen.dts       |    2 +-
 arch/arm/boot/dts/exynos4412-trats2.dts       |    4 ++--
 arch/arm/boot/dts/exynos5250-arndale.dts      |    2 +-
 arch/arm/boot/dts/exynos5250-cros-common.dtsi |    4 ++--
 arch/arm/boot/dts/exynos5250-smdk5250.dts     |    2 +-
 arch/arm/boot/dts/exynos5420-arndale-octa.dts |    2 +-
 arch/arm/boot/dts/rk3066a-bqcurie2.dts        |    2 +-
 arch/arm/boot/dts/socfpga_arria5.dtsi         |    2 +-
 arch/arm/boot/dts/socfpga_cyclone5.dtsi       |    2 +-
 arch/arm/boot/dts/socfpga_vt.dts              |    2 +-
 11 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4412-odroidx.dts b/arch/arm/boot/dts/exynos4412-odroidx.dts
index 31db28a..24ec351 100644
--- a/arch/arm/boot/dts/exynos4412-odroidx.dts
+++ b/arch/arm/boot/dts/exynos4412-odroidx.dts
@@ -46,7 +46,6 @@
 
 		num-slots = <1>;
 		supports-highspeed;
-		broken-cd;
 		card-detect-delay = <200>;
 		samsung,dw-mshc-ciu-div = <3>;
 		samsung,dw-mshc-sdr-timing = <2 3>;
@@ -55,6 +54,7 @@
 		slot@0 {
 			reg = <0>;
 			bus-width = <8>;
+			broken-cd;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/exynos4412-origen.dts b/arch/arm/boot/dts/exynos4412-origen.dts
index e2c0dca..ed712a6 100644
--- a/arch/arm/boot/dts/exynos4412-origen.dts
+++ b/arch/arm/boot/dts/exynos4412-origen.dts
@@ -129,7 +129,6 @@
 
 		num-slots = <1>;
 		supports-highspeed;
-		broken-cd;
 		card-detect-delay = <200>;
 		samsung,dw-mshc-ciu-div = <3>;
 		samsung,dw-mshc-sdr-timing = <2 3>;
@@ -138,6 +137,7 @@
 		slot@0 {
 			reg = <0>;
 			bus-width = <8>;
+			broken-cd;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index 73be464..37c3cb3 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -460,8 +460,6 @@
 	mmc@12550000 {
 		num-slots = <1>;
 		supports-highspeed;
-		broken-cd;
-		non-removable;
 		card-detect-delay = <200>;
 		vmmc-supply = <&vemmc_reg>;
 		clock-frequency = <400000000>;
@@ -475,6 +473,8 @@
 		slot@0 {
 			reg = <0>;
 			bus-width = <8>;
+			non-removable;
+			broken-cd;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/exynos5250-arndale.dts b/arch/arm/boot/dts/exynos5250-arndale.dts
index 090f983..0c9a7da 100644
--- a/arch/arm/boot/dts/exynos5250-arndale.dts
+++ b/arch/arm/boot/dts/exynos5250-arndale.dts
@@ -400,7 +400,6 @@
 		status = "okay";
 		num-slots = <1>;
 		supports-highspeed;
-		broken-cd;
 		card-detect-delay = <200>;
 		samsung,dw-mshc-ciu-div = <3>;
 		samsung,dw-mshc-sdr-timing = <2 3>;
@@ -412,6 +411,7 @@
 		slot@0 {
 			reg = <0>;
 			bus-width = <8>;
+			broken-cd;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/exynos5250-cros-common.dtsi b/arch/arm/boot/dts/exynos5250-cros-common.dtsi
index 2c1560d..7ab3b94 100644
--- a/arch/arm/boot/dts/exynos5250-cros-common.dtsi
+++ b/arch/arm/boot/dts/exynos5250-cros-common.dtsi
@@ -249,7 +249,6 @@
 	mmc@12200000 {
 		num-slots = <1>;
 		supports-highspeed;
-		broken-cd;
 		card-detect-delay = <200>;
 		samsung,dw-mshc-ciu-div = <3>;
 		samsung,dw-mshc-sdr-timing = <2 3>;
@@ -260,6 +259,7 @@
 		slot@0 {
 			reg = <0>;
 			bus-width = <8>;
+			broken-cd;
 		};
 	};
 
@@ -283,7 +283,6 @@
 	mmc@12230000 {
 		num-slots = <1>;
 		supports-highspeed;
-		broken-cd;
 		card-detect-delay = <200>;
 		samsung,dw-mshc-ciu-div = <3>;
 		samsung,dw-mshc-sdr-timing = <2 3>;
@@ -293,6 +292,7 @@
 		slot@0 {
 			reg = <0>;
 			bus-width = <4>;
+			broken-cd;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts
index a794a70..feffe24 100644
--- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
@@ -283,7 +283,6 @@
 		status = "okay";
 		num-slots = <1>;
 		supports-highspeed;
-		broken-cd;
 		card-detect-delay = <200>;
 		samsung,dw-mshc-ciu-div = <3>;
 		samsung,dw-mshc-sdr-timing = <2 3>;
@@ -294,6 +293,7 @@
 		slot@0 {
 			reg = <0>;
 			bus-width = <8>;
+			broken-cd;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/exynos5420-arndale-octa.dts b/arch/arm/boot/dts/exynos5420-arndale-octa.dts
index 80a3bf4..0d3b467 100644
--- a/arch/arm/boot/dts/exynos5420-arndale-octa.dts
+++ b/arch/arm/boot/dts/exynos5420-arndale-octa.dts
@@ -39,7 +39,6 @@
 
 	mmc@12200000 {
 		status = "okay";
-		broken-cd;
 		supports-highspeed;
 		card-detect-delay = <200>;
 		samsung,dw-mshc-ciu-div = <3>;
@@ -52,6 +51,7 @@
 		slot@0 {
 			reg = <0>;
 			bus-width = <8>;
+			broken-cd;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/rk3066a-bqcurie2.dts b/arch/arm/boot/dts/rk3066a-bqcurie2.dts
index 035df40..62c7484 100644
--- a/arch/arm/boot/dts/rk3066a-bqcurie2.dts
+++ b/arch/arm/boot/dts/rk3066a-bqcurie2.dts
@@ -69,7 +69,6 @@
 		dwmmc@10218000 { /* wifi */
 			num-slots = <1>;
 			status = "okay";
-			non-removable;
 
 			pinctrl-names = "default";
 			pinctrl-0 = <&sd1_clk &sd1_cmd &sd1_bus4>;
@@ -78,6 +77,7 @@
 				reg = <0>;
 				bus-width = <4>;
 				disable-wp;
+				non-removable;
 			};
 		};
 
diff --git a/arch/arm/boot/dts/socfpga_arria5.dtsi b/arch/arm/boot/dts/socfpga_arria5.dtsi
index 6c87b70..9c2b933 100644
--- a/arch/arm/boot/dts/socfpga_arria5.dtsi
+++ b/arch/arm/boot/dts/socfpga_arria5.dtsi
@@ -30,11 +30,11 @@
 		dwmmc0@ff704000 {
 			num-slots = <1>;
 			supports-highspeed;
-			broken-cd;
 
 			slot@0 {
 				reg = <0>;
 				bus-width = <4>;
+				broken-cd;
 			};
 		};
 
diff --git a/arch/arm/boot/dts/socfpga_cyclone5.dtsi b/arch/arm/boot/dts/socfpga_cyclone5.dtsi
index ca41b0e..c5c7b5f 100644
--- a/arch/arm/boot/dts/socfpga_cyclone5.dtsi
+++ b/arch/arm/boot/dts/socfpga_cyclone5.dtsi
@@ -31,11 +31,11 @@
 		dwmmc0@ff704000 {
 			num-slots = <1>;
 			supports-highspeed;
-			broken-cd;
 
 			slot@0 {
 				reg = <0>;
 				bus-width = <4>;
+				broken-cd;
 			};
 		};
 
diff --git a/arch/arm/boot/dts/socfpga_vt.dts b/arch/arm/boot/dts/socfpga_vt.dts
index 87d6f75..ff1111e 100644
--- a/arch/arm/boot/dts/socfpga_vt.dts
+++ b/arch/arm/boot/dts/socfpga_vt.dts
@@ -44,11 +44,11 @@
 		dwmmc0@ff704000 {
 			num-slots = <1>;
 			supports-highspeed;
-			broken-cd;
 
 			slot@0 {
 				reg = <0>;
 				bus-width = <4>;
+				broken-cd;
 			};
 		};
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCHv2 1/3] mmc: host: add slot argument to mmc_of_parse
  2014-05-26 11:35 ` [PATCHv2 1/3] mmc: host: add slot argument to mmc_of_parse Jaehoon Chung
@ 2014-05-26 14:37   ` Ulf Hansson
  2014-05-27  9:48   ` Seungwon Jeon
  1 sibling, 0 replies; 11+ messages in thread
From: Ulf Hansson @ 2014-05-26 14:37 UTC (permalink / raw)
  To: Jaehoon Chung
  Cc: linux-mmc, Chris Ball, Ludovic Desroches, tgih.jun@samsung.com,
	devicetree@vger.kernel.org, linux-samsung-soc

On 26 May 2014 13:35, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
>
> Some hosts manage several slots. In these case information such as the
> bus width, chip detect and others are into the slot node. So we have to
> parse child node. If not NULL, slot node will be used instead of the
> device node.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>

Thanks Jaehoon/Ludovic,

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

> ---
> Changelog V2:
>         - Fix the typo.
>
>  drivers/mmc/core/host.c  |   13 +++++++++----
>  include/linux/mmc/host.h |   10 +++++++++-
>  2 files changed, 18 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index 95cceae..0f677b3 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -298,15 +298,17 @@ static inline void mmc_host_clk_sysfs_init(struct mmc_host *host)
>  #endif
>
>  /**
> - *     mmc_of_parse() - parse host's device-tree node
> + *     __mmc_of_parse() - parse host's device-tree node
>   *     @host: host whose node should be parsed.
> + *     @slot : some device provide several slots so the node to parse
> + *             is not the host one.
>   *
>   * To keep the rest of the MMC subsystem unaware of whether DT has been
>   * used to to instantiate and configure this host instance or not, we
>   * parse the properties and set respective generic mmc-host flags and
>   * parameters.
>   */
> -int mmc_of_parse(struct mmc_host *host)
> +int __mmc_of_parse(struct mmc_host *host, struct device_node *slot)
>  {
>         struct device_node *np;
>         u32 bus_width;
> @@ -317,7 +319,10 @@ int mmc_of_parse(struct mmc_host *host)
>         if (!host->parent || !host->parent->of_node)
>                 return 0;
>
> -       np = host->parent->of_node;
> +       if (slot)
> +               np = slot;
> +       else
> +               np = host->parent->of_node;
>
>         /* "bus-width" is translated to MMC_CAP_*_BIT_DATA flags */
>         if (of_property_read_u32(np, "bus-width", &bus_width) < 0) {
> @@ -459,7 +464,7 @@ out:
>         return ret;
>  }
>
> -EXPORT_SYMBOL(mmc_of_parse);
> +EXPORT_SYMBOL(__mmc_of_parse);
>
>  /**
>   *     mmc_alloc_host - initialise the per-host structure.
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 7960424..c62af91 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -372,7 +372,15 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *);
>  int mmc_add_host(struct mmc_host *);
>  void mmc_remove_host(struct mmc_host *);
>  void mmc_free_host(struct mmc_host *);
> -int mmc_of_parse(struct mmc_host *host);
> +int __mmc_of_parse(struct mmc_host *host, struct device_node *slot);
> +/*
> + * mmc_of_parse - parse host's device-tree node
> + *     @host: host whose node should be parsed.
> + */
> +static inline int mmc_of_parse(struct mmc_host *host)
> +{
> +       return __mmc_of_parse(host, NULL);
> +}
>
>  static inline void *mmc_priv(struct mmc_host *host)
>  {
> --
> 1.7.9.5
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCHv2 1/3] mmc: host: add slot argument to mmc_of_parse
  2014-05-26 11:35 ` [PATCHv2 1/3] mmc: host: add slot argument to mmc_of_parse Jaehoon Chung
  2014-05-26 14:37   ` Ulf Hansson
@ 2014-05-27  9:48   ` Seungwon Jeon
  1 sibling, 0 replies; 11+ messages in thread
From: Seungwon Jeon @ 2014-05-27  9:48 UTC (permalink / raw)
  To: 'Jaehoon Chung', linux-mmc
  Cc: chris, ulf.hansson, ludovic.desroches, devicetree,
	linux-samsung-soc, cpgs

On Mon, May 26, 2014, Jaehoon Chung wrote:
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
> 
> Some hosts manage several slots. In these case information such as the
> bus width, chip detect and others are into the slot node. So we have to
> parse child node. If not NULL, slot node will be used instead of the
> device node.
> 
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>

Acked-by: Seungwon Jeon <tgih.jun@samsung.com>

Thanks,
Seungwon Jeon

> ---
> Changelog V2:
> 	- Fix the typo.
> 
>  drivers/mmc/core/host.c  |   13 +++++++++----
>  include/linux/mmc/host.h |   10 +++++++++-
>  2 files changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index 95cceae..0f677b3 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -298,15 +298,17 @@ static inline void mmc_host_clk_sysfs_init(struct mmc_host *host)
>  #endif
> 
>  /**
> - *	mmc_of_parse() - parse host's device-tree node
> + *	__mmc_of_parse() - parse host's device-tree node
>   *	@host: host whose node should be parsed.
> + *	@slot : some device provide several slots so the node to parse
> + *		is not the host one.
>   *
>   * To keep the rest of the MMC subsystem unaware of whether DT has been
>   * used to to instantiate and configure this host instance or not, we
>   * parse the properties and set respective generic mmc-host flags and
>   * parameters.
>   */
> -int mmc_of_parse(struct mmc_host *host)
> +int __mmc_of_parse(struct mmc_host *host, struct device_node *slot)
>  {
>  	struct device_node *np;
>  	u32 bus_width;
> @@ -317,7 +319,10 @@ int mmc_of_parse(struct mmc_host *host)
>  	if (!host->parent || !host->parent->of_node)
>  		return 0;
> 
> -	np = host->parent->of_node;
> +	if (slot)
> +		np = slot;
> +	else
> +		np = host->parent->of_node;
> 
>  	/* "bus-width" is translated to MMC_CAP_*_BIT_DATA flags */
>  	if (of_property_read_u32(np, "bus-width", &bus_width) < 0) {
> @@ -459,7 +464,7 @@ out:
>  	return ret;
>  }
> 
> -EXPORT_SYMBOL(mmc_of_parse);
> +EXPORT_SYMBOL(__mmc_of_parse);
> 
>  /**
>   *	mmc_alloc_host - initialise the per-host structure.
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 7960424..c62af91 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -372,7 +372,15 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *);
>  int mmc_add_host(struct mmc_host *);
>  void mmc_remove_host(struct mmc_host *);
>  void mmc_free_host(struct mmc_host *);
> -int mmc_of_parse(struct mmc_host *host);
> +int __mmc_of_parse(struct mmc_host *host, struct device_node *slot);
> +/*
> + * mmc_of_parse - parse host's device-tree node
> + *	@host: host whose node should be parsed.
> + */
> +static inline int mmc_of_parse(struct mmc_host *host)
> +{
> +	return __mmc_of_parse(host, NULL);
> +}
> 
>  static inline void *mmc_priv(struct mmc_host *host)
>  {
> --
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCHv2 2/3] mmc: dw_mmc: use the __mmc_of_parse to parse the slot node
  2014-05-26 11:35 ` [PATCHv2 2/3] mmc: dw_mmc: use the __mmc_of_parse to parse the slot node Jaehoon Chung
@ 2014-05-27  9:49   ` Seungwon Jeon
  2014-05-27 10:07     ` Jaehoon Chung
  0 siblings, 1 reply; 11+ messages in thread
From: Seungwon Jeon @ 2014-05-27  9:49 UTC (permalink / raw)
  To: 'Jaehoon Chung', linux-mmc
  Cc: chris, ulf.hansson, ludovic.desroches, devicetree,
	linux-samsung-soc, cpgs

Hi Jaehoon,

On Mon, May 26, 2014, Jaehoon Chung wrote:
> dw-mmc controller have the multiple slot.
Have -> has?

> Then it needs to parse the property for each slot.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
> Changelog V2:
> 	- None
> 
>  drivers/mmc/host/dw_mmc.c |   25 ++++++-------------------
>  1 file changed, 6 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 1ac227c..d4800f8 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1015,12 +1015,11 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
>  {
>  	int present;
>  	struct dw_mci_slot *slot = mmc_priv(mmc);
> -	struct dw_mci_board *brd = slot->host->pdata;
>  	struct dw_mci *host = slot->host;
>  	int gpio_cd = mmc_gpio_get_cd(mmc);
> 
>  	/* Use platform get_cd function, else try onboard card detect */
> -	if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
> +	if (slot->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
>  		present = 1;
>  	else if (!IS_ERR_VALUE(gpio_cd))
>  		present = gpio_cd;
> @@ -2010,6 +2009,9 @@ static struct dw_mci_of_slot_quirks {
>  	{
>  		.quirk	= "disable-wp",
>  		.id	= DW_MCI_SLOT_QUIRK_NO_WRITE_PROTECT,
> +	}, {
> +		.quirk	= "broken-cd",
> +		.id	= DW_MCI_QUIRK_BROKEN_CARD_DETECTION,
>  	},
>  };
> 
> @@ -2088,7 +2090,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
>  	if (host->pdata->caps2)
>  		mmc->caps2 = host->pdata->caps2;
> 
> -	mmc_of_parse(mmc);
> +	__mmc_of_parse(mmc, dw_mci_of_find_slot_node(host->dev, slot->id));
> 
>  	if (host->pdata->blk_settings) {
>  		mmc->max_segs = host->pdata->blk_settings->max_segs;
> @@ -2231,23 +2233,13 @@ static inline bool dw_mci_ctrl_all_reset(struct dw_mci *host)
>  }
> 
>  #ifdef CONFIG_OF
> -static struct dw_mci_of_quirks {
> -	char *quirk;
> -	int id;
> -} of_quirks[] = {
> -	{
> -		.quirk	= "broken-cd",
> -		.id	= DW_MCI_QUIRK_BROKEN_CARD_DETECTION,
> -	},
> -};
> -
Moving broken-cd to slot_quirks is reasonable.
But I think of_quirks should be kept and we can add right quirks.
In cae of DW_MCI_QUIRK_IDMAC_DTO and DW_MCI_QUIRK_RETRY_DELAY,
we can handle those with dw_mci_of_quirks although we didn't add.

>  static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
>  {
>  	struct dw_mci_board *pdata;
>  	struct device *dev = host->dev;
>  	struct device_node *np = dev->of_node;
>  	const struct dw_mci_drv_data *drv_data = host->drv_data;
> -	int idx, ret;
> +	int ret;
>  	u32 clock_frequency;
> 
>  	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
> @@ -2264,11 +2256,6 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
>  		pdata->num_slots = 1;
>  	}
> 
> -	/* get quirks */
> -	for (idx = 0; idx < ARRAY_SIZE(of_quirks); idx++)
> -		if (of_get_property(np, of_quirks[idx].quirk, NULL))
> -			pdata->quirks |= of_quirks[idx].id;
> -
Same as above.

Thanks,
Seungwon Jeon

>  	if (of_property_read_u32(np, "fifo-depth", &pdata->fifo_depth))
>  		dev_info(dev, "fifo-depth property not found, using "
>  				"value of FIFOTH register as default\n");
> --
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCHv2 3/3] ARM: dts: replace the broken-cd property into slot node for dwmmc.
  2014-05-26 11:35 ` [PATCHv2 3/3] ARM: dts: replace the broken-cd property into slot node for dwmmc Jaehoon Chung
@ 2014-05-27  9:49   ` Seungwon Jeon
  2014-05-27 10:08     ` Jaehoon Chung
  2014-05-27 10:38     ` Ulf Hansson
  0 siblings, 2 replies; 11+ messages in thread
From: Seungwon Jeon @ 2014-05-27  9:49 UTC (permalink / raw)
  To: 'Jaehoon Chung', linux-mmc
  Cc: chris, ulf.hansson, ludovic.desroches, devicetree,
	linux-samsung-soc, cpgs

Can this be merged with your another patch, " [PATCH 2/5] mmc: dw_mmc: remove the "supports-highspeed" property."?

On Mon, May 26, 2014, Jaehoon Chung wrote:
> dw-mmc controller can be support the multiple slot.
can support, it would be better to correct the above message.

Thanks,
Seungwon Jeon

> So each slot's property can be difference.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
> Changelog V2:
> 	- None
> 
>  arch/arm/boot/dts/exynos4412-odroidx.dts      |    2 +-
>  arch/arm/boot/dts/exynos4412-origen.dts       |    2 +-
>  arch/arm/boot/dts/exynos4412-trats2.dts       |    4 ++--
>  arch/arm/boot/dts/exynos5250-arndale.dts      |    2 +-
>  arch/arm/boot/dts/exynos5250-cros-common.dtsi |    4 ++--
>  arch/arm/boot/dts/exynos5250-smdk5250.dts     |    2 +-
>  arch/arm/boot/dts/exynos5420-arndale-octa.dts |    2 +-
>  arch/arm/boot/dts/rk3066a-bqcurie2.dts        |    2 +-
>  arch/arm/boot/dts/socfpga_arria5.dtsi         |    2 +-
>  arch/arm/boot/dts/socfpga_cyclone5.dtsi       |    2 +-
>  arch/arm/boot/dts/socfpga_vt.dts              |    2 +-
>  11 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/exynos4412-odroidx.dts b/arch/arm/boot/dts/exynos4412-odroidx.dts
> index 31db28a..24ec351 100644
> --- a/arch/arm/boot/dts/exynos4412-odroidx.dts
> +++ b/arch/arm/boot/dts/exynos4412-odroidx.dts
> @@ -46,7 +46,6 @@
> 
>  		num-slots = <1>;
>  		supports-highspeed;
> -		broken-cd;
>  		card-detect-delay = <200>;
>  		samsung,dw-mshc-ciu-div = <3>;
>  		samsung,dw-mshc-sdr-timing = <2 3>;
> @@ -55,6 +54,7 @@
>  		slot@0 {
>  			reg = <0>;
>  			bus-width = <8>;
> +			broken-cd;
>  		};
>  	};
> 
> diff --git a/arch/arm/boot/dts/exynos4412-origen.dts b/arch/arm/boot/dts/exynos4412-origen.dts
> index e2c0dca..ed712a6 100644
> --- a/arch/arm/boot/dts/exynos4412-origen.dts
> +++ b/arch/arm/boot/dts/exynos4412-origen.dts
> @@ -129,7 +129,6 @@
> 
>  		num-slots = <1>;
>  		supports-highspeed;
> -		broken-cd;
>  		card-detect-delay = <200>;
>  		samsung,dw-mshc-ciu-div = <3>;
>  		samsung,dw-mshc-sdr-timing = <2 3>;
> @@ -138,6 +137,7 @@
>  		slot@0 {
>  			reg = <0>;
>  			bus-width = <8>;
> +			broken-cd;
>  		};
>  	};
> 
> diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
> index 73be464..37c3cb3 100644
> --- a/arch/arm/boot/dts/exynos4412-trats2.dts
> +++ b/arch/arm/boot/dts/exynos4412-trats2.dts
> @@ -460,8 +460,6 @@
>  	mmc@12550000 {
>  		num-slots = <1>;
>  		supports-highspeed;
> -		broken-cd;
> -		non-removable;
>  		card-detect-delay = <200>;
>  		vmmc-supply = <&vemmc_reg>;
>  		clock-frequency = <400000000>;
> @@ -475,6 +473,8 @@
>  		slot@0 {
>  			reg = <0>;
>  			bus-width = <8>;
> +			non-removable;
> +			broken-cd;
>  		};
>  	};
> 
> diff --git a/arch/arm/boot/dts/exynos5250-arndale.dts b/arch/arm/boot/dts/exynos5250-arndale.dts
> index 090f983..0c9a7da 100644
> --- a/arch/arm/boot/dts/exynos5250-arndale.dts
> +++ b/arch/arm/boot/dts/exynos5250-arndale.dts
> @@ -400,7 +400,6 @@
>  		status = "okay";
>  		num-slots = <1>;
>  		supports-highspeed;
> -		broken-cd;
>  		card-detect-delay = <200>;
>  		samsung,dw-mshc-ciu-div = <3>;
>  		samsung,dw-mshc-sdr-timing = <2 3>;
> @@ -412,6 +411,7 @@
>  		slot@0 {
>  			reg = <0>;
>  			bus-width = <8>;
> +			broken-cd;
>  		};
>  	};
> 
> diff --git a/arch/arm/boot/dts/exynos5250-cros-common.dtsi b/arch/arm/boot/dts/exynos5250-cros-
> common.dtsi
> index 2c1560d..7ab3b94 100644
> --- a/arch/arm/boot/dts/exynos5250-cros-common.dtsi
> +++ b/arch/arm/boot/dts/exynos5250-cros-common.dtsi
> @@ -249,7 +249,6 @@
>  	mmc@12200000 {
>  		num-slots = <1>;
>  		supports-highspeed;
> -		broken-cd;
>  		card-detect-delay = <200>;
>  		samsung,dw-mshc-ciu-div = <3>;
>  		samsung,dw-mshc-sdr-timing = <2 3>;
> @@ -260,6 +259,7 @@
>  		slot@0 {
>  			reg = <0>;
>  			bus-width = <8>;
> +			broken-cd;
>  		};
>  	};
> 
> @@ -283,7 +283,6 @@
>  	mmc@12230000 {
>  		num-slots = <1>;
>  		supports-highspeed;
> -		broken-cd;
>  		card-detect-delay = <200>;
>  		samsung,dw-mshc-ciu-div = <3>;
>  		samsung,dw-mshc-sdr-timing = <2 3>;
> @@ -293,6 +292,7 @@
>  		slot@0 {
>  			reg = <0>;
>  			bus-width = <4>;
> +			broken-cd;
>  		};
>  	};
> 
> diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts
> index a794a70..feffe24 100644
> --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
> +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
> @@ -283,7 +283,6 @@
>  		status = "okay";
>  		num-slots = <1>;
>  		supports-highspeed;
> -		broken-cd;
>  		card-detect-delay = <200>;
>  		samsung,dw-mshc-ciu-div = <3>;
>  		samsung,dw-mshc-sdr-timing = <2 3>;
> @@ -294,6 +293,7 @@
>  		slot@0 {
>  			reg = <0>;
>  			bus-width = <8>;
> +			broken-cd;
>  		};
>  	};
> 
> diff --git a/arch/arm/boot/dts/exynos5420-arndale-octa.dts b/arch/arm/boot/dts/exynos5420-arndale-
> octa.dts
> index 80a3bf4..0d3b467 100644
> --- a/arch/arm/boot/dts/exynos5420-arndale-octa.dts
> +++ b/arch/arm/boot/dts/exynos5420-arndale-octa.dts
> @@ -39,7 +39,6 @@
> 
>  	mmc@12200000 {
>  		status = "okay";
> -		broken-cd;
>  		supports-highspeed;
>  		card-detect-delay = <200>;
>  		samsung,dw-mshc-ciu-div = <3>;
> @@ -52,6 +51,7 @@
>  		slot@0 {
>  			reg = <0>;
>  			bus-width = <8>;
> +			broken-cd;
>  		};
>  	};
> 
> diff --git a/arch/arm/boot/dts/rk3066a-bqcurie2.dts b/arch/arm/boot/dts/rk3066a-bqcurie2.dts
> index 035df40..62c7484 100644
> --- a/arch/arm/boot/dts/rk3066a-bqcurie2.dts
> +++ b/arch/arm/boot/dts/rk3066a-bqcurie2.dts
> @@ -69,7 +69,6 @@
>  		dwmmc@10218000 { /* wifi */
>  			num-slots = <1>;
>  			status = "okay";
> -			non-removable;
> 
>  			pinctrl-names = "default";
>  			pinctrl-0 = <&sd1_clk &sd1_cmd &sd1_bus4>;
> @@ -78,6 +77,7 @@
>  				reg = <0>;
>  				bus-width = <4>;
>  				disable-wp;
> +				non-removable;
>  			};
>  		};
> 
> diff --git a/arch/arm/boot/dts/socfpga_arria5.dtsi b/arch/arm/boot/dts/socfpga_arria5.dtsi
> index 6c87b70..9c2b933 100644
> --- a/arch/arm/boot/dts/socfpga_arria5.dtsi
> +++ b/arch/arm/boot/dts/socfpga_arria5.dtsi
> @@ -30,11 +30,11 @@
>  		dwmmc0@ff704000 {
>  			num-slots = <1>;
>  			supports-highspeed;
> -			broken-cd;
> 
>  			slot@0 {
>  				reg = <0>;
>  				bus-width = <4>;
> +				broken-cd;
>  			};
>  		};
> 
> diff --git a/arch/arm/boot/dts/socfpga_cyclone5.dtsi b/arch/arm/boot/dts/socfpga_cyclone5.dtsi
> index ca41b0e..c5c7b5f 100644
> --- a/arch/arm/boot/dts/socfpga_cyclone5.dtsi
> +++ b/arch/arm/boot/dts/socfpga_cyclone5.dtsi
> @@ -31,11 +31,11 @@
>  		dwmmc0@ff704000 {
>  			num-slots = <1>;
>  			supports-highspeed;
> -			broken-cd;
> 
>  			slot@0 {
>  				reg = <0>;
>  				bus-width = <4>;
> +				broken-cd;
>  			};
>  		};
> 
> diff --git a/arch/arm/boot/dts/socfpga_vt.dts b/arch/arm/boot/dts/socfpga_vt.dts
> index 87d6f75..ff1111e 100644
> --- a/arch/arm/boot/dts/socfpga_vt.dts
> +++ b/arch/arm/boot/dts/socfpga_vt.dts
> @@ -44,11 +44,11 @@
>  		dwmmc0@ff704000 {
>  			num-slots = <1>;
>  			supports-highspeed;
> -			broken-cd;
> 
>  			slot@0 {
>  				reg = <0>;
>  				bus-width = <4>;
> +				broken-cd;
>  			};
>  		};
> 
> --
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCHv2 2/3] mmc: dw_mmc: use the __mmc_of_parse to parse the slot node
  2014-05-27  9:49   ` Seungwon Jeon
@ 2014-05-27 10:07     ` Jaehoon Chung
  0 siblings, 0 replies; 11+ messages in thread
From: Jaehoon Chung @ 2014-05-27 10:07 UTC (permalink / raw)
  To: Seungwon Jeon, 'Jaehoon Chung', linux-mmc
  Cc: chris, ulf.hansson, ludovic.desroches, devicetree,
	linux-samsung-soc, cpgs

Hi, Seungwon

On 05/27/2014 06:49 PM, Seungwon Jeon wrote:
> Hi Jaehoon,
> 
> On Mon, May 26, 2014, Jaehoon Chung wrote:
>> dw-mmc controller have the multiple slot.
> Have -> has?
Fix it.

> 
>> Then it needs to parse the property for each slot.
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>> ---
>> Changelog V2:
>> 	- None
>>
>>  drivers/mmc/host/dw_mmc.c |   25 ++++++-------------------
>>  1 file changed, 6 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>> index 1ac227c..d4800f8 100644
>> --- a/drivers/mmc/host/dw_mmc.c
>> +++ b/drivers/mmc/host/dw_mmc.c
>> @@ -1015,12 +1015,11 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
>>  {
>>  	int present;
>>  	struct dw_mci_slot *slot = mmc_priv(mmc);
>> -	struct dw_mci_board *brd = slot->host->pdata;
>>  	struct dw_mci *host = slot->host;
>>  	int gpio_cd = mmc_gpio_get_cd(mmc);
>>
>>  	/* Use platform get_cd function, else try onboard card detect */
>> -	if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
>> +	if (slot->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
>>  		present = 1;
>>  	else if (!IS_ERR_VALUE(gpio_cd))
>>  		present = gpio_cd;
>> @@ -2010,6 +2009,9 @@ static struct dw_mci_of_slot_quirks {
>>  	{
>>  		.quirk	= "disable-wp",
>>  		.id	= DW_MCI_SLOT_QUIRK_NO_WRITE_PROTECT,
>> +	}, {
>> +		.quirk	= "broken-cd",
>> +		.id	= DW_MCI_QUIRK_BROKEN_CARD_DETECTION,
>>  	},
>>  };
>>
>> @@ -2088,7 +2090,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
>>  	if (host->pdata->caps2)
>>  		mmc->caps2 = host->pdata->caps2;
>>
>> -	mmc_of_parse(mmc);
>> +	__mmc_of_parse(mmc, dw_mci_of_find_slot_node(host->dev, slot->id));
>>
>>  	if (host->pdata->blk_settings) {
>>  		mmc->max_segs = host->pdata->blk_settings->max_segs;
>> @@ -2231,23 +2233,13 @@ static inline bool dw_mci_ctrl_all_reset(struct dw_mci *host)
>>  }
>>
>>  #ifdef CONFIG_OF
>> -static struct dw_mci_of_quirks {
>> -	char *quirk;
>> -	int id;
>> -} of_quirks[] = {
>> -	{
>> -		.quirk	= "broken-cd",
>> -		.id	= DW_MCI_QUIRK_BROKEN_CARD_DETECTION,
>> -	},
>> -};
>> -
> Moving broken-cd to slot_quirks is reasonable.
> But I think of_quirks should be kept and we can add right quirks.
> In cae of DW_MCI_QUIRK_IDMAC_DTO and DW_MCI_QUIRK_RETRY_DELAY,
> we can handle those with dw_mci_of_quirks although we didn't add.
Ok. 

Best Regards,
Jaehoon Chung
> 
>>  static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
>>  {
>>  	struct dw_mci_board *pdata;
>>  	struct device *dev = host->dev;
>>  	struct device_node *np = dev->of_node;
>>  	const struct dw_mci_drv_data *drv_data = host->drv_data;
>> -	int idx, ret;
>> +	int ret;
>>  	u32 clock_frequency;
>>
>>  	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
>> @@ -2264,11 +2256,6 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
>>  		pdata->num_slots = 1;
>>  	}
>>
>> -	/* get quirks */
>> -	for (idx = 0; idx < ARRAY_SIZE(of_quirks); idx++)
>> -		if (of_get_property(np, of_quirks[idx].quirk, NULL))
>> -			pdata->quirks |= of_quirks[idx].id;
>> -
> Same as above.
> 
> Thanks,
> Seungwon Jeon
> 
>>  	if (of_property_read_u32(np, "fifo-depth", &pdata->fifo_depth))
>>  		dev_info(dev, "fifo-depth property not found, using "
>>  				"value of FIFOTH register as default\n");
>> --
>> 1.7.9.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCHv2 3/3] ARM: dts: replace the broken-cd property into slot node for dwmmc.
  2014-05-27  9:49   ` Seungwon Jeon
@ 2014-05-27 10:08     ` Jaehoon Chung
  2014-05-27 10:38     ` Ulf Hansson
  1 sibling, 0 replies; 11+ messages in thread
From: Jaehoon Chung @ 2014-05-27 10:08 UTC (permalink / raw)
  To: Seungwon Jeon, 'Jaehoon Chung', linux-mmc
  Cc: chris, ulf.hansson, ludovic.desroches, devicetree,
	linux-samsung-soc, cpgs

On 05/27/2014 06:49 PM, Seungwon Jeon wrote:
> Can this be merged with your another patch, " [PATCH 2/5] mmc: dw_mmc: remove the "supports-highspeed" property."?

Sure..

> 
> On Mon, May 26, 2014, Jaehoon Chung wrote:
>> dw-mmc controller can be support the multiple slot.
> can support, it would be better to correct the above message.

Fix it.

Best Regards,
Jaehoon Chung
> 
> Thanks,
> Seungwon Jeon
> 
>> So each slot's property can be difference.
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>> ---
>> Changelog V2:
>> 	- None
>>
>>  arch/arm/boot/dts/exynos4412-odroidx.dts      |    2 +-
>>  arch/arm/boot/dts/exynos4412-origen.dts       |    2 +-
>>  arch/arm/boot/dts/exynos4412-trats2.dts       |    4 ++--
>>  arch/arm/boot/dts/exynos5250-arndale.dts      |    2 +-
>>  arch/arm/boot/dts/exynos5250-cros-common.dtsi |    4 ++--
>>  arch/arm/boot/dts/exynos5250-smdk5250.dts     |    2 +-
>>  arch/arm/boot/dts/exynos5420-arndale-octa.dts |    2 +-
>>  arch/arm/boot/dts/rk3066a-bqcurie2.dts        |    2 +-
>>  arch/arm/boot/dts/socfpga_arria5.dtsi         |    2 +-
>>  arch/arm/boot/dts/socfpga_cyclone5.dtsi       |    2 +-
>>  arch/arm/boot/dts/socfpga_vt.dts              |    2 +-
>>  11 files changed, 13 insertions(+), 13 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/exynos4412-odroidx.dts b/arch/arm/boot/dts/exynos4412-odroidx.dts
>> index 31db28a..24ec351 100644
>> --- a/arch/arm/boot/dts/exynos4412-odroidx.dts
>> +++ b/arch/arm/boot/dts/exynos4412-odroidx.dts
>> @@ -46,7 +46,6 @@
>>
>>  		num-slots = <1>;
>>  		supports-highspeed;
>> -		broken-cd;
>>  		card-detect-delay = <200>;
>>  		samsung,dw-mshc-ciu-div = <3>;
>>  		samsung,dw-mshc-sdr-timing = <2 3>;
>> @@ -55,6 +54,7 @@
>>  		slot@0 {
>>  			reg = <0>;
>>  			bus-width = <8>;
>> +			broken-cd;
>>  		};
>>  	};
>>
>> diff --git a/arch/arm/boot/dts/exynos4412-origen.dts b/arch/arm/boot/dts/exynos4412-origen.dts
>> index e2c0dca..ed712a6 100644
>> --- a/arch/arm/boot/dts/exynos4412-origen.dts
>> +++ b/arch/arm/boot/dts/exynos4412-origen.dts
>> @@ -129,7 +129,6 @@
>>
>>  		num-slots = <1>;
>>  		supports-highspeed;
>> -		broken-cd;
>>  		card-detect-delay = <200>;
>>  		samsung,dw-mshc-ciu-div = <3>;
>>  		samsung,dw-mshc-sdr-timing = <2 3>;
>> @@ -138,6 +137,7 @@
>>  		slot@0 {
>>  			reg = <0>;
>>  			bus-width = <8>;
>> +			broken-cd;
>>  		};
>>  	};
>>
>> diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
>> index 73be464..37c3cb3 100644
>> --- a/arch/arm/boot/dts/exynos4412-trats2.dts
>> +++ b/arch/arm/boot/dts/exynos4412-trats2.dts
>> @@ -460,8 +460,6 @@
>>  	mmc@12550000 {
>>  		num-slots = <1>;
>>  		supports-highspeed;
>> -		broken-cd;
>> -		non-removable;
>>  		card-detect-delay = <200>;
>>  		vmmc-supply = <&vemmc_reg>;
>>  		clock-frequency = <400000000>;
>> @@ -475,6 +473,8 @@
>>  		slot@0 {
>>  			reg = <0>;
>>  			bus-width = <8>;
>> +			non-removable;
>> +			broken-cd;
>>  		};
>>  	};
>>
>> diff --git a/arch/arm/boot/dts/exynos5250-arndale.dts b/arch/arm/boot/dts/exynos5250-arndale.dts
>> index 090f983..0c9a7da 100644
>> --- a/arch/arm/boot/dts/exynos5250-arndale.dts
>> +++ b/arch/arm/boot/dts/exynos5250-arndale.dts
>> @@ -400,7 +400,6 @@
>>  		status = "okay";
>>  		num-slots = <1>;
>>  		supports-highspeed;
>> -		broken-cd;
>>  		card-detect-delay = <200>;
>>  		samsung,dw-mshc-ciu-div = <3>;
>>  		samsung,dw-mshc-sdr-timing = <2 3>;
>> @@ -412,6 +411,7 @@
>>  		slot@0 {
>>  			reg = <0>;
>>  			bus-width = <8>;
>> +			broken-cd;
>>  		};
>>  	};
>>
>> diff --git a/arch/arm/boot/dts/exynos5250-cros-common.dtsi b/arch/arm/boot/dts/exynos5250-cros-
>> common.dtsi
>> index 2c1560d..7ab3b94 100644
>> --- a/arch/arm/boot/dts/exynos5250-cros-common.dtsi
>> +++ b/arch/arm/boot/dts/exynos5250-cros-common.dtsi
>> @@ -249,7 +249,6 @@
>>  	mmc@12200000 {
>>  		num-slots = <1>;
>>  		supports-highspeed;
>> -		broken-cd;
>>  		card-detect-delay = <200>;
>>  		samsung,dw-mshc-ciu-div = <3>;
>>  		samsung,dw-mshc-sdr-timing = <2 3>;
>> @@ -260,6 +259,7 @@
>>  		slot@0 {
>>  			reg = <0>;
>>  			bus-width = <8>;
>> +			broken-cd;
>>  		};
>>  	};
>>
>> @@ -283,7 +283,6 @@
>>  	mmc@12230000 {
>>  		num-slots = <1>;
>>  		supports-highspeed;
>> -		broken-cd;
>>  		card-detect-delay = <200>;
>>  		samsung,dw-mshc-ciu-div = <3>;
>>  		samsung,dw-mshc-sdr-timing = <2 3>;
>> @@ -293,6 +292,7 @@
>>  		slot@0 {
>>  			reg = <0>;
>>  			bus-width = <4>;
>> +			broken-cd;
>>  		};
>>  	};
>>
>> diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts
>> index a794a70..feffe24 100644
>> --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
>> +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
>> @@ -283,7 +283,6 @@
>>  		status = "okay";
>>  		num-slots = <1>;
>>  		supports-highspeed;
>> -		broken-cd;
>>  		card-detect-delay = <200>;
>>  		samsung,dw-mshc-ciu-div = <3>;
>>  		samsung,dw-mshc-sdr-timing = <2 3>;
>> @@ -294,6 +293,7 @@
>>  		slot@0 {
>>  			reg = <0>;
>>  			bus-width = <8>;
>> +			broken-cd;
>>  		};
>>  	};
>>
>> diff --git a/arch/arm/boot/dts/exynos5420-arndale-octa.dts b/arch/arm/boot/dts/exynos5420-arndale-
>> octa.dts
>> index 80a3bf4..0d3b467 100644
>> --- a/arch/arm/boot/dts/exynos5420-arndale-octa.dts
>> +++ b/arch/arm/boot/dts/exynos5420-arndale-octa.dts
>> @@ -39,7 +39,6 @@
>>
>>  	mmc@12200000 {
>>  		status = "okay";
>> -		broken-cd;
>>  		supports-highspeed;
>>  		card-detect-delay = <200>;
>>  		samsung,dw-mshc-ciu-div = <3>;
>> @@ -52,6 +51,7 @@
>>  		slot@0 {
>>  			reg = <0>;
>>  			bus-width = <8>;
>> +			broken-cd;
>>  		};
>>  	};
>>
>> diff --git a/arch/arm/boot/dts/rk3066a-bqcurie2.dts b/arch/arm/boot/dts/rk3066a-bqcurie2.dts
>> index 035df40..62c7484 100644
>> --- a/arch/arm/boot/dts/rk3066a-bqcurie2.dts
>> +++ b/arch/arm/boot/dts/rk3066a-bqcurie2.dts
>> @@ -69,7 +69,6 @@
>>  		dwmmc@10218000 { /* wifi */
>>  			num-slots = <1>;
>>  			status = "okay";
>> -			non-removable;
>>
>>  			pinctrl-names = "default";
>>  			pinctrl-0 = <&sd1_clk &sd1_cmd &sd1_bus4>;
>> @@ -78,6 +77,7 @@
>>  				reg = <0>;
>>  				bus-width = <4>;
>>  				disable-wp;
>> +				non-removable;
>>  			};
>>  		};
>>
>> diff --git a/arch/arm/boot/dts/socfpga_arria5.dtsi b/arch/arm/boot/dts/socfpga_arria5.dtsi
>> index 6c87b70..9c2b933 100644
>> --- a/arch/arm/boot/dts/socfpga_arria5.dtsi
>> +++ b/arch/arm/boot/dts/socfpga_arria5.dtsi
>> @@ -30,11 +30,11 @@
>>  		dwmmc0@ff704000 {
>>  			num-slots = <1>;
>>  			supports-highspeed;
>> -			broken-cd;
>>
>>  			slot@0 {
>>  				reg = <0>;
>>  				bus-width = <4>;
>> +				broken-cd;
>>  			};
>>  		};
>>
>> diff --git a/arch/arm/boot/dts/socfpga_cyclone5.dtsi b/arch/arm/boot/dts/socfpga_cyclone5.dtsi
>> index ca41b0e..c5c7b5f 100644
>> --- a/arch/arm/boot/dts/socfpga_cyclone5.dtsi
>> +++ b/arch/arm/boot/dts/socfpga_cyclone5.dtsi
>> @@ -31,11 +31,11 @@
>>  		dwmmc0@ff704000 {
>>  			num-slots = <1>;
>>  			supports-highspeed;
>> -			broken-cd;
>>
>>  			slot@0 {
>>  				reg = <0>;
>>  				bus-width = <4>;
>> +				broken-cd;
>>  			};
>>  		};
>>
>> diff --git a/arch/arm/boot/dts/socfpga_vt.dts b/arch/arm/boot/dts/socfpga_vt.dts
>> index 87d6f75..ff1111e 100644
>> --- a/arch/arm/boot/dts/socfpga_vt.dts
>> +++ b/arch/arm/boot/dts/socfpga_vt.dts
>> @@ -44,11 +44,11 @@
>>  		dwmmc0@ff704000 {
>>  			num-slots = <1>;
>>  			supports-highspeed;
>> -			broken-cd;
>>
>>  			slot@0 {
>>  				reg = <0>;
>>  				bus-width = <4>;
>> +				broken-cd;
>>  			};
>>  		};
>>
>> --
>> 1.7.9.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCHv2 3/3] ARM: dts: replace the broken-cd property into slot node for dwmmc.
  2014-05-27  9:49   ` Seungwon Jeon
  2014-05-27 10:08     ` Jaehoon Chung
@ 2014-05-27 10:38     ` Ulf Hansson
  1 sibling, 0 replies; 11+ messages in thread
From: Ulf Hansson @ 2014-05-27 10:38 UTC (permalink / raw)
  To: Seungwon Jeon, Jaehoon Chung
  Cc: linux-mmc, Chris Ball, Ludovic Desroches,
	devicetree@vger.kernel.org, linux-samsung-soc, cpgs

On 27 May 2014 11:49, Seungwon Jeon <tgih.jun@samsung.com> wrote:
> Can this be merged with your another patch, " [PATCH 2/5] mmc: dw_mmc: remove the "supports-highspeed" property."?

Normally devicetree people don't like us to remove DT bindings.

In principle you need to support them forever once added. Still you
should update the DTS files to use the new bindings and mark the old
ones as deprecated in the documentation. I am not sure if this
approach has changed though!?

Kind regards
Ulf Hansson

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-05-27 10:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-26 11:35 [PATCHv2 0/3] mmc: fixed the mmc_of_parse for dwmmc Jaehoon Chung
2014-05-26 11:35 ` [PATCHv2 1/3] mmc: host: add slot argument to mmc_of_parse Jaehoon Chung
2014-05-26 14:37   ` Ulf Hansson
2014-05-27  9:48   ` Seungwon Jeon
2014-05-26 11:35 ` [PATCHv2 2/3] mmc: dw_mmc: use the __mmc_of_parse to parse the slot node Jaehoon Chung
2014-05-27  9:49   ` Seungwon Jeon
2014-05-27 10:07     ` Jaehoon Chung
2014-05-26 11:35 ` [PATCHv2 3/3] ARM: dts: replace the broken-cd property into slot node for dwmmc Jaehoon Chung
2014-05-27  9:49   ` Seungwon Jeon
2014-05-27 10:08     ` Jaehoon Chung
2014-05-27 10:38     ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).