public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Flavio Leitner <fbl@redhat.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Flavio Leitner <fbl@sysclose.org>
Subject: Re: [PATCH] i8k: increase fan limit to 3
Date: Thu, 22 May 2014 12:54:58 -0300	[thread overview]
Message-ID: <20140522155458.GI12759@t520.home> (raw)
In-Reply-To: <20140522151048.GB1001@roeck-us.net>

On Thu, May 22, 2014 at 08:10:48AM -0700, Guenter Roeck wrote:
> On Wed, May 21, 2014 at 11:19:28PM -0300, Flavio Leitner wrote:
> > From: Flavio Leitner <fbl@sysclose.org>
> > 
> > It is possible to increase left fan speed on a
> > DELL Precision 490n system up to 3.
> > 
> >     value    fan rpm
> >       1      35460
> >       2      64740
> >       3      78510
> > 
> > Signed-off-by: Flavio Leitner <fbl@sysclose.org>
> > ---
> >  drivers/char/i8k.c       | 4 ++--
> >  include/uapi/linux/i8k.h | 3 ++-
> >  2 files changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
> > index d915707..99180f0 100644
> > --- a/drivers/char/i8k.c
> > +++ b/drivers/char/i8k.c
> > @@ -519,7 +519,7 @@ static ssize_t i8k_hwmon_show_pwm(struct device *dev,
> >  	status = i8k_get_fan_status(index);
> >  	if (status < 0)
> >  		return -EIO;
> > -	return sprintf(buf, "%d\n", clamp_val(status * 128, 0, 255));
> > +	return sprintf(buf, "%d\n", clamp_val(status * 128, 0, 384));
> 
> pwm value range is limited to (0, 255), so we'll have to find another
> solution.

You mean in the hw? Because the code today just multiply by 128 so
you have 0, 128 and 256 as possible pwm values. See below.

> I think we'll have to define a per-system data structure
> which holds the fan speed range and the fan multiplier, and attach it
> to the dmi data. Currently, .driver_data is used directly to override
> the fan multiplier; it will have to point to a configuration data
> structure with both fan multiplier and maximum fan speed value.
> Unless someone has a better idea, of course.

Sounds good to me.  It could provide a generic one that works as
today in case there is no specific per-system data structure.

It could also include the status multiplier so that for systems with
levels off, minimum and maximum then use x128 and systems with more
states can use another multiplier.

I volunteer to test on precision 490n and on latitude D520.

fbl

  reply	other threads:[~2014-05-22 15:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22  2:19 [PATCH] i8k: increase fan limit to 3 Flavio Leitner
2014-05-22  3:32 ` Guenter Roeck
2014-05-22  3:45   ` Flavio Leitner
2014-05-22  5:36     ` Guenter Roeck
2014-05-22 12:33       ` Flavio Leitner
2014-05-22  8:28   ` Thomas Bogendoerfer
2014-05-22 15:12     ` Guenter Roeck
2014-05-22 16:27       ` Jean Delvare
2014-05-22 15:10 ` Guenter Roeck
2014-05-22 15:54   ` Flavio Leitner [this message]
2014-05-22 18:00     ` Guenter Roeck
2014-05-23 17:09       ` Flavio Leitner
2014-05-23 18:33         ` Guenter Roeck
2014-05-25 15:28           ` Flavio Leitner

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=20140522155458.GI12759@t520.home \
    --to=fbl@redhat.com \
    --cc=arnd@arndb.de \
    --cc=fbl@sysclose.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox