#include <linux/component.h>
#include <linux/usb/role.h>
#include <linux/property.h>
#include <linux/device.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/slab.h>
static const struct class role_class = …;
struct usb_role_switch { … };
#define to_role_switch(d) …
static int connector_bind(struct device *dev, struct device *connector, void *data)
{ … }
static void connector_unbind(struct device *dev, struct device *connector, void *data)
{ … }
static const struct component_ops connector_ops = …;
int usb_role_switch_set_role(struct usb_role_switch *sw, enum usb_role role)
{ … }
EXPORT_SYMBOL_GPL(…);
enum usb_role usb_role_switch_get_role(struct usb_role_switch *sw)
{ … }
EXPORT_SYMBOL_GPL(…);
static void *usb_role_switch_match(const struct fwnode_handle *fwnode, const char *id,
void *data)
{ … }
static struct usb_role_switch *
usb_role_switch_is_parent(struct fwnode_handle *fwnode)
{ … }
struct usb_role_switch *usb_role_switch_get(struct device *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
struct usb_role_switch *fwnode_usb_role_switch_get(struct fwnode_handle *fwnode)
{ … }
EXPORT_SYMBOL_GPL(…);
void usb_role_switch_put(struct usb_role_switch *sw)
{ … }
EXPORT_SYMBOL_GPL(…);
struct usb_role_switch *
usb_role_switch_find_by_fwnode(const struct fwnode_handle *fwnode)
{ … }
EXPORT_SYMBOL_GPL(…);
static umode_t
usb_role_switch_is_visible(struct kobject *kobj, struct attribute *attr, int n)
{ … }
static const char * const usb_roles[] = …;
const char *usb_role_string(enum usb_role role)
{ … }
EXPORT_SYMBOL_GPL(…);
static ssize_t
role_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static ssize_t role_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t size)
{ … }
static DEVICE_ATTR_RW(role);
static struct attribute *usb_role_switch_attrs[] = …;
static const struct attribute_group usb_role_switch_group = …;
static const struct attribute_group *usb_role_switch_groups[] = …;
static int usb_role_switch_uevent(const struct device *dev, struct kobj_uevent_env *env)
{ … }
static void usb_role_switch_release(struct device *dev)
{ … }
static const struct device_type usb_role_dev_type = …;
struct usb_role_switch *
usb_role_switch_register(struct device *parent,
const struct usb_role_switch_desc *desc)
{ … }
EXPORT_SYMBOL_GPL(…);
void usb_role_switch_unregister(struct usb_role_switch *sw)
{ … }
EXPORT_SYMBOL_GPL(…);
void usb_role_switch_set_drvdata(struct usb_role_switch *sw, void *data)
{ … }
EXPORT_SYMBOL_GPL(…);
void *usb_role_switch_get_drvdata(struct usb_role_switch *sw)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __init usb_roles_init(void)
{ … }
subsys_initcall(usb_roles_init);
static void __exit usb_roles_exit(void)
{ … }
module_exit(usb_roles_exit);
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;