Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp339477pxf; Thu, 25 Mar 2021 05:30:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeh46MdgW/CmL2GnTCvPsY7Asex85ULbGgzlULp9hq7LNdCUjFurLJ0zp04nxUtLGFz3Qs X-Received: by 2002:a17:906:d8d3:: with SMTP id re19mr9264419ejb.440.1616675452285; Thu, 25 Mar 2021 05:30:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616675452; cv=none; d=google.com; s=arc-20160816; b=Lohz/9ktQi+/uN1g3ayMKtaEHsXoEyj18UN/1k781PbmUo0JdzifYCvdJccz5Cwls4 YdPlIeVu5xm1Kp+gerIsSftYaR+KriYTjEyflGfkGmpC6OyUGyLzZgWwWfakNVBsTcvD JHqUwFIByu2O653esS97EIhaOt/h8fpXIUO5SAfDpczHPsdgEdrs+ARJcbgyJM79g4p9 aKQMHls5ZyRCAQq4sGHYNe9UVbKwyUYrCGj5lh7NvWHMM+uPHR6EGO6FRFCoGFc2FcVZ eFnL8iVBJr98Lum8qA4uDgKJrDI64xlUigObLhIUHDW0jFe4JPLZjX/3ROGPYTFINl01 qEvg== 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 :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=02sCe/fRMxd2eA514r+otdGGWKJPwSe6W+TLXNj6SiI=; b=yMT1gYKCX3w10wFodf6tBNSmli6Z6592g+nltwl9+kHq/KpfyN8p7Jm+BY/FHPkNxY IDoqBpSMfrniDdJOZpB7Lx/VvT5aKnmApTB9vu7q8lvmNr58aXYBMcCRrtC0Qot+GFE9 EbBkUa4m68IMzqGVyHvgJ67YR1hYyE5gCn/qGQPyAkAdBYJmnYbTtkiYsAuWSgJp7bGL OCt9zta8XmKfc7s/i1m+Y5DFqflo4TlclbI/ooO1uVPue3/+ympDDYt3QNrXaz1Hk181 e4q6K+s9/5nkajxBoUq7t073EVVrRT/xNRqYIFNJrk28DyRmZM8W/k/4bt7wzdPJlz5W RA9Q== 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 y13si4349134edc.327.2021.03.25.05.30.29; Thu, 25 Mar 2021 05:30:52 -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 S230313AbhCYM3f (ORCPT + 99 others); Thu, 25 Mar 2021 08:29:35 -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 S229995AbhCYM3P (ORCPT ); Thu, 25 Mar 2021 08:29:15 -0400 IronPort-SDR: qEKyoLQF4hmYBIJbzIK688Xna97Vdmmig7z3KrxErBim9s/d4RcavhhHYhtHL/Dmkrl4gFgH49 ZTG+aHGmrKKw== X-IronPort-AV: E=McAfee;i="6000,8403,9933"; a="170895468" X-IronPort-AV: E=Sophos;i="5.81,277,1610438400"; d="scan'208";a="170895468" 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:14 -0700 IronPort-SDR: e33qbh8QHajFNMSwD+bDkSzV/Gg+xqfWHcjUY4UtyimbrQPGTXdM2m/vTDM3k946wgGx28qUDk tiRS/B9Ybf9A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,277,1610438400"; d="scan'208";a="514623120" 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:12 -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 0/6] usb: Linking ports to their Type-C connectors Date: Thu, 25 Mar 2021 15:29:20 +0300 Message-Id: <20210325122926.58392-1-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Adding a simple function typec_link_port() that can be used to create a symlink "connector" that points to the USB Type-C connector of a port. It is used with USB ports initially, but hopefully later also with other things like DisplayPorts. Being able to see which connector is connected to a port is important in general, but it is really important when for example the data or power role of a device needs to swapped. The user probable wants to know which USB device is disconnected if role swap on a USB Type-C connector is executed. Hope these are OK. thanks, Heikki Krogerus (6): usb: Iterator for ports usb: typec: Organize the private headers properly usb: typec: Declare the typec_class static usb: typec: Port mapping utility usb: Link the ports to the connectors they are attached to usb: typec: Link all ports during connector registration Documentation/ABI/testing/sysfs-bus-usb | 9 + drivers/usb/core/port.c | 3 + drivers/usb/core/usb.c | 43 ++++ drivers/usb/typec/Makefile | 1 + drivers/usb/typec/bus.c | 2 + drivers/usb/typec/bus.h | 19 +- drivers/usb/typec/class.c | 101 +++------ drivers/usb/typec/class.h | 94 ++++++++ drivers/usb/typec/mux.c | 4 +- drivers/usb/typec/mux.h | 21 ++ drivers/usb/typec/port-mapper.c | 283 ++++++++++++++++++++++++ include/linux/usb.h | 1 + include/linux/usb/typec.h | 13 ++ 13 files changed, 499 insertions(+), 95 deletions(-) create mode 100644 drivers/usb/typec/class.h create mode 100644 drivers/usb/typec/mux.h create mode 100644 drivers/usb/typec/port-mapper.c -- 2.30.2