diff options
author | Kever Yang <kever.yang@rock-chips.com> | 2017-02-23 15:37:52 +0800 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-03-16 16:03:46 -0600 |
commit | 41793000d77172a7472aad256049473c00e29dc5 (patch) | |
tree | 6c0afeb6daceaa53713d1ce9fa786c81e12ccbdd /arch/arm/mach-rockchip/rk3328 | |
parent | 85a3cfb80aeda3500e32816f2d9c9ec66bf3b50e (diff) |
rockchip: rk3328: add clock driver
Add rk3328 clock driver and cru structure definition.
Signed-off-by: William Zhang <william.zhang@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'arch/arm/mach-rockchip/rk3328')
-rw-r--r-- | arch/arm/mach-rockchip/rk3328/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-rockchip/rk3328/clk_rk3328.c | 31 |
2 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/rk3328/Makefile b/arch/arm/mach-rockchip/rk3328/Makefile index 8ecf8eed1c..bbab036a12 100644 --- a/arch/arm/mach-rockchip/rk3328/Makefile +++ b/arch/arm/mach-rockchip/rk3328/Makefile @@ -4,5 +4,6 @@ # SPDX-License-Identifier: GPL-2.0+ # +obj-y += clk_rk3328.o obj-y += rk3328.o obj-y += syscon_rk3328.o diff --git a/arch/arm/mach-rockchip/rk3328/clk_rk3328.c b/arch/arm/mach-rockchip/rk3328/clk_rk3328.c new file mode 100644 index 0000000000..1205516227 --- /dev/null +++ b/arch/arm/mach-rockchip/rk3328/clk_rk3328.c @@ -0,0 +1,31 @@ +/* + * (C) Copyright 2017 Rockchip Electronics Co., Ltd + * + * SPDX-License-Identifier: GPL-2.0 + */ + +#include <common.h> +#include <dm.h> +#include <asm/arch/clock.h> +#include <asm/arch/cru_rk3328.h> + +int rockchip_get_clk(struct udevice **devp) +{ + return uclass_get_device_by_driver(UCLASS_CLK, + DM_GET_DRIVER(rockchip_rk3328_cru), devp); +} + +void *rockchip_get_cru(void) +{ + struct rk3328_clk_priv *priv; + struct udevice *dev; + int ret; + + ret = rockchip_get_clk(&dev); + if (ret) + return ERR_PTR(ret); + + priv = dev_get_addr_ptr(dev); + + return priv->cru; +} |