From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946601AbcBRPNu (ORCPT ); Thu, 18 Feb 2016 10:13:50 -0500 Received: from mga11.intel.com ([192.55.52.93]:27994 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1426370AbcBRPNt (ORCPT ); Thu, 18 Feb 2016 10:13:49 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,465,1449561600"; d="scan'208";a="748724522" Date: Thu, 18 Feb 2016 17:13:44 +0200 From: Heikki Krogerus To: Oliver Neukum Cc: Felipe Balbi , Mathias Nyman , Greg KH , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH 1/3] usb: USB Type-C Connector Class Message-ID: <20160218151344.GA17761@kuha.fi.intel.com> References: <1455037283-106479-1-git-send-email-heikki.krogerus@linux.intel.com> <1455037283-106479-2-git-send-email-heikki.krogerus@linux.intel.com> <1455718047.7626.22.camel@suse.com> <20160218084724.GA1859@kuha.fi.intel.com> <1455788141.1384.16.camel@suse.com> <20160218132541.GM1859@kuha.fi.intel.com> <1455803065.14660.5.camel@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455803065.14660.5.camel@suse.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 18, 2016 at 02:44:25PM +0100, Oliver Neukum wrote: > On Thu, 2016-02-18 at 15:25 +0200, Heikki Krogerus wrote: > > Hi, > > > > > We have port directories for port power switching. How is > > > the connector directory linked to them? > > > > I'm sorry, I don't think I understand this point. > > Like this: > > oneukum@linux-dtbq:/sys/bus/usb/devices/3-0:1.0> ls -l > total 0 > -rw-r--r-- 1 root root 4096 Feb 18 14:34 authorized > -r--r--r-- 1 root root 4096 Feb 18 14:34 bAlternateSetting > -r--r--r-- 1 root root 4096 Feb 18 14:34 bInterfaceClass > -r--r--r-- 1 root root 4096 Feb 18 14:34 bInterfaceNumber > -r--r--r-- 1 root root 4096 Feb 18 14:34 bInterfaceProtocol > -r--r--r-- 1 root root 4096 Feb 18 14:34 bInterfaceSubClass > -r--r--r-- 1 root root 4096 Feb 18 14:34 bNumEndpoints > lrwxrwxrwx 1 root root 0 Feb 17 15:59 driver > -> ../../../../../bus/usb/drivers/hub > drwxr-xr-x 3 root root 0 Feb 18 09:35 ep_81 > -r--r--r-- 1 root root 4096 Feb 18 14:34 modalias > drwxr-xr-x 2 root root 0 Feb 18 09:35 power > lrwxrwxrwx 1 root root 0 Feb 17 15:59 subsystem > -> ../../../../../bus/usb > -r--r--r-- 1 root root 4096 Feb 18 14:34 supports_autosuspend > -rw-r--r-- 1 root root 4096 Feb 18 14:34 uevent > drwxr-xr-x 3 root root 0 Feb 18 09:35 usb3-port1 > drwxr-xr-x 3 root root 0 Feb 18 09:35 usb3-port10 > drwxr-xr-x 3 root root 0 Feb 18 09:35 usb3-port11 > drwxr-xr-x 3 root root 0 Feb 18 09:35 usb3-port12 > drwxr-xr-x 3 root root 0 Feb 18 09:35 usb3-port13 > drwxr-xr-x 3 root root 0 Feb 18 09:35 usb3-port14 > drwxr-xr-x 3 root root 0 Feb 18 09:35 usb3-port15 > drwxr-xr-x 3 root root 0 Feb 18 09:35 usb3-port2 > drwxr-xr-x 3 root root 0 Feb 18 09:35 usb3-port3 > drwxr-xr-x 3 root root 0 Feb 18 09:35 usb3-port4 > drwxr-xr-x 3 root root 0 Feb 18 09:35 usb3-port5 > drwxr-xr-x 3 root root 0 Feb 18 09:35 usb3-port6 > drwxr-xr-x 3 root root 0 Feb 18 09:35 usb3-port7 > drwxr-xr-x 3 root root 0 Feb 18 09:35 usb3-port8 > drwxr-xr-x 3 root root 0 Feb 18 09:35 usb3-port9 > > usb*-port* > > They correspond to the connectors a system has. > It seems to me that we want a link connecting them > if the correspondance is known. Ah, got it. In case of ACPI enumerated UCSI, we will have the actual ACPI device object for the port as a child device object. So when we attach the port ACPI companion to the connector device we create in the class, it will link us directly to the correct usb*-port*. I have not done it so far because the same port ACPI device object will also be bound to the usb peripheral once it gets enumerated, and I was worried if that would cause a problem. But after talking to guys that know more about ACPI then I do, I'm sure that is not going to be a problem. With ACPI, the binding should happen the same way even without UCSI. What ever device driver registers the connector device should have the port ACPI device object as it's child. So I'm thinking about doing this in typec_register_port() and not in UCSI driver. Thanks, -- heikki