Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752166AbbGMQhU (ORCPT ); Mon, 13 Jul 2015 12:37:20 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:33957 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752095AbbGMQhQ (ORCPT ); Mon, 13 Jul 2015 12:37:16 -0400 Message-ID: <55A3E937.2050804@cogentembedded.com> Date: Mon, 13 Jul 2015 19:37:11 +0300 From: Sergei Shtylyov Organization: Cogent Embedded User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Phil Edworthy , Kishon Vijay Abraham I CC: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Yoshihiro Shimoda , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-sh@vger.kernel.org" Subject: Re: [PATCH v3] phy: rcar-gen2 usb: Add Host/Function switching for USB0 References: <1436270121-25924-1-git-send-email-phil.edworthy@renesas.com> <559FF47A.5000001@cogentembedded.com> <55A39030.1030601@cogentembedded.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2695 Lines: 71 On 07/13/2015 06:02 PM, Phil Edworthy wrote: >>>>> Instead of statically selecting the PHY connection to either the >>>>> USBHS (Function) or PCI0 (Host) IP blocks, this change allows the >>>>> dts to specifiy gpio pins for the vbus and id signals. Additional >>>> These GPIOs don't have anything to do with the PHY, they're interfacing >> Perhaps that was too strong statement but nevertheless... > Looking at your MAX3355 extcon driver, I can't see how it would work on it's > own. I've added the 'extcon' support into the Renesas USBHS driver, so that it should be able to sense the ID pin status. > The system needs to sense vbus in order to determine that the board > has been plugged into a USB Host. > Since the MAX3355 device doesn't > directly provide any vbus signals, this shouldn't be part of the extcon driver, > so where should it be? Sure, MAX3355 does provide voltage on Vbus, controlled by -OFFVBUS input. It's just that the driver has only ID sensing support. Do you have the MAX3355 datasheet at all? > On the other hand, the MAX3355 has a pair of status pins that can be used > to get vbus instead. Sure, these bits reflect 4 OTG Vbus thresholds. > If these pins aren't used for other functions, maybe > it's better to use these in the extcon driver. They are not. > My intention is to make the USB PHY driver listen for extcon events instead > of directly accessing the ID and VBUS signals, but otherwise behave in the > same way it currently does. I'm not sure the PHY driver should be interested in that... > After reading some other threads, I also intend to set up a fixed regulator > for the MAX3355 device to setup the shutdown and vbus enable pins. I know > that the vbus enable should really be controlled some other way depending > on the role, but for the moment I think it's ok just to enable it always. It's OK only in the host mode. I don't think we need regulators. SHDN- is already supported by the driver (though it only drives it high at start-up time), in fact it was the only reason not to use gpio. > Do you think that is the correct way to progress this? I didn't have a clear picture how to implement the OTG support at the time of writing the MAX3355 driver; actually, I was tasked to only support ID p[in sensing. Note that there's some ongoing effort now on linux-usb to support OTG functionality. > Thanks > Phil WBR, Sergei -- 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/