From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754943AbcESOut (ORCPT ); Thu, 19 May 2016 10:50:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:52696 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754634AbcESOur (ORCPT ); Thu, 19 May 2016 10:50:47 -0400 Message-ID: <1463669237.14323.8.camel@suse.com> Subject: Re: [RFC PATCHv2] usb: USB Type-C Connector Class From: Oliver Neukum To: Heikki Krogerus Cc: Guenter Roeck , Andy Shevchenko , Rajaram R , Felipe Balbi , Mathias Nyman , Greg KH , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Date: Thu, 19 May 2016 16:47:17 +0200 In-Reply-To: <1463661894-22820-1-git-send-email-heikki.krogerus@linux.intel.com> References: <1463661894-22820-1-git-send-email-heikki.krogerus@linux.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-05-19 at 15:44 +0300, Heikki Krogerus wrote: > The purpose of this class is to provide unified interface for user > space to get the status and basic information about USB Type-C > Connectors in the system, control data role swapping, and when USB PD > is available, also power role swapping and Alternate Modes. > > Signed-off-by: Heikki Krogerus > --- > drivers/usb/Kconfig | 2 + > drivers/usb/Makefile | 2 + > drivers/usb/type-c/Kconfig | 7 + > drivers/usb/type-c/Makefile | 1 + > drivers/usb/type-c/typec.c | 957 ++++++++++++++++++++++++++++++++++++++++++++ > include/linux/usb/typec.h | 230 +++++++++++ > 6 files changed, 1199 insertions(+) > create mode 100644 drivers/usb/type-c/Kconfig > create mode 100644 drivers/usb/type-c/Makefile > create mode 100644 drivers/usb/type-c/typec.c > create mode 100644 include/linux/usb/typec.h > > Hi, > > Like I've told some of you guys, I'm trying to implement a bus for > the Alternate Modes, but I'm still nowhere near finished with that > one, so let's just get the class ready now. The altmode bus should in > any case not affect the userspace interface proposed in this patch. > > As you can see, the Alternate Modes are handled completely differently > compared to the original proposal. Every Alternate Mode will have > their own device instance (which will be then later bound to an > Alternate Mode specific driver once we have the bus), but also every > partner, cable and cable plug will have their own device instances > representing them. That raises a question. If I read the standard correctly, alternate modes could be combinable. So how do you represent that. > An other change is that the data role is now handled in two ways. > The current_data_role file will represent static mode of the port, and > it will use the names for the roles as they are defined in the spec: > DFP, UFP and DRP. This file should be used if the port needs to be > fixed to one specific role with DRP ports. So this approach will > replace the suggestions for "preferred" data role we had. The > current_usb_data_role will use values "host" and "device" and it will > be used for data role swapping when already connected. Please explain. How does that express DRP but prefered master? > I Hope I remembered to CC everybody interested. Alternate modes can be left involuntarily. So we need a method of notification. Regards Oliver