mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-27 03:49:57 -04:00
Merge tag 'usb-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB/Thunderbolt updates from Greg KH: "Here is the big set of USB and Thunderbolt driver updates for 6.19-rc1. Nothing major here, just lots of tiny updates for most of the common USB drivers. Included in here are: - more xhci driver updates and fixes - Thunderbolt driver cleanups - usb serial driver updates - typec driver updates - USB tracepoint additions - dwc3 driver updates, including support for Apple hardware - lots of other smaller driver updates and cleanups All of these have been in linux-next for a while with no reported issues" * tag 'usb-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (161 commits) usb: gadget: tegra-xudc: Always reinitialize data toggle when clear halt USB: serial: option: move Telit 0x10c7 composition in the right place USB: serial: option: add Telit Cinterion FE910C04 new compositions usb: typec: ucsi: fix use-after-free caused by uec->work usb: typec: ucsi: fix probe failure in gaokun_ucsi_probe() usb: dwc3: core: Remove redundant comment in core init usb: phy: Initialize struct usb_phy list_head USB: serial: option: add Foxconn T99W760 usb: usb-storage: No additional quirks need to be added to the EL-R12 optical drive. usb: typec: hd3ss3220: Enable VBUS based on ID pin state dt-bindings: usb: ti,hd3ss3220: Add support for VBUS based on ID state usb: typec: anx7411: add WQ_PERCPU to alloc_workqueue users USB: add WQ_PERCPU to alloc_workqueue users dt-bindings: usb: dwc3-xilinx: Describe the reset constraint for the versal platform drivers/usb/storage: use min() instead of min_t() usb: raw-gadget: cap raw_io transfer length to KMALLOC_MAX_SIZE usb: ohci-da8xx: remove unused platform data usb: gadget: functionfs: use dma_buf_unmap_attachment_unlocked() helper usb: uas: reduce time under spinlock usb: dwc3: eic7700: Add EIC7700 USB driver ...
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#ifndef __LINUX_USB_PD_H
|
||||
#define __LINUX_USB_PD_H
|
||||
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/usb/typec.h>
|
||||
@@ -271,9 +272,11 @@ enum pd_pdo_type {
|
||||
|
||||
enum pd_apdo_type {
|
||||
APDO_TYPE_PPS = 0,
|
||||
APDO_TYPE_EPR_AVS = 1,
|
||||
APDO_TYPE_SPR_AVS = 2,
|
||||
};
|
||||
|
||||
#define PDO_APDO_TYPE_SHIFT 28 /* Only valid value currently is 0x0 - PPS */
|
||||
#define PDO_APDO_TYPE_SHIFT 28
|
||||
#define PDO_APDO_TYPE_MASK 0x3
|
||||
|
||||
#define PDO_APDO_TYPE(t) ((t) << PDO_APDO_TYPE_SHIFT)
|
||||
@@ -297,6 +300,35 @@ enum pd_apdo_type {
|
||||
PDO_PPS_APDO_MIN_VOLT(min_mv) | PDO_PPS_APDO_MAX_VOLT(max_mv) | \
|
||||
PDO_PPS_APDO_MAX_CURR(max_ma))
|
||||
|
||||
/*
|
||||
* Applicable only to EPR AVS APDO source cap as per
|
||||
* Table 6.15 EPR Adjustable Voltage Supply APDO – Source
|
||||
*/
|
||||
#define PDO_EPR_AVS_APDO_PEAK_CURRENT GENMASK(27, 26)
|
||||
|
||||
/*
|
||||
* Applicable to both EPR AVS APDO source and sink cap as per
|
||||
* Table 6.15 EPR Adjustable Voltage Supply APDO – Source
|
||||
* Table 6.22 EPR Adjustable Voltage Supply APDO – Sink
|
||||
*/
|
||||
#define PDO_EPR_AVS_APDO_MAX_VOLT GENMASK(25, 17) /* 100mV unit */
|
||||
#define PDO_EPR_AVS_APDO_MIN_VOLT GENMASK(15, 8) /* 100mV unit */
|
||||
#define PDO_EPR_AVS_APDO_PDP GENMASK(7, 0) /* 1W unit */
|
||||
|
||||
/*
|
||||
* Applicable only SPR AVS APDO source cap as per
|
||||
* Table 6.14 SPR Adjustable Voltage Supply APDO – Source
|
||||
*/
|
||||
#define PDO_SPR_AVS_APDO_PEAK_CURRENT GENMASK(27, 26)
|
||||
|
||||
/*
|
||||
* Applicable to both SPR AVS APDO source and sink cap as per
|
||||
* Table 6.14 SPR Adjustable Voltage Supply APDO – Source
|
||||
* Table 6.21 SPR Adjustable Voltage Supply APDO – Sink
|
||||
*/
|
||||
#define PDO_SPR_AVS_APDO_9V_TO_15V_MAX_CURR GENMASK(19, 10) /* 10mA unit */
|
||||
#define PDO_SPR_AVS_APDO_15V_TO_20V_MAX_CURR GENMASK(9, 0) /* 10mA unit */
|
||||
|
||||
static inline enum pd_pdo_type pdo_type(u32 pdo)
|
||||
{
|
||||
return (pdo >> PDO_TYPE_SHIFT) & PDO_TYPE_MASK;
|
||||
@@ -350,6 +382,41 @@ static inline unsigned int pdo_pps_apdo_max_current(u32 pdo)
|
||||
PDO_PPS_APDO_CURR_MASK) * 50;
|
||||
}
|
||||
|
||||
static inline unsigned int pdo_epr_avs_apdo_src_peak_current(u32 pdo)
|
||||
{
|
||||
return FIELD_GET(PDO_EPR_AVS_APDO_PEAK_CURRENT, pdo);
|
||||
}
|
||||
|
||||
static inline unsigned int pdo_epr_avs_apdo_min_voltage_mv(u32 pdo)
|
||||
{
|
||||
return FIELD_GET(PDO_EPR_AVS_APDO_MIN_VOLT, pdo) * 100;
|
||||
}
|
||||
|
||||
static inline unsigned int pdo_epr_avs_apdo_max_voltage_mv(u32 pdo)
|
||||
{
|
||||
return FIELD_GET(PDO_EPR_AVS_APDO_MIN_VOLT, pdo) * 100;
|
||||
}
|
||||
|
||||
static inline unsigned int pdo_epr_avs_apdo_pdp_w(u32 pdo)
|
||||
{
|
||||
return FIELD_GET(PDO_EPR_AVS_APDO_PDP, pdo);
|
||||
}
|
||||
|
||||
static inline unsigned int pdo_spr_avs_apdo_src_peak_current(u32 pdo)
|
||||
{
|
||||
return FIELD_GET(PDO_SPR_AVS_APDO_PEAK_CURRENT, pdo);
|
||||
}
|
||||
|
||||
static inline unsigned int pdo_spr_avs_apdo_9v_to_15v_max_current_ma(u32 pdo)
|
||||
{
|
||||
return FIELD_GET(PDO_SPR_AVS_APDO_9V_TO_15V_MAX_CURR, pdo) * 10;
|
||||
}
|
||||
|
||||
static inline unsigned int pdo_spr_avs_apdo_15v_to_20v_max_current_ma(u32 pdo)
|
||||
{
|
||||
return FIELD_GET(PDO_SPR_AVS_APDO_15V_TO_20V_MAX_CURR, pdo) * 10;
|
||||
}
|
||||
|
||||
/* RDO: Request Data Object */
|
||||
#define RDO_OBJ_POS_SHIFT 28
|
||||
#define RDO_OBJ_POS_MASK 0x7
|
||||
|
||||
@@ -337,6 +337,7 @@ struct typec_plug *typec_register_plug(struct typec_cable *cable,
|
||||
void typec_unregister_plug(struct typec_plug *plug);
|
||||
|
||||
void typec_set_data_role(struct typec_port *port, enum typec_data_role role);
|
||||
enum typec_data_role typec_get_data_role(struct typec_port *port);
|
||||
void typec_set_pwr_role(struct typec_port *port, enum typec_role role);
|
||||
void typec_set_vconn_role(struct typec_port *port, enum typec_role role);
|
||||
void typec_set_pwr_opmode(struct typec_port *port, enum typec_pwr_opmode mode);
|
||||
|
||||
@@ -172,6 +172,19 @@ typec_altmode_get_svdm_version(struct typec_altmode *altmode)
|
||||
return typec_get_negotiated_svdm_version(typec_altmode2port(altmode));
|
||||
}
|
||||
|
||||
/**
|
||||
* typec_altmode_get_data_role - Get port data role
|
||||
* @altmode: Handle to the alternate mode
|
||||
*
|
||||
* Alt Mode drivers should only issue Enter Mode through the port if they are
|
||||
* the DFP.
|
||||
*/
|
||||
static inline enum typec_data_role
|
||||
typec_altmode_get_data_role(struct typec_altmode *altmode)
|
||||
{
|
||||
return typec_get_data_role(typec_altmode2port(altmode));
|
||||
}
|
||||
|
||||
/**
|
||||
* struct typec_altmode_driver - USB Type-C alternate mode device driver
|
||||
* @id_table: Null terminated array of SVIDs
|
||||
|
||||
@@ -55,6 +55,7 @@ struct typec_thunderbolt_data {
|
||||
|
||||
/* TBT3 Device Enter Mode VDO bits */
|
||||
#define TBT_ENTER_MODE_CABLE_SPEED(s) TBT_SET_CABLE_SPEED(s)
|
||||
#define TBT_ENTER_MODE_UNI_DIR_LSRX BIT(23)
|
||||
#define TBT_ENTER_MODE_ACTIVE_CABLE BIT(24)
|
||||
|
||||
#endif /* __USB_TYPEC_TBT_H */
|
||||
|
||||
Reference in New Issue
Block a user