mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Paul Walmsley <pwalmsley@nvidia.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,
	Andrew Chew <achew@nvidia.com>,
	Matthew Longnecker <mlongnecker@nvidia.com>
Subject: Re: [PATCH] regulator: core: add regulator_get_linear_step()
Date: Fri, 7 Jun 2013 10:59:36 +0100	[thread overview]
Message-ID: <20130607095936.GK31367@sirena.org.uk> (raw)
In-Reply-To: <alpine.DEB.2.02.1306070920010.32163@utopia.booyaka.com>

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

On Fri, Jun 07, 2013 at 09:38:10AM +0000, Paul Walmsley wrote:

> +static int get_cvb_voltage(struct platform_device *pdev, int c0, int c1,
> +			   int c2)
> +{
> +	struct tegra_dfll *td = dev_get_drvdata(&pdev->dev);
> +	/* apply only speedo scale: output mv = cvb_mv * v_scale */
> +	int mv;
> +
> +	/* combined: apply voltage scale and round to cvb alignment step */
> +	mv = DIV_ROUND_CLOSEST(c2 * td->speedo_value, td->cvb_speedo_scale);
> +	mv = DIV_ROUND_CLOSEST((mv + c1) * td->speedo_value,
> +			       td->cvb_speedo_scale) + c0;
> +
> +	/* XXX Bring back cvb_alignment_uv; put it in the board dfll DT */
> +	return DIV_ROUND_UP(mv * 1000,
> +			    td->cvb_voltage_scale * td->vdd_step) *
> +		td->vdd_step / 1000;
> +}

Hrm, right.  So I guess for this the question is why you need the steps
at all - can't the driver just ask for the voltage it wants with
whatever tolerance is appropriate (or just specify the maximum tolerable
voltage if that's better)?  I'm not sure what cvb_voltage_scale is.

I guess the problem here is that you have to hit some fairly tight
tolerances on the voltage?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-06-07 10:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-07  8:06 Paul Walmsley
2013-06-07  9:09 ` Mark Brown
2013-06-07  9:38   ` Paul Walmsley
2013-06-07  9:59     ` Mark Brown [this message]
2013-06-07 10:03       ` Paul Walmsley
2013-06-07 10:11         ` Paul Walmsley
2013-06-07 10:18         ` Mark Brown

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=20130607095936.GK31367@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=achew@nvidia.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mlongnecker@nvidia.com \
    --cc=pwalmsley@nvidia.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®