Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp480752rdh; Wed, 7 Feb 2024 10:09:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWYnUu2FnO8bkQKiSv8wAhr/ShwgyZkrOkr4DJR3ZYC+ULmVV7JfWLXdiyoorx7o7OKLyFePGwKSBHpODv2RjW6ci1cdc18Yqz/VCMG/g== X-Google-Smtp-Source: AGHT+IG4C7P3sWg8RvGT0LkthatcwxXgGK8dCDrcHL4rJBiEVlugE/0l8p/TjUxGGtymC5qXTJdu X-Received: by 2002:a17:902:6803:b0:1d9:167b:8e6c with SMTP id h3-20020a170902680300b001d9167b8e6cmr5058686plk.46.1707329346474; Wed, 07 Feb 2024 10:09:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707329346; cv=pass; d=google.com; s=arc-20160816; b=cmyHhlulMeisk1b6JY7VHe3MuenkKDr0YFRjg+KZy8eC988JseqlnCPguXwzuJbXt2 LIQZMBGAIjsv2jQ08SoMzxJCjPQ2wmuPF0mphI6HImXuollow4/ah5KSkskWh5L2D47n zIMktcLi4AYMD6A767oWdl/lM/4FY+RWnhS180ii3uIWvcqeY+dHZln+HijBwV/SwVwB n9m56UW7iOER20pUjoySpeLZbdLU8DsQAOD20GUDAct6OZe0w2dWocS7kGZcuhmsn0+e zxxqrorCKriOHrcwbv7zncM82LMNyYmm6DKAC2wq7op1X9ojTwmeWc5gxkKxnB98MCuG 1luw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=BYeftyOwOMJMWgypRQnW2rUGS3xqUTlYlTswlsHkHm4=; fh=4WecJKWwVO/S/I+5w1Alfm1I59HAzrmHBbPQYXRdkjM=; b=sk/HlOw+Y/UQbLZ/v3j6CNc75uWDzyaouT6ud3wL0oTwlqVNxfgPQBTeetT6IBloLK zKfAg+ha4lrKw5B/6Da0pcib9Xh+4P7fL6ycWDbyW1CTyE9OitAfyvzQuUObss6S9h+5 b1movEa05i96uejWC5r8qWlFsDka9GfYsyO+Xdeylme4EmNA5er47zhLlQhfQkIRMgMe EZyN23FwtfnleMviicLH6gYiLaqzhlAeJDPyHyy519mhnPDIByt6DXvIPcCaF/JrFiDN 58RMffwNcreMibwCkWJgGgnSYFtB1M2kDPekSAAZ2oyLikZ5Vi2zFBj+fLnhT4DtJv1e xMmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Bz//pEE0"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-56682-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56682-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCVoYIghGhNh4vVBmRY9rCTKztfk2dbOLywsEWjFWcwghyiUT9qf+khfKFjBNnxGBEoVBoW1asdbq17S22LzyC0IEyDeov0zuzQbcmp5qQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id v13-20020a170902f0cd00b001d9427ea3e1si2007680pla.80.2024.02.07.10.09.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 10:09:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56682-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Bz//pEE0"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-56682-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56682-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 3AB0B292A1A for ; Wed, 7 Feb 2024 15:00:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 86D987FBAD; Wed, 7 Feb 2024 14:59:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Bz//pEE0" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (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 65D227FBBE; Wed, 7 Feb 2024 14:59:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707317963; cv=none; b=MXtKbVpXTvfdRK5JG6D0P1A/y/+4Ksy+gNsuW6eaOr0J2I0IRShr+ZlIoUX8hiunS4CNEcLq4/zoPd0YnAh7GxpO5L8IEaD3iFp6vgR98qwC3YXitumOGQWvArJIL2wC/Dl0TBPJryBWq3ZC9eRbdt49Vo+Du5bFxrzaZfzk7J4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707317963; c=relaxed/simple; bh=wJ5erar78HhMhQzSx2+rDQ9WduuYUwpvlY26tbDxq6g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tkJYzoKbk8duz38gZ8dpfnmV9JeFhsAVQt59IV9+wOR7W8Q860MJmp0BBMZYMbUn/J/LMkCeCeZ0HQ/mhF7v6g3GS2CEqzJdLxYDiPdQhvPD6tupUnDLbTA0pL/F71ALoFdQzHcPVAjXUo/iuDs9mNPDge4clGUU4OWGsxNAss0= 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=Bz//pEE0; arc=none smtp.client-ip=198.175.65.18 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=1707317962; x=1738853962; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wJ5erar78HhMhQzSx2+rDQ9WduuYUwpvlY26tbDxq6g=; b=Bz//pEE0nLE17QsgMYDeMR9rasJSCe4mNDgi8NttTfImga5p1tK6LmoH mbNjTsIJJmIZLStnlmLM3CYPBBkxZKafw7lzx84scLB1MO2REp29/hTaH kslrY5FE3da6JixXpP/fryzXqdkutboSTID7rJtIHU/JBQMgsesFkdr/L SvOqvlwjSkUBoaQ5M7ET+Marb2uNTLvZzl3lUFTZeO9flZH0BVKa1u4pz fFIug7yW+Y+Vv6gz3uJ0ykkeMzwrER+zhVc8YVPQafPOtGbC1UeBuML8m 7qRhew1puG0ButRuV09TsJ6qloFnOfdAYkVu1lfKOWj8NsPgkkNoXeF6f g==; X-IronPort-AV: E=McAfee;i="6600,9927,10977"; a="1155047" X-IronPort-AV: E=Sophos;i="6.05,251,1701158400"; d="scan'208";a="1155047" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2024 06:59:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10977"; a="933799566" X-IronPort-AV: E=Sophos;i="6.05,251,1701158400"; d="scan'208";a="933799566" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 07 Feb 2024 06:59:00 -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 , linux-usb@vger.kernel.org, chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, Uday Bhat Subject: [PATCH 2/2] platform/chrome: cros_ec_typec: Make sure the USB role switch has PLD Date: Wed, 7 Feb 2024 16:58:51 +0200 Message-ID: <20240207145851.1603237-3-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240207145851.1603237-1-heikki.krogerus@linux.intel.com> References: <20240207145851.1603237-1-heikki.krogerus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The USB role switch does not always have the _PLD (Physical Location of Device) in ACPI tables. If it's missing, assigning the PLD hash of the port to the switch. That should guarantee that the USB Type-C port mapping code is always able to find the connection between the two (the port and the switch). Tested-by: Uday Bhat Signed-off-by: Heikki Krogerus --- drivers/platform/chrome/cros_ec_typec.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c index 2b2f14a1b711..5c14e8db08b5 100644 --- a/drivers/platform/chrome/cros_ec_typec.c +++ b/drivers/platform/chrome/cros_ec_typec.c @@ -28,6 +28,7 @@ static int cros_typec_parse_port_props(struct typec_capability *cap, struct fwnode_handle *fwnode, struct device *dev) { + struct fwnode_handle *sw_fwnode; const char *buf; int ret; @@ -66,6 +67,16 @@ static int cros_typec_parse_port_props(struct typec_capability *cap, cap->prefer_role = ret; } + /* Assing the USB role switch the correct pld_crc if it's missing. */ + sw_fwnode = fwnode_find_reference(fwnode, "usb-role-switch", 0); + if (!IS_ERR_OR_NULL(sw_fwnode)) { + struct acpi_device *adev = to_acpi_device_node(sw_fwnode); + + if (adev && !adev->pld_crc) + adev->pld_crc = to_acpi_device_node(fwnode)->pld_crc; + fwnode_handle_put(sw_fwnode); + } + cap->fwnode = fwnode; return 0; -- 2.43.0