1186f8572SMark Yao /* 2186f8572SMark Yao * (C) Copyright 2008-2017 Fuzhou Rockchip Electronics Co., Ltd 3186f8572SMark Yao * 4186f8572SMark Yao * SPDX-License-Identifier: GPL-2.0+ 5186f8572SMark Yao */ 6186f8572SMark Yao 7186f8572SMark Yao #ifndef _ROCKCHIP_PHY_H_ 8186f8572SMark Yao #define _ROCKCHIP_PHY_H_ 9186f8572SMark Yao 10396701fdSWyon Bi enum phy_mode { 119e3ffb10SGuochun Huang PHY_MODE_INVALID, 12*3091368dSGuochun Huang PHY_MODE_MIPI_DPHY, 139e3ffb10SGuochun Huang PHY_MODE_VIDEO_LVDS, 149e3ffb10SGuochun Huang PHY_MODE_VIDEO_TTL, 15396701fdSWyon Bi }; 16396701fdSWyon Bi 1715081c50SWyon Bi struct rockchip_phy; 1815081c50SWyon Bi 19186f8572SMark Yao struct rockchip_phy_funcs { 2015081c50SWyon Bi int (*init)(struct rockchip_phy *phy); 2115081c50SWyon Bi int (*power_on)(struct rockchip_phy *phy); 2215081c50SWyon Bi int (*power_off)(struct rockchip_phy *phy); 2315081c50SWyon Bi unsigned long (*set_pll)(struct rockchip_phy *phy, unsigned long rate); 2415081c50SWyon Bi int (*set_bus_width)(struct rockchip_phy *phy, u32 bus_width); 2515081c50SWyon Bi long (*round_rate)(struct rockchip_phy *phy, unsigned long rate); 26396701fdSWyon Bi int (*set_mode)(struct rockchip_phy *phy, enum phy_mode mode); 27186f8572SMark Yao }; 28186f8572SMark Yao 29186f8572SMark Yao struct rockchip_phy { 3015081c50SWyon Bi struct udevice *dev; 31186f8572SMark Yao const struct rockchip_phy_funcs *funcs; 32186f8572SMark Yao const void *data; 3327d50ce7SNickey Yang int soc_type; 34186f8572SMark Yao }; 35186f8572SMark Yao 3615081c50SWyon Bi int rockchip_phy_init(struct rockchip_phy *phy); 3715081c50SWyon Bi int rockchip_phy_power_off(struct rockchip_phy *phy); 3815081c50SWyon Bi int rockchip_phy_power_on(struct rockchip_phy *phy); 3915081c50SWyon Bi unsigned long rockchip_phy_set_pll(struct rockchip_phy *phy, 40186f8572SMark Yao unsigned long rate); 4115081c50SWyon Bi int rockchip_phy_set_bus_width(struct rockchip_phy *phy, u32 bus_width); 4215081c50SWyon Bi long rockchip_phy_round_rate(struct rockchip_phy *phy, unsigned long rate); 43396701fdSWyon Bi int rockchip_phy_set_mode(struct rockchip_phy *phy, enum phy_mode mode); 44186f8572SMark Yao 45186f8572SMark Yao #endif 46