Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp935585pxf; Wed, 7 Apr 2021 15:29:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBErXNs2xSk9xef8P0CLoQDlDGqfISklz5iE2ZeSF37UYTeSqKy0M7chXTHqLcbEoi6Adw X-Received: by 2002:a05:6402:520b:: with SMTP id s11mr7392330edd.212.1617834559117; Wed, 07 Apr 2021 15:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617834559; cv=none; d=google.com; s=arc-20160816; b=RbauvFqEsQeykannjxO3M1b/Iu798dNPgq+lypimdGQrfjxH8NtMIkE7L6goAmFE3O tmeqcR9UAFftUdLX5wMqjh5HF6h5/BeLKx8OzYaBcjt781mBhHJ//XFpXSe17I+lIyjC eAPOh9KbsHAGYm8Y2r7ow9eYEb3fbRHxv8op2G3xLP3mJa+mzCYk38QTvKUV/AGD3ke9 DCMbC/SVMeslOFUXUo+HBVvRhAah7KJyxfMWEWw6tG+sU6ZosO7hVaZCPfwzZDTzU15Y EOh5K4fNcGWKJhzRICpymDQ3emn/4TnlAZ50DEPuvX2Jd7yluQMTTANjiux6/xqwhXzT +ZYQ== 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=Le27ForBa19P0UNV67IjfwOIGTw+lMKk8nwk4JbyB2cj67xkwXnlDoiC/DGFm0FgYV isomDvrqlKkUpaBcsfNOVGL20NRbkad1ypvdKapYgEoAe8lGWaXJo8kBpCeSkS/rdh4H 8CNsCfP0AR6qq5ChwhxN71yQ9B6I6r2JARSb0FAItAs1EDtMWr0wbj0v5TGANkmCdIdp EYIFBTgecexZ5vbUe97FwQNDwYD5wlRxHOsogmX7DfexwDyRCxVgxZpb6ZldSn+fWwok u5TgzVYwg0pPtbmOSQjH7cs3F2mhgT9QJ/1jpRNIba3SQTn2ot2GtB+McIlURJW8VSOM VUsg== 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 m17si9408319edr.21.2021.04.07.15.28.56; Wed, 07 Apr 2021 15:29:19 -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 S1349266AbhDGGz7 (ORCPT + 99 others); Wed, 7 Apr 2021 02:55:59 -0400 Received: from mga02.intel.com ([134.134.136.20]:62003 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349245AbhDGGzy (ORCPT ); Wed, 7 Apr 2021 02:55:54 -0400 IronPort-SDR: uyIF8Bxuttcm/xHi0RtO/8cBryDMPMTLDbfd8Vx0FMAGA/KzC9qkn1PLLgk6mBJpZKNxmID6GG YEt1lGNVmB/w== X-IronPort-AV: E=McAfee;i="6000,8403,9946"; a="180372035" X-IronPort-AV: E=Sophos;i="5.82,201,1613462400"; d="scan'208";a="180372035" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2021 23:55:45 -0700 IronPort-SDR: 0HVzktk3sVZeol8LXvTwADQ942KAVlQ15q8HzmFQSAIHttfjPb/AbaHwQcV78P+ae8/Kx5zcsA FABv6tISp/wg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,201,1613462400"; d="scan'208";a="519326273" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 06 Apr 2021 23:55:43 -0700 From: Heikki Krogerus To: Greg Kroah-Hartman Cc: Alan Stern , Guenter Roeck , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 2/4] usb: Link the ports to the connectors they are attached to Date: Wed, 7 Apr 2021 09:55:53 +0300 Message-Id: <20210407065555.88110-3-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210407065555.88110-1-heikki.krogerus@linux.intel.com> References: <20210407065555.88110-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