Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754453AbbBQTTY (ORCPT ); Tue, 17 Feb 2015 14:19:24 -0500 Received: from mga09.intel.com ([134.134.136.24]:44763 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751792AbbBQTTV (ORCPT ); Tue, 17 Feb 2015 14:19:21 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,595,1418112000"; d="scan'208";a="667664282" Date: Tue, 17 Feb 2015 11:20:56 -0800 From: David Cohen To: Linus Walleij Cc: MyungJoo Ham , Chanwoo Choi , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , baolu.lu@linux.intel.com Subject: Re: [RFC/PATCH] extcon: otg_gpio: add driver for USB OTG port controlled by GPIO(s) Message-ID: <20150217192056.GB2957@psi-dev26.jf.intel.com> References: <1419288217-19262-1-git-send-email-david.a.cohen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2674 Lines: 86 Hi Linus, Thanks for reviewing. On Thu, Jan 08, 2015 at 08:23:03PM +0100, Linus Walleij wrote: > On Mon, Dec 22, 2014 at 11:43 PM, David Cohen > wrote: > > > Some platforms have an USB OTG port fully (or partially) controlled by > > GPIOs: > > > > (1) USB ID is connected directly to GPIO > > > > Optionally: > > (2) VBUS is enabled by a GPIO (when ID is grounded) > > (3) Platform has 2 USB controllers connected to same port: one for > > device and one for host role. D+/- are switched between phys > > by GPIO. > > > > As per initial version, this driver has the duty to control whether > > USB-Host cable is plugged in or not: > > - If yes, OTG port is configured for host role > > - If no, by standard, the OTG port is configured for device role > > > > Signed-off-by: David Cohen > > Pretty interesting! I don't understand the USB stuff so commenting > from a GPIO side of things only. > > > +config EXTCON_OTG_GPIO > > + tristate "VIRTUAL USB OTG PORT support" > > + depends on GPIOLIB > > Isn't it dependent on ACPI? This was mentioned in the commit message. Yep, I'll add it :) > > > +/* > > + * Virtual USB OTG Port driver controlled by gpios > > + * > > + * Copyright (c) 2014, Intel Corporation. > > + * Author: David Cohen > > + * > > + * This program is free software; you can redistribute it and/or modify > > + * it under the terms of the GNU General Public License version 2 as > > + * published by the Free Software Foundation. > > + * > > + * This program is distributed in the hope that it will be useful, > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > + * GNU General Public License for more details. > > + */ > > + > > +#include > > +#include > > +#include > > You should include > > And nothing else. (I think it'll just work.) It should work. I'll fix it. > > > +static int __init vuport_init(void) > > +{ > > + return platform_driver_register(&vuport_driver); > > +} > > +subsys_initcall(vuport_init); > > Usually we try to avoid this kind of early initcalls. > Doesn't deferred probe work as intended? Yeah, deferred probe is a better thing to try here. Br, David > > 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/