Linux Audio

Check our new training course

Loading...
v5.9
 1/* SPDX-License-Identifier: GPL-2.0 */
 2
 3#ifndef __USB_TYPEC_ALTMODE_H__
 4#define __USB_TYPEC_ALTMODE_H__
 5
 6#include <linux/usb/typec_altmode.h>
 7#include <linux/usb/typec_mux.h>
 8
 9struct bus_type;
10
11struct altmode {
12	unsigned int			id;
13	struct typec_altmode		adev;
14	struct typec_mux		*mux;
15
16	enum typec_port_data		roles;
17
18	struct attribute		*attrs[5];
19	char				group_name[8];
20	struct attribute_group		group;
21	const struct attribute_group	*groups[2];
22
23	struct altmode			*partner;
24	struct altmode			*plug[2];
 
 
25};
26
27#define to_altmode(d) container_of(d, struct altmode, adev)
28
29extern struct bus_type typec_bus;
30extern const struct device_type typec_altmode_dev_type;
31extern const struct device_type typec_port_dev_type;
32
33#define is_typec_altmode(_dev_) (_dev_->type == &typec_altmode_dev_type)
34#define is_typec_port(_dev_) (_dev_->type == &typec_port_dev_type)
35
36extern struct class typec_mux_class;
37
38struct typec_switch {
39	struct device dev;
40	typec_switch_set_fn_t set;
41};
42
43struct typec_mux {
44	struct device dev;
45	typec_mux_set_fn_t set;
46};
47
48#define to_typec_switch(_dev_) container_of(_dev_, struct typec_switch, dev)
49#define to_typec_mux(_dev_) container_of(_dev_, struct typec_mux, dev)
50
51#endif /* __USB_TYPEC_ALTMODE_H__ */
v5.4
 1/* SPDX-License-Identifier: GPL-2.0 */
 2
 3#ifndef __USB_TYPEC_ALTMODE_H__
 4#define __USB_TYPEC_ALTMODE_H__
 5
 6#include <linux/usb/typec_altmode.h>
 7#include <linux/usb/typec_mux.h>
 8
 9struct bus_type;
10
11struct altmode {
12	unsigned int			id;
13	struct typec_altmode		adev;
14	struct typec_mux		*mux;
15
16	enum typec_port_data		roles;
17
18	struct attribute		*attrs[5];
19	char				group_name[8];
20	struct attribute_group		group;
21	const struct attribute_group	*groups[2];
22
23	struct altmode			*partner;
24	struct altmode			*plug[2];
25
26	struct blocking_notifier_head	nh;
27};
28
29#define to_altmode(d) container_of(d, struct altmode, adev)
30
31extern struct bus_type typec_bus;
32extern const struct device_type typec_altmode_dev_type;
33extern const struct device_type typec_port_dev_type;
34
35#define is_typec_altmode(_dev_) (_dev_->type == &typec_altmode_dev_type)
36#define is_typec_port(_dev_) (_dev_->type == &typec_port_dev_type)
37
38extern struct class typec_mux_class;
39
40struct typec_switch {
41	struct device dev;
42	typec_switch_set_fn_t set;
43};
44
45struct typec_mux {
46	struct device dev;
47	typec_mux_set_fn_t set;
48};
49
50#define to_typec_switch(_dev_) container_of(_dev_, struct typec_switch, dev)
51#define to_typec_mux(_dev_) container_of(_dev_, struct typec_mux, dev)
52
53#endif /* __USB_TYPEC_ALTMODE_H__ */