From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1426233AbcBRKpG (ORCPT ); Thu, 18 Feb 2016 05:45:06 -0500 Received: from mga02.intel.com ([134.134.136.20]:33035 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425620AbcBRKpA (ORCPT ); Thu, 18 Feb 2016 05:45:00 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,464,1449561600"; d="scan'208";a="748593030" Date: Thu, 18 Feb 2016 12:44:55 +0200 From: Heikki Krogerus To: Peter Chen Cc: Felipe Balbi , Oliver Neukum , Felipe Balbi , Mathias Nyman , Greg KH , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH 2/3] usb: type-c: USB Type-C Connector System Software Interface Message-ID: <20160218104455.GC1859@kuha.fi.intel.com> References: <20160216092238.GA18565@kuha.fi.intel.com> <1455629987.4532.25.camel@suse.com> <20160217075841.GA24649@kuha.fi.intel.com> <1455699834.7626.4.camel@suse.com> <87fuwrsk7w.fsf@ti.com> <1455705412.7626.18.camel@suse.com> <20160217111116.GB24649@kuha.fi.intel.com> <87bn7fihld.fsf@ti.com> <20160217142816.GC24649@kuha.fi.intel.com> <20160218090704.GA13644@shlinux2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160218090704.GA13644@shlinux2> 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 Hi Peter, On Thu, Feb 18, 2016 at 05:07:04PM +0800, Peter Chen wrote: > On Wed, Feb 17, 2016 at 04:28:16PM +0200, Heikki Krogerus wrote: > > On Wed, Feb 17, 2016 at 03:36:46PM +0200, Felipe Balbi wrote: > > > IIRC mode and role negotiation goes via CC pins using the power delivery > > > protocol. If I misunderstand anything, let me know. > > > > The data role swap with USB Type-C connectors is in no way tied to USB > > Power Delivery. The USB Type-C spec defines that when USB PD is > > available, DR_Swap USB PD function is used to swap the role, otherwise > > emulated disconnect will do the trick. > > I am interested in how you design role swap on the fly without USB PD. > Do you follow the spec like USB OTG 3.0 RSP (Role Swap Protocol) or > just echo the /sys to give up current role, and swap to another? No OTG with USB Type-C. You echo the wanted role to the /sys/class/type-C/usbcN/data_role. This operation from userspace is the same regardless was USB PD supported or not. The actual operations needed for the role swap are of course platform specific, and the responsibility of the drivers that register the ports with type-c class. Thanks, -- heikki