All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [RFC] [PATCH] hwmon: Add LTC4245 driver
Date: Mon, 13 Oct 2008 10:35:28 +0000	[thread overview]
Message-ID: <48F32470.5090103@redhat.com> (raw)
In-Reply-To: <20081010222831.GC8570@ovro.caltech.edu>

Jean Delvare wrote:
> On Sun, 12 Oct 2008 12:12:19 +0200, Hans de Goede wrote:
>> Ira Snyder wrote:
>>> Add Linux support for the Linear Technology LTC4245 Multiple Supply Hot
>>> Swap controller I2C monitoring interface.
>> (...)
>> That only leaves one issue, it would be nice to be able to map the currents and 
>> voltages together by something other then labels, but allas we have no API in 
>> place for that. We could however try to give them to same numbers.
>>
>> So what I would like to suggest is to have the following sysfs attributes for 
>> inputs:
>>
>> in1_input	12v input  voltage (mV)
>> in2_input	5v  input  voltage (mV)
>> in3_input	3v  input  voltage (mV)
>> curr1_input	12v amperage (mA)
>> curr2_input	12v amperage (mA)
> 
> I guess you mean 5v...
> 
>> curr3_input	12v amperage (mA)
> 
> ... and 3v.
> 

Erm, yes.

>> Given that we measure both output voltage and current, I think it would be cool 
>> to also add power#_input's to the driver, as thats just "output voltage * 
>> current". I know people will start screaming that we should do things like this 
>> in userspace, but given the fact that we have no API to match voltages and 
>> currents, let alone one to do the interesting mapping here, where one current 
>> corresponds to 2 voltages, and given how easy it is to add these 2 this driver, 
>> I'm in favor of adding them, so then we would also get:
>>
>> power1_input 12v power consumption (micro watt)
>> power2_input 5v power consumption (micro watt)
>> power3_input 3v power consumption (micro watt)
>>
>> Jean, whats your 2 cents on this ?
> 
> I don't have enough free time these days to afford having an objection.
> I am not too happy to see non-independent inputs in sysfs, as there's
> no way for the user to know which values are independent and which are
> computer, but indeed we lack a good way to express the relations
> between different inputs. That's the same problem we had for fan# and
> pwm#, or pwm# and temp# for automatic fan speed control. At some point
> it might be convenient to introduce virtual sub-devices grouping
> together things related items. For now, all we have is
> pwm[1-*]_auto_channels_temp to map temperature channels to pwm outputs.
> I guess we could do something similar to link voltage and current
> channels.
> 
> But then again I do not have enough time to properly think about this
> and propose something. So I'd say, do whatever you want, and whoever
> really cares will have to do the thinking and the proposal and update
> the drivers and libsensors if/as needed.

I hear you, but as everyone involved in hwmon seems to be short on time, and as 
  this is the first IC to expose this kind of problems, I think for now its 
best to just stick with what we have. And add the power#_input attributes to 
this driver as a service to userspace, as userspace cannot easily find this out 
itself due to lack of API.

>>> Take it easy on me, this is my first hwmon driver :) I'd love
>>> suggestions for improvements, however.
>> Don't worry, for a first driver it is pretty good :) If you agree with my 
>> proposed sysfs interface and change the driver to match, I think we can get it 
>> in to 2.6.28.
> 
> That's a pretty optimistic statement from someone who isn't in charge ;)

Erm (I get the hint), yes it is :)

Regards,

Hans

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

      parent reply	other threads:[~2008-10-13 10:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-10 22:28 [lm-sensors] [RFC] [PATCH] hwmon: Add LTC4245 driver Ira Snyder
2008-10-12 10:12 ` Hans de Goede
2008-10-13 10:00 ` Jean Delvare
2008-10-13 10:35 ` Hans de Goede [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=48F32470.5090103@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=lm-sensors@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 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.