Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1823172rdb; Mon, 8 Jan 2024 11:16:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpC1xX89r5w2n8enMR1tEdD/m0IT+RabF7BAPIBKtIXcGD2YuOI0OYaJ9ZxPfDyIVQzRpU X-Received: by 2002:a17:903:228c:b0:1d0:6ffd:835c with SMTP id b12-20020a170903228c00b001d06ffd835cmr1774374plh.103.1704741402714; Mon, 08 Jan 2024 11:16:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704741402; cv=none; d=google.com; s=arc-20160816; b=C+hYD7TmeiA1pGe2h7S6DokFDGl96duGGBDPwpgmdlhpgySAe51PNiu+2fiFKT8Bpi enMHqMyb2yZspz5c7z1VYnxCesT1htM6CuymIl+pYuV+XYpPZ3PxrPGwLn3IHxhs0I4L VqKnFjW5qPdmROdrqrgrzQwlwOc10JZYknGHWjpX3t0UD22Rvl+ZUnM0i+RWrJV/ct+X saCbMlwreLTUkWWvSTWIUFodn3su8Rv/a7wvnN2e8f22PgbfEdZwQ0xnC2r0TQw2GK9Z 3eWQmLTeevQEgjz6sEE62uQtCVsVc7+jPIaYPC5vMcYNdWo5GfHb7StFvWruoqvHykrW 1lYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=2bGe+uuOkBgrwm/2cptBzkQ5d6/QuIv5dqSJD9o8kNM=; fh=bY9M7RuwC9RhXS0a4JlzGLNcLBIsjKYIZiZHjIHDIhs=; b=A8y6lmcgx06VbhPoilo50q0Bk5bJHaJbK8r7GCjk9mHO7vqqPMzRRIL1uBotSFwbmP gha8oxVJYYI973cvtR5r2jH9yIyEOVVT90o0IyEFKtfZlQRYJBjgrJDCgu0ZV8G0KoMQ Ab9+9acPee7U/OUpPxiykSrxulcAhHnnm5w/Lt0dEZsZRKBktcFVwvMDmMLNsIzMQUIq 0BioNiaIxqqdzfAV25ezcKrJ+ZdSXf+BMlEWrlnlEjXlDU7ssKAC9hGprIgCUAKPmGKj 6sJoz0/rXCc4lQqskJUHuHfXaWuir2eLxPvaNI861Z0XBEmfE6qGIUC6sRLJtH7mv+ZS 8tQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=HxR0w1Nu; spf=pass (google.com: domain of linux-kernel+bounces-20017-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20017-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n6-20020a170902e54600b001d54e05a672si288067plf.333.2024.01.08.11.16.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 11:16:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20017-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=HxR0w1Nu; spf=pass (google.com: domain of linux-kernel+bounces-20017-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20017-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5DD412835DD for ; Mon, 8 Jan 2024 19:16:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0966454FAE; Mon, 8 Jan 2024 19:16:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="HxR0w1Nu" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19A2554F91 for ; Mon, 8 Jan 2024 19:16:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--rdbabiera.bounces.google.com Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dbe9ef2422cso1902239276.0 for ; Mon, 08 Jan 2024 11:16:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1704741390; x=1705346190; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=2bGe+uuOkBgrwm/2cptBzkQ5d6/QuIv5dqSJD9o8kNM=; b=HxR0w1NutpaRr0hdvjfOlazRtz3YbRVi++Nocw03BUulcUOHObHNGIAqrYLmw5aXSN QI1awL1PvOwuQK5PcljBr8EggVZByBv6bFLkCjt9klU7TsjVAeu3Ly3aH4tTdVvxeIib 057uUI9Y0zkOqw1oZgq6sbI58G8+/0vGAaAeQsr+T50XLGgkjbK3G5ceWYUtaLt0n3vb ZmdjiZsfWXHY7qz8Il4AezJo5UF/Enpw7SKhUViOac6R8zmjv7WPiMpEQ42yIuYK8S4Q pzQfdz5HYaH+4Pzr9FdbqDnpCx9dtPWNZtkBK/mkR88FGR3kQ/902YiVangZJRATXe1B KJSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704741390; x=1705346190; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2bGe+uuOkBgrwm/2cptBzkQ5d6/QuIv5dqSJD9o8kNM=; b=TPakXUYtHoGtt/gn8WtdcejOQrhOSLDtcjAMbgicRZa/4mriKLzl6Da7zvihZtpMtU RJFJcF7baslgKfLlbmePYVIHHF0UC8gYI4ooM8KLCvodEz1+Ou8kASlQzcyHoR6TwuC8 cboOtIWuWtOO19Ur/UR8TQyF2D+YBAaynMMoSnAEXsYPgs1Sb80NpgOZ348H4ikO7OFF v6wMzubrByV/v4uJSSEtyjR/4WE4+eETDwVMiKnfEO2wE0Jq+NlgtEAM1lfPiiq2tu59 zMfGuaOIg7mmJJMxnzMF1wMPVKac1ZMm9BXUM5GNj6G4gjT3oy8rw7DbwW4BEg0FWHI5 XNVw== X-Gm-Message-State: AOJu0YyCNKuon1esFZFAYQEMW3qiozdvB3slzBcv6COOX/rhQzlG7DIA 3Vt0juAqzxhav7lJ0yz+E7hL3hZKYxmW96Nd87zm5w== X-Received: from rdbabiera.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:18a8]) (user=rdbabiera job=sendgmr) by 2002:a25:8388:0:b0:dbd:7149:a389 with SMTP id t8-20020a258388000000b00dbd7149a389mr142790ybk.11.1704741390212; Mon, 08 Jan 2024 11:16:30 -0800 (PST) Date: Mon, 8 Jan 2024 19:16:13 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Developer-Key: i=rdbabiera@google.com; a=openpgp; fpr=639A331F1A21D691815CE090416E17CA2BBBD5C8 X-Developer-Signature: v=1; a=openpgp-sha256; l=3559; i=rdbabiera@google.com; h=from:subject; bh=T6W1b6xfgTVUjTcJ8N2zILYWmciZGv0IRjajoRxiXJo=; b=owGbwMvMwCFW0bfok0KS4TbG02pJDKlzvFj6zSK8A8RUDrmeZHWe0vR4cZb9mbPs8RwR5o8VX y+VPNHdUcrCIMbBICumyKLrn2dw40rqljmcNcYwc1iZQIYwcHEKwESUuhkZ5jTnep8X2bxoeb70 XqtpaUcLtDif8/06GbZufUVcpaS5AyND06yfvoX9PJfNd7GoeR+3fX43ocCA/9v9b2/38PM9Pqr JBQA= X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog Message-ID: <20240108191620.987785-14-rdbabiera@google.com> Subject: [PATCH v3 00/12] usb: typec: add SOP' support to the tcpm and alt mode drivers From: RD Babiera To: rdbabiera@google.com, heikki.krogerus@linux.intel.com, linux@roeck-us.net, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Cc: badhri@google.com, bryan.odonoghue@linaro.org, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org Content-Type: text/plain; charset="UTF-8" Extend the TCPM's functionality to include support for SOP' messages. This feature is opt-in: TCPCI chip drivers opt into sending and receiving SOP' messages. TCPCI drivers will also be expected to take the SOP frame type in order to process SOP' messages within the TCPM. Specifically, the exisiting API tcpm_pd_receive now takes tcpm_transmit_type as input. The Maxim TCPCI implements this in Patch 4. Discover Identity, Discover SVIDs, Discover Modes, and Alt Mode SVDM support are included within the patchset. Because the port is expected to be the Vconn source in order to communicate with the cable, TCPCI chip drivers opt into performing a Vconn swap after Discover Identity on SOP before performing Discover Identity on SOP'. typec_cable_ops are defined to facilitate communication between the alt mode drivers and the cable plugs. 2 new apis allow the alt mode drivers to enter and exit mode on active cable plugs. A third is used by alt mode drivers to send VDMs to the cable plugs or by the TCPM to return the resulting VDM from the cable plug to the alt mode drivers. --- Changes since v1: * Add typec_cable_ops as replacement for changing typec_altmode_ops interface. Displayport driver patch now reflects this * Separate patch for cable SVDM versioning. * Separate patch for tcpm_pd_receive() api changes and cable_comm_capable addition to tcpci. * Separate patches for Discover SVIDs/Discover Modes and Alt Mode operations on SOP'. Changes since v2: * Style changes, bugfix for lock in displayport.c, bugfix in tcpm.c that restores code deleted by patch. RD Babiera (12): usb: typec: altmodes: add typec_cable_ops to typec_altmode usb: typec: altmodes: add svdm version info for typec cables usb: typec: tcpci: add cable_comm_capable attribute usb: typec: tcpci: add tcpm_transmit_type to tcpm_pd_receive usb: typec: tcpm: process receive and transmission of sop' messages usb: typec: tcpm: add control message support to sop' usb: typec: tcpci: add attempt_vconn_swap_discovery callback usb: typec: tcpm: add discover identity support for SOP' usb: typec: tcpm: add state machine support for SRC_VDM_IDENTITY_REQUEST usb: typec: tcpm: add discover svids and discover modes support for sop' usb: typec: tcpm: add alt mode enter/exit/vdm support for sop' usb: typec: altmodes/displayport: add SOP' support drivers/usb/typec/altmodes/displayport.c | 162 ++- drivers/usb/typec/bus.c | 102 ++ drivers/usb/typec/class.c | 59 + drivers/usb/typec/class.h | 1 + drivers/usb/typec/tcpm/fusb302.c | 2 +- .../typec/tcpm/qcom/qcom_pmic_typec_pdphy.c | 2 +- drivers/usb/typec/tcpm/tcpci.c | 26 +- drivers/usb/typec/tcpm/tcpci_maxim.h | 1 + drivers/usb/typec/tcpm/tcpci_maxim_core.c | 38 +- drivers/usb/typec/tcpm/tcpm.c | 1030 ++++++++++++++--- drivers/usb/typec/tcpm/wcove.c | 2 +- include/linux/usb/pd.h | 1 + include/linux/usb/pd_vdo.h | 8 +- include/linux/usb/tcpci.h | 13 + include/linux/usb/tcpm.h | 16 +- include/linux/usb/typec.h | 7 + include/linux/usb/typec_altmode.h | 30 + 17 files changed, 1337 insertions(+), 163 deletions(-) base-commit: 933bb7b878ddd0f8c094db45551a7daddf806e00 -- 2.43.0.472.g3155946c3a-goog