omap_hsmmc: Supports slot-name also in DT
Subsystems (3)
cover omap_hsmmc: Supports slot-name also in DT
This patch series fix regression when migrating from legacy board code to DT on Nokia N900. It exports slot-name property to /sys structure from DT. Legacy board code is doing it but DT code without this patch not.
Nokia N900 has two mmc slots, one internal (eMMC) and one external (uSD card). Userspace on Nokia N900 is using slot-name for detecting if mmc device is eMMC or uSD.
Pali Rohár (2):
mmc: omap_hsmmc: Add support for slot-name property in DT omap3-n900.dts: Add slot-name properties for mmc devices
arch/arm/boot/dts/omap3-n900.dts | 2 ++ drivers/mmc/host/omap_hsmmc.c | 2 ++ 2 files changed, 4 insertions(+)
Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/2 mmc: omap_hsmmc: Add support for slot-name property in DT
--- drivers/mmc/host/omap_hsmmc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mmc/host/omap_hsmmc.c +2 -0
@@ -1901,6 +1901,8 @@ static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev)if (of_find_property (np,"ti,needs-special-hs-handling" ,NULL )) pdata->features |=HSMMC_HAS_HSPE_SUPPORT ; +of_property_read_string (np,"slot-name" , &pdata->name); + return pdata; }#else
Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] mmc: omap_hsmmc: Add support for slot-name property in DT
drivers/mmc/host/omap_hsmmc.c static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev) · line 1908
Quoted 13 lines · On Friday 15 May 2015 23:14:48 Pali Rohár wrote:
drivers/mmc/host/omap_hsmmc.c +2
-0@@ -1901,6 +1901,8 @@ static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev)if (of_find_property (np,"ti,needs-special-hs-handling" ,NULL )) pdata->features |=HSMMC_HAS_HSPE_SUPPORT ; +of_property_read_string (np,"slot-name" , &pdata->name); +return pdata; }
This property needs to be documented in Documentation/devicetree/bindings/mmc/mmc.txt and preferably the implementation moved into mmc_of_parse.
We should not have an interface like this specific to one driver.
Arnd
Re: [PATCH 1/2] mmc: omap_hsmmc: Add support for slot-name property in DT
Quoted 24 lines · On Friday 15 May 2015 23:19:44 Arnd Bergmann wrote:
Quoted 8 lines · On Friday 15 May 2015 23:14:48 Pali Rohár wrote:
(quoted diff) +0
-0
b/drivers/mmc/host/omap_hsmmc.cindex 9df2b68..f6073dd 100644drivers/mmc/host/omap_hsmmc.c +0
-0@@ -1901,6 +1901,8 @@ static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev) if (of_find_property(np, "ti,needs-special-hs-handling",drivers/mmc/host/omap_hsmmc.c static struct omap_hsmmc_platform_data
Quoted 10 lines
drivers/mmc/host/omap_hsmmc.c +2
-0NULL)) pdata->features |=HSMMC_HAS_HSPE_SUPPORT ; +of_property_read_string (np,"slot-name" , &pdata->name); +return pdata; }This property needs to be documented in
Documentation/devicetree/bindings/mmc/mmc.txtand preferably the implementation moved intommc_of_parse.
Quoted 3 lines
We should not have an interface like this specific to one driver.
Arnd
Interface is already present for platform data code (which do not use DT). So "pdata->name" is not DT specific...
Signature · 2 lines
Pali Rohár [email protected]
Re: [PATCH 1/2] mmc: omap_hsmmc: Add support for slot-name property in DT
Quoted 25 lines · On Friday 15 May 2015 23:22:37 Pali Rohár wrote:
Quoted 24 lines · On Friday 15 May 2015 23:19:44 Arnd Bergmann wrote:
Quoted 8 lines · On Friday 15 May 2015 23:14:48 Pali Rohár wrote:
(quoted diff) +0
-0
b/drivers/mmc/host/omap_hsmmc.cindex 9df2b68..f6073dd 100644drivers/mmc/host/omap_hsmmc.c +0
-0@@ -1901,6 +1901,8 @@ static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev) if (of_find_property(np, "ti,needs-special-hs-handling",drivers/mmc/host/omap_hsmmc.c static struct omap_hsmmc_platform_data
Quoted 10 lines
drivers/mmc/host/omap_hsmmc.c +2
-0NULL)) pdata->features |=HSMMC_HAS_HSPE_SUPPORT ; +of_property_read_string (np,"slot-name" , &pdata->name); +return pdata; }This property needs to be documented in
Documentation/devicetree/bindings/mmc/mmc.txtand preferably the implementation moved intommc_of_parse.
Quoted 7 lines
Quoted 3 lines
We should not have an interface like this specific to one driver.
Arnd
Interface is already present for platform data code (which do not use DT). So "
pdata->name" is not DT specific...
The driver can of course keep providing the name from platform_data where that is used. All I was saying is that when you introduce a DT property, it should not be specific to that driver.
Arnd
Re: [PATCH 1/2] mmc: omap_hsmmc: Add support for slot-name property in DT
Quoted 30 lines · Arnd Bergmann
Quoted 29 lines · On Friday 15 May 2015 23:22:37 Pali Rohár wrote:
Quoted 27 lines · On Friday 15 May 2015 23:19:44 Arnd Bergmann wrote:
Quoted 8 lines · On Friday 15 May 2015 23:14:48 Pali Rohár wrote:
(quoted diff) +0
-0
b/drivers/mmc/host/omap_hsmmc.cindex 9df2b68..f6073dd 100644drivers/mmc/host/omap_hsmmc.c +0
-0@@ -1901,6 +1901,8 @@ static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev) if (of_find_property(np, "ti,needs-special-hs-handling",drivers/mmc/host/omap_hsmmc.c static struct omap_hsmmc_platform_data
Quoted 10 lines
drivers/mmc/host/omap_hsmmc.c +2
-0NULL)) pdata->features |=HSMMC_HAS_HSPE_SUPPORT ; +of_property_read_string (np,"slot-name" , &pdata->name); +return pdata; }This property needs to be documented in
Documentation/devicetree/bindings/mmc/mmc.txtand preferably the implementation moved intommc_of_parse.We should not have an interface like this specific to one driver.
Arnd
Quoted 7 lines
Quoted 3 lines
Interface is already present for platform data code (which do not use DT). So "
pdata->name" is not DT specific...The driver can of course keep providing the name from
platform_datawhere that is used. All I was saying is that when you introduce a DT property, it should not be specific to that driver.
Yes sounds like it would be a usable generic binding. Not sure that it should be called slot-name though, maybe you can use the MMC driver instance name instead? I don't think much any drivers support multiple MMC slots although it's in the original MMC spec.
If setting up the generic binding is expected to take a while, you can naturally pass it in pdata while waiting for the generic binding to get merged.
Regards,
Tony
Re: [PATCH 1/2] mmc: omap_hsmmc: Add support for slot-name property in DT
Quoted 5 lines · On Monday 18 May 2015 08:06:07 Tony Lindgren wrote:
Quoted 1 line · Arnd Bergmann
On Friday 15 May 2015 23:22:37 Pali Rohár wrote:
If setting up the generic binding is expected to take a while, you can naturally pass it in pdata while waiting for the generic binding to get merged.
Yes, good idea. So the n900 machine can use auxdata to pass this for the time being, while the binding and generic implementation is being worked out.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] mmc: omap_hsmmc: Add support for slot-name property in DT
Quoted 7 lines · On Monday 18 May 2015 17:07:57 Arnd Bergmann wrote:
Quoted 5 lines · On Monday 18 May 2015 08:06:07 Tony Lindgren wrote:
Quoted 1 line · Arnd Bergmann
On Friday 15 May 2015 23:22:37 Pali Rohár wrote:
If setting up the generic binding is expected to take a while, you can naturally pass it in pdata while waiting for the generic binding to get merged.
Quoted 5 lines
Yes, good idea. So the n900 machine can use auxdata to pass this for the time being, while the binding and generic implementation is being worked out.
Arnd
Ok, so what is needed to finish this patch series?
Signature · 2 lines
Pali Rohár [email protected]
Re: [PATCH 1/2] mmc: omap_hsmmc: Add support for slot-name property in DT
Quoted 8 lines · On Friday 25 December 2015 13:53:11 Pali Rohár wrote:
Quoted 7 lines · On Monday 18 May 2015 17:07:57 Arnd Bergmann wrote:
Quoted 5 lines · On Monday 18 May 2015 08:06:07 Tony Lindgren wrote:
Quoted 1 line · Arnd Bergmann
On Friday 15 May 2015 23:22:37 Pali Rohár wrote:
If setting up the generic binding is expected to take a while, you can naturally pass it in pdata while waiting for the generic binding to get merged.
Quoted 6 lines
Quoted 4 lines
Yes, good idea. So the n900 machine can use auxdata to pass this for the time being, while the binding and generic implementation is being worked out.
Ok, so what is needed to finish this patch series?
I don't know where we are at this point. Has either the auxdata approach or the generic binding been worked on at all?
If not, please try to get the auxdata variant to work, it should not be hard at all because there is no dependency on a generic binding.
Arnd
Re: [PATCH 1/2] mmc: omap_hsmmc: Add support for slot-name property in DT
Quoted 9 lines · On Monday 28 December 2015 15:14:50 Arnd Bergmann wrote:
Quoted 8 lines · On Friday 25 December 2015 13:53:11 Pali Rohár wrote:
Quoted 7 lines · On Monday 18 May 2015 17:07:57 Arnd Bergmann wrote:
Quoted 5 lines · On Monday 18 May 2015 08:06:07 Tony Lindgren wrote:
Quoted 1 line · Arnd Bergmann
On Friday 15 May 2015 23:22:37 Pali Rohár wrote:
If setting up the generic binding is expected to take a while, you can naturally pass it in pdata while waiting for the generic binding to get merged.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Yes, good idea. So the n900 machine can use auxdata to pass this for the time being, while the binding and generic implementation is being worked out.
Ok, so what is needed to finish this patch series?
I don't know where we are at this point. Has either the auxdata approach or the generic binding been worked on at all?
What are auxdata data? And what do you mean with "generic binding" approach?
Quoted 4 lines
If not, please try to get the auxdata variant to work, it should not be hard at all because there is no dependency on a generic binding.
Arnd
Signature · 2 lines
Pali Rohár [email protected]
Re: [PATCH 1/2] mmc: omap_hsmmc: Add support for slot-name property in DT
Quoted 14 lines · On Monday 28 December 2015 15:28:48 Pali Rohár wrote:
Quoted 13 lines · On Monday 28 December 2015 15:14:50 Arnd Bergmann wrote:
Quoted 12 lines · On Friday 25 December 2015 13:53:11 Pali Rohár wrote:
Quoted 10 lines · On Monday 18 May 2015 17:07:57 Arnd Bergmann wrote:
Quoted 5 lines · On Monday 18 May 2015 08:06:07 Tony Lindgren wrote:
Quoted 1 line · Arnd Bergmann
On Friday 15 May 2015 23:22:37 Pali Rohár wrote:
If setting up the generic binding is expected to take a while, you can naturally pass it in pdata while waiting for the generic binding to get merged.
Yes, good idea. So the n900 machine can use auxdata to pass this for the time being, while the binding and generic implementation is being worked out.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Ok, so what is needed to finish this patch series?
I don't know where we are at this point. Has either the auxdata approach or the generic binding been worked on at all?
What are auxdata data?
I mean you can add the platform data to the omap_auxdata_lookup[] table for this board.
Quoted 1 line
And what do you mean with "generic binding" approach?
Start a discussion to specify slot names and implement that in the mmc driver core, so we can remove the hack from the OMAP driver and make it work the same way for any machine.
Arnd
Re: [PATCH 1/2] mmc: omap_hsmmc: Add support for slot-name property in DT
Quoted 17 lines · On Monday 28 December 2015 15:41:01 Arnd Bergmann wrote:
Quoted 16 lines · On Monday 28 December 2015 15:28:48 Pali Rohár wrote:
Quoted 15 lines · On Monday 28 December 2015 15:14:50 Arnd Bergmann wrote:
Quoted 13 lines · On Friday 25 December 2015 13:53:11 Pali Rohár wrote:
Quoted 10 lines · On Monday 18 May 2015 17:07:57 Arnd Bergmann wrote:
Quoted 5 lines · On Monday 18 May 2015 08:06:07 Tony Lindgren wrote:
Quoted 1 line · Arnd Bergmann
On Friday 15 May 2015 23:22:37 Pali Rohár wrote:
If setting up the generic binding is expected to take a while, you can naturally pass it in pdata while waiting for the generic binding to get merged.
Yes, good idea. So the n900 machine can use auxdata to pass this for the time being, while the binding and generic implementation is being worked out.
Ok, so what is needed to finish this patch series?
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
I don't know where we are at this point. Has either the auxdata approach or the generic binding been worked on at all?
What are auxdata data?
I mean you can add the platform data to the omap_auxdata_lookup[] table for this board.
But can I mix data from omap3-n900.dts and omap_auxdata_lookup[]?
Signature · 2 lines
Pali Rohár [email protected]
Re: [PATCH 1/2] mmc: omap_hsmmc: Add support for slot-name property in DT
Quoted 21 lines · On Monday 28 December 2015 15:54:35 Pali Rohár wrote:
Quoted 20 lines · On Monday 28 December 2015 15:41:01 Arnd Bergmann wrote:
Quoted 19 lines · On Monday 28 December 2015 15:28:48 Pali Rohár wrote:
Quoted 17 lines · On Monday 28 December 2015 15:14:50 Arnd Bergmann wrote:
Quoted 8 lines · On Friday 25 December 2015 13:53:11 Pali Rohár wrote:
Quoted 7 lines · On Monday 18 May 2015 17:07:57 Arnd Bergmann wrote:
Quoted 5 lines · On Monday 18 May 2015 08:06:07 Tony Lindgren wrote:
Quoted 1 line · Arnd Bergmann
On Friday 15 May 2015 23:22:37 Pali Rohár wrote:
If setting up the generic binding is expected to take a while, you can naturally pass it in pdata while waiting for the generic binding to get merged.
Quoted 5 lines
Quoted 3 lines
Yes, good idea. So the n900 machine can use auxdata to pass this for the time being, while the binding and generic implementation is being worked out.
Ok, so what is needed to finish this patch series?
I don't know where we are at this point. Has either the auxdata approach or the generic binding been worked on at all?
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
What are auxdata data?
I mean you can add the platform data to the omap_auxdata_lookup[] table for this board.
But can I mix data from
omap3-n900.dtsand omap_auxdata_lookup[]?
Yes.
Arnd
Re: [PATCH 1/2] mmc: omap_hsmmc: Add support for slot-name property in DT
Quoted 25 lines · On Monday 28 December 2015 15:55:28 Arnd Bergmann wrote:
Quoted 24 lines · On Monday 28 December 2015 15:54:35 Pali Rohár wrote:
Quoted 23 lines · On Monday 28 December 2015 15:41:01 Arnd Bergmann wrote:
Quoted 21 lines · On Monday 28 December 2015 15:28:48 Pali Rohár wrote:
Quoted 13 lines · On Monday 28 December 2015 15:14:50 Arnd Bergmann wrote:
Quoted 12 lines · On Friday 25 December 2015 13:53:11 Pali Rohár wrote:
Quoted 10 lines · On Monday 18 May 2015 17:07:57 Arnd Bergmann wrote:
Quoted 5 lines · On Monday 18 May 2015 08:06:07 Tony Lindgren wrote:
Quoted 1 line · Arnd Bergmann
On Friday 15 May 2015 23:22:37 Pali Rohár wrote:
If setting up the generic binding is expected to take a while, you can naturally pass it in pdata while waiting for the generic binding to get merged.
Yes, good idea. So the n900 machine can use auxdata to pass this for the time being, while the binding and generic implementation is being worked out.
Quoted 5 lines
Quoted 1 line
Ok, so what is needed to finish this patch series?
I don't know where we are at this point. Has either the auxdata approach or the generic binding been worked on at all?
What are auxdata data?
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
I mean you can add the platform data to the omap_auxdata_lookup[] table for this board.
But can I mix data from
omap3-n900.dtsand omap_auxdata_lookup[]?Yes.
Arnd
Hm... looks like it is not possible. omap_hsmmc driver ignores any supplied platform data if there are device tree data. So array omap_auxdata_lookup[] does not help.
Signature · 2 lines
Pali Rohár [email protected]
Re: [PATCH 1/2] mmc: omap_hsmmc: Add support for slot-name property in DT
Quoted 11 lines · On Saturday 02 January 2016 16:22:03 Pali Rohár wrote:
Quoted 7 lines · On Monday 28 December 2015 15:55:28 Arnd Bergmann wrote:
Quoted 5 lines · On Monday 28 December 2015 15:54:35 Pali Rohár wrote:
Quoted 3 lines
I mean you can add the platform data to the omap_auxdata_lookup[] table for this board.
But can I mix data from
omap3-n900.dtsand omap_auxdata_lookup[]?Hm... looks like it is not possible.
omap_hsmmcdriver ignores any supplied platform data if there are device tree data. So array omap_auxdata_lookup[] does not help.
Obviously you need to the driver to work with that setting. Maybe something as simple as
drivers/mmc/host/omap_hsmmc.c +1 -1
@@ -2006,7 +2006,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)void __iomem *base; match =of_match_device (of_match_ptr (omap_mmc_of_match), &pdev->dev); -if (match) { +if (!pdata && match) { pdata =of_get_hsmmc_pdata (&pdev->dev);if (IS_ERR (pdata))
Arnd
Re: [PATCH 1/2] mmc: omap_hsmmc: Add support for slot-name property in DT
Quoted 32 lines · On Saturday 02 January 2016 23:57:47 Arnd Bergmann wrote:
Quoted 11 lines · On Saturday 02 January 2016 16:22:03 Pali Rohár wrote:
Quoted 6 lines · On Monday 28 December 2015 15:55:28 Arnd Bergmann wrote:
Quoted 5 lines · On Monday 28 December 2015 15:54:35 Pali Rohár wrote:
Quoted 2 lines
I mean you can add the platform data to the
omap_auxdata_lookup[] table for this board.But can I mix data from
omap3-n900.dtsand
omap_auxdata_lookup[]?Hm... looks like it is not possible.
omap_hsmmcdriver ignores any supplied platform data if there are device tree data. So array omap_auxdata_lookup[] does not help.Obviously you need to the driver to work with that setting. Maybe something as simple as
(quoted diff) +0
-0
b/drivers/mmc/host/omap_hsmmc.cindexe06b1881b6a1..4fa35fc84b8b100644drivers/mmc/host/omap_hsmmc.c +1
-0@@ -2006,7 +2006,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev) void __iomem *base; match =of_match_device (of_match_ptr (omap_mmc_of_match), &pdev->dev); - if (match) { +if (!pdata && match) { pdata =of_get_hsmmc_pdata (&pdev->dev);if (IS_ERR (pdata))
Quoted 1 line
Arnd
But in this case I must copy mmc definition from omap3-n900.dts file back to board code to omap_auxdata_lookup[]. And mmc definitions in omap3-n900.dts will be ignored. This is step back.
Mixing mmc definitions from DTS file together with omap_auxdata_lookup[] just will not work.
Signature · 2 lines
Pali Rohár [email protected]
Re: [PATCH 1/2] mmc: omap_hsmmc: Add support for slot-name property in DT
Quoted 37 lines · On Sunday 03 January 2016 00:03:54 Pali Rohár wrote:
Quoted 23 lines · On Saturday 02 January 2016 23:57:47 Arnd Bergmann wrote:
Quoted 11 lines · On Saturday 02 January 2016 16:22:03 Pali Rohár wrote:
Quoted 6 lines · On Monday 28 December 2015 15:55:28 Arnd Bergmann wrote:
Quoted 5 lines · On Monday 28 December 2015 15:54:35 Pali Rohár wrote:
Quoted 2 lines
I mean you can add the platform data to the
omap_auxdata_lookup[] table for this board.But can I mix data from
omap3-n900.dtsand
omap_auxdata_lookup[]?Hm... looks like it is not possible.
omap_hsmmcdriver ignores any supplied platform data if there are device tree data. So array omap_auxdata_lookup[] does not help.Obviously you need to the driver to work with that setting. Maybe something as simple as
(quoted diff) +0
-0
b/drivers/mmc/host/omap_hsmmc.cindexe06b1881b6a1..4fa35fc84b8b100644drivers/mmc/host/omap_hsmmc.c static int omap_hsmmc_probe(struct · line 2012
Quoted 8 lines
drivers/mmc/host/omap_hsmmc.c +1
-0@@ -2006,7 +2006,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev) void __iomem *base; match =of_match_device (of_match_ptr (omap_mmc_of_match), &pdev->dev); - if (match) { +if (!pdata && match) { pdata =of_get_hsmmc_pdata (&pdev->dev);if (IS_ERR (pdata))But in this case I must copy mmc definition from
omap3-n900.dtsfile back to board code to omap_auxdata_lookup[]. And mmc definitions inomap3-n900.dtswill be ignored. This is step back.
Quoted 2 lines
Mixing mmc definitions from DTS file together with omap_auxdata_lookup[] just will not work.
As I said earlier, if you prefer to avoid the auxdata hack, you are also welcome to work on support for named slots in the MMC core code, it will just be more work and will take time to get consensus on.
Arnd
PATCH 2/2 omap3-n900.dts: Add slot-name properties for mmc devices
In reply to Pali Rohár--- arch/arm/boot/dts/omap3-n900.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/omap3-n900.dts +2 -0
@@ -678,6 +678,7 @@ }; &mmc1 { + slot-name = "external"; pinctrl-names = "default"; pinctrl-0 = <&mmc1_pins>; vmmc-supply = <&vmmc1>;
@@ -687,6 +688,7 @@ /* most boards use vaux3, only some old versions use vmmc2 instead */ &mmc2 { + slot-name = "internal"; pinctrl-names = "default"; pinctrl-0 = <&mmc2_pins>; vmmc-supply = <&vaux3>;
Signature · 1 line
1.7.9.5