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_funcs { 11 int (*init)(struct display_state *state); 12 int (*power_on)(struct display_state *state); 13 int (*power_off)(struct display_state *state); 14 unsigned long (*set_pll)(struct display_state *state, 15 unsigned long rate); 16 void (*set_bus_width)(struct display_state *state, u32 bus_width); 17 long (*round_rate)(struct display_state *state, unsigned long rate); 18 }; 19 20 struct rockchip_phy { 21 const struct rockchip_phy_funcs *funcs; 22 const void *data; 23 }; 24 25 const struct rockchip_phy * 26 rockchip_get_phy(const void *blob, int phy_node); 27 int rockchip_phy_power_off(struct display_state *state); 28 int rockchip_phy_power_on(struct display_state *state); 29 unsigned long rockchip_phy_set_pll(struct display_state *state, 30 unsigned long rate); 31 void rockchip_phy_set_bus_width(struct display_state *state, u32 bus_width); 32 long rockchip_phy_round_rate(struct display_state *state, unsigned long rate); 33 34 #ifdef CONFIG_DRM_ROCKCHIP_DW_MIPI_DSI 35 extern const struct rockchip_phy_funcs inno_mipi_dphy_funcs; 36 #endif 37 #ifdef CONFIG_ROCKCHIP_INNO_HDMI_PHY 38 extern const struct rockchip_phy_funcs inno_hdmi_phy_funcs; 39 #endif 40 #endif 41