Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754109AbbBTJxr (ORCPT ); Fri, 20 Feb 2015 04:53:47 -0500 Received: from mail-ob0-f181.google.com ([209.85.214.181]:59967 "EHLO mail-ob0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753972AbbBTJxp (ORCPT ); Fri, 20 Feb 2015 04:53:45 -0500 MIME-Version: 1.0 In-Reply-To: <54E6D721.9070107@samsung.com> References: <1419288217-19262-1-git-send-email-david.a.cohen@linux.intel.com> <1424375984-26241-1-git-send-email-david.a.cohen@linux.intel.com> <54E6D721.9070107@samsung.com> Date: Fri, 20 Feb 2015 10:53:44 +0100 Message-ID: Subject: Re: [PATCH v2] extcon: otg_gpio: add driver for USB OTG port controlled by GPIO(s) From: Linus Walleij To: Robert Baldyga Cc: David Cohen , MyungJoo Ham , Chanwoo Choi , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , baolu.lu@linux.intel.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1627 Lines: 40 On Fri, Feb 20, 2015 at 7:41 AM, Robert Baldyga wrote: > Hi David, > > On 02/19/2015 08:59 PM, David Cohen wrote: >> Some Intel platforms have an USB OTG port fully (or partially) >> controlled by GPIOs: >> >> (1) USB ID is connected directly to a pulled up GPIO. >> >> Optionally: >> (2) VBUS is enabled/disabled by a GPIO >> (3) Platform has 2 USB controllers connected to same port: one for >> device and one for host role. D+/- are switched between phys. >> according to this GPIO level. >> >> This driver configures USB OTG port for device or host role according to >> USB ID value. >> - If USB ID's GPIO level is low, OTG port is configured for host role >> by sourcing VBUS and switching D+/- to host phy. >> - If USB ID's GPIO level is high, by standard, the OTG port is >> configured for device role by not sourcing VBUS and switching D+/- to >> device controller. > > IMO it's not very elegant to handle VBUS power on/off in extcon driver. > Creating fixed regulator would allow to make VBUS handling more generic. IMHO it's just layers of abstraction piled on top of each other here. I would put this adjacent to the phy driver somewhere in drivers/usb/* and make the actual USB-driver thing handle its GPIOs directly. But I guess David and Felipe have already discussed that as we're seeing this patch? Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/