All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Georgi Djakov <georgi.djakov@linaro.org>
Cc: lgirdwood@gmail.com, andy.gross@linaro.org, lina.iyer@linaro.org,
	sboyd@codeaurora.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v2] regulator: qcom-saw2: Add support for SAW2 regulators
Date: Fri, 29 Jan 2016 00:24:57 +0100	[thread overview]
Message-ID: <20160128232457.GF4130@sirena.org.uk> (raw)
In-Reply-To: <1453993142-17885-1-git-send-email-georgi.djakov@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 898 bytes --]

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

      reply	other threads:[~2016-01-28 23:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28 14:59 [PATCH v2] regulator: qcom-saw2: Add support for SAW2 regulators Georgi Djakov
2016-01-28 23:24 ` Mark Brown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160128232457.GF4130@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=andy.gross@linaro.org \
    --cc=georgi.djakov@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=lina.iyer@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.