From bd56c1ecb912bb5cbe7c12dd2ae26f7aed16d2ba Mon Sep 17 00:00:00 2001 From: Christoffer Sandberg Date: Thu, 11 Nov 2021 22:31:12 +0100 Subject: [PATCH] Restrict fan-curve copy to "v1" profile devices only --- src/uniwill_keyboard.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/uniwill_keyboard.h b/src/uniwill_keyboard.h index 7a60656..72febab 100644 --- a/src/uniwill_keyboard.h +++ b/src/uniwill_keyboard.h @@ -811,11 +811,13 @@ static int uniwill_keyboard_probe(struct platform_device *dev) // uw_ec_write_addr(0x51, 0x07, 0x00, 0x00, ®_write_return); uniwill_write_ec_ram(0x0751, 0x00); - // Set manual-mode fan-curve in 0x0743 - 0x0747 - // Some kind of default fan-curve is stored in 0x0786 - 0x078a: Using it to initialize manual-mode fan-curve - for (i = 0; i < 5; ++i) { - uniwill_read_ec_ram(0x0786 + i, &data); - uniwill_write_ec_ram(0x0743 + i, data); + if (uw_feats->uniwill_profile_v1) { + // Set manual-mode fan-curve in 0x0743 - 0x0747 + // Some kind of default fan-curve is stored in 0x0786 - 0x078a: Using it to initialize manual-mode fan-curve + for (i = 0; i < 5; ++i) { + uniwill_read_ec_ram(0x0786 + i, &data); + uniwill_write_ec_ram(0x0743 + i, data); + } } // Enable manual mode