1 /* 2 * (C) Copyright 2008-2017 Fuzhou Rockchip Electronics Co., Ltd 3 * 4 * SPDX-License-Identifier: GPL-2.0+ 5 */ 6 7 #ifndef _ROCKCHIP_PHY_H_ 8 #define _ROCKCHIP_PHY_H_ 9 10 struct rockchip_phy; 11 12 struct rockchip_phy_funcs { 13 int (*init)(struct rockchip_phy *phy); 14 int (*power_on)(struct rockchip_phy *phy); 15 int (*power_off)(struct rockchip_phy *phy); 16 unsigned long (*set_pll)(struct rockchip_phy *phy, unsigned long rate); 17 int (*set_bus_width)(struct rockchip_phy *phy, u32 bus_width); 18 long (*round_rate)(struct rockchip_phy *phy, unsigned long rate); 19 }; 20 21 struct rockchip_phy { 22 struct udevice *dev; 23 const struct rockchip_phy_funcs *funcs; 24 const void *data; 25 }; 26 27 int rockchip_phy_init(struct rockchip_phy *phy); 28 int rockchip_phy_power_off(struct rockchip_phy *phy); 29 int rockchip_phy_power_on(struct rockchip_phy *phy); 30 unsigned long rockchip_phy_set_pll(struct rockchip_phy *phy, 31 unsigned long rate); 32 int rockchip_phy_set_bus_width(struct rockchip_phy *phy, u32 bus_width); 33 long rockchip_phy_round_rate(struct rockchip_phy *phy, unsigned long rate); 34 35 #endif 36