Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751728AbbBLSqH (ORCPT ); Thu, 12 Feb 2015 13:46:07 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:47475 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750878AbbBLSqF (ORCPT ); Thu, 12 Feb 2015 13:46:05 -0500 Date: Thu, 12 Feb 2015 12:45:53 -0600 From: Felipe Balbi To: David Cohen CC: , , , , Subject: Re: [RFC] USB phy type C Message-ID: <20150212184553.GE31034@saruman.tx.rr.com> Reply-To: References: <20150212184137.GA21337@psi-dev26.jf.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d8Lz2Tf5e5STOWUP" Content-Disposition: inline In-Reply-To: <20150212184137.GA21337@psi-dev26.jf.intel.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: 2713 Lines: 82 --d8Lz2Tf5e5STOWUP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Thu, Feb 12, 2015 at 10:41:37AM -0800, David Cohen wrote: > Hi Felipe, et al, >=20 > Is there any on going discussion regarding to USB phy for type C connecto= rs? >=20 > 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. >=20 > 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) } } =20 + dwc->usb3_typec_phy =3D devm_phy_get(dev, "usb3-typec-phy"); + if (IS_ERR(dwc->usb3_typec_phy)) { + ret =3D PTR_ERR(dwc->usb3_typec_phy); + if (ret =3D=3D -ENOSYS || ret =3D=3D -ENODEV) { + dwc->usb3_typec_phy =3D NULL; + } else if (ret =3D=3D -EPROBE_DEFER) { + return ret; + } else { + dev_err(dev, "no usb3 typeC phy, continuing without\n"); + dwc->usb3_typec_phy =3D NULL; + } + } + return 0; } =20 The only interesting part will be dealing with the other modes of operation, I haven't wrapped my head around it yet. --=20 balbi --d8Lz2Tf5e5STOWUP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJU3PThAAoJEIaOsuA1yqRE/1kP/Apl9avM6ACenW4eexBsxpWG mS6BrINCiWDvS4B/kAGyAH4mtn0W700eLEtwlPCARwn0SKP7otYzqapuw+GT41YN dw+/rnyzgDPdxdjG43A4WAXo4vrxLB/mkJlL07O823d4I2maP1I3l0uUg7QnuJrg zytQspR7LRwsAxRG5L75SE2kGztvrT7MSa9qms1DpBw0KW7U4M+tNsWiY0GVVbei 9ixfDKMIwthHI+/kuHYwmgImSsesiqMAbsb3BwWqSh/XMRE/zv+6rWRSdgDZW8Rp Fub0+0njvrCG5cUsEM4/eyMGdnl+DElaLSpb6S/uzlxn+zznR3/AXfrdJvlUWgvM EB+vl4Bna5rrDBOvshjz8Neb+SM1CJWvjBvtOlNM4UVMpJ8LeA0Raf8cnokGwZqL 0caylIktcxMDTjINo61T8upHFGWd6SZSEns1MF5A77fw1s6d9ldYgERAU32Q7U6v +/IpjzVnML3NwiIkFdnyw0X4eL13Wa3+WdqzxuWc9vYM12CuZiXn6Fn7OVJltmjr 3wBiigJ6BKmCtBsZZepmIx9LRtW2Z7bxjK1hAwYO2ZTebSzM2P/qdu91MzMevmjU clTcVHzMkIjlAjPdh012Z2JtfKk09gLyUEreQ+MmHLFxBGQho7DF1ya8CpYa/DPC 5qpqSUsQI5v40nxpG8IA =gm3i -----END PGP SIGNATURE----- --d8Lz2Tf5e5STOWUP-- -- 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/