From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932686AbcE0IIS (ORCPT ); Fri, 27 May 2016 04:08:18 -0400 Received: from mga04.intel.com ([192.55.52.120]:15535 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932077AbcE0IIM (ORCPT ); Fri, 27 May 2016 04:08:12 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,373,1459839600"; d="scan'208";a="963437797" Subject: Re: [PATCH v8 2/7] usb: mux: add generic code for dual role port mux To: Heikki Krogerus References: <1462426383-3949-1-git-send-email-baolu.lu@linux.intel.com> <1462426383-3949-3-git-send-email-baolu.lu@linux.intel.com> <20160525110652.GA27570@kuha.fi.intel.com> <57464B4F.8050907@linux.intel.com> <20160527080027.GE22411@kuha.fi.intel.com> Cc: felipe.balbi@linux.intel.com, Mathias Nyman , Greg Kroah-Hartman , Lee Jones , Liam Girdwood , Mark Brown , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org From: Lu Baolu Message-ID: <57480052.1070606@linux.intel.com> Date: Fri, 27 May 2016 16:07:46 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160527080027.GE22411@kuha.fi.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 05/27/2016 04:00 PM, Heikki Krogerus wrote: >> I agree with you that we should move extcon out of the framework. >> > >> > In order to support multiport systems, I have below proposal. >> > >> > Currently, we have below interfaces. >> > >> > struct portmux_dev *portmux_register(struct portmux_desc *desc); >> > void portmux_unregister(struct portmux_dev *pdev); >> > >> > I will add below ones. >> > >> > struct portmux_dev *portmux_lookup_by_name(char *name); >> > int portmux_switch(struct portmux_dev *pdev, enum port_role); >> > >> > The normal usage mode is >> > 1) the mux device is registered as soon as a mux is detected with >> > portmux_register(); >> > 2) In components like USB PHY or changer drivers, the mux could >> > be retrieved with portmux_lookup_by_name() and controlled via >> > portmux_switch(). >> > >> > Is this helpful? > It works for me, and we can improve it later if needed. Okay, thanks. Best regards, Lu Baolu