From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1426401AbcBRNrF (ORCPT ); Thu, 18 Feb 2016 08:47:05 -0500 Received: from mx2.suse.de ([195.135.220.15]:59439 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425322AbcBRNrC (ORCPT ); Thu, 18 Feb 2016 08:47:02 -0500 Message-ID: <1455803065.14660.5.camel@suse.com> Subject: Re: [PATCH 1/3] usb: USB Type-C Connector Class From: Oliver Neukum To: Heikki Krogerus Cc: Felipe Balbi , Mathias Nyman , Greg KH , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Date: Thu, 18 Feb 2016 14:44:25 +0100 In-Reply-To: <20160218132541.GM1859@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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > Likewise, if we have USB PD, we have to know how that > > is linked to the connector directory. > > So you mean when we have USB PD PHY or controller, right? That > will be the parent of the connector device if we have one on the > platform. So the parentage is different on whether a PD controller is present? That needs to be documented. And so we cannot deal with separate modules for a PD driver? [..] > > Furthermore, do these files support poll? At least the current role and mode can change, so in principle poll() makes sense. > > And lastly we can get "Attention" as a message connected > > with a connector in an alternate mode. How does user space > > learn about that? > > The class should notify the userspace with uevent on > connection/disconnection regardless what is being connected, or what > mode the connector enters initially. Yes, but "Attention" in the sense of 6.4.4.3.6 of the PD spec. Does this need to be handled in the kernel? Do we generate a uevent for that? > So do you want to see that explained in the ABI document? No. Regards Oliver