mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-10-31 03:58:17 +00:00 
			
		
		
		
	As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
		
			
				
	
	
		
			33 lines
		
	
	
		
			615 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			615 B
		
	
	
	
		
			C
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-2.0+
 | |
| /*
 | |
|  * Copyright (C) 2015 Google, Inc
 | |
|  * Written by Simon Glass <sjg@chromium.org>
 | |
|  */
 | |
| 
 | |
| #include <dm.h>
 | |
| #include <syscon.h>
 | |
| #include <asm/arch-rockchip/clock.h>
 | |
| #include <asm/arch-rockchip/cru_rk3188.h>
 | |
| #include <linux/err.h>
 | |
| 
 | |
| int rockchip_get_clk(struct udevice **devp)
 | |
| {
 | |
| 	return uclass_get_device_by_driver(UCLASS_CLK,
 | |
| 			DM_DRIVER_GET(rockchip_rk3188_cru), devp);
 | |
| }
 | |
| 
 | |
| void *rockchip_get_cru(void)
 | |
| {
 | |
| 	struct rk3188_clk_priv *priv;
 | |
| 	struct udevice *dev;
 | |
| 	int ret;
 | |
| 
 | |
| 	ret = rockchip_get_clk(&dev);
 | |
| 	if (ret)
 | |
| 		return ERR_PTR(ret);
 | |
| 
 | |
| 	priv = dev_get_priv(dev);
 | |
| 
 | |
| 	return priv->cru;
 | |
| }
 |