All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Nicolin Chen <nicoleotsuka@gmail.com>
Cc: jdelvare@suse.com, afd@ti.com, linux-hwmon@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] hwmon: ina3221: Add INA3221_CONFIG to volatile_table
Date: Sun, 30 Sep 2018 08:00:01 -0700	[thread overview]
Message-ID: <20180930150001.GA13042@roeck-us.net> (raw)
In-Reply-To: <20180929214407.27208-2-nicoleotsuka@gmail.com>

On Sat, Sep 29, 2018 at 02:44:05PM -0700, Nicolin Chen wrote:
> The MSB (15th bit) of INA3221_CONFIG is a self-clear reset bit.
> So this register should be added to the volatile_table of the
> regmap_config. Otherwise, we will see this bit is sticky in the
> regcache which might accidentally reset the chip when an actual
> write happens to the register.
> 
> This might not be a severe bug for the current code line since
> there's no second place touching the INA3221_CONFIG except the
> reset routine in the probe().
> 
> Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  drivers/hwmon/ina3221.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/ina3221.c b/drivers/hwmon/ina3221.c
> index e6b49500c52a..cfe65ff01051 100644
> --- a/drivers/hwmon/ina3221.c
> +++ b/drivers/hwmon/ina3221.c
> @@ -353,7 +353,7 @@ static struct attribute *ina3221_attrs[] = {
>  ATTRIBUTE_GROUPS(ina3221);
>  
>  static const struct regmap_range ina3221_yes_ranges[] = {
> -	regmap_reg_range(INA3221_SHUNT1, INA3221_BUS3),
> +	regmap_reg_range(INA3221_CONFIG, INA3221_BUS3),
>  	regmap_reg_range(INA3221_MASK_ENABLE, INA3221_MASK_ENABLE),
>  };
>  

  reply	other threads:[~2018-09-30 21:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-29 21:44 [PATCH v2 0/3] Add suspend and resume functions Nicolin Chen
2018-09-29 21:44 ` [PATCH v2 1/3] hwmon: ina3221: Add INA3221_CONFIG to volatile_table Nicolin Chen
2018-09-30 15:00   ` Guenter Roeck [this message]
2018-09-29 21:44 ` [PATCH v2 2/3] hwmon: ina3221: Fix INA3221_CONFIG_MODE macros Nicolin Chen
2018-09-30 15:01   ` Guenter Roeck
2018-09-29 21:44 ` [PATCH v2 3/3] hwmon: ina3221: Add suspend and resume functions Nicolin Chen
2018-09-30 15:27   ` Guenter Roeck
2018-10-01  3:15     ` Nicolin Chen

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=20180930150001.GA13042@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=afd@ti.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicoleotsuka@gmail.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 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.