All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leonid Maksymchuk <leonmaxx@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: platform-driver-x86@vger.kernel.org,
	acpi4asus-user@lists.sourceforge.net, chiu@endlessm.com,
	yurii.pavlovskyi@gmail.com, kristian@klausen.dk,
	andy@infradead.org, dvhart@infradead.org,
	corentin.chary@gmail.com, Leonid Maksymchuk <leonmaxx@gmail.com>
Subject: [PATCH v4 3/3] asus_wmi: Set default fan boost mode to normal
Date: Fri,  8 Nov 2019 18:46:52 +0200	[thread overview]
Message-ID: <20191108164652.3223-1-leonmaxx@gmail.com> (raw)
In-Reply-To: <20191108164317.2874-1-leonmaxx@gmail.com>

Set default fan boost mode to normal for multiple reasons:

1) existing code assumes that laptop started in normal mode and that is
   not always correct.
2) FX705DY/FX505DY starts in silent mode and under heavy CPU load it
   overheats and drops CPU frequency to 399MHz [1]. Setting fan mode to
   normal avoids overheating.

[1] Link: https://bugzilla.kernel.org/show_bug.cgi?id=203733

Signed-off-by: Leonid Maksymchuk <leonmaxx@gmail.com>
---
 drivers/platform/x86/asus-wmi.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 4f9c0b99f352..e6565b4e7ed7 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1675,6 +1675,15 @@ static int fan_boost_mode_write(struct asus_wmi *asus)
 	return 0;
 }
 
+static int fan_boost_mode_set_default(struct asus_wmi *asus)
+{
+	if (!asus->fan_boost_mode_available)
+		return 0;
+
+	asus->fan_boost_mode = ASUS_FAN_BOOST_MODE_NORMAL;
+	return fan_boost_mode_write(asus);
+}
+
 static int fan_boost_mode_switch_next(struct asus_wmi *asus)
 {
 	u8 mask = asus->fan_boost_mode_mask;
@@ -2451,6 +2460,7 @@ static int asus_wmi_add(struct platform_device *pdev)
 	err = fan_boost_mode_check_present(asus);
 	if (err)
 		goto fail_fan_boost_mode;
+	fan_boost_mode_set_default(asus);
 
 	err = asus_wmi_sysfs_init(asus->platform_device);
 	if (err)
-- 
2.23.0


      parent reply	other threads:[~2019-11-08 16:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-08 16:43 [PATCH v4 0/3] asus_wmi: Support of ASUS TUF laptops on Ryzen CPUs Leonid Maksymchuk
2019-11-08 16:44 ` [PATCH v4 1/3] asus_wmi: Fix return value of fan_boost_mode_store Leonid Maksymchuk
2019-11-08 16:45 ` [PATCH v4 2/3] asus_wmi: Support fan boost mode on FX505DY/FX705DY Leonid Maksymchuk
2019-11-08 16:46 ` Leonid Maksymchuk [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=20191108164652.3223-1-leonmaxx@gmail.com \
    --to=leonmaxx@gmail.com \
    --cc=acpi4asus-user@lists.sourceforge.net \
    --cc=andy@infradead.org \
    --cc=chiu@endlessm.com \
    --cc=corentin.chary@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=kristian@klausen.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=yurii.pavlovskyi@gmail.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 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.