Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752252AbbBLT01 (ORCPT ); Thu, 12 Feb 2015 14:26:27 -0500 Received: from mga03.intel.com ([134.134.136.65]:59466 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751176AbbBLT0Z (ORCPT ); Thu, 12 Feb 2015 14:26:25 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,566,1418112000"; d="scan'208";a="684933658" Date: Thu, 12 Feb 2015 11:27:28 -0800 From: David Cohen To: Felipe Balbi Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, yousaf.kaukab@intel.com, nirmala.bailur@intel.com Subject: Re: [RFC] USB phy type C Message-ID: <20150212192728.GB21337@psi-dev26.jf.intel.com> References: <20150212184137.GA21337@psi-dev26.jf.intel.com> <20150212184553.GE31034@saruman.tx.rr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150212184553.GE31034@saruman.tx.rr.com> 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: 1841 Lines: 58 On Thu, Feb 12, 2015 at 12:45:53PM -0600, Felipe Balbi wrote: > Hi, > > On Thu, Feb 12, 2015 at 10:41:37AM -0800, David Cohen wrote: > > Hi Felipe, et al, > > > > Is there any on going discussion regarding to USB phy for type C connectors? > > > > We'd like to know the community's preferable direction for handling > > (still unsupported) cases like USB3.1 PD, Accessories and Alternate > > modes as a new layer or an extension of current USB phy layer. > > > > Comments are welcome :) > > Not the USB phy layer, but the generic phy layer. All you need to do is > add a new phy provider and add support for it from within dwc3. > Something like below: > > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c > index 9f0e209b8f6c..55a85b40e43e 100644 > --- a/drivers/usb/dwc3/core.c > +++ b/drivers/usb/dwc3/core.c > @@ -653,6 +653,19 @@ static int dwc3_core_get_phy(struct dwc3 *dwc) > } > } > > + dwc->usb3_typec_phy = devm_phy_get(dev, "usb3-typec-phy"); > + if (IS_ERR(dwc->usb3_typec_phy)) { > + ret = PTR_ERR(dwc->usb3_typec_phy); > + if (ret == -ENOSYS || ret == -ENODEV) { > + dwc->usb3_typec_phy = NULL; > + } else if (ret == -EPROBE_DEFER) { > + return ret; > + } else { > + dev_err(dev, "no usb3 typeC phy, continuing without\n"); > + dwc->usb3_typec_phy = NULL; > + } > + } > + > return 0; > } Thanks. That's a nice direction. > > > The only interesting part will be dealing with the other modes of > operation, I haven't wrapped my head around it yet. We'll probably get back to here with more questions/proposals about that. Br, David -- 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/