File Index
Files and directories
Sign in
FILE

typec_retimer.h

File preview with syntax highlighting.

linux-6.19.14/include/linux/usb/typec_retimer.h C
 1/* SPDX-License-Identifier: GPL-2.0 */
 2
 3#ifndef __USB_TYPEC_RETIMER
 4#define __USB_TYPEC_RETIMER
 5
 6#include <linux/property.h>
 7#include <linux/usb/typec.h>
 8
 9struct device;
10struct typec_retimer;
11struct typec_altmode;
12struct fwnode_handle;
13
14struct typec_retimer_state {
15	struct typec_altmode *alt;
16	unsigned long mode;
17	void *data;
18};
19
20typedef int (*typec_retimer_set_fn_t)(struct typec_retimer *retimer,
21				      struct typec_retimer_state *state);
22
23struct typec_retimer_desc {
24	struct fwnode_handle *fwnode;
25	typec_retimer_set_fn_t set;
26	const char *name;
27	void *drvdata;
28};
29
30struct typec_retimer *fwnode_typec_retimer_get(struct fwnode_handle *fwnode);
31void typec_retimer_put(struct typec_retimer *retimer);
32int typec_retimer_set(struct typec_retimer *retimer, struct typec_retimer_state *state);
33
34static inline struct typec_retimer *typec_retimer_get(struct device *dev)
35{
36	return fwnode_typec_retimer_get(dev_fwnode(dev));
37}
38
39struct typec_retimer *
40typec_retimer_register(struct device *parent, const struct typec_retimer_desc *desc);
41void typec_retimer_unregister(struct typec_retimer *retimer);
42
43void *typec_retimer_get_drvdata(struct typec_retimer *retimer);
44
45#endif /* __USB_TYPEC_RETIMER */
~/ Read-only file preview.