mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: jerome Neanne <jneanne@baylibre.com>
To: Axel Lin <axel.lin@ingics.com>
Cc: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Tony Lindgren <tony@atomide.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFT] [PATCH] regulator: tps65219: Fix .bypass_val_on setting
Date: Tue, 13 Sep 2022 12:00:30 +0200	[thread overview]
Message-ID: <1ab23284-aec6-6817-253a-536ed5150c00@baylibre.com> (raw)
In-Reply-To: <CAFRkauDKUGRracu2ofc=q-UTjWaeef5GfevT6kHnP=MWo__BGw@mail.gmail.com>

Got it! And validate it.

On 13/09/2022 01:48, Axel Lin wrote:
> jerome Neanne <jneanne@baylibre.com> 於 2022年9月12日 週一 下午5:49寫道:
>> Hi Axel,
>>
>> On 28/08/2022 14:01, Axel Lin wrote:
>>> The .bypass_val_on setting does not match the .bypass_mask setting, so the
>>> .bypass_mask bit will never get set.  Fix it by removing .bypass_val_on
>>> setting, the regulator_set_bypass_regmap and regulator_get_bypass_regmap
>>> helpers will use rdev->desc->bypass_mask as val_on if the val_on is 0.
>> I think this will result in exact same behavior. val would be assigned
>> to 1 when enable is set and 0 otherwise. Anyway you are right this line
>> is useless.
> Setting .bypass_val_on=1 won't set TPS65219_LDOS_BYP_CONFIG_MASK bit.
> The TPS65219_LDOS_BYP_CONFIG_MASK is BIT(6), so you need to set BIT(6)
> instead of 1 for .bypass_val_on.
> Remove .bypass_val_on setting then it will use .bypass_mask as
> .bypass_val_on setting.

Got your point. The issue is on the get path not on the set path...

I misinterpreted val_on usage.

I was able to confirm on board that cat 
/sys/class/regulator/regulator.10/bypass
always return disabled before your fix is applied.

After your fix is applied, it accurately return enabled/disabled 
depending how LDO is set (forced at probe).

side note:

- I added virtual regulator and userspace consumer to validate (that's 
why VDDSHV_SD_IO_PMIC is regulator.10)

- This bug was missed because I did not re-validated the bypass after I 
changed from custom to standard helpers (I apologize).

Thanks for raising this

Regards,

Jerome.





      reply	other threads:[~2022-09-13 10:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-28 12:01 Axel Lin
2022-09-09 22:56 ` Mark Brown
2022-09-12  9:49 ` jerome Neanne
2022-09-12 23:48   ` Axel Lin
2022-09-13 10:00     ` jerome Neanne [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=1ab23284-aec6-6817-253a-536ed5150c00@baylibre.com \
    --to=jneanne@baylibre.com \
    --cc=axel.lin@ingics.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony@atomide.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®