// SPDX-License-Identifier: GPL-2.0 /* * UCSI DisplayPort Alternate Mode Support * * Copyright (C) 2018, Intel Corporation * Author: Heikki Krogerus <[email protected]> */ #include <linux/usb/typec_dp.h> #include <linux/usb/pd_vdo.h> #include "ucsi.h" #define UCSI_CMD_SET_NEW_CAM(_con_num_, _enter_, _cam_, _am_) … struct ucsi_dp { … }; /* * Note. Alternate mode control is optional feature in UCSI. It means that even * if the system supports alternate modes, the OS may not be aware of them. * * In most cases however, the OS will be able to see the supported alternate * modes, but it may still not be able to configure them, not even enter or exit * them. That is because UCSI defines alt mode details and alt mode "overriding" * as separate options. * * In case alt mode details are supported, but overriding is not, the driver * will still display the supported pin assignments and configuration, but any * changes the user attempts to do will lead into failure with return value of * -EOPNOTSUPP. */ static int ucsi_displayport_enter(struct typec_altmode *alt, u32 *vdo) { … } static int ucsi_displayport_exit(struct typec_altmode *alt) { … } /* * We do not actually have access to the Status Update VDO, so we have to guess * things. */ static int ucsi_displayport_status_update(struct ucsi_dp *dp) { … } static int ucsi_displayport_configure(struct ucsi_dp *dp) { … } static int ucsi_displayport_vdm(struct typec_altmode *alt, u32 header, const u32 *data, int count) { … } static const struct typec_altmode_ops ucsi_displayport_ops = …; static void ucsi_displayport_work(struct work_struct *work) { … } void ucsi_displayport_remove_partner(struct typec_altmode *alt) { … } struct typec_altmode *ucsi_register_displayport(struct ucsi_connector *con, bool override, int offset, struct typec_altmode_desc *desc) { … }