From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sven Schwermer Date: Fri, 31 May 2019 10:17:49 +0200 Subject: [U-Boot] [PATCH] regulator: Allow autosetting fixed regulators In-Reply-To: References: <20190531072729.16487-1-sven@svenschwermer.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de Hi Peng, > According to code: > if (uc_pdata->flags & REGULATOR_FLAG_AUTOSET_UV) > ret = regulator_set_value(dev, uc_pdata->min_uV); > if (!ret && (uc_pdata->flags & REGULATOR_FLAG_AUTOSET_UA)) > ret = regulator_set_current(dev, uc_pdata->min_uA); > > So you get -ENOSYS from the upper code? Yes, for fixed regulators, the following if clause evaluates to true in regulator_pre_probe: /* Those values are optional (-ENODATA if unset) */ if ((uc_pdata->min_uV != -ENODATA) && (uc_pdata->max_uV != -ENODATA) && (uc_pdata->min_uV == uc_pdata->max_uV)) uc_pdata->flags |= REGULATOR_FLAG_AUTOSET_UV; However, in regulator_set_value, there is this section: if (!ops || !ops->set_value) return -ENOSYS; So for fixed regulators, which don’t have a set_value, we’ll always get a -ENOSYS. Sven