RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
phye.h
浏览该文件的文档.
1/*
2 * Copyright (c) 2006-2022, RT-Thread Development Team
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Change Logs:
7 * Date Author Notes
8 * 2022-10-24 GuEe-GUI first version
9 */
10
11#ifndef __PHYE_H__
12#define __PHYE_H__
13
14#include <rtthread.h>
15#include <drivers/ofw.h>
16
47
48struct rt_phye_ops;
49
50struct rt_phye
51{
52 struct rt_device *dev;
53
54 const struct rt_phye_ops *ops;
55
59};
60
62{
63 rt_err_t (*init)(struct rt_phye *phye);
64 rt_err_t (*exit)(struct rt_phye *phye);
65 rt_err_t (*reset)(struct rt_phye *phye);
66 rt_err_t (*power_on)(struct rt_phye *phye);
67 rt_err_t (*power_off)(struct rt_phye *phye);
68 rt_err_t (*set_mode)(struct rt_phye *phye, enum rt_phye_mode mode, int submode);
69 rt_err_t (*ofw_parse)(struct rt_phye *phye, struct rt_ofw_cell_args *phye_args);
70};
71
74
80rt_err_t rt_phye_set_mode(struct rt_phye *phye, enum rt_phye_mode mode, int submode);
81
82rt_inline rt_err_t rt_phye_set_mode_simple(struct rt_phye *phye, enum rt_phye_mode mode)
83{
84 return rt_phye_set_mode(phye, mode, RT_PHYE_MODE_INVALID);
85}
86
87struct rt_phye *rt_phye_get_by_index(struct rt_device *dev, int index);
88struct rt_phye *rt_phye_get_by_name(struct rt_device *dev, const char *id);
89void rt_phye_put(struct rt_phye *phye);
90
91#endif /* __PHYE_H__ */
rt_err_t rt_phye_init(struct rt_phye *phye)
rt_err_t rt_phye_exit(struct rt_phye *phye)
rt_err_t rt_phye_set_mode(struct rt_phye *phye, enum rt_phye_mode mode, int submode)
struct rt_phye * rt_phye_get_by_name(struct rt_device *dev, const char *id)
rt_phye_mode
定义 phye.h:18
@ RT_PHYE_MODE_DP
定义 phye.h:38
@ RT_PHYE_MODE_MIPI_DPHY
定义 phye.h:35
@ RT_PHYE_MODE_USB_HOST
定义 phye.h:20
@ RT_PHYE_MODE_PCIE_EP
定义 phye.h:44
@ RT_PHYE_MODE_USB_DEVICE_LS
定义 phye.h:26
@ RT_PHYE_MODE_USB_OTG
定义 phye.h:30
@ RT_PHYE_MODE_USB_HOST_FS
定义 phye.h:22
@ RT_PHYE_MODE_PCIE_BIFURCATION
定义 phye.h:45
@ RT_PHYE_MODE_UFS_HS_A
定义 phye.h:31
@ RT_PHYE_MODE_SATA
定义 phye.h:36
@ RT_PHYE_MODE_INVALID
定义 phye.h:19
@ RT_PHYE_MODE_USB_DEVICE_HS
定义 phye.h:28
@ RT_PHYE_MODE_USB_DEVICE
定义 phye.h:25
@ RT_PHYE_MODE_USB_DEVICE_FS
定义 phye.h:27
@ RT_PHYE_MODE_PCIE
定义 phye.h:33
@ RT_PHYE_MODE_USB_DEVICE_SS
定义 phye.h:29
@ RT_PHYE_MODE_PCIE_RC
定义 phye.h:43
@ RT_PHYE_MODE_MAX
定义 phye.h:40
@ RT_PHYE_MODE_USB_HOST_LS
定义 phye.h:21
@ RT_PHYE_MODE_USB_HOST_HS
定义 phye.h:23
@ RT_PHYE_MODE_ETHERNET
定义 phye.h:34
@ RT_PHYE_MODE_UFS_HS_B
定义 phye.h:32
@ RT_PHYE_MODE_LVDS
定义 phye.h:37
@ RT_PHYE_MODE_USB_HOST_SS
定义 phye.h:24
rt_err_t rt_phye_power_on(struct rt_phye *phye)
rt_err_t rt_phye_power_off(struct rt_phye *phye)
rt_inline rt_err_t rt_phye_set_mode_simple(struct rt_phye *phye, enum rt_phye_mode mode)
定义 phye.h:82
rt_err_t rt_phye_unregister(struct rt_phye *phye)
void rt_phye_put(struct rt_phye *phye)
struct rt_phye * rt_phye_get_by_index(struct rt_device *dev, int index)
rt_err_t rt_phye_register(struct rt_phye *phye)
rt_err_t rt_phye_reset(struct rt_phye *phye)
rt_base_t rt_err_t
rt_err_t(* reset)(struct rt_phye *phye)
定义 phye.h:65
rt_err_t(* ofw_parse)(struct rt_phye *phye, struct rt_ofw_cell_args *phye_args)
定义 phye.h:69
rt_err_t(* set_mode)(struct rt_phye *phye, enum rt_phye_mode mode, int submode)
定义 phye.h:68
rt_err_t(* power_on)(struct rt_phye *phye)
定义 phye.h:66
rt_err_t(* init)(struct rt_phye *phye)
定义 phye.h:63
rt_err_t(* exit)(struct rt_phye *phye)
定义 phye.h:64
rt_err_t(* power_off)(struct rt_phye *phye)
定义 phye.h:67
struct rt_spinlock lock
定义 phye.h:58
const struct rt_phye_ops * ops
定义 phye.h:54
int init_count
定义 phye.h:56
struct rt_device * dev
定义 phye.h:52
int power_count
定义 phye.h:57