#include <linux/delay.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/property.h>
#include <linux/usb/pd_vdo.h>
#include <linux/usb/typec_dp.h>
#include <drm/drm_connector.h>
#include "displayport.h"
#define DP_HEADER(_dp, ver, cmd) …
enum { … };
#define DP_PIN_ASSIGN_GEN2_BR_MASK …
#define DP_PIN_ASSIGN_DP_BR_MASK …
#define DP_PIN_ASSIGN_DP_ONLY_MASK …
#define DP_PIN_ASSIGN_MULTI_FUNC_MASK …
enum dp_state { … };
struct dp_altmode { … };
static int dp_altmode_notify(struct dp_altmode *dp)
{ … }
static int dp_altmode_configure(struct dp_altmode *dp, u8 con)
{ … }
static int dp_altmode_status_update(struct dp_altmode *dp)
{ … }
static int dp_altmode_configured(struct dp_altmode *dp)
{ … }
static int dp_altmode_configure_vdm(struct dp_altmode *dp, u32 conf)
{ … }
static int dp_altmode_configure_vdm_cable(struct dp_altmode *dp, u32 conf)
{ … }
static void dp_altmode_work(struct work_struct *work)
{ … }
static void dp_altmode_attention(struct typec_altmode *alt, const u32 vdo)
{ … }
static int dp_altmode_vdm(struct typec_altmode *alt,
const u32 hdr, const u32 *vdo, int count)
{ … }
static int dp_cable_altmode_vdm(struct typec_altmode *alt, enum typec_plug_index sop,
const u32 hdr, const u32 *vdo, int count)
{ … }
static int dp_altmode_activate(struct typec_altmode *alt, int activate)
{ … }
static const struct typec_altmode_ops dp_altmode_ops = …;
static const struct typec_cable_ops dp_cable_ops = …;
static const char * const configurations[] = …;
static ssize_t
configuration_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t size)
{ … }
static ssize_t configuration_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RW(configuration);
static const char * const pin_assignments[] = …;
static u8 get_current_pin_assignments(struct dp_altmode *dp)
{ … }
static ssize_t
pin_assignment_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t size)
{ … }
static ssize_t pin_assignment_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RW(pin_assignment);
static ssize_t hpd_show(struct device *dev, struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(hpd);
static struct attribute *displayport_attrs[] = …;
static const struct attribute_group displayport_group = …;
static const struct attribute_group *displayport_groups[] = …;
int dp_altmode_probe(struct typec_altmode *alt)
{ … }
EXPORT_SYMBOL_GPL(…);
void dp_altmode_remove(struct typec_altmode *alt)
{ … }
EXPORT_SYMBOL_GPL(…);
static const struct typec_device_id dp_typec_id[] = …;
MODULE_DEVICE_TABLE(typec, dp_typec_id);
static struct typec_altmode_driver dp_altmode_driver = …;
module_typec_altmode_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;