linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: Dan Murphy <dmurphy@ti.com>
Cc: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFT][PATCH 2/2] regulator: lm363x: Fix n_voltages setting for lm36274
Date: Mon, 8 Jul 2019 10:04:09 +0800	[thread overview]
Message-ID: <CAFRkauCeayKSvxOz8_qdFs1PX8gAWj9H3iOp0XaZQ+kndf_cUw@mail.gmail.com> (raw)
In-Reply-To: <CAFRkauBxJKcYbiT6UmKw81SAKm=AuDFu1Ez6Ttuc_EcMh_SudQ@mail.gmail.com>

Axel Lin <axel.lin@ingics.com> 於 2019年6月27日 週四 上午7:58寫道:
>
> > > With your current code where LM36274_LDO_VSEL_MAX and n_voltages is 0x34,
> > > the maximum voltage will become 400000 + 50000 * 0x34 = 6.6V which
> > > does not match the datasheet.
> >
> > Not sure how you get 6.6v the LDO max is 6.5v.
> >
> > After 0x32->0x7f maps to 6.5v
> >
> > 000000 = 4 V
> > 000001 = 4.05 V
> > :
> > 011110 = 5.5 V (Default)
> > :
> > 110010 = 6.5 V
> >
> > 110011 to 111111 map to 6.5 V <- Should never see 6.6v from LDO
> >
> > Page 7 of the Datasheet says range is 4v->6.5v
> Hi Dan,
>
> The device indeed can only support up to 6.5V, the point is you are using
> linear equation to calculate the voltage of each selecter.
> In your current code:
> #define LM36274_LDO_VSEL_MAX           0x34 (and it's .n_voltages)
> So it supports selector 0 ... 0x33.
> For selector 0x33 in the linear equation is
> 4000000 + 50000 * 51 = 6550000 (i.e. 6.55V)
> i.e. The device actually only support up to 6.5V but the driver
> reports it support up to 6.55V
>      because regulator_list_voltage() will return 6.55V for selector 0x33.
> (I have off-by-one in my previous reply because when .n_voltages is
> 0x34, it supports up to 0x33)

Similar comment as I mentioned in another path.
Did you check regulator_list_voltage() output for the boundary case
with and without this patch?

  reply	other threads:[~2019-07-08  2:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26 13:26 [RFT][PATCH 1/2] regulator: lm363x: Fix off-by-one n_voltages for lm3632 ldo_vpos/ldo_vneg Axel Lin
2019-06-26 13:26 ` [RFT][PATCH 2/2] regulator: lm363x: Fix n_voltages setting for lm36274 Axel Lin
2019-06-26 15:06   ` Dan Murphy
2019-06-26 15:20     ` Axel Lin
2019-06-26 17:07       ` Dan Murphy
2019-06-26 23:58         ` Axel Lin
2019-07-08  2:04           ` Axel Lin [this message]
2019-07-22 12:22   ` Applied "regulator: lm363x: Fix n_voltages setting for lm36274" to the regulator tree Mark Brown
2019-06-26 15:06 ` [RFT][PATCH 1/2] regulator: lm363x: Fix off-by-one n_voltages for lm3632 ldo_vpos/ldo_vneg Dan Murphy
2019-06-26 15:12   ` Axel Lin
2019-07-08  2:02     ` Axel Lin
2019-07-16 18:08       ` Dan Murphy
2019-07-22 12:22 ` Applied "regulator: lm363x: Fix off-by-one n_voltages for lm3632 ldo_vpos/ldo_vneg" to the regulator tree 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=CAFRkauCeayKSvxOz8_qdFs1PX8gAWj9H3iOp0XaZQ+kndf_cUw@mail.gmail.com \
    --to=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=dmurphy@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).