Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3437305pxf; Mon, 29 Mar 2021 02:06:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycn2MH3mtEqxmU7cHB+6aOMSQtdOJj+IzrF16ABYmBroOFDOl9KzHZGzD4IBcU3P67zodY X-Received: by 2002:a17:906:ecb8:: with SMTP id qh24mr28365865ejb.162.1617008808520; Mon, 29 Mar 2021 02:06:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617008808; cv=none; d=google.com; s=arc-20160816; b=bSYJPklc7cz69YLwpOMOilM3cY2Q43G5saVHqIMJq2wMCS4GFc7IZN2wp3mHrfHtMu 1l1VR9XN8V97d/ju4TKMR2TnMilBanofyyAsbB3K0kR90a1z78AovytgMBKhB891s2Qm nw+luV/1XXd+GbjMWlT9UUSQERj9p1kUbtSbzgbBFlKRyAwiTIDN60WiyJAtF8LjwVbE q9OAxdxDHTK9QKslG+iVAuV/4d4jDxnL8GFDdaKFT3ZN4IslYhAwWzh8AC3i6mGB75fC Jx1WqMEXD5a4CXid9SRhSAEwvANQnauHuSJqFkXdeL2TwhVNzP8+89nqFUEvf3JWHuQX oFIQ== 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=0qZTmijMhSRnn0N3STCCOJ0HftAFHHXbcBEmSE6bFP9NmRzUtRWRcV+wCpT/dF8DFd pkXX/PFltRRwKLW9g2Kwa4TkyJMIYrPuyYBv9/tZMr/MsTva/1updW0LnKwThtMyP9mR DQJVr1p/6PG2E0IU3/baGKn/yLTPO/2giydd1kR6ut12XgsH08U194VWzi2B27CLV6RZ pVNcFu1CzfM9QG+jtj48y8bjifcW8+I9z3Y1dZyyKxljGcsRgPMW0Jje3U8usnWo2m+p gietfwb/9sp+3MrrfV1PFrD1I+GzLQBVVgQV6ezIc9N5IpAIUx1bMUIIdNCX569CA5pf 6ufQ== 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 e22si7469282edu.575.2021.03.29.02.06.26; Mon, 29 Mar 2021 02:06:48 -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 S234838AbhC2JFF (ORCPT + 99 others); Mon, 29 Mar 2021 05:05:05 -0400 Received: from mga06.intel.com ([134.134.136.31]:14119 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235098AbhC2Ioy (ORCPT ); Mon, 29 Mar 2021 04:44:54 -0400 IronPort-SDR: 0oIvAPad+fX9VT0SAl3rHsCv6ZTLKDn3jue71iCs81s4YfpBSs6wujxlLJT26GbPeJWno8nUjm Fz2soFTANGog== X-IronPort-AV: E=McAfee;i="6000,8403,9937"; a="252854853" X-IronPort-AV: E=Sophos;i="5.81,287,1610438400"; d="scan'208";a="252854853" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2021 01:44:25 -0700 IronPort-SDR: HuPZ2jyIsh0mdvwsVXuggJIhFoAkPJwHKzE8MIu3D0I7jCba38XsxQLRRXwmzpL1gQq143Gzw2 sUw5UXC4WByA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,287,1610438400"; d="scan'208";a="515918721" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 29 Mar 2021 01:44:22 -0700 From: Heikki Krogerus To: Greg Kroah-Hartman Cc: Alan Stern , Benson Leung , Prashant Malani , Guenter Roeck , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/6] usb: Link the ports to the connectors they are attached to Date: Mon, 29 Mar 2021 11:44:24 +0300 Message-Id: <20210329084426.78138-5-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210329084426.78138-1-heikki.krogerus@linux.intel.com> References: <20210329084426.78138-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