Linux-Hwmon Archive on lore.kernel.org
 help / Atom feed
* LM5066 low- and high-current limit scaling
@ 2019-01-25 20:13 Matt Wilbur
  2019-01-25 22:04 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Wilbur @ 2019-01-25 20:13 UTC (permalink / raw)
  To: linux-hwmon

Hi

First off, this is the first time I've ever tried something like this,
so I fully anticipate I will make some etiquette / process mistakes.

In a project I am working on, we make use of the LM5066 hot-swap
controller.  I believe the kernel module for this chip
(drivers/hwmon/pmbus/lm25066.c) has an error where the scaling
parameters for the low- and high-current limits are swapped.

What's the best way for me to make my case?  Just create a patch and
try to submit it?  A free-form discussion on the mailing list?

Thanks in advance.

Matt

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: LM5066 low- and high-current limit scaling
  2019-01-25 20:13 LM5066 low- and high-current limit scaling Matt Wilbur
@ 2019-01-25 22:04 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2019-01-25 22:04 UTC (permalink / raw)
  To: Matt Wilbur; +Cc: linux-hwmon

On Fri, Jan 25, 2019 at 03:13:39PM -0500, Matt Wilbur wrote:
> Hi
> 
> First off, this is the first time I've ever tried something like this,
> so I fully anticipate I will make some etiquette / process mistakes.
> 
> In a project I am working on, we make use of the LM5066 hot-swap
> controller.  I believe the kernel module for this chip
> (drivers/hwmon/pmbus/lm25066.c) has an error where the scaling
> parameters for the low- and high-current limits are swapped.
> 
> What's the best way for me to make my case?  Just create a patch and
> try to submit it?  A free-form discussion on the mailing list?
> 

Normally you would send a patch and make your case in the description.

However, be careful.

PSC_CURRENT_IN_L is used if DEVICE_SETUP[4]=1, which (hopefully) translates
to CL=VDD. Per LM25066 datasheet, table 41:
	CL=GND:		M=13661, B=–5200, R=-2
	CL=VDD:		M=6854, B=-3100, R=-2

Current code:
	DEVICE_SETUP[4]=0: M=13661, B=0, R=-2
	DEVICE_SETUP[4]=1: M=6852, B=0, R=-2

This looks mostly correct to me, except for the offset and the
slight difference if CL=VDD. Looks like that was changed at some
point in later datasheet versions.

Overall, the problem (or confusion) is that the logic for
DEVICE_SETUP[4] in the datasheets for the various chips changes.

5066i:
	0 = high setting (50 mV)
	1 = low setting (26 mV)

25066, 25066i:
	0 = low setting (25 mV)
	1 = high setting (46 mV)

... so of course it may well be that the data for some of the chips
is wrong, since we use PSC_CURRENT_IN_L for DEVICE_SETUP[4]=1
throughout (in other words, it is likely that either the data for
LM5066 is wrong, or that the data for LM25066 is wrong - the only
question is which one). It may also be that the datasheets are wrong
or misleading, and that CL=VDD is not (or not always) equivalent
to DEVICE_SETUP[4]=1.

Guenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25 20:13 LM5066 low- and high-current limit scaling Matt Wilbur
2019-01-25 22:04 ` Guenter Roeck

Linux-Hwmon Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hwmon/0 linux-hwmon/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hwmon linux-hwmon/ https://lore.kernel.org/linux-hwmon \
		linux-hwmon@vger.kernel.org linux-hwmon@archiver.kernel.org
	public-inbox-index linux-hwmon


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hwmon


AGPL code for this site: git clone https://public-inbox.org/ public-inbox