From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756587AbcIGSxs (ORCPT ); Wed, 7 Sep 2016 14:53:48 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:33860 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753615AbcIGSxp (ORCPT ); Wed, 7 Sep 2016 14:53:45 -0400 Date: Wed, 7 Sep 2016 19:53:25 +0100 From: Mark Brown To: Stefan Agner Cc: Felipe Balbi , gregkh@linuxfoundation.org, fabio.estevam@nxp.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <20160907185325.GC3950@sirena.org.uk> References: <20160904040416.22163-1-stefan@agner.ch> <87mvjlmpyo.fsf@linux.intel.com> <20160906082210.GE3950@sirena.org.uk> <56840b0a8520f348ee0517390f518274@agner.ch> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="+KKZr+d1tCZIVt60" Content-Disposition: inline In-Reply-To: <56840b0a8520f348ee0517390f518274@agner.ch> X-Cookie: FEELINGS are cascading over me!!! User-Agent: Mutt/1.6.0 (2016-04-01) X-SA-Exim-Connect-IP: 81.153.65.142 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH] usb: phy: generic: request regulator optionally X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --+KKZr+d1tCZIVt60 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Sep 06, 2016 at 11:01:15AM -0700, Stefan Agner wrote: > On 2016-09-06 01:22, Mark Brown wrote: > > This is nonsense unless the device can work without this supply. Given > > that the supply is called VCC that doesn't seem entirely likely. > Afaik it is kind of a generic device tree binding, I guess the physical > device can have various appearances and properties... Is it really realistic that a meaningful proportion of them will work without power? > A quick survey showed several device trees which do not specify > vcc-supply... The regulator framework will attempt to be forgiving in what it accepts, the absence of a mandatory supply is sadly not a good indication that the supply does not physically exist... > That said, I checked the device at hand, and it actually has a USB PHY > power supply inputs, but the device tree does not model them. ...like here. > > That's how to use _get_optional() but it's really unusual that you > > should be using _get_optional(). > Despite the above findings, I still think it is the right thing to do as > long as we specify vcc-supply to be optional. I disagree, and bear in mind that it is more complex all round to handle optional supples - the reason they exist is that on devices where supplies may be omitted you usually have to do some kind of special case handling (like enabling internal regulators or something). If you don't have any such special case handling but instead simply omit enables and disables then that's a fairly clear abuse of the API. --+KKZr+d1tCZIVt60 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJX0GIkAAoJECTWi3JdVIfQpdsH/Rz1YBj7dwESYDmV2Btal6eT EaJrUh3Wo/khabXcBD0YW3eiBbXt50AkNa7HG9arMFkEe/S9BU9IfX+LmZyesfTh P+c6O/r+B7hl/MPrL4F4ES4SRMmwOD4fwTOo4a+2IR77ZgIBG8Y4Zsvd/kKVU4YY PyEQLJs+v3Rji43uPRtDs1JwyVFF5nD0pz2iqFJj7RsCnvprjXFgxMoe1PjhJK6d 3kXZH9ifVK427xm9BLpKdylIO9Xuygk/koDP7yJKBGooN4mJIMflV6Fg2PzrHhTl Vj2woJadl95BpC0CUlcO1zexwtiDssDJipFAFFZJZSHjsydf6iDg8F4rfowOXyI= =W0nm -----END PGP SIGNATURE----- --+KKZr+d1tCZIVt60--