mmc: sdhci-of-arasan: Add support to request the "gate" clock
Subsystems (3)
PATCH 1/1 mmc: sdhci-of-arasan: Add support to request the "gate" clock
Add support to read the optional "gate" clock property and request the clock which will be used to ungate the DLL clock.
For Xilinx platforms which has DLL module, dll clock must be ungated/enabled when SD controller operates at higher frequencies like 50 MHz, 100 MHz and 200 MHz. This will be done by explicitly requesting gate clock from the driver.
--- drivers/mmc/host/sdhci-of-arasan.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/mmc/host/sdhci-of-arasan.c +7 -0
@@ -1870,6 +1870,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev)int ret;struct device_node *node;struct clk *clk_xin; +struct clk *clk_dll;struct sdhci_host *host;struct sdhci_pltfm_host *pltfm_host;struct device *dev = &pdev->dev;
@@ -1943,6 +1944,12 @@ static int sdhci_arasan_probe(struct platform_device *pdev) goto clk_dis_ahb; } + clk_dll =devm_clk_get_optional_enabled (dev,"gate" ); +if (IS_ERR (clk_dll)) { + ret =dev_err_probe (dev,PTR_ERR (clk_dll),"failed to get dll clk\n" ); + goto clk_disable_all; + } +if (of_property_read_bool (np,"xlnx,fails-without-test-cd" )) sdhci_arasan->quirks |=SDHCI_ARASAN_QUIRK_FORCE_CDTEST ;
Signature · 1 line
2.17.1
Quoted 28 lines · Swati Agarwal
Add support to read the optional "gate" clock property and request the clock which will be used to ungate the DLL clock.
For Xilinx platforms which has DLL module, dll clock must be ungated/enabled when SD controller operates at higher frequencies like 50 MHz, 100 MHz and 200 MHz. This will be done by explicitly requesting gate clock from the driver.
Signed-off-by Swati Agarwal <[email protected]>--- drivers/mmc/host/sdhci-of-arasan.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/mmc/host/sdhci-of-arasan.c +1
-0@@ -1870,6 +1870,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev)int ret;struct device_node *node;struct clk *clk_xin; +struct clk *clk_dll;struct sdhci_host *host;struct sdhci_pltfm_host *pltfm_host;struct device *dev = &pdev->dev;@@ -1943,6 +1944,12 @@ static int sdhci_arasan_probe(struct platform_device *pdev) goto clk_dis_ahb; }
drivers/mmc/host/sdhci-of-arasan.c static int sdhci_arasan_probe(struct platform_device *pdev) · line 1955
Quoted 10 lines
drivers/mmc/host/sdhci-of-arasan.c +6
-0+ clk_dll =devm_clk_get_optional_enabled (dev,"gate" ); +if (IS_ERR (clk_dll)) { + ret =dev_err_probe (dev,PTR_ERR (clk_dll),"failed to get dll clk\n" ); + goto clk_disable_all; + } +if (of_property_read_bool (np,"xlnx,fails-without-test-cd" )) sdhci_arasan->quirks |=SDHCI_ARASAN_QUIRK_FORCE_CDTEST ;
Based on available information, that it is not clear what gate clock really is and what it is used for, I think the patch is correct.
Thanks,
Michal
Quoted 8 lines · Swati Agarwal
Add support to read the optional "gate" clock property and request the clock which will be used to ungate the DLL clock.
For Xilinx platforms which has DLL module, dll clock must be ungated/enabled when SD controller operates at higher frequencies like 50 MHz, 100 MHz and 200 MHz. This will be done by explicitly requesting gate clock from the driver.
I guess we need to update the DT bindings too?
Kind regards
Uffe
Quoted 34 lines
Signed-off-by Swati Agarwal <[email protected]>--- drivers/mmc/host/sdhci-of-arasan.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/mmc/host/sdhci-of-arasan.c +7
-1@@ -1870,6 +1870,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev)int ret;struct device_node *node;struct clk *clk_xin; +struct clk *clk_dll;struct sdhci_host *host;struct sdhci_pltfm_host *pltfm_host;struct device *dev = &pdev->dev;@@ -1943,6 +1944,12 @@ static int sdhci_arasan_probe(struct platform_device *pdev) goto clk_dis_ahb; } + clk_dll =devm_clk_get_optional_enabled (dev,"gate" ); +if (IS_ERR (clk_dll)) { + ret =dev_err_probe (dev,PTR_ERR (clk_dll),"failed to get dll clk\n" ); + goto clk_disable_all; + } +if (of_property_read_bool (np,"xlnx,fails-without-test-cd" )) sdhci_arasan->quirks |=SDHCI_ARASAN_QUIRK_FORCE_CDTEST ; --2.17.1
Michal Simek
maintainerQuoted 8 lines · Ulf Hansson
CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
Quoted 4 lines · Swati Agarwal
Add support to read the optional "gate" clock property and request the clock which will be used to ungate the DLL clock.
Quoted 6 lines
Quoted 4 lines
For Xilinx platforms which has DLL module, dll clock must be ungated/enabled when SD controller operates at higher frequencies like 50 MHz, 100 MHz and 200 MHz. This will be done by explicitly requesting gate clock from the driver.
I guess we need to update the DT bindings too?
DT binding has it already. It is just not used.
Thanks,
Michal
Quoted 17 lines · Michal Simek
Quoted 13 lines · Ulf Hansson
CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
Quoted 8 lines · Swati Agarwal
Add support to read the optional "gate" clock property and request the clock which will be used to ungate the DLL clock.
For Xilinx platforms which has DLL module, dll clock must be ungated/enabled when SD controller operates at higher frequencies like 50 MHz, 100 MHz and 200 MHz. This will be done by explicitly requesting gate clock from the driver.
Quoted 5 lines
Quoted 1 line
I guess we need to update the DT bindings too?
DT binding has it already. It is just not used.
Aha, thanks for the pointer!
Kind regards
Uffe
Quoted 9 lines · Swati Agarwal
Add support to read the optional "gate" clock property and request the clock which will be used to ungate the DLL clock.
For Xilinx platforms which has DLL module, dll clock must be ungated/enabled when SD controller operates at higher frequencies like 50 MHz, 100 MHz and 200 MHz. This will be done by explicitly requesting gate clock from the driver.
Signed-off-by Swati Agarwal <[email protected]>
Quoted 29 lines
--- drivers/mmc/host/sdhci-of-arasan.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/mmc/host/sdhci-of-arasan.c +7
-0@@ -1870,6 +1870,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev)int ret;struct device_node *node;struct clk *clk_xin; +struct clk *clk_dll;struct sdhci_host *host;struct sdhci_pltfm_host *pltfm_host;struct device *dev = &pdev->dev;@@ -1943,6 +1944,12 @@ static int sdhci_arasan_probe(struct platform_device *pdev) goto clk_dis_ahb; } + clk_dll =devm_clk_get_optional_enabled (dev,"gate" ); +if (IS_ERR (clk_dll)) { + ret =dev_err_probe (dev,PTR_ERR (clk_dll),"failed to get dll clk\n" ); + goto clk_disable_all; + } +if (of_property_read_bool (np,"xlnx,fails-without-test-cd" )) sdhci_arasan->quirks |=SDHCI_ARASAN_QUIRK_FORCE_CDTEST ;
Quoted 10 lines · Swati Agarwal
Add support to read the optional "gate" clock property and request the clock which will be used to ungate the DLL clock.
For Xilinx platforms which has DLL module, dll clock must be ungated/enabled when SD controller operates at higher frequencies like 50 MHz, 100 MHz and 200 MHz. This will be done by explicitly requesting gate clock from the driver.
Signed-off-by Swati Agarwal <[email protected]>
Applied for next, thanks!
Kind regards
Uffe
Quoted 32 lines
--- drivers/mmc/host/sdhci-of-arasan.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/mmc/host/sdhci-of-arasan.c +7
-1@@ -1870,6 +1870,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev)int ret;struct device_node *node;struct clk *clk_xin; +struct clk *clk_dll;struct sdhci_host *host;struct sdhci_pltfm_host *pltfm_host;struct device *dev = &pdev->dev;@@ -1943,6 +1944,12 @@ static int sdhci_arasan_probe(struct platform_device *pdev) goto clk_dis_ahb; } + clk_dll =devm_clk_get_optional_enabled (dev,"gate" ); +if (IS_ERR (clk_dll)) { + ret =dev_err_probe (dev,PTR_ERR (clk_dll),"failed to get dll clk\n" ); + goto clk_disable_all; + } +if (of_property_read_bool (np,"xlnx,fails-without-test-cd" )) sdhci_arasan->quirks |=SDHCI_ARASAN_QUIRK_FORCE_CDTEST ; --2.17.1