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