)]}'
{
  "commit": "d3d959404e6c72e09db8de8893a970edf0ac565d",
  "tree": "4e63f77d2a5a5bf9add06ef5c125d400660cccdf",
  "parents": [
    "a43dd4f6f91ed1a1d16595cb0c550b283e9b2298"
  ],
  "author": {
    "name": "Badhri Jagan Sridharan",
    "email": "badhri@google.com",
    "time": "Mon Mar 16 15:03:01 2026 +0000"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@linuxfoundation.org",
    "time": "Wed Mar 18 16:08:39 2026 +0100"
  },
  "message": "tcpm: Implement sink support for PD SPR AVS negotiation\n\nAdd support to enable TCPM to negotiate with\nUSB PD Standard Power Range Adjustable Voltage Supply (SPR AVS) when\nacting as a power sink.\n\n* Added support to the tcpm power supply properties, allowing userspace\n  to enable and control the dynamic limits (voltage and current)\n  specific to the SPR AVS contract.\n* Implemented tcpm_pd_select_spr_avs_apdo() to select the appropriate\n  APDO and validate the requested voltage/current against both the\n  Source and Sink capabilities.\n* Implemented tcpm_pd_build_spr_avs_request() to construct the\n  Request Data Object (RDO) for SPR AVS.\n* Added SNK_NEGOTIATE_SPR_AVS_CAPABILITIES state to the state machine to\n  handle negotiation for SPR AVS.\n* Updated the SNK_TRANSITION_SINK state to implement the SPR\n  AVS-specific VBUS transition rules, including reducing current draw to\n  PD_I_SNK_STBY_MA for large voltage changes, as required by USB PD spec.\n\nLog stub captured when enabling AVS:\n$ echo 3 \u003e /sys/class/power_supply/tcpm-source-psy-1-0025/online\n$ cat /d/usb/tcpm-1-0025/log\n[  358.895775] request to set AVS online\n[  358.895792] AMS POWER_NEGOTIATION start\n[  358.895806] state change SNK_READY -\u003e AMS_START [rev3 POWER_NEGOTIATION]\n[  358.895850] state change AMS_START -\u003e SNK_NEGOTIATE_SPR_AVS_CAPABILITIES [rev3 POWER_NEGOTIATION]\n[  358.895866] SPR AVS src_pdo_index:4 snk_pdo_index:2 req_op_curr_ma roundup:2200 req_out_volt_mv roundup:9000\n[  358.895880] Requesting APDO SPR AVS 4: 9000 mV, 2200 mA\n[  358.896405] set_auto_vbus_discharge_threshold mode:0 pps_active:n vbus:0 pps_apdo_min_volt:0 ret:0\n[  358.896422] PD TX, header: 0x1a82\n[  358.900158] PD TX complete, status: 0\n[  358.900205] pending state change SNK_NEGOTIATE_SPR_AVS_CAPABILITIES -\u003e HARD_RESET_SEND @ 60 ms [rev3 POWER_NEGOTIATION]\n[  358.904832] PD RX, header: 0x1a3 [1]\n[  358.904854] state change SNK_NEGOTIATE_SPR_AVS_CAPABILITIES -\u003e SNK_TRANSITION_SINK [rev3 POWER_NEGOTIATION]\n[  358.904888] pending state change SNK_TRANSITION_SINK -\u003e HARD_RESET_SEND @ 700 ms [rev3 POWER_NEGOTIATION]\n[  359.021530] PD RX, header: 0x3a6 [1]\n[  359.021546] Setting voltage/current limit 9000 mV 2200 mA\n[  359.023035] set_auto_vbus_discharge_threshold mode:3 pps_active:n vbus:9000 pps_apdo_min_volt:0 ret:0\n[  359.023053] state change SNK_TRANSITION_SINK -\u003e SNK_READY [rev3 POWER_NEGOTIATION]\n[  359.023090] AMS POWER_NEGOTIATION finished\n\n$ cat /sys/class/power_supply/tcpm-source-psy-1-0025/online\n3\n\nLog stub captured when increasing voltage:\n$ echo 9100000 \u003e /sys/class/power_supply/tcpm-source-psy-1-0025/voltage_now\n$ cat /d/usb/tcpm-1-0025/log\n\n[  632.116714] AMS POWER_NEGOTIATION start\n[  632.116728] state change SNK_READY -\u003e AMS_START [rev3 POWER_NEGOTIATION]\n[  632.116779] state change AMS_START -\u003e SNK_NEGOTIATE_SPR_AVS_CAPABILITIES [rev3 POWER_NEGOTIATION]\n[  632.116798] SPR AVS src_pdo_index:4 snk_pdo_index:2 req_op_curr_ma roundup:2200 req_out_volt_mv roundup:9100\n[  632.116811] Requesting APDO SPR AVS 4: 9100 mV, 2200 mA\n[  632.117315] set_auto_vbus_discharge_threshold mode:0 pps_active:n vbus:0 pps_apdo_min_volt:0 ret:0\n[  632.117328] PD TX, header: 0x1c82\n[  632.121007] PD TX complete, status: 0\n[  632.121052] pending state change SNK_NEGOTIATE_SPR_AVS_CAPABILITIES -\u003e HARD_RESET_SEND @ 60 ms [rev3 POWER_NEGOTIATION]\n[  632.124572] PD RX, header: 0x5a3 [1]\n[  632.124594] state change SNK_NEGOTIATE_SPR_AVS_CAPABILITIES -\u003e SNK_TRANSITION_SINK [rev3 POWER_NEGOTIATION]\n[  632.124623] pending state change SNK_TRANSITION_SINK -\u003e HARD_RESET_SEND @ 700 ms [rev3 POWER_NEGOTIATION]\n[  632.149256] PD RX, header: 0x7a6 [1]\n[  632.149271] Setting voltage/current limit 9100 mV 2200 mA\n[  632.150770] set_auto_vbus_discharge_threshold mode:3 pps_active:n vbus:9100 pps_apdo_min_volt:0 ret:0\n[  632.150787] state change SNK_TRANSITION_SINK -\u003e SNK_READY [rev3 POWER_NEGOTIATION]\n[  632.150823] AMS POWER_NEGOTIATION finished\n\n$ cat /sys/class/power_supply/tcpm-source-psy-1-0025/voltage_now\n9100000\n\nSigned-off-by: Badhri Jagan Sridharan \u003cbadhri@google.com\u003e\nReviewed-by: Amit Sunil Dhamne \u003camitsd@google.com\u003e\nAcked-by: Heikki Krogerus \u003cheikki.krogerus@linux.intel.com\u003e\nLink: https://patch.msgid.link/20260316150301.3892223-4-badhri@google.com\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "63a75b94743d45dd2bc36517f2d0c88e4bb92028",
      "old_mode": 33188,
      "old_path": "drivers/usb/typec/tcpm/tcpm.c",
      "new_id": "dfbb94ddc98a6168e88abe9c2d62c0deef1627a4",
      "new_mode": 33188,
      "new_path": "drivers/usb/typec/tcpm/tcpm.c"
    },
    {
      "type": "modify",
      "old_id": "5a98983195cbb99735d7c5cf10cc43f69fd1b9bd",
      "old_mode": 33188,
      "old_path": "include/linux/usb/pd.h",
      "new_id": "337a5485af7c7c6db03c4a510efe463bd1cad304",
      "new_mode": 33188,
      "new_path": "include/linux/usb/pd.h"
    },
    {
      "type": "modify",
      "old_id": "b22e659f81ba549d663175c7f55c3826251f6d14",
      "old_mode": 33188,
      "old_path": "include/linux/usb/tcpm.h",
      "new_id": "93079450bba01fbf978f80bc18d92ef1119d2e2e",
      "new_mode": 33188,
      "new_path": "include/linux/usb/tcpm.h"
    }
  ]
}
