All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Myhr <fmyhr@fhmtech.com>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] sysfs-interface: pwm [0-100] rather than [0-255] ?
Date: Tue, 24 Jun 2008 03:06:29 +0000	[thread overview]
Message-ID: <486064B5.5070704@fhmtech.com> (raw)

Hi,

I've added automatic pwm control to the it87.c driver and it's working
on my Gigabyte GA-MA770-DS3 motherboard with it8718f chip. I plan to
contribute the modified driver, but need to do significant cleanup and
logical patch-splitting before it's in a fit state to submit.
In my naivete I didn't read sysfs-interface until I'd already rolled
my own non-conforming interface for it87. My bad, my pain as I fix that.
I do have a comment, though:

For pwm[1-*], it seems to me to make better sense to use a range
[0, 100] ("% duty cycle"), rather than the current 8-bit range [0, 255].

Points in favor of using range [0, 100] "% duty cycle" for pwm[1-*]:

1) Consistency: other hwmon sysfs attributes that correspond to
physical quantities (temp[1-*], fan[1-*], etc.) are in physical units.

2) Freedom from chip implementation: 0-100% duty cycle remains
the same regardless of whether specific chip uses 6,7,8 or whatever
bits to represent it.

3) Meaningful value: natural for user to think in terms of 0-100% duty
cycle, rather than "255 means 100%... 60% would be... (pulls out calculator)"

Of course I remain naive, and so have some questions:

a) Is there any possibility of changing pwm[1-*] to use range [0, 100] ?*

b) If backward compatibility with [0, 255] range must be preserved,
would it be acceptable to make available an additional redundant
attribute, named something like pwm[1-*]_duty that would have range [0, 100] ?*

c) Is your [dog / cat / fish / fill in the blank] less naive than I am? :-)

*Note that the following attributes would also be affected:
pwm[1-*]_auto_point[1-*]_pwm
temp[1-*]_auto_point[1-*]_pwm

Thanks,
Frank

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

             reply	other threads:[~2008-06-24  3:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-24  3:06 Frank Myhr [this message]
2008-06-24  6:11 ` [lm-sensors] sysfs-interface: pwm [0-100] rather than [0-255] ? Jean Delvare
2008-06-24 12:39 ` Frank Myhr
2008-06-24 13:23 ` Jean Delvare
2008-06-24 13:52 ` Frank Myhr

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=486064B5.5070704@fhmtech.com \
    --to=fmyhr@fhmtech.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.