Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp105762lqp; Thu, 4 Apr 2024 08:11:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUDfZe3jrU2VQG25H4QtnKLzw4J3xYJLdlGzz1E1kASeV+2vHe0v3yQ9ZZOLiv3ojGO5ObfVmGyT+Bn9KexqTMH+sm0LsPA5YCrSsLOcw== X-Google-Smtp-Source: AGHT+IGEg9BL6LPph6PplFOwUXqK+W7y2D0AqzrEic+OeFL3M9OrgeT1gkttpJQrAlVcNEJbofvh X-Received: by 2002:a05:622a:606:b0:431:5c25:8105 with SMTP id z6-20020a05622a060600b004315c258105mr2740410qta.16.1712243487825; Thu, 04 Apr 2024 08:11:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712243487; cv=pass; d=google.com; s=arc-20160816; b=emeSptSpkGKXme0SuomYnJm1vGDe70oMg8GEpPwP2wV6LllHoPdIeJLRU8qK+zhx9k 6VVc/9D2YIMlPSTdDwIHr2gv6ZTuGp2P88tfO4XHgmkLLUt7vl8/ku/l7dXzXwoaMREr YUQ8HDxY+AOv1jr3CUZW8XJH5jxDvbKYxavE7CrshpgVPQk4HeONgy507SQZZ4Xix3Fv ZnJgxneRJXUzSLXx2wkRAQqhc1cR8tZpKhxIgDXBiqefaC9HlIaAh8/h/hZ11Q6zYgdJ oHRhcyiaTgMAx2MyQNszXdBXTvOfU3dFx+Tr62jMotX0FjtHseGYvhU0ayXsNtSgBTl+ Qfwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id; bh=V+zkJ96+5XiiBNPIA8B/MZaWLvwMV74PILVl9aqV5ik=; fh=/+owxner3WYKz3/7Zp4+OEGE7z3/PLYL67juEiTZ6mg=; b=tf2F8o2Ry0zZi/JO+00QEvk6bQae0kDaNLyfWFcUfNApnBE6XPG6w5aTm2mah+NX/X YG9Rl2TjEz3k2Xz0AobIQxPxnlyhz0IPE/ECi0CRP7POCOrghnZun9InRNa4LZAoFFVO KAJNOmbyvDktcyhUPlyTAyN+pQfsBQfhLKnhqQWh31y9q8FCnunSM/dUNX6bHODnm/xU vNzWnLRQgY2mkUIHXbICh59bLr6MKyZW9hlc55/evlbqmh1iPyF5GLVpPOVppKdBOjHY ylsgwCyZ5tfkO8wUplSQCMZauLTGc58tFPzuK0xU1lgFR7cWNCG/9cvj4cgqt9V5I7Hz sPXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=irl.hu dmarc=pass fromdomain=irl.hu); spf=pass (google.com: domain of linux-kernel+bounces-131680-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131680-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id l11-20020a05622a050b00b00432b780f63dsi16055782qtx.728.2024.04.04.08.11.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 08:11:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-131680-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=irl.hu dmarc=pass fromdomain=irl.hu); spf=pass (google.com: domain of linux-kernel+bounces-131680-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-131680-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=irl.hu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 81D491C2710B for ; Thu, 4 Apr 2024 15:11:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87244129A99; Thu, 4 Apr 2024 15:10:43 +0000 (UTC) Received: from irl.hu (irl.hu [95.85.9.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C12681D551; Thu, 4 Apr 2024 15:10:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.85.9.111 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712243443; cv=none; b=nIH9l7cCWoxcdA9rOGC7KCq3aY3dS1bxHJNJYi3MYV6Yrc5/frQRUCdXx4TgNDZaMwasSgoQHJAZgNT+Y1sPk/PKIOgpdgUaib4dhnBXF/E8+rLrCGEUvKk1CYnQoNKsX8vF4QWN35sllUjY9mQRQ8y4JRzOQdn6nha99+kfd8I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712243443; c=relaxed/simple; bh=vaEH/7UI3i+pPAefwLuVf+TqLBvLn9fh0xIiqmLVADw=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=fFgx0Z8MKofK+08151HGzoRZKJS38IPCqNx5/X2ihq9Tz6KW/sb3ACj6tOW4HxXKrm1l9e1MRUZ8cGVrvQUpCct1eEPyBfSGm9WCj1eHojvKqfSeqr8i5PIUaObSq9CBslXTGqCzfduF/yrugfrrf97mXYkHNMR/10B/oXoMrwQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=irl.hu; spf=pass smtp.mailfrom=irl.hu; arc=none smtp.client-ip=95.85.9.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=irl.hu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=irl.hu Received: from [192.168.2.4] (51b69867.dsl.pool.telekom.hu [::ffff:81.182.152.103]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 000000000006EF1D.00000000660EC1BA.002595F8; Thu, 04 Apr 2024 17:05:30 +0200 Message-ID: Subject: Re: [PATCH v3] platform/x86: ideapad-laptop: switch platform profiles using thermal management key From: Gergo Koteles To: Daniel Lezcano , Ike Panhc , Hans de Goede , Ilpo =?ISO-8859-1?Q?J=E4rvinen?= Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 04 Apr 2024 17:05:29 +0200 In-Reply-To: <45f12590-4f79-4875-a497-cbb1ac3deb38@linaro.org> References: <7c358ad8dd6de7889fa887954145a181501ac362.1712236099.git.soyer@irl.hu> <45f12590-4f79-4875-a497-cbb1ac3deb38@linaro.org> Autocrypt: addr=soyer@irl.hu; prefer-encrypt=mutual; keydata=mDMEZgeDQBYJKwYBBAHaRw8BAQdAD5oxV6MHkjzSfQL2O8VsPW3rSUeCHfbx/a6Yfj3NUnS0HEdlcmdvIEtvdGVsZXMgPHNveWVyQGlybC5odT6ImQQTFgoAQRYhBLSYvEYEgjzzEMQCqgtEJzXf/1IRBQJmB4NAAhsDBQkFo5qABQsJCAcCAiICBhUKCQgLAgQWAgMBAh4HAheAAAoJEAtEJzXf/1IRmdYA/0bE1BX7zOGKBgCa1DwzH2UHXawSKLpptADvI/ao6OOtAP4+wYgpR0kWR28lhmkRTpzG/+8GiMWsT60SV2bz9B7sCbg4BGYHg0ASCisGAQQBl1UBBQEBB0CPo8ow/E97WYtaek9EsLXvsvwpBsjWLq5mMOgJL/ukCwMBCAeIfgQYFgoAJhYhBLSYvEYEgjzzEMQCqgtEJzXf/1IRBQJmB4NAAhsMBQkFo5qAAAoJEAtEJzXf/1IRklEA/ipTfAI/onzNwZIp9sCdnt0bLhR5Oz8RD/FpbrJV1v7eAP0c/C6NQPDPWbQpobBR0pf1eTjWXjjr1fj2jxSvWbMRCw== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.4 (3.50.4-1.fc39) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi Daniel, On Thu, 2024-04-04 at 15:27 +0200, Daniel Lezcano wrote: > > Cycling is done through modulo. > >=20 > > Quick and dirty example: > >=20 > > static int profiles[] =3D { > > PLATFORM_PROFILE_LOW_POWER, > > PLATFORM_PROFILE_BALANCED, > > PLATFORM_PROFILE_PERFORMANCE > > }; > >=20 > > static int current_profile_index =3D 0; > >=20 > > static void dytc_profile_cycle(struct ideapad_private *priv) > > { > > current_profile_index++ > >=20 > > current_profile_index =3D > > current_profile_index % ARRAY_SIZE(profiles); > >=20 > > dytc_profile_set(&priv->dytc->pprof, > > profiles[current_profile_index]); > >=20 > > platform_profile_notify(); > > } > >=20 Thanks for your suggestions. I thought about it. It would make this module complicated, but something like this fits well in the platform_profile module. I will implement the cycle there in v4. Best regards, Gergo