mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-18 02:38:56 +00:00
2577d3f924
rk3399 has two clock-controller: cru and pmucru, update the rockchip_get_crui() API, and rockchip_get_clk() do not used for other module. Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
33 lines
601 B
C
33 lines
601 B
C
/*
|
|
* Copyright (C) 2016 Google, Inc
|
|
* Written by Simon Glass <sjg@chromium.org>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <dm.h>
|
|
#include <syscon.h>
|
|
#include <asm/arch/clock.h>
|
|
#include <asm/arch/cru_rk3399.h>
|
|
|
|
static int rockchip_get_cruclk(struct udevice **devp)
|
|
{
|
|
return uclass_get_device_by_driver(UCLASS_CLK,
|
|
DM_GET_DRIVER(clk_rk3399), devp);
|
|
}
|
|
|
|
void *rockchip_get_cru(void)
|
|
{
|
|
struct rk3399_clk_priv *priv;
|
|
struct udevice *dev;
|
|
int ret;
|
|
|
|
ret = rockchip_get_cruclk(&dev);
|
|
if (ret)
|
|
return ERR_PTR(ret);
|
|
|
|
priv = dev_get_priv(dev);
|
|
|
|
return priv->cru;
|
|
}
|