mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Jonas Rebmann <jre@pengutronix.de>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] hwmon: (ina2xx) Shift INA234 shunt and current registers
Date: Tue, 3 Mar 2026 09:02:38 -0800	[thread overview]
Message-ID: <245e095d-d357-4fb7-b202-4b63e5cfbee6@roeck-us.net> (raw)
In-Reply-To: <20260303-ina234-shift-v1-2-318c33ac4480@pengutronix.de>

On Tue, Mar 03, 2026 at 12:07:02PM +0100, Jonas Rebmann wrote:
> The INA219 has the lowest three bits of the bus voltage register
> zero-reserved, the bus_voltage_shift ina2xx_config field was introduced
> to accommodate for that.
> 
> The INA234 has four bits of the bus voltage, of the shunt voltage, and
> of the current registers zero-reserved but the latter two were
> implemented by choosing a 16x higher shunt_div instead of a separate
> field specifying a bit shift.
> 
> This is possible because shunt voltage and current are divided by
> shunt_div, hence a 16x higher shunt_div results in a 16x smaller LSB for
> both the shunt voltage and the current register, perfectly accounting
> for the missing bit shift.
> 
> For consistency and correctness, account for the reserved bits via
> shunt_voltage_shift and current_shift configuration fields as already
> done for voltage registers and use the conversion constants given in the
> INA234 datasheet.
> 
> Signed-off-by: Jonas Rebmann <jre@pengutronix.de>

Applied.

Thanks,
Guenter

      reply	other threads:[~2026-03-03 17:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03 11:07 [PATCH 0/2] hwmon: ina2xx conistency improvements Jonas Rebmann
2026-03-03 11:07 ` [PATCH 1/2] hwmon: (ina2xx) clean up unused macro and outdated comment Jonas Rebmann
2026-03-03 17:00   ` Guenter Roeck
2026-03-03 11:07 ` [PATCH 2/2] hwmon: (ina2xx) Shift INA234 shunt and current registers Jonas Rebmann
2026-03-03 17:02   ` Guenter Roeck [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=245e095d-d357-4fb7-b202-4b63e5cfbee6@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=jre@pengutronix.de \
    --cc=linux-hwmon@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®