hc
2024-08-12 233ab1bd4c5697f5cdec94e60206e8c6ac609b4c
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
46
47
48
49
50
51
52
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (C) 2020 Rockchip Electronics Co., Ltd
 *
 * Based on include/soc/rockchip/rockchip_phy_typec.h in Linux Kernel.
 */
 
#ifndef __LINUX_ROCKCHIP_PHY_TYPEC_H
#define __LINUX_ROCKCHIP_PHY_TYPEC_H
 
#include <reset.h>
 
struct usb3phy_reg {
   u32 offset;
   u32 enable_bit;
   u32 write_enable;
};
 
struct rockchip_usb3phy_port_cfg {
   struct usb3phy_reg typec_conn_dir;
   struct usb3phy_reg usb3tousb2_en;
   struct usb3phy_reg usb3host_disable;
   struct usb3phy_reg usb3host_port;
   struct usb3phy_reg external_psm;
   struct usb3phy_reg pipe_status;
};
 
struct rockchip_typec_phy {
   struct udevice *dev;
   void __iomem *base;
   void __iomem *grf_regs;
   struct reset_ctl uphy_rst;
   struct reset_ctl pipe_rst;
   struct reset_ctl tcphy_rst;
   struct rockchip_usb3phy_port_cfg port_cfgs;
   /* mutex to protect access to individual PHYs */
   struct mutex lock;
 
   bool flip;
   u8 mode;
};
 
#if CONFIG_IS_ENABLED(PHY_ROCKCHIP_TYPEC)
int rockchip_u3phy_uboot_init(const char *name);
#else
static inline int rockchip_u3phy_uboot_init(const char *name)
{
   return -ENOTSUPP;
}
#endif
 
#endif /* __LINUX_ROCKCHIP_PHY_TYPEC_H */