From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751622AbbEGS50 (ORCPT ); Thu, 7 May 2015 14:57:26 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:56889 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750726AbbEGS5Y (ORCPT ); Thu, 7 May 2015 14:57:24 -0400 Date: Thu, 7 May 2015 13:55:38 -0500 From: Felipe Balbi To: Heikki Krogerus CC: Felipe Balbi , David Cohen , Greg Kroah-Hartman , Stephen Boyd , Baolu Lu , Paul Bolle , , , Kishon Vijay Abraham I Subject: Re: =?utf-8?B?W82EUEFUQ0h2?= =?utf-8?Q?4?= 11/12] phy: helpers for USB ULPI PHY registering Message-ID: <20150507185538.GH29183@saruman.tx.rr.com> Reply-To: References: <1430979572-14768-1-git-send-email-heikki.krogerus@linux.intel.com> <1430979572-14768-12-git-send-email-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MGu/vTNewDGZ7tmp" Content-Disposition: inline In-Reply-To: <1430979572-14768-12-git-send-email-heikki.krogerus@linux.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 --MGu/vTNewDGZ7tmp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 07, 2015 at 09:19:31AM +0300, Heikki Krogerus wrote: > ULPI PHYs need to be bound to their controllers with a > lookup. This adds helpers that the ULPI drivers can use to > do both, the registration of the PHY and the lookup, at the > same time. >=20 > Signed-off-by: Heikki Krogerus > Acked-by: David Cohen > Cc: Kishon Vijay Abraham I Kishon, need your Acked-by here and on the following patch. I think it's easier to merge it through my tree although there is not real harsh depedency, apparently. > --- > drivers/phy/ulpi_phy.h | 31 +++++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > create mode 100644 drivers/phy/ulpi_phy.h >=20 > diff --git a/drivers/phy/ulpi_phy.h b/drivers/phy/ulpi_phy.h > new file mode 100644 > index 0000000..ac49fb6 > --- /dev/null > +++ b/drivers/phy/ulpi_phy.h > @@ -0,0 +1,31 @@ > +#include > + > +/** > + * Helper that registers PHY for a ULPI device and adds a lookup for bin= ding it > + * and it's controller, which is always the parent. > + */ > +static inline struct phy > +*ulpi_phy_create(struct ulpi *ulpi, struct phy_ops *ops) > +{ > + struct phy *phy; > + int ret; > + > + phy =3D phy_create(&ulpi->dev, NULL, ops); > + if (IS_ERR(phy)) > + return phy; > + > + ret =3D phy_create_lookup(phy, "usb2-phy", dev_name(ulpi->dev.parent)); > + if (ret) { > + phy_destroy(phy); > + return ERR_PTR(ret); > + } > + > + return phy; > +} > + > +/* Remove a PHY that was created with ulpi_phy_create() and it's lookup.= */ > +static inline void ulpi_phy_destroy(struct ulpi *ulpi, struct phy *phy) > +{ > + phy_remove_lookup(phy, "usb2-phy", dev_name(ulpi->dev.parent)); > + phy_destroy(phy); > +} > --=20 > 2.1.4 >=20 --=20 balbi --MGu/vTNewDGZ7tmp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVS7UqAAoJEIaOsuA1yqREV08P/iH6IU7A1Qozu8goKmsd4/L3 Yp3Zn92KBijEQbVhIVTykFi9g8DZBWCGSuYZnL+n8J1ztFZchlFBl9ad4XD3vzJL qcqkR9iQvOmFPoukfSuN7KX9bZixoJRx8rleNt/IWRh+aVM0KZF8d4VxO2pD9FMR tdWgw4/VR3H/iOjQg5v7b/wG0sCLm5SfkT3NVzY8gGjzchlYWRxAp57KPkgjYxtO MymQMLeltCXUsON8cKYniIQhAtieIDQYAI8A97X/vf0YlQy1bcL+J2t4XsaNlA4e ngdYHl+2w0dDTZusnCqnWsHTNc/6ePBYTCcEcCvHMDEjtcYEoNW44KxWXvW2VXC8 H0Fjx6o51bUv8VZ8ghDUwnqQvuWFEdWO/AJeS0B7vK5dXyDY9y8SW8vPqEkp1ehc BZo4w21Hnk7vdzTs3hRYs+JoFHa/ISaBVH+kmIytuA6t6ju7aHR5rnF3FETmOvfZ yTtU63SkJg8+EX1WK+i7RysJYvjWWtzWGN1KqYl8XSWHB/F9w2dRd4HpRlmVaTk2 uRn5gQ5GhAOx63kQo6Zr5gWBvPFc58tRsrK1LKsR0Vh7FUMleH95sf9IvegRVu+G CycXzbcQ6DQ2MvjxCmcahyLCbTkXH0LsnYr3H0MFNIDhDfH3rvjotg214AOrvjmK MtP0Tq2iMsBnbgE8ZBV5 =lr1F -----END PGP SIGNATURE----- --MGu/vTNewDGZ7tmp--