Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp341332pxf; Thu, 25 Mar 2021 05:33:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtXpNMO3uCV+BxCsFo0oBI2AHBXnFYupZfuEdHjRA5ibjNBkGyzECseC34mOOzZSp9caOg X-Received: by 2002:a05:6402:1d1a:: with SMTP id dg26mr8734078edb.266.1616675603324; Thu, 25 Mar 2021 05:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616675603; cv=none; d=google.com; s=arc-20160816; b=R8QXcr/t0dPS727I1nrolAwyYQ1yEkJSQziu+VsNg24qvg8xBBP7ePdrCA8dRUgt8C zga+mFouQpMiSYUBz1N3ixbTxm218achd7aNjsz4NBPFkqOkl9/L67HFH2Pugq7jd86r /rMSaRbHkE8+KA6L6Z11bR5DQWRE5U1uIkUFnE8lKwNKiCS0fIHrmCH5cjpjFLr0EJdC N3bzttujFiCbKXfYD2ycOq/xV+c4YEuhcvu0DEyqQvNS/XLujbu8E4VKy2vucKUc3znR zpmz2zB79Sa0ekFmV1SYlh1H6aWet9gNSYRf4To4ERFQXsNqVqujJrUE3QHWXXb6ZkEr famQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=o5OBEhFfHjHb/6s6wAb5/XzECPHZBEZ1U8AcyfT0CXs=; b=q0HaxYPSX27gXOfqB7F8CeQt5JwICp8JZ/I849NZ7u1GNKSsfgy5t/4aCKfseDHX05 lJcjPL0P2/Cv/yDW7balc6gPNZKfZGucr/UEkvLDuK1r7klFjaiBU6qj9W5vZ9DKMzOZ uc7/P5X9WW6H6X77c9MJB+KOrRoL05GLZ82y9txWOjIfAikgxxuemjr/quLvDcYJql6r u8rSlQK1gHaEhLSW56gOxZ01hLNJE7h7/1lKFa+dNxY24HfElyXxuG1nY5jbNsAMXNj3 BbpcuPUnq/cU1P1bSp3W2P88e6I0jjwtADWHA7F3lSnM+LRrMPQJGcgK7JsXxiCyLL5C lRBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o9si4600787ejr.588.2021.03.25.05.33.00; Thu, 25 Mar 2021 05:33:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231146AbhCYM3p (ORCPT + 99 others); Thu, 25 Mar 2021 08:29:45 -0400 Received: from mga17.intel.com ([192.55.52.151]:31183 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230208AbhCYM30 (ORCPT ); Thu, 25 Mar 2021 08:29:26 -0400 IronPort-SDR: ajXTx/QMHzrOdMPStDDlJJN8sOI00S/4KFhR2rOKPEL5Uy4RNFKxXDWt3Ashhu83/mUMZ2KKLk YuZm4DxISe9Q== X-IronPort-AV: E=McAfee;i="6000,8403,9933"; a="170895509" X-IronPort-AV: E=Sophos;i="5.81,277,1610438400"; d="scan'208";a="170895509" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2021 05:29:25 -0700 IronPort-SDR: THsVBnyVCyuF3fx6mrKFI1Zd8R7BSEIFe1wp82f3YXCByj8I1UelEIm0WfvbVDG1uFlRSB5cMe So6arsuRzi1g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,277,1610438400"; d="scan'208";a="514623176" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 25 Mar 2021 05:29:23 -0700 From: Heikki Krogerus To: Greg Kroah-Hartman Cc: Benson Leung , Prashant Malani , Guenter Roeck , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/6] usb: Link the ports to the connectors they are attached to Date: Thu, 25 Mar 2021 15:29:25 +0300 Message-Id: <20210325122926.58392-6-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210325122926.58392-1-heikki.krogerus@linux.intel.com> References: <20210325122926.58392-1-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Creating link to the USB Type-C connector for every new port that is added when possible. Signed-off-by: Heikki Krogerus --- Documentation/ABI/testing/sysfs-bus-usb | 9 +++++++++ drivers/usb/core/port.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb index bf2c1968525f0..8b4303a0ff51d 100644 --- a/Documentation/ABI/testing/sysfs-bus-usb +++ b/Documentation/ABI/testing/sysfs-bus-usb @@ -255,6 +255,15 @@ Description: is permitted, "u2" if only u2 is permitted, "u1_u2" if both u1 and u2 are permitted. +What: /sys/bus/usb/devices/.../(hub interface)/portX/connector +Date: April 2021 +Contact: Heikki Krogerus +Description: + Link to the USB Type-C connector when available. This link is + only created when USB Type-C Connector Class is enabled, and + only if the system firmware is capable of describing the + connection between a port and its connector. + What: /sys/bus/usb/devices/.../power/usb2_lpm_l1_timeout Date: May 2013 Contact: Mathias Nyman diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index dfcca9c876c73..3c382a4b648ec 100644 --- a/drivers/usb/core/port.c +++ b/drivers/usb/core/port.c @@ -9,6 +9,7 @@ #include #include +#include #include "hub.h" @@ -576,6 +577,7 @@ int usb_hub_create_port_device(struct usb_hub *hub, int port1) } find_and_link_peer(hub, port1); + typec_link_port(&port_dev->dev); /* * Enable runtime pm and hold a refernce that hub_configure() @@ -619,5 +621,6 @@ void usb_hub_remove_port_device(struct usb_hub *hub, int port1) peer = port_dev->peer; if (peer) unlink_peers(port_dev, peer); + typec_unlink_port(&port_dev->dev); device_unregister(&port_dev->dev); } -- 2.30.2