From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bjorn Andersson Subject: Re: [PATCH 4/4] regulator: qcom: Rework to single platform device Date: Tue, 3 Mar 2015 14:32:35 -0800 Message-ID: <20150303223235.GK26334@sonymobile.com> References: <1425356740-26285-1-git-send-email-bjorn.andersson@sonymobile.com> <1425356740-26285-5-git-send-email-bjorn.andersson@sonymobile.com> <54F630FF.60109@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Received: from seldrel01.sonyericsson.com ([212.209.106.2]:2368 "EHLO seldrel01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756935AbbCCWcr (ORCPT ); Tue, 3 Mar 2015 17:32:47 -0500 Content-Disposition: inline In-Reply-To: <54F630FF.60109@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Stephen Boyd Cc: Ian Campbell , Kumar Gala , Lee Jones , Liam Girdwood , Mark Brown , Mark Rutland , Pawel Moll , Rob Herring , Andy Gross , Chanwoo Choi , Krzysztof Kozlowski , Srinivas Kandagatla , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-msm@vger.kernel.org" On Tue 03 Mar 14:09 PST 2015, Stephen Boyd wrote: > On 03/02/15 20:25, Bjorn Andersson wrote: > > - config.of_node = pdev->dev.of_node; > > +static int rpm_reg_probe(struct platform_device *pdev) > > +{ > > + const struct rpm_regulator_data *reg; > > + const struct of_device_id *match; > > + struct regulator_config config = { }; > > + struct regulator_dev *rdev; > > + struct qcom_rpm_reg *vreg; > > > > - ret = rpm_reg_of_parse(pdev->dev.of_node, &vreg->desc, > > - &config, initdata); > > - if (ret) > > - return ret; > > + match = of_match_device(rpm_of_match, &pdev->dev); > > + for (reg = match->data; reg->name; reg++) { > > How does this work for the case where we may not want to add all the > regulators that a PMIC supports. I'm mostly thinking about the case > where we want to use the pm8xxx-regulator driver for a few regulators > and so we omit them from the DT for the RPM regulators. > An empty or non-existing regulator of_node will still be registered, but without REGULATOR_CHANGE_STATUS nor REGULATOR_CHANGE_VOLTAGE; so any operation on this regulator will fail with an -EPERM. Regards, Bjorn