From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425839AbcBRJZ1 (ORCPT ); Thu, 18 Feb 2016 04:25:27 -0500 Received: from mga01.intel.com ([192.55.52.88]:35301 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425615AbcBRJZX (ORCPT ); Thu, 18 Feb 2016 04:25:23 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,464,1449561600"; d="scan'208";a="50043732" Date: Thu, 18 Feb 2016 11:21:51 +0200 From: Heikki Krogerus To: Oliver Neukum Cc: Greg KH , Felipe Balbi , Mathias Nyman , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH 0/3] usb: USB Type-C Class and driver for UCSI Message-ID: <20160218092151.GB1859@kuha.fi.intel.com> References: <1455037283-106479-1-git-send-email-heikki.krogerus@linux.intel.com> <1455735227.26846.4.camel@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455735227.26846.4.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 Wed, Feb 17, 2016 at 07:53:47PM +0100, Oliver Neukum wrote: > On Tue, 2016-02-09 at 19:01 +0200, Heikki Krogerus wrote: > > Hi, > > > > The OS, or more precisely the user space, needs to be able to control > > a few things regarding USB Type-C ports. The first thing that must be > > allowed to be controlled is the data role. USB Type-C ports will > > select the data role randomly with DRP ports. When USB PD is > > supported, also independent (from data role) power role swapping can > > be supported together with Alternate Mode control. > > What about S4? We need to restore the alternate mode upon resume, > if we are the DFP and as that might involve storage devices it > needs to be done in kernel space. That I'm expecting to be the responsibility of the drivers registering the ports at them moment, because I'm afraid of all the possible different kind of platform specific oddities that need to be considered. But I guess all we would need to do in the class is store the roles and mode during suspend, and restore them during resuming with dr_swap, pr_swap and set_alt_mode hooks if they changed. Thanks, -- heikki