From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755465AbcEYPAJ (ORCPT ); Wed, 25 May 2016 11:00:09 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:57670 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753177AbcEYPAD (ORCPT ); Wed, 25 May 2016 11:00:03 -0400 Date: Wed, 25 May 2016 07:59:57 -0700 From: Guenter Roeck To: Oliver Neukum Cc: Heikki Krogerus , Andy Shevchenko , Rajaram R , Felipe Balbi , Mathias Nyman , Greg KH , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [RFC PATCHv2] usb: USB Type-C Connector Class Message-ID: <20160525145957.GA19413@roeck-us.net> References: <1463661894-22820-1-git-send-email-heikki.krogerus@linux.intel.com> <20160524192826.GA28453@roeck-us.net> <20160525115135.GD27570@kuha.fi.intel.com> <5745A6F2.6000406@roeck-us.net> <20160525140429.GE27570@kuha.fi.intel.com> <1464186056.2132.12.camel@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464186056.2132.12.camel@suse.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 25, 2016 at 04:20:56PM +0200, Oliver Neukum wrote: > On Wed, 2016-05-25 at 17:04 +0300, Heikki Krogerus wrote: > > > I'm not against leaving the responsibility of registering the alternate > > modes to the drivers. I'm a little bit worried about relying then on > > the drivers to also handle the unregistering accordingly, but I can > > live with that. But we just shouldn't share the responsibility of > > un/registering them between the class and the drivers, so the driver > > should then handle the registration always. > > > > Oliver, what do you think? > > Either will do for me. Registration by the drivers is a bit better. > But it has to be the one or the other. Mixing is indeed bad. > Same here. I don't have any problems handling unregistering from the driver. I just have to keep track of the state and call typec_unregister_altmodes() before calling typec_disconnect(). Having to wait for mode discovery to complete before calling typec_connect() is much more complicated, at least with my current code. Guenter