From: Kever Yang Date: Tue, 20 Mar 2018 22:46:45 +0800 Subject: [U-Boot] [PATCH] rockchip: clk: rk3288: add clk_enable function and support USB HOST0/HSIC In-Reply-To: <1521473969-39054-1-git-send-email-w.egorov@phytec.de> References: <1521473969-39054-1-git-send-email-w.egorov@phytec.de> Message-ID: <19208938-5c94-bd53-46aa-bd76d7652031@rock-chips.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Wadim, On 03/19/2018 11:39 PM, Wadim Egorov wrote: > The generic ehci-driver (ehci-generic.c) will try to enable the clocks > listed in the DTSI. If this fails (e.g. due to clk_enable not being > implemented in a driver and -ENOSYS being returned by the clk-uclass), > the driver will bail our and print an error message. Does ehci driver update this feature recently? I think the driver works for me before without clk_enable(). BTW, I don't think we add this kind of no use call back in clock driver is an good idea. Thanks, - Kever > > This implements a minimal clk_enable for the RK3288 and supports the > clocks mandatory for the EHCI controllers; as these are enabled by > default we simply return success. > > Signed-off-by: Wadim Egorov > --- > drivers/clk/rockchip/clk_rk3288.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/drivers/clk/rockchip/clk_rk3288.c b/drivers/clk/rockchip/clk_rk3288.c > index 552a71a..a028b8b 100644 > --- a/drivers/clk/rockchip/clk_rk3288.c > +++ b/drivers/clk/rockchip/clk_rk3288.c > @@ -893,12 +893,25 @@ static int __maybe_unused rk3288_clk_set_parent(struct clk *clk, struct clk *par > return -ENOENT; > } > > +static int rk3288_clk_enable(struct clk *clk) > +{ > + switch (clk->id) { > + case HCLK_USBHOST0: > + case HCLK_HSIC: > + return 0; > + } > + > + debug("%s: unsupported clk %ld\n", __func__, clk->id); > + return -ENOENT; > +} > + > static struct clk_ops rk3288_clk_ops = { > .get_rate = rk3288_clk_get_rate, > .set_rate = rk3288_clk_set_rate, > #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) > .set_parent = rk3288_clk_set_parent, > #endif > + .enable = rk3288_clk_enable, > }; > > static int rk3288_clk_ofdata_to_platdata(struct udevice *dev)