From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932326AbcE0DVh (ORCPT ); Thu, 26 May 2016 23:21:37 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:35780 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932168AbcE0DVf (ORCPT ); Thu, 26 May 2016 23:21:35 -0400 Date: Fri, 27 May 2016 11:16:24 +0800 From: Peter Chen To: Thierry Reding Cc: Peter Chen , Greg Kroah-Hartman , Stephen Warren , Alexandre Courbot , Jon Hunter , linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC 0/5] usb: chipidea: Add support for Tegra20 through Tegra124 Message-ID: <20160527031624.GA3034@shlinux2> References: <20160526154005.11558-1-thierry.reding@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160526154005.11558-1-thierry.reding@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 26, 2016 at 05:40:00PM +0200, Thierry Reding wrote: > From: Thierry Reding > > All Tegra SoC generations from Tegra20 through Tegra124 have a ChipIdea > USB device controller. This set of patches adds very rudimentary support > for it to the existing ChipIdea driver and enables them on the set of > boards that I could easily test on. > > I'm sending this out as RFC because I'm not sure yet how to merge this. > While the driver seems to work fine (tested by exporting a USB driver or > eMMC via the mass storage function) I don't yet understand how to make > the driver switch between host and device modes dynamically. It might be > useful to get this merged before, but I'd like to have some feedback on > this, because doing so would mean that we need to use device mode on the > devices where it's enabled and can't use the USBD port in host mode. > Chipidea driver supports many ways to switch between host and device mode. It can support switching with/without disconnecting cable. Most of cases need to disconnect cable (Micro-AB) to switch between host and device mode, I just take this as an example: Using ID pin which is at Micro-B receptacle on the board to determine host (ID = 0) or device (ID = 1 )mode. - ID pin connects to CPU, and ID interrupt and value can be get through register OTGSC. - ID pin does not connect to CPU, and there is a dedicated GPIO for ID. -- Best Regards, Peter Chen