Linux-Hwmon Archive on lore.kernel.org
 help / color / Atom feed
* ABI for these two registers?
@ 2019-09-12  0:28 Nicolin Chen
  2019-09-12 18:32 ` Guenter Roeck
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolin Chen @ 2019-09-12  0:28 UTC (permalink / raw)
  To: linux; +Cc: linux-hwmon

Hello Guenter,

Datasheet: http://www.ti.com/lit/ds/symlink/ina3221.pdf
(At page 32, chapter 8.6.2.14 and 8.6.2.15)

I have two registers that I need to expose to user space:
	Shunt-Voltage-Sum and Shunt-Voltage-Limit registers

Right now in[123]_input of INA3221 are for voltage channels
while in[456]_input are for Shunt voltage channels.

So can I just use in7_input and in7_crit for them?

Thanks
Nicolin

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

* Re: ABI for these two registers?
  2019-09-12  0:28 ABI for these two registers? Nicolin Chen
@ 2019-09-12 18:32 ` Guenter Roeck
  2019-09-12 21:09   ` Nicolin Chen
  0 siblings, 1 reply; 9+ messages in thread
From: Guenter Roeck @ 2019-09-12 18:32 UTC (permalink / raw)
  To: Nicolin Chen; +Cc: linux-hwmon

On Wed, Sep 11, 2019 at 05:28:14PM -0700, Nicolin Chen wrote:
> Hello Guenter,
> 
> Datasheet: http://www.ti.com/lit/ds/symlink/ina3221.pdf
> (At page 32, chapter 8.6.2.14 and 8.6.2.15)
> 
> I have two registers that I need to expose to user space:
> 	Shunt-Voltage-Sum and Shunt-Voltage-Limit registers
> 
> Right now in[123]_input of INA3221 are for voltage channels
> while in[456]_input are for Shunt voltage channels.
> 
> So can I just use in7_input and in7_crit for them?
> 
Doesn't Shunt-Voltage-Limit apply to in[456]_input ?
If so, the limit should be attached to those.
in7_input for Shunt-Voltage-Sum would be fine.

Guenter

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

* Re: ABI for these two registers?
  2019-09-12 18:32 ` Guenter Roeck
@ 2019-09-12 21:09   ` Nicolin Chen
  2019-09-12 22:09     ` Guenter Roeck
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolin Chen @ 2019-09-12 21:09 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon

Hello Guenter,

On Thu, Sep 12, 2019 at 11:32:18AM -0700, Guenter Roeck wrote:
> On Wed, Sep 11, 2019 at 05:28:14PM -0700, Nicolin Chen wrote:
> > Hello Guenter,
> > 
> > Datasheet: http://www.ti.com/lit/ds/symlink/ina3221.pdf
> > (At page 32, chapter 8.6.2.14 and 8.6.2.15)
> > 
> > I have two registers that I need to expose to user space:
> > 	Shunt-Voltage-Sum and Shunt-Voltage-Limit registers
> > 
> > Right now in[123]_input of INA3221 are for voltage channels
> > while in[456]_input are for Shunt voltage channels.
> > 
> > So can I just use in7_input and in7_crit for them?
> > 
> Doesn't Shunt-Voltage-Limit apply to in[456]_input ?
> If so, the limit should be attached to those.

The initial patch of ina3221 driver applied Shunt-Voltage-Limits,
being named as "Critical Alert Limit Registers" in the datasheet,
to curr[123]_crit, corresponding to curr[123] and in[456]_input.

And this Shunt-Voltage-Limit-Sum is more related to the reading
from Shunt-Voltage-Sum, which we just agreed it to be in7_input.

Do you mean that this Limit-Sum should become in[456]_crit even
though it only has one value, related to sum of all three shunt
voltage channels?

> in7_input for Shunt-Voltage-Sum would be fine.

Okay. Will add in7_input for Shunt-Voltage-Sum. Thanks!

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

* Re: ABI for these two registers?
  2019-09-12 21:09   ` Nicolin Chen
@ 2019-09-12 22:09     ` Guenter Roeck
  2019-09-12 22:45       ` Nicolin Chen
  0 siblings, 1 reply; 9+ messages in thread
From: Guenter Roeck @ 2019-09-12 22:09 UTC (permalink / raw)
  To: Nicolin Chen; +Cc: linux-hwmon

On Thu, Sep 12, 2019 at 02:09:58PM -0700, Nicolin Chen wrote:
> Hello Guenter,
> 
> On Thu, Sep 12, 2019 at 11:32:18AM -0700, Guenter Roeck wrote:
> > On Wed, Sep 11, 2019 at 05:28:14PM -0700, Nicolin Chen wrote:
> > > Hello Guenter,
> > > 
> > > Datasheet: http://www.ti.com/lit/ds/symlink/ina3221.pdf
> > > (At page 32, chapter 8.6.2.14 and 8.6.2.15)
> > > 
> > > I have two registers that I need to expose to user space:
> > > 	Shunt-Voltage-Sum and Shunt-Voltage-Limit registers
> > > 
> > > Right now in[123]_input of INA3221 are for voltage channels
> > > while in[456]_input are for Shunt voltage channels.
> > > 
> > > So can I just use in7_input and in7_crit for them?
> > > 
> > Doesn't Shunt-Voltage-Limit apply to in[456]_input ?
> > If so, the limit should be attached to those.
> 
> The initial patch of ina3221 driver applied Shunt-Voltage-Limits,
> being named as "Critical Alert Limit Registers" in the datasheet,
> to curr[123]_crit, corresponding to curr[123] and in[456]_input.
> 
> And this Shunt-Voltage-Limit-Sum is more related to the reading
> from Shunt-Voltage-Sum, which we just agreed it to be in7_input.
> 
You didn't say Shunt-Voltage-Limit-Sum earlier. You said
Shunt-Voltage-Limit. I would agree that Shunt-Voltage-Limit-Sum is
associated with Shunt-Voltage-Sum, but, again, that is not what you
said earlier. Confused :-(

Guenter

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

* Re: ABI for these two registers?
  2019-09-12 22:09     ` Guenter Roeck
@ 2019-09-12 22:45       ` Nicolin Chen
  2019-09-13  0:12         ` Nicolin Chen
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolin Chen @ 2019-09-12 22:45 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon

On Thu, Sep 12, 2019 at 03:09:47PM -0700, Guenter Roeck wrote:
> On Thu, Sep 12, 2019 at 02:09:58PM -0700, Nicolin Chen wrote:
> > Hello Guenter,
> > 
> > On Thu, Sep 12, 2019 at 11:32:18AM -0700, Guenter Roeck wrote:
> > > On Wed, Sep 11, 2019 at 05:28:14PM -0700, Nicolin Chen wrote:
> > > > Hello Guenter,
> > > > 
> > > > Datasheet: http://www.ti.com/lit/ds/symlink/ina3221.pdf
> > > > (At page 32, chapter 8.6.2.14 and 8.6.2.15)
> > > > 
> > > > I have two registers that I need to expose to user space:
> > > > 	Shunt-Voltage-Sum and Shunt-Voltage-Limit registers
> > > > 
> > > > Right now in[123]_input of INA3221 are for voltage channels
> > > > while in[456]_input are for Shunt voltage channels.
> > > > 
> > > > So can I just use in7_input and in7_crit for them?
> > > > 
> > > Doesn't Shunt-Voltage-Limit apply to in[456]_input ?
> > > If so, the limit should be attached to those.
> > 
> > The initial patch of ina3221 driver applied Shunt-Voltage-Limits,
> > being named as "Critical Alert Limit Registers" in the datasheet,
> > to curr[123]_crit, corresponding to curr[123] and in[456]_input.
> > 
> > And this Shunt-Voltage-Limit-Sum is more related to the reading
> > from Shunt-Voltage-Sum, which we just agreed it to be in7_input.
> > 
> You didn't say Shunt-Voltage-Limit-Sum earlier. You said

Ah....right...it's my fault. Sorry.

> Shunt-Voltage-Limit. I would agree that Shunt-Voltage-Limit-Sum is
> associated with Shunt-Voltage-Sum, but, again, that is not what you
> said earlier. Confused :-(

So, those two should be in7_input and in7_crit?

Thanks!

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

* Re: ABI for these two registers?
  2019-09-12 22:45       ` Nicolin Chen
@ 2019-09-13  0:12         ` Nicolin Chen
  2019-10-01 22:17           ` Nicolin Chen
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolin Chen @ 2019-09-13  0:12 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon

On Thu, Sep 12, 2019 at 03:45:29PM -0700, Nicolin Chen wrote:
> On Thu, Sep 12, 2019 at 03:09:47PM -0700, Guenter Roeck wrote:
> > On Thu, Sep 12, 2019 at 02:09:58PM -0700, Nicolin Chen wrote:
> > > Hello Guenter,
> > > 
> > > On Thu, Sep 12, 2019 at 11:32:18AM -0700, Guenter Roeck wrote:
> > > > On Wed, Sep 11, 2019 at 05:28:14PM -0700, Nicolin Chen wrote:
> > > > > Hello Guenter,
> > > > > 
> > > > > Datasheet: http://www.ti.com/lit/ds/symlink/ina3221.pdf
> > > > > (At page 32, chapter 8.6.2.14 and 8.6.2.15)
> > > > > 
> > > > > I have two registers that I need to expose to user space:
> > > > > 	Shunt-Voltage-Sum and Shunt-Voltage-Limit registers
> > > > > 
> > > > > Right now in[123]_input of INA3221 are for voltage channels
> > > > > while in[456]_input are for Shunt voltage channels.
> > > > > 
> > > > > So can I just use in7_input and in7_crit for them?
> > > > > 
> > > > Doesn't Shunt-Voltage-Limit apply to in[456]_input ?
> > > > If so, the limit should be attached to those.
> > > 
> > > The initial patch of ina3221 driver applied Shunt-Voltage-Limits,
> > > being named as "Critical Alert Limit Registers" in the datasheet,
> > > to curr[123]_crit, corresponding to curr[123] and in[456]_input.
> > > 
> > > And this Shunt-Voltage-Limit-Sum is more related to the reading
> > > from Shunt-Voltage-Sum, which we just agreed it to be in7_input.
> > > 
> > You didn't say Shunt-Voltage-Limit-Sum earlier. You said
> 
> Ah....right...it's my fault. Sorry.
> 
> > Shunt-Voltage-Limit. I would agree that Shunt-Voltage-Limit-Sum is
> > associated with Shunt-Voltage-Sum, but, again, that is not what you
> > said earlier. Confused :-(
> 
> So, those two should be in7_input and in7_crit?

And a couple of more questions upon it:

1) There are 3 control bits for the summation of this
   shunt-voltage-sum register to enable corresponding
   input channels. But in7_enable only allows users to
   en/disable all three channels at the same time. So
   how should I attach three enable bits using ABI?
   Or should I create a device-specific sysfs node?

2) We have a requirement of providing current-sum and
   current-limit-sum nodes, for use cases where those
   enabled channels use same value shunt resistors.
   It's similar to provide curr[1-3]_crit by dividing
   shunt[123]_resistor from in[456]_input. So could I
   deploy curr4_input and curr4_crit nodes for this
   requirement?

Thank you!

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

* Re: ABI for these two registers?
  2019-09-13  0:12         ` Nicolin Chen
@ 2019-10-01 22:17           ` Nicolin Chen
  2019-10-03  5:03             ` Guenter Roeck
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolin Chen @ 2019-10-01 22:17 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon

Hello Guenter,

It's been nearly three weeks. Would it be possible for you to
provide some advice on my latest questions? I'd like to write
code and submit changes once ABI is confirmed...

Thank you!

On Thu, Sep 12, 2019 at 05:12:38PM -0700, Nicolin Chen wrote:

> > > > > > Datasheet: http://www.ti.com/lit/ds/symlink/ina3221.pdf
> > > > > > (At page 32, chapter 8.6.2.14 and 8.6.2.15)
> > > > > > 
> > > > > > I have two registers that I need to expose to user space:
> > > > > > 	Shunt-Voltage-Sum and Shunt-Voltage-Limit registers
> > > > > > 
> > > > > > Right now in[123]_input of INA3221 are for voltage channels
> > > > > > while in[456]_input are for Shunt voltage channels.
> > > > > > 
> > > > > > So can I just use in7_input and in7_crit for them?
> > > > > > 
> > > > > Doesn't Shunt-Voltage-Limit apply to in[456]_input ?
> > > > > If so, the limit should be attached to those.
> > > > 
> > > > The initial patch of ina3221 driver applied Shunt-Voltage-Limits,
> > > > being named as "Critical Alert Limit Registers" in the datasheet,
> > > > to curr[123]_crit, corresponding to curr[123] and in[456]_input.
> > > > 
> > > > And this Shunt-Voltage-Limit-Sum is more related to the reading
> > > > from Shunt-Voltage-Sum, which we just agreed it to be in7_input.
> > > > 
> > > You didn't say Shunt-Voltage-Limit-Sum earlier. You said
> > 
> > Ah....right...it's my fault. Sorry.
> > 
> > > Shunt-Voltage-Limit. I would agree that Shunt-Voltage-Limit-Sum is
> > > associated with Shunt-Voltage-Sum, but, again, that is not what you
> > > said earlier. Confused :-(
> > 
> > So, those two should be in7_input and in7_crit?
> 
> And a couple of more questions upon it:
> 
> 1) There are 3 control bits for the summation of this
>    shunt-voltage-sum register to enable corresponding
>    input channels. But in7_enable only allows users to
>    en/disable all three channels at the same time. So
>    how should I attach three enable bits using ABI?
>    Or should I create a device-specific sysfs node?
> 
> 2) We have a requirement of providing current-sum and
>    current-limit-sum nodes, for use cases where those
>    enabled channels use same value shunt resistors.
>    It's similar to provide curr[1-3]_crit by dividing
>    shunt[123]_resistor from in[456]_input. So could I
>    deploy curr4_input and curr4_crit nodes for this
>    requirement?

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

* Re: ABI for these two registers?
  2019-10-01 22:17           ` Nicolin Chen
@ 2019-10-03  5:03             ` Guenter Roeck
  2019-10-07 22:54               ` Nicolin Chen
  0 siblings, 1 reply; 9+ messages in thread
From: Guenter Roeck @ 2019-10-03  5:03 UTC (permalink / raw)
  To: Nicolin Chen; +Cc: linux-hwmon

On 10/1/19 3:17 PM, Nicolin Chen wrote:
> Hello Guenter,
> 
> It's been nearly three weeks. Would it be possible for you to
> provide some advice on my latest questions? I'd like to write
> code and submit changes once ABI is confirmed...
> 

Non-standard attribute discussions always require a lot of time,
since I have to re-read the chip documentation and try to understand
the reasoning why the attributes are needed. On top of that,
asking me "what should I do" instead of suggesting possible
solutions for me to choose from takes even more time, which
unfortunately I don't have right now. I'll try to get to it,
but, sorry, I can not promise you a time right now.

Guenter

> Thank you!
> 
> On Thu, Sep 12, 2019 at 05:12:38PM -0700, Nicolin Chen wrote:
> 
>>>>>>> Datasheet: http://www.ti.com/lit/ds/symlink/ina3221.pdf
>>>>>>> (At page 32, chapter 8.6.2.14 and 8.6.2.15)
>>>>>>>
>>>>>>> I have two registers that I need to expose to user space:
>>>>>>> 	Shunt-Voltage-Sum and Shunt-Voltage-Limit registers
>>>>>>>
>>>>>>> Right now in[123]_input of INA3221 are for voltage channels
>>>>>>> while in[456]_input are for Shunt voltage channels.
>>>>>>>
>>>>>>> So can I just use in7_input and in7_crit for them?
>>>>>>>
>>>>>> Doesn't Shunt-Voltage-Limit apply to in[456]_input ?
>>>>>> If so, the limit should be attached to those.
>>>>>
>>>>> The initial patch of ina3221 driver applied Shunt-Voltage-Limits,
>>>>> being named as "Critical Alert Limit Registers" in the datasheet,
>>>>> to curr[123]_crit, corresponding to curr[123] and in[456]_input.
>>>>>
>>>>> And this Shunt-Voltage-Limit-Sum is more related to the reading
>>>>> from Shunt-Voltage-Sum, which we just agreed it to be in7_input.
>>>>>
>>>> You didn't say Shunt-Voltage-Limit-Sum earlier. You said
>>>
>>> Ah....right...it's my fault. Sorry.
>>>
>>>> Shunt-Voltage-Limit. I would agree that Shunt-Voltage-Limit-Sum is
>>>> associated with Shunt-Voltage-Sum, but, again, that is not what you
>>>> said earlier. Confused :-(
>>>
>>> So, those two should be in7_input and in7_crit?
>>
>> And a couple of more questions upon it:
>>
>> 1) There are 3 control bits for the summation of this
>>     shunt-voltage-sum register to enable corresponding
>>     input channels. But in7_enable only allows users to
>>     en/disable all three channels at the same time. So
>>     how should I attach three enable bits using ABI?
>>     Or should I create a device-specific sysfs node?
>>
>> 2) We have a requirement of providing current-sum and
>>     current-limit-sum nodes, for use cases where those
>>     enabled channels use same value shunt resistors.
>>     It's similar to provide curr[1-3]_crit by dividing
>>     shunt[123]_resistor from in[456]_input. So could I
>>     deploy curr4_input and curr4_crit nodes for this
>>     requirement?
> 


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

* Re: ABI for these two registers?
  2019-10-03  5:03             ` Guenter Roeck
@ 2019-10-07 22:54               ` Nicolin Chen
  0 siblings, 0 replies; 9+ messages in thread
From: Nicolin Chen @ 2019-10-07 22:54 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon

On Wed, Oct 02, 2019 at 10:03:11PM -0700, Guenter Roeck wrote:
> On 10/1/19 3:17 PM, Nicolin Chen wrote:
> > Hello Guenter,
> > 
> > It's been nearly three weeks. Would it be possible for you to
> > provide some advice on my latest questions? I'd like to write
> > code and submit changes once ABI is confirmed...
> > 
> 
> Non-standard attribute discussions always require a lot of time,
> since I have to re-read the chip documentation and try to understand
> the reasoning why the attributes are needed. On top of that,
> asking me "what should I do" instead of suggesting possible
> solutions for me to choose from takes even more time, which
> unfortunately I don't have right now. I'll try to get to it,
> but, sorry, I can not promise you a time right now.

Thank you for the reply...as I can't submit changes unless ABI
is decided, I will be waiting for your further reply.

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

end of thread, back to index

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-12  0:28 ABI for these two registers? Nicolin Chen
2019-09-12 18:32 ` Guenter Roeck
2019-09-12 21:09   ` Nicolin Chen
2019-09-12 22:09     ` Guenter Roeck
2019-09-12 22:45       ` Nicolin Chen
2019-09-13  0:12         ` Nicolin Chen
2019-10-01 22:17           ` Nicolin Chen
2019-10-03  5:03             ` Guenter Roeck
2019-10-07 22:54               ` Nicolin Chen

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
	public-inbox-index linux-hwmon

Example config snippet for mirrors

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.git