[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160128232457.GF4130@sirena.org.uk>
Date: Fri, 29 Jan 2016 00:24:57 +0100
From: Mark Brown <broonie@...nel.org>
To: Georgi Djakov <georgi.djakov@...aro.org>
Cc: lgirdwood@...il.com, andy.gross@...aro.org, lina.iyer@...aro.org,
sboyd@...eaurora.org, linux-kernel@...r.kernel.org,
linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH v2] regulator: qcom-saw2: Add support for SAW2 regulators
On Thu, Jan 28, 2016 at 04:59:02PM +0200, Georgi Djakov wrote:
> +static int saw2_regulator_get_voltage(struct regulator_dev *rdev)
> +{
> + struct saw2_vreg *vreg = rdev_get_drvdata(rdev);
> +
> + return regulator_list_voltage_linear_range(rdev, vreg->selector);
> +}
Implement regulator_get_voltage_sel() instead.
> + do {
> + regmap_read(vreg->regmap, SPM_REG_STS_1, &new_val);
> + new_val &= 0xff;
> + if (new_val == val)
> + break;
> + udelay(1);
> + } while (--timeout_us);
A cpu_relax() in here might be friendly.
> + if (sel > vreg->selector) {
> + /* PMIC internal slew rate is 1250 uV/us */
> + udelay((sel - vreg->selector) * 10);
> + }
The core already does this for you.
> + vreg->rdesc.name = of_get_property(np, "regulator-name", NULL);
Don't open code standard properties and don't add new use of legacy
properties like regulator-name. Just assign a sensible name.
Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)
Powered by blists - more mailing lists