Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754098AbbBET1s (ORCPT ); Thu, 5 Feb 2015 14:27:48 -0500 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:52180 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751510AbbBET1q (ORCPT ); Thu, 5 Feb 2015 14:27:46 -0500 Date: Thu, 5 Feb 2015 19:27:40 +0000 From: Mark Brown To: Tim Bird Cc: "lgirdwood@gmail.com" , "linux-kernel@vger.kernel.org" , =?iso-8859-1?B?IkFuZGVyc3NvbiwgQmr2cm4i?= Message-ID: <20150205192740.GL21293@sirena.org.uk> References: <54D2A91D.5090700@sonymobile.com> <20150205015945.GQ21293@sirena.org.uk> <54D3A96B.2020704@sonymobile.com> <20150205174353.GA21293@sirena.org.uk> <54D3B858.9060103@sonymobile.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="+70WA+jpOhwibLh4" Content-Disposition: inline In-Reply-To: <54D3B858.9060103@sonymobile.com> X-Cookie: My LESLIE GORE record is BROKEN ... User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH] regulator: Support different config and dev of_nodes in regulator_register X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2984 Lines: 72 --+70WA+jpOhwibLh4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Feb 05, 2015 at 10:37:12AM -0800, Tim Bird wrote: > On 02/05/2015 09:43 AM, Mark Brown wrote: > >> Sorry - what is the "Linux MFD structure"? > > The way we split things up into subsystems via drivers/mfd. Our set of > > subsystems is neither fixed nor authorative. > I'm not doing anything in drivers/mfd? Should I be? > The charger driver is currently in drivers/power, but should it be > moved to drivers/mfd if it's going to expose regulators as > well as power supplies? I'm sorry, but I'm not following > your point here. I associated this regulator with the charger Possibly not. My reply was explaining the sorts of breakage that allowing the DT node to be overridden is usually intended to support, the sort of thoughtless bindings for MFDs that I'm describing is one typical example. > So you're saying I should have a "regulators" child node of the charger > node, and then define the chg_otg and boost regulators under that, each > with it's own compatible string, so that the DT code can instantiate No, absolutely not - you should not need to put compatible strings for individual regulators within a single device in the device tree. Please take a look at how other devices do this - there are plenty of bindings for existing devices in tree with matching code in the kernel. > Or is this instantiation something I do manually in the charger probe > routine? (That's what I'm doing now, but open coding each regulator > individually.) Given the way you're talking separately about there being a charger driver and a regulator driver here it sounds like you should be creating a MFD. The MFD subsystem exists to provide a way of mapping a single physical device into multiple kernel subsystems which sounds like it will be what you're trying to do here. > Can you recommend a driver to look at that does (properly) what > you're describing? Most of drivers/mfd is PMICs doing this, anything recently added should be reasonable to look at. Most of the Maxim or Wolfson devices for example. --+70WA+jpOhwibLh4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJU08QrAAoJECTWi3JdVIfQAqYH/RwoaRBWNAHW/Pwmv+HBU/oP 5dT9N7YGV6GHwxOZNY0IlGsCmdDzbOzVOBLXK0WaMhnlE34DQoR7282vcHx9i5oI sQ+GXoY6dLQvu1LFGrtDWHDt5R9VcdqptTiTwUiDTBXMibUQsTYq8iEHha2g05OW NtIlRRys2kG+XcYwW9uU6m/168wpVAOn1Q/a+SIkBs5Zu3QOhv+rS2aFdWk6mcms TdvQnKe1aQpS6xRxR9DF/QaY9e/hiivW7Rh1ElIHAm2eAolA5TnDV8E5XlWfD5NC 3f9vzXVZ4lHqLfPbnaOfibl5CpzzRI//iAw5Zmcha6+QuxcUfG0z5CuK6fWZHIU= =CsJW -----END PGP SIGNATURE----- --+70WA+jpOhwibLh4-- -- 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/