mmc: meson-gx: add device reset
Jerome Brunet
reviewerPATCH 1/1 mmc: meson-gx: add device reset
Trigger the reset line of the mmc controller while probing, if available The reset should be optional for now, at least until all related DT node have the reset property
--- Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt | 2 ++ drivers/mmc/host/meson-gx-mmc.c | 6 ++++++ 2 files changed, 8 insertions(+)
Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt +2 -0
@@ -20,6 +20,7 @@ Required properties: "clkin1" - Other parent clock of internal mux The driver has an internal mux clock which switches between clkin0 and clkin1 depending on the clock rate requested by the MMC core. +- reset : phandle of the internal reset line Example:
@@ -30,4 +31,5 @@ Example: clocks = <&clkc CLKID_SD_EMMC_A>, <&xtal>, <&clkc CLKID_FCLK_DIV2>; clock-names = "core", "clkin0", "clkin1"; pinctrl-0 = <&emmc_pins>; + resets = <&reset RESET_SD_EMMC_A>; };
drivers/mmc/host/meson-gx-mmc.c +6 -0
@@ -35,6 +35,7 @@#include <linux/clk.h> #include <linux/clk-provider.h> #include <linux/regulator/consumer.h> +#include <linux/reset.h> #include <linux/interrupt.h> #include <linux/bitfield.h> #include <linux/pinctrl/consumer.h>
@@ -1212,6 +1213,11 @@ static int meson_mmc_probe(struct platform_device *pdev) goto free_host; } + ret =device_reset_optional (&pdev->dev); +if (ret) +if (ret != -EPROBE_DEFER ) +dev_err (&pdev->dev,"device reset failed: %d\n" , ret); + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); host->regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (host->regs)) {
Signature · 1 line
2.14.3
Quoted 7 lines · Jerome Brunet
Trigger the reset line of the mmc controller while probing, if available The reset should be optional for now, at least until all related DT node have the reset property
Signed-off-by Jerome Brunet <[email protected]>--- Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt | 2 ++
Please move DT doc changes into separate patches. And make the DT maintainers are in to field as well.
Otherwise, this looks good to me.
Kind regards
Uffe
Quoted 48 lines
drivers/mmc/host/meson-gx-mmc.c | 6 ++++++ 2 files changed, 8 insertions(+)Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt +2
-0@@ -20,6 +20,7 @@ Required properties: "clkin1" - Other parent clock of internal mux The driver has an internal mux clock which switches between clkin0 and clkin1 depending on the clock rate requested by the MMC core. +- reset : phandle of the internal reset line Example:@@ -30,4 +31,5 @@ Example: clocks = <&clkc CLKID_SD_EMMC_A>, <&xtal>, <&clkc CLKID_FCLK_DIV2>; clock-names = "core", "clkin0", "clkin1"; pinctrl-0 = <&emmc_pins>; + resets = <&reset RESET_SD_EMMC_A>; };drivers/mmc/host/meson-gx-mmc.c +6
-1@@ -35,6 +35,7 @@#include <linux/clk.h> #include <linux/clk-provider.h> #include <linux/regulator/consumer.h> +#include <linux/reset.h> #include <linux/interrupt.h> #include <linux/bitfield.h> #include <linux/pinctrl/consumer.h> @@ -1212,6 +1213,11 @@ static int meson_mmc_probe(struct platform_device *pdev) goto free_host; } + ret =device_reset_optional (&pdev->dev); +if (ret) +if (ret != -EPROBE_DEFER ) +dev_err (&pdev->dev,"device reset failed: %d\n" , ret); + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); host->regs =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (host->regs)) { --2.14.3
Quoted 5 lines · Jerome Brunet
Trigger the reset line of the mmc controller while probing, if available The reset should be optional for now, at least until all related DT node have the reset property
Signed-off-by Jerome Brunet <[email protected]>
Rob Herring
maintainerQuoted 15 lines · Jerome Brunet
Trigger the reset line of the mmc controller while probing, if available The reset should be optional for now, at least until all related DT node have the reset property
Signed-off-by Jerome Brunet <[email protected]>--- Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt | 2 ++ drivers/mmc/host/meson-gx-mmc.c | 6 ++++++ 2 files changed, 8 insertions(+)Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt +0
-0
Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt Required properties: · line 23
Quoted 4 lines
Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt +1
-0@@ -20,6 +20,7 @@ Required properties: "clkin1" - Other parent clock of internal mux The driver has an internal mux clock which switches between clkin0 and clkin1 depending on the clock rate requested by the MMC core. +- reset : phandle of the internal reset line
resets
Quoted 9 lines
Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt +1
-0Example:@@ -30,4 +31,5 @@ Example: clocks = <&clkc CLKID_SD_EMMC_A>, <&xtal>, <&clkc CLKID_FCLK_DIV2>; clock-names = "core", "clkin0", "clkin1"; pinctrl-0 = <&emmc_pins>; + resets = <&reset RESET_SD_EMMC_A>; };