public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Luke Jones <luke@ljones.dev>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Bastien Nocera <hadess@hadess.net>,
	linux-kernel@vger.kernel.org, pobrn@protonmail.com,
	linux@roeck-us.net, platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v11] asus-wmi: Add support for custom fan curves
Date: Wed, 29 Sep 2021 00:59:11 +1300	[thread overview]
Message-ID: <NY750R.JRUHTBKNLH1F1@ljones.dev> (raw)
In-Reply-To: <10be9244-0d89-ef79-08d0-fe7024609ee2@redhat.com>



On Tue, Sep 28 2021 at 13:56:05 +0200, Hans de Goede 
<hdegoede@redhat.com> wrote:
> Hi,
> 
> On 9/28/21 1:43 PM, Luke Jones wrote:
>>  Sure, the path is similar to 
>> /sys/devices/platform/asus-nb-wmi/hwmon/hwmon4/pwm1_enable where 
>> hwmon4 will likely be different depending on init, and pwm2_enable 
>> is the second fan if it exists. The values are 1,2,3 - where 1 = fan 
>> curve enabled/manual, 2 = auto. 3 here is custom extra that writes 
>> default curve back then defaults to 2.
>> 
>>  As I understand it, this should be adhering to the accepted kernel 
>> standard, so if you use this for ASUS laptops, then it should carry 
>> over to other brands that implement it also.
> 
> Ah, so this is a bit different then how I thought this would work
> (this is probably better though).
> 
> <snip>
> 
>>>>   The fans have settings [1,2,3] under pwm<N>_enable:
>>>>   1. Enable and write settings out
>>>>   2. Disable and use factory fan mode
>>>>   3. Same as 2, additionally restoring default factory curve.
> 
> Quoting Documentation/hwmon/sysfs-interface.rst
> 
> `pwm[1-*]_enable`
>                 Fan speed control method:
> 
>                 - 0: no fan speed control (i.e. fan at full speed)
>                 - 1: manual fan speed control enabled (using 
> `pwm[1-*]`)
>                 - 2+: automatic fan speed control enabled
> 
> 1 normally means the fans runs at a fixed speed, but you are using it
> for the custom/manual profile, which is still a temp<->pwm table,
> right?
> 
> I guess this make sense since full manual control is not supported
> and this keeps "2" aka auto as being the normal factory auto
> setting which is good.
> 
> Bastien is this interface usable for p-p-d ?
> 
> I guess that it is a bit annoying that you need to figure out
> the # in the hwmon# part of the path, but there will be only
> one hwmon child.
> 
> You could also go through /sys/class/hwmon but then you really
> have no idea which one to use. Ideally we would have some way
> to indicate that there is a hmwon class-dev associated with
> /sys/firmware/acpi/platform_profile but as we mentioned before
> we should defer coming up with a generic solution for this
> until we have more then 1 user, so that we hopefully get the
> generic solution right in one go.

If it's at all helpful, I named the interface as 
"asus_custom_fan_curve". I use this to verify I have the correct hwmon 
for asusctl. Open to suggestions on that.

> 
> Regards,
> 
> Hans
> 
> 
> 
> 
> 
>>>> 
>>>>   Use of 2 means that the curve the user has set is still stored 
>>>> and
>>>>   won't be erased, but the laptop will be using its default 
>>>> auto-fan
>>>>   mode. Re-enabling the manual mode then activates the curves 
>>>> again.
>>>> 
>>>>   Notes:
>>>>   - pwm<N>_enable = 0 is an invalid setting.
>>>>   - pwm is actually a percentage and is scaled on writing to 
>>>> device.
>>> 
>>>  I was trying to update:
>>>  
>>> https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/merge_requests/80
>>>  but I don't understand what files I need to check for what values 
>>> to
>>>  detect whether custom fan curves were used.
>>> 
>>>  Can you help me out here?
>>> 
>>>  Also, was this patch accepted in the pdx86 tree?
>>> 
>>>  Cheers
>>> 
>> 
>> 
> 



  reply	other threads:[~2021-09-28 11:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 23:22 [PATCH v11 0/1] asus-wmi: Add support for custom fan curves Luke D. Jones
2021-09-07 23:22 ` [PATCH v11] " Luke D. Jones
2021-09-08 12:32   ` kernel test robot
2021-09-08 17:49   ` kernel test robot
2021-09-28 11:36   ` Bastien Nocera
2021-09-28 11:43     ` Luke Jones
2021-09-28 11:56       ` Hans de Goede
2021-09-28 11:59         ` Luke Jones [this message]
2021-09-28 12:03           ` Hans de Goede
2021-09-28 12:15             ` Luke Jones
2021-09-28 14:11               ` Hans de Goede
2021-09-28 11:44     ` Hans de Goede
2021-09-28 11:56       ` Luke Jones
2021-09-28 11:59         ` Hans de Goede
2021-09-28 12:01           ` Luke Jones

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=NY750R.JRUHTBKNLH1F1@ljones.dev \
    --to=luke@ljones.dev \
    --cc=hadess@hadess.net \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=pobrn@protonmail.com \
    /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