All of lore.kernel.org
 help / color / mirror / Atom feed
From: khali@linux-fr.org (Jean Delvare)
To: lm-sensors@vger.kernel.org
Subject: adm1026 driver port for kernel 2.6.X
Date: Thu, 19 May 2005 06:25:20 +0000	[thread overview]
Message-ID: <20041025223958.5cfdb5ef.khali@linux-fr.org> (raw)
In-Reply-To: <20041018210758.GB14960@penguincomputing.com>

> > BTW, how are pwm1 and pwm2 (aka DAC) linked? if pwm1 and pwm2
> > correspond to the same output, shouldn't they be a single pwm file?
> 
> You can have one or the other, but not both.  And since all
> PWM/DAC-controlled fans are driven by no more than one output at a
> time, providing access to both seems even less useful.

This convinces me that we need a single pwm file then.

> But I see your point.  If we keep the DAC output as well as the PWM
> output in the interface, there really is no reason to provide separate
> pwm1_* and pwm2_* entries, since only one can operate at a time.  Then
> we would need to replace
> 
> pwm[1-2]_enable, {0,1,2}
> 
> with a single file such as:
> 
> pwm_enable, {0,1,2,3,4}
> 
> where:
> 
> 0 -> no fan control, fans set @ full speed
> 1 -> manual PWM fan control
> 2 -> manual DAC fan control
> 3 -> automatic PWM fan control
> 4 -> automatic DAC fan control

This won't be allowed since value 2 is standardized as auto mode. You
could default to PWM and allow the used to switch to DAC, or provide a
non-standard file to switch from PWM to DAC and back (pwm1_mode?)

> > Should be scaled so that this max value matches the max pwm value
> > (around 250).
> 
> Ugh.  Is this really a good idea?  Is scaling pwnN_auto_pwm_min so
> that it matches pwmN worth:
> 
> (A)  Obscuring the actual granularity of pwmN_auto_pwm_min

We don't much care about the granularity. All measured values are
reported in a fixed unit (mV...) regardless of the chip. This is the
only way to provide a unified interface where the user (or user-space
application) doesn't need to know anything about the chip.

The granularity issue and the rounding errors are really not a problem.
Noone can differenciate between 80% and 82% duty cycle anyway.

The ultimate goal is that the user can echo 192 to the pwm file and get
around 75% duty cycle regardless of the chip.

> (B)  Introducing "best fit" functions/macros to scale {0-255} =>
> {0-15}.

Converting from 0-15 to 0-255 is easy and lossless (X << 4 + X, X >> 4).

> Especially since the PWM := PWM(PWM_min) equation actually just
> generates values in the {0-100} range.  Which granularity level should
> we respect?{0-255}? {0-100}? {0-15}?

0-255. Think standard.

> Is pwmN_auto_pwm_min using a different scale than pwmN any more
> confusing when compared to the effect that the "invisible" granularity
> a pwmN_auto_pwm_min scaled {0-255} or {0-100} will have?

pwmN_auto_* files have to be consistent with pwmN values of course.

> Moreover, if we are to keep the DAC as a 2nd "PWM" output, then
> shouldn't its pwmN_auto_pwm_min scale {0-240}, rather than {0-255}?

I admit I don't really care about 0-240 vs 0-255. I think we have
drivers doing both. Since the underlying hardware only knows of 16 steps
anyway, this doesn't make much difference. 255 is the standard though ;)

Thanks.

-- 
Jean Delvare
http://khali.linux-fr.org/

  reply	other threads:[~2005-05-19  6:25 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-19  6:25 adm1026 driver port for kernel 2.6.X Justin Thiessen
2005-05-19  6:25 ` Jean Delvare [this message]
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Justin Thiessen
2004-11-02 16:46   ` adm1026 driver port for kernel 2.6.X - [REVISED DRIVER] Justin Thiessen
2005-05-19  6:25     ` Justin Thiessen
2004-11-02 19:31     ` Jean Delvare
2005-05-19  6:25       ` Jean Delvare
2004-11-02 22:17       ` Justin Thiessen
2005-05-19  6:25         ` Justin Thiessen
2004-11-03  8:01         ` Jean Delvare
2005-05-19  6:25           ` Jean Delvare
2004-11-03 16:43           ` adm1026 driver port for kernel 2.6.X - [RE-REVISED DRIVER] Justin Thiessen
2005-05-19  6:25             ` Justin Thiessen
2004-11-16 18:56             ` Jean Delvare
2005-05-19  6:25               ` Jean Delvare
2004-11-18 18:56             ` adm1026 driver port for kernel 2.6.10-rc2 " Justin Thiessen
2005-05-19  6:25               ` Justin Thiessen
2004-11-20  9:57               ` Jean Delvare
2005-05-19  6:25                 ` Jean Delvare
2004-11-22 19:35                 ` Justin Thiessen
2005-05-19  6:25                   ` Justin Thiessen
2004-11-20 10:13               ` Arjan van de Ven
2005-05-19  6:25                 ` Arjan van de Ven
2004-11-20 10:32                 ` Jean Delvare
2005-05-19  6:25                   ` Jean Delvare
2004-11-22 19:43                 ` Justin Thiessen
2005-05-19  6:25                   ` Justin Thiessen
2004-11-22 21:00                   ` Arjan van de Ven
2005-05-19  6:25                     ` Arjan van de Ven
2004-11-22 21:30                     ` linux-os
2005-05-19  6:25                       ` linux-os
2004-11-23 17:58                   ` Jean Delvare
2005-05-19  6:25                     ` Jean Delvare
2004-11-23 16:52               ` adm1026 driver port for kernel 2.6.10-rc2 (patch includes driver, patch to Kconfig, and patch to Makefile) Justin Thiessen
2005-05-19  6:25                 ` adm1026 driver port for kernel 2.6.10-rc2 (patch includes driver, Justin Thiessen
2004-11-23 17:50                 ` adm1026 driver port for kernel 2.6.10-rc2 (patch includes driver, patch to Kconfig, and patch to Makefile) Jean Delvare
2005-05-19  6:25                   ` adm1026 driver port for kernel 2.6.10-rc2 (patch includes Jean Delvare
2004-11-24 21:36                 ` adm1026 driver port for kernel 2.6.10-rc2 (patch includes driver, patch to Kconfig, and patch to Makefile) Greg KH
2005-05-19  6:25                   ` adm1026 driver port for kernel 2.6.10-rc2 (patch includes driver, Greg KH
2004-11-24 23:10                   ` adm1026 driver port for kernel 2.6.10-rc2 (patch includes driver, patch to Kconfig, and patch to Makefile) [fixed] Justin Thiessen
2005-05-19  6:25                     ` adm1026 driver port for kernel 2.6.10-rc2 (patch includes Justin Thiessen
2004-11-24 22:35                     ` adm1026 driver port for kernel 2.6.10-rc2 (patch includes driver, patch to Kconfig, and patch to Makefile) [fixed] Greg KH
2005-05-19  6:25                       ` adm1026 driver port for kernel 2.6.10-rc2 (patch includes driver, Greg KH
2005-05-19  6:25 ` adm1026 driver port for kernel 2.6.X Justin Thiessen
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Justin Thiessen
2005-05-19  6:25 ` Mark M. Hoffman
2005-05-19  6:25 ` Justin Thiessen
2005-05-19  6:25 ` Jean Delvare

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=20041025223958.5cfdb5ef.khali@linux-fr.org \
    --to=khali@linux-fr.org \
    --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.