From patchwork Tue Feb 13 13:00:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heikki Krogerus X-Patchwork-Id: 20317 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp637598dyb; Tue, 13 Feb 2024 08:05:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXV/Q5rS+jguqzK2w32keqfpLxIQadtdmvDyJyHhrBHLSqUaoqUrzes1NGkL+xxDR2h3oiPij1KJKc1bd96DEW8H4wCmw== X-Google-Smtp-Source: AGHT+IEQY4Cpf6rSkgPsgzFEP4s4Hyux7ryZHg1Av6TlwoRhTKwyIsK+Aa23EuLVa3QOamEE8Cgm X-Received: by 2002:a05:6214:242f:b0:68e:f036:f5d0 with SMTP id gy15-20020a056214242f00b0068ef036f5d0mr1502435qvb.12.1707840336908; Tue, 13 Feb 2024 08:05:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707840336; cv=pass; d=google.com; s=arc-20160816; b=DBYN+lyv7gvFFoUI9+kibRemvY1L1iIA5dSpU30blp2Q2Lb0lh1sO68eJUy+D4gGhS IohOkWNZ46UyUp1UbS3+G1ZI+G2mjrsXcxsCyKw/TGxnZr9LPE+DKrg/t6LH7Ar6q6nf hwbakL9QQtErEIt9MIChb1qTBtN7PpqoWGL7ZMiSLcpE3Ni0bQzevEEB9V4VJsIT4UP0 u4I/VKHelPBfQcQOR+jjgo8wVbD7aiWijEMcXTJPGu5ACUJT1MCpYpojrcPMADf1KUBS VOTvZ5z8k+6LmdSFVKkLGa/OEoFTE1p/y9Z3LndTrB+dv32qM7XciKGt9zDd+8qFXljS Sx4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=SWczRoSj0daWjgySeJdAG7yldajycjlwRF7Do5goLL8=; fh=ZhWYlthkO1TJi0WjQDORWSsstHvb6f8ZNak9mpnJUL8=; b=XGz/92paxyJNZTDGV3t6Qtb5zrFAzuAqgr4PSnPDQhGm3bk977ZDN+SzmrWSdtYLJ2 QjJH2UhoC7nCXfzZY3J3fKcAF9VCHllqJS2UNkrutgZBsaeF2kiyGkUNbgnpjcHI0Jcb RPNNkoZ7BFB4plra6shuBfT8iqJggnd5DBdt3gU4FHhFA+rzGKVhA/4tPCifJMnZpnA4 rdbcS3i0zG2SN07JqFRtzggUhHYLR+NaSa0QDl7L5jcj2LyIq8zxuUkbI6hfaL/BRG+p WUhQkxr/K2KwEWtkry6e/ag4lysF3WfjEEPn1dzMhY1Au1VvBSsqt4o8tyzgg0htdU6X mFUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RMeYLfGS; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-63549-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63549-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCXnyRZPov7JfHqGvlom1KwTwHKmumulh0vFZ+aSDqM4p+6aKMPTeuVdbXnPgmXptBKEE2o5ucq99SwCKQRIqmtMYwXFyA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o11-20020a0562140e4b00b0068cb0ec2748si2952350qvc.581.2024.02.13.08.05.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 08:05:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63549-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RMeYLfGS; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-63549-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63549-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B12E91C268A8 for ; Tue, 13 Feb 2024 13:00:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9BDE45024D; Tue, 13 Feb 2024 13:00:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RMeYLfGS" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CD8543AD1; Tue, 13 Feb 2024 13:00:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707829226; cv=none; b=l1V7llH0aCnQ+0a/iw6qhRhzOh6vbSO7XXfDiQUkeX+boAcnBFhDgvfgOel1uWf/h/9hcVWti+r6yAqgFGeqdF+AC2e8r+nDR7X7OiJkIpIVIbc9IzQUdyDSlmau5ptZdqSlI5IWXcGHyXTgqCxN/HZV2rrXyTsS92kzsGkxo0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707829226; c=relaxed/simple; bh=iLASq6PGk0pCcLZpQwuo3+UhK6BRy553sU7kvPf0prQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dn9xLyphTKgOIPHjDpMSACpTGFRGGoX0sYcK/N6pK5oKh1+5c9pYZAM6XeByoRSEtyhiiqDi9Js8ae+09YuDLHaAi3DOO2OSUwF0mYlt0Mr47qeeuASjdNAsywLFNGV+a6EB79h+wGayuHH2jDFUR7XjjxBQ5uRYhKNrtbVDiwM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=RMeYLfGS; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707829224; x=1739365224; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=iLASq6PGk0pCcLZpQwuo3+UhK6BRy553sU7kvPf0prQ=; b=RMeYLfGSuRDA0YtGikwwQgI/QB5RyZV8XQhfwD0kzVAHESzderioDCqC EydDLDWoNJ/q+pH18rTBDgUG0hfRE6gvZk82mdKC52zdPsT5hGFJaJa4Q EKwkDSSGRjfomhqcVbaI4w/Bx3p7swSGKE9KGHkOdxyxfkhzSnP8Wc7lm xltZAoYMf5X4PIt6Qmn7jYDqJ/JuEmJdddrhQ0E0tp0zOZjUi3TvWw7hJ /glbQr7DmDdLqDcDUjcM13QWseq9zYA9rQf4UHbCbToxbsmmUL/UUjlA0 CtkRCisv0sIBBCsm4lTbSsOTsn2BzMcGuynndk0ow2Vbfm1QmXeDqSz8Y A==; X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="1708879" X-IronPort-AV: E=Sophos;i="6.06,157,1705392000"; d="scan'208";a="1708879" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2024 05:00:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="935348366" X-IronPort-AV: E=Sophos;i="6.06,157,1705392000"; d="scan'208";a="935348366" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 13 Feb 2024 05:00:19 -0800 From: Heikki Krogerus To: Prashant Malani , Greg Kroah-Hartman Cc: Benson Leung , Tzung-Bi Shih , Guenter Roeck , Emilie Roberts , "Nyman, Mathias" , "Regupathy, Rajaram" , "Radjacoumar, Shyam Sundar" , Samuel Jacob , Uday Bhat , linux-usb@vger.kernel.org, chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] platform/chrome: typec: xHCI DbC Date: Tue, 13 Feb 2024 15:00:16 +0200 Message-ID: <20240213130018.3029991-1-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790800388827635470 X-GMAIL-MSGID: 1790800388827635470 Hi, Changed in v2: The quirk is now wrapped inside an ugly ifdef CONFIG_ACPI :( I don't have better ideas better ideas for this I'm afraid. Side note! I will be away for the next three weeks (plus a few days) starting from Friday (Feb 16). The original message: In order to use xHCI DbC we need to allow the USB to be muxed to xHCI even when the connector is in device role. That's because in DbC mode the xHCI is the USB device controller. In the first patch I'm just adding symlinks between the USB role switches and their USB Type-C connectors. That way the user space can find the correct role switch simply by following the symlink. The second patch modifies cros_ec_typec.c. I'm assigning the PLD (Physical Location of Device) hash of the port to the USB role switch when it's missing from the ACPI tables. That should make sure the first patch always works. Heikki Krogerus (2): usb: roles: Link the switch to its connector platform/chrome: cros_ec_typec: Make sure the USB role switch has PLD .../ABI/testing/sysfs-class-usb_role | 6 +++ drivers/platform/chrome/cros_ec_typec.c | 19 +++++++++ drivers/usb/roles/class.c | 40 ++++++++++++++++++- 3 files changed, 63 insertions(+), 2 deletions(-)