mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-29 20:30:35 +00:00
![Prashant Malani](/assets/img/avatar_default.png)
Introduce a retimer device class and associated functions that register and use retimer "switch" devices. These operate in a manner similar to the "mode-switch" and help configure retimers that exist between the Type-C connector and host controller(s). Type C ports can be linked to retimers using firmware node device references (again, in a manner similar to "mode-switch"). There are no new sysfs files being created; there is the new retimer class directory, but there are no class-specific files being created there. Signed-off-by: Prashant Malani <pmalani@chromium.org> Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20220711072333.2064341-2-pmalani@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
45 lines
1.2 KiB
C
45 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef __USB_TYPEC_RETIMER
|
|
#define __USB_TYPEC_RETIMER
|
|
|
|
#include <linux/property.h>
|
|
#include <linux/usb/typec.h>
|
|
|
|
struct device;
|
|
struct typec_retimer;
|
|
struct typec_altmode;
|
|
struct fwnode_handle;
|
|
|
|
struct typec_retimer_state {
|
|
struct typec_altmode *alt;
|
|
unsigned long mode;
|
|
void *data;
|
|
};
|
|
|
|
typedef int (*typec_retimer_set_fn_t)(struct typec_retimer *retimer,
|
|
struct typec_retimer_state *state);
|
|
|
|
struct typec_retimer_desc {
|
|
struct fwnode_handle *fwnode;
|
|
typec_retimer_set_fn_t set;
|
|
const char *name;
|
|
void *drvdata;
|
|
};
|
|
|
|
struct typec_retimer *fwnode_typec_retimer_get(struct fwnode_handle *fwnode);
|
|
void typec_retimer_put(struct typec_retimer *retimer);
|
|
int typec_retimer_set(struct typec_retimer *retimer, struct typec_retimer_state *state);
|
|
|
|
static inline struct typec_retimer *typec_retimer_get(struct device *dev)
|
|
{
|
|
return fwnode_typec_retimer_get(dev_fwnode(dev));
|
|
}
|
|
|
|
struct typec_retimer *
|
|
typec_retimer_register(struct device *parent, const struct typec_retimer_desc *desc);
|
|
void typec_retimer_unregister(struct typec_retimer *retimer);
|
|
|
|
void *typec_retimer_get_drvdata(struct typec_retimer *retimer);
|
|
|
|
#endif /* __USB_TYPEC_RETIMER */
|