From mboxrd@z Thu Jan 1 00:00:00 1970 From: s.nawrocki@samsung.com (Sylwester Nawrocki) Date: Fri, 20 Sep 2013 11:52:32 +0200 Subject: [PATCH] media: i2c: adv7343: fix the DT binding properties In-Reply-To: References: <1379073471-7244-1-git-send-email-prabhakar.csengg@gmail.com> <523395DC.5080009@wwwdotorg.org> <523730A8.9060201@wwwdotorg.org> <523B554A.2030701@gmail.com> Message-ID: <523C1AE0.9020603@samsung.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Prabhakar, On 09/20/2013 10:11 AM, Prabhakar Lad wrote: > OK I will, just send out a fix up patch which fixes the mismatch between > names for the rc-cycle, and later send out a patch which removes the > platform data usage for next release with proper DT bindings. I think the binding need to be fully corrected now, I just meant to not touch the board file, i.e. leave non-dt support unchanged. > I'm OK with making regulator properties as optional, But still it would > change the meaning of what DT is, we know that the VDD/VDD_IO .. etc > pins are required properties (but still making them as optional) :-( > > I think there might several devices where this situation may arise so > just thinking of a alternative solution. > > say we have property 'software-regulator' which takes true/false(0/1) > If set to true we make the regulators as required property or else we > assume it is handled and ignore it ? I don't think this is a good idea. You would have to add a similar platform data flag for non-dt, it doesn't sound right. I can see two options here: 1. Make the regulator properties mandatory and, e.g. define a fixed voltage GPIO regulator in DT with an empty 'gpio' property. Then pass a phandle to that regulator in the adv7343 *-supply properties. For non-dt similarly a fixed voltage regulator(s) and voltage supplies would need to be defined in the board files. 2. Make the properties optional and use (devm_)regulator_get_optional() calls in the driver (a recently added function). I must admit I don't fully understand description of this function, it currently looks pretty much same as (devm_)regulator_get(). Thus the driver would need to be handling regulator supplies only when non ERR_PTR() is returned from regulator_get_optional() and otherwise assume a non critical error. There is already quite a few example occurrences of regulator_get_optional() usage. -- Regards, Sylwester From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sylwester Nawrocki Subject: Re: [PATCH] media: i2c: adv7343: fix the DT binding properties Date: Fri, 20 Sep 2013 11:52:32 +0200 Message-ID: <523C1AE0.9020603@samsung.com> References: <1379073471-7244-1-git-send-email-prabhakar.csengg@gmail.com> <523395DC.5080009@wwwdotorg.org> <523730A8.9060201@wwwdotorg.org> <523B554A.2030701@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-reply-to: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Prabhakar Lad Cc: Stephen Warren , DLOS , LMML , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , LAK , Sekhar Nori , LDOC , Rob Herring , Hans Verkuil , Pawel Moll , Mark Rutland , Ian Campbell , Rob Landley , Laurent Pinchart , Sakari Ailus List-Id: devicetree@vger.kernel.org Hi Prabhakar, On 09/20/2013 10:11 AM, Prabhakar Lad wrote: > OK I will, just send out a fix up patch which fixes the mismatch between > names for the rc-cycle, and later send out a patch which removes the > platform data usage for next release with proper DT bindings. I think the binding need to be fully corrected now, I just meant to not touch the board file, i.e. leave non-dt support unchanged. > I'm OK with making regulator properties as optional, But still it would > change the meaning of what DT is, we know that the VDD/VDD_IO .. etc > pins are required properties (but still making them as optional) :-( > > I think there might several devices where this situation may arise so > just thinking of a alternative solution. > > say we have property 'software-regulator' which takes true/false(0/1) > If set to true we make the regulators as required property or else we > assume it is handled and ignore it ? I don't think this is a good idea. You would have to add a similar platform data flag for non-dt, it doesn't sound right. I can see two options here: 1. Make the regulator properties mandatory and, e.g. define a fixed voltage GPIO regulator in DT with an empty 'gpio' property. Then pass a phandle to that regulator in the adv7343 *-supply properties. For non-dt similarly a fixed voltage regulator(s) and voltage supplies would need to be defined in the board files. 2. Make the properties optional and use (devm_)regulator_get_optional() calls in the driver (a recently added function). I must admit I don't fully understand description of this function, it currently looks pretty much same as (devm_)regulator_get(). Thus the driver would need to be handling regulator supplies only when non ERR_PTR() is returned from regulator_get_optional() and otherwise assume a non critical error. There is already quite a few example occurrences of regulator_get_optional() usage. -- Regards, Sylwester -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html