mirror of https://github.com/torvalds/linux.git
dt-bindings: connector: Add SPR AVS Sink APDO definitions
USB Power Delivery 3.2 introduces a new power supply type SPR AVS. Add macro definitions for the USB Power Delivery (PD) Standard Power Range (SPR) Adjustable Voltage Supply (AVS) as a Sink Augmented Power Data Object (APDO) in the device tree bindings. Signed-off-by: Badhri Jagan Sridharan <badhri@google.com> Acked-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20260316150301.3892223-2-badhri@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f8a5f6934f
commit
9270102a00
|
|
@ -364,8 +364,9 @@ $defs:
|
|||
"Universal Serial Bus Power Delivery Specification" chapter 6.4.1.3
|
||||
Sink Capabilities Message, the order of each entry(PDO) should follow the
|
||||
PD spec chapter 6.4.1. Required for power sink and power dual role. User
|
||||
can specify the sink PDO array via PDO_FIXED/BATT/VAR/PPS_APDO() defined
|
||||
in dt-bindings/usb/pd.h.
|
||||
can specify the sink PDO array via
|
||||
PDO_FIXED/BATT/VAR/PPS_APDO/SPR_AVS_SNK_APDO() defined in
|
||||
dt-bindings/usb/pd.h.
|
||||
minItems: 1
|
||||
maxItems: 7
|
||||
$ref: /schemas/types.yaml#/definitions/uint32-array
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@
|
|||
PDO_VAR_MAX_VOLT(max_mv) | PDO_VAR_MAX_CURR(max_ma))
|
||||
|
||||
#define APDO_TYPE_PPS 0
|
||||
#define APDO_TYPE_SPR_AVS 2
|
||||
|
||||
#define PDO_APDO_TYPE_SHIFT 28 /* Only valid value currently is 0x0 - PPS */
|
||||
#define PDO_APDO_TYPE_MASK 0x3
|
||||
|
|
@ -85,6 +86,23 @@
|
|||
PDO_PPS_APDO_MIN_VOLT(min_mv) | PDO_PPS_APDO_MAX_VOLT(max_mv) | \
|
||||
PDO_PPS_APDO_MAX_CURR(max_ma))
|
||||
|
||||
#define PDO_SPR_AVS_APDO_9V_TO_15V_MAX_CURR_SHIFT 10 /* 10mA units */
|
||||
#define PDO_SPR_AVS_APDO_15V_TO_20V_MAX_CURR_SHIFT 0 /* 10mA units */
|
||||
#define PDO_SPR_AVS_APDO_MAX_CURR_MASK 0x3ff
|
||||
|
||||
#define PDO_SPR_AVS_APDO_9V_TO_15V_MAX_CURR(max_cur_9v_to_15v_ma) \
|
||||
((((max_cur_9v_to_15v_ma) / 10) & PDO_SPR_AVS_APDO_MAX_CURR_MASK) << \
|
||||
PDO_SPR_AVS_APDO_9V_TO_15V_MAX_CURR_SHIFT)
|
||||
|
||||
#define PDO_SPR_AVS_APDO_15V_TO_20V_MAX_CURR(max_cur_15v_to_20v_ma) \
|
||||
((((max_cur_15v_to_20v_ma) / 10) & PDO_SPR_AVS_APDO_MAX_CURR_MASK) << \
|
||||
PDO_SPR_AVS_APDO_15V_TO_20V_MAX_CURR_SHIFT)
|
||||
|
||||
#define PDO_SPR_AVS_SNK_APDO(max_cur_9v_to_15v_ma, max_cur_15v_to_20v_ma) \
|
||||
(PDO_TYPE(PDO_TYPE_APDO) | PDO_APDO_TYPE(APDO_TYPE_SPR_AVS) | \
|
||||
PDO_SPR_AVS_APDO_9V_TO_15V_MAX_CURR(max_cur_9v_to_15v_ma) | \
|
||||
PDO_SPR_AVS_APDO_15V_TO_20V_MAX_CURR(max_cur_15v_to_20v_ma))
|
||||
|
||||
/*
|
||||
* Based on "Table 6-14 Fixed Supply PDO - Sink" of "USB Power Delivery Specification Revision 3.0,
|
||||
* Version 1.2"
|
||||
|
|
|
|||
Loading…
Reference in New Issue