diff options
author | Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | 2020-03-04 15:42:17 +0900 |
---|---|---|
committer | Geert Uytterhoeven <geert+renesas@glider.be> | 2020-03-09 09:29:58 +0100 |
commit | 1ab4f43927a452ef24cd47ef686f3e1cbac9ab61 (patch) | |
tree | 5a74c50049c8afa2216380a8b1f54be26a080450 /drivers/clk/renesas/rcar-usb2-clock-sel.c | |
parent | 80cf67dd010b4a187360bb8ce8a1974bdad8c076 (diff) | |
download | linux-stable-1ab4f43927a452ef24cd47ef686f3e1cbac9ab61.tar.gz linux-stable-1ab4f43927a452ef24cd47ef686f3e1cbac9ab61.tar.bz2 linux-stable-1ab4f43927a452ef24cd47ef686f3e1cbac9ab61.zip |
clk: renesas: rcar-usb2-clock-sel: Add reset_control
This hardware needs to deassert resets of both host and peripheral.
So, this patch adds reset control.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/1583304137-28482-5-git-send-email-yoshihiro.shimoda.uh@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Diffstat (limited to 'drivers/clk/renesas/rcar-usb2-clock-sel.c')
-rw-r--r-- | drivers/clk/renesas/rcar-usb2-clock-sel.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/clk/renesas/rcar-usb2-clock-sel.c b/drivers/clk/renesas/rcar-usb2-clock-sel.c index d5f47ab017b7..d4c02986c34e 100644 --- a/drivers/clk/renesas/rcar-usb2-clock-sel.c +++ b/drivers/clk/renesas/rcar-usb2-clock-sel.c @@ -19,6 +19,7 @@ #include <linux/platform_device.h> #include <linux/pm.h> #include <linux/pm_runtime.h> +#include <linux/reset.h> #include <linux/slab.h> #define USB20_CLKSET0 0x00 @@ -35,6 +36,7 @@ struct usb2_clock_sel_priv { void __iomem *base; struct clk_hw hw; struct clk_bulk_data clks[ARRAY_SIZE(rcar_usb2_clocks)]; + struct reset_control *rsts; bool extal; bool xtal; }; @@ -62,10 +64,16 @@ static int usb2_clock_sel_enable(struct clk_hw *hw) struct usb2_clock_sel_priv *priv = to_priv(hw); int ret; - ret = clk_bulk_prepare_enable(ARRAY_SIZE(priv->clks), priv->clks); + ret = reset_control_deassert(priv->rsts); if (ret) return ret; + ret = clk_bulk_prepare_enable(ARRAY_SIZE(priv->clks), priv->clks); + if (ret) { + reset_control_assert(priv->rsts); + return ret; + } + usb2_clock_sel_enable_extal_only(priv); return 0; @@ -78,6 +86,7 @@ static void usb2_clock_sel_disable(struct clk_hw *hw) usb2_clock_sel_disable_extal_only(priv); clk_bulk_disable_unprepare(ARRAY_SIZE(priv->clks), priv->clks); + reset_control_assert(priv->rsts); } /* @@ -151,6 +160,10 @@ static int rcar_usb2_clock_sel_probe(struct platform_device *pdev) if (ret < 0) return ret; + priv->rsts = devm_reset_control_array_get(dev, true, false); + if (IS_ERR(priv->rsts)) + return PTR_ERR(priv->rsts); + pm_runtime_enable(dev); pm_runtime_get_sync(dev); |