Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp10317lqe; Wed, 3 Apr 2024 19:36:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUGZnUOlgbiZDC2QIfatgdDfRdEQ+beXgGRYNVI0mOJ6Of2J0jz+l0fl2Kntc9zNr/n41EW9b4+Bj08Pi7QQmRm+fHkeIY4FSAyf/+gQg== X-Google-Smtp-Source: AGHT+IE5U/dT6He1FeJfh+t/7hgaU6Iga46Ei9hiQBBPsnqdPYTs/1StycVKL94HClhu021kqRlO X-Received: by 2002:a05:6a21:339d:b0:1a3:68ff:5805 with SMTP id yy29-20020a056a21339d00b001a368ff5805mr1583963pzb.44.1712198204047; Wed, 03 Apr 2024 19:36:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712198204; cv=pass; d=google.com; s=arc-20160816; b=GrpbPJ03oz+MNrwviq0HR8ql0vNCutdgj188o0/LHYRMdj48Xjl0xg4VRSEidPpN9H TSHVMcc/4HAPHONrpo1JbwZeUH+SUGQizwvHCGq8ZL1O9D+OiJ5tEG6kA9vT6ZrT3rlw nXC+bEcsKZdCTHW762lO8eRP9kdpKerL3XBlkqqzvCvLAHtxlyWgKqJaahh/7LvLqcLd /kJl4ZPZZ+bcerDD8rRFx2yntU7RkoT2yhg9SZTDyWYvxlUdYcmIOICZApEorP6EZ47C PG8xPSjK4eV1rY6K4zSaNdkdg9uLmELWdS0Kqwbsi5Q9pG9X6uQj9fRgcZDUe1t1jRCu 3MtA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:feedback-id:dkim-signature:dkim-signature; bh=DqglvZr5k/JEAGAixTdTEp4OkixttBJt7dLokKdRZbg=; fh=wDrqx0f+299Z9E/ydfQE0sLKgm4EkrYz7I1GVgXm5co=; b=C5Dy2ApdnuC0p1W8VqyOI1xrjF1HVj1C8RXyu0K+IfY4mEW9/l73Zc9ERk+NRUioFb o599Be5p8PbdeNB+yP/HIChse5umWE43V/i3mLijmFxJkqO/NKRU/P9VIEv9UXyhe6bD 8g0iUiQSgOIV2K6fj9yX/TTN/+kJv9nRtmzLloc17PlZvZkiIGlVREsIM8Cw5LZcep/l oAdCImBlDNRomQdJafBBdispXWlmXr/gRCWtuz/PPDXXPzuwGIFRnnwUllsIXfHHzHZt sCGjY+cvdtxvMgh6eGWPejTY+Q9lQkGTj58bJGFNJ9A6kb1qVbAjsedXjOMJbWYO9yQv V1pQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm3 header.b=sGaeZ7mw; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="A88Y/rcB"; arc=pass (i=1 dkim=pass dkdomain=ljones.dev dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-130767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130767-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t21-20020a17090ad51500b002a2943f924csi688491pju.49.2024.04.03.19.36.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 19:36:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm3 header.b=sGaeZ7mw; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="A88Y/rcB"; arc=pass (i=1 dkim=pass dkdomain=ljones.dev dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-130767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130767-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 3C57BB282BD for ; Thu, 4 Apr 2024 00:17:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D1E29C138; Thu, 4 Apr 2024 00:17:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="sGaeZ7mw"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="A88Y/rcB" Received: from wfhigh8-smtp.messagingengine.com (wfhigh8-smtp.messagingengine.com [64.147.123.159]) (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 267DA8462; Thu, 4 Apr 2024 00:17:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.159 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189839; cv=none; b=FBo9MAO+os4JaRESyIVAnKuMHCTyo4fFaY4Km8UjWyuBBGk4Kgl/ExzlZPehgJM47HJL5X3sb1mEBrlcXRNv0whXztFaWCx4h6qOAOiWqw/bQaV/Jr6ddaYUNskVvCERl0SlQZspM6jZC4+c0l22UOxHRa3d+6U3DddnW+HULq4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712189839; c=relaxed/simple; bh=BDM+uHjAeszpHyFFAxX7i9RiVw2Ng2s5OMK1+h3nC4I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iqDrr73L0L7OgMNEoS3VGbsPsAPGeqBQXrC0OV3k+PXUA+92lLEzjxP2y5gOCWIk2E1dWfI4/hO/7+nNDVry3VtCjN0sfDbhRlsCP3IiI7D8h1hGuEcM6k1N1r/SRNzEq0D6iLJmqZSQ1cHEp7RcSTxaN51RaPkobJTL8S1tLFA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=sGaeZ7mw; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=A88Y/rcB; arc=none smtp.client-ip=64.147.123.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id B309318000DD; Wed, 3 Apr 2024 20:17:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 03 Apr 2024 20:17:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1712189836; x=1712276236; bh=DqglvZr5k/JEAGAixTdTEp4OkixttBJt7dLokKdRZbg=; b= sGaeZ7mwiqGYLpHU7sSszI8Cdtxsk8/+lqoNEfnNjO560Je3UIPUEwFIVCrk9LAh kiEhcpaTZ9cemwVXo+iPzVstUGueW0RXpNR6MqtOp/cbUaL0NfGiaQPR6BaJDyn3 N0Yk80nPh5dRLfoKFuIBger4E3sC4GgRR2rTtXzxGW8mXnVYT8rCzW1rMQ7r/mSf 4G3Dx/NN86c1ioH3lfP5+lZjrpPU1cH42xg/L27SD5juRkopZLRzU/M+7IQrylAK xWmzIOyNTiv+FNWXg2+GbK3gyn2r6PPA23yTfIn/+X8ZjQIqcquNlsUEP2YRQ44l YLOMslvsz8IDRpY8Io8rCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712189836; x= 1712276236; bh=DqglvZr5k/JEAGAixTdTEp4OkixttBJt7dLokKdRZbg=; b=A 88Y/rcBJz2ow5femLbum5fKlqlAvsNtp9SvhqQrOFCkvYnLbKVScpc++4tHtGiat QnT2Wf87SbBEpKM0+j4WKtOuMS1P/tiTCbgOaxEXM51s9Wdvue3oSnSklzi1mwLu 54SBa3CHxRmgr6FpJTV/oCcqcELHg/UZ5CViS7Li15m9Gmj6NlmjRCQ6m+KjnoIy ZmW/75BvyuuERrF57v8RnmDsBbD0SbscIhTnsS9ZO/eypknlbct1GfgRQuksFmnQ lJ1UgW3zZpLwh9tKIgrJI3N7oiXnevjgi3cVk+qywTklV0ooCPJHcsLP5641SPde L9Bbe3rR5fOWMC4hDWGPQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefjedgfeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfgggtgfesth ekredtredtjeenucfhrhhomhepfdfnuhhkvgcuffdrucflohhnvghsfdcuoehluhhkvges lhhjohhnvghsrdguvghvqeenucggtffrrghtthgvrhhnpeduudetudehiedvvdevveelhf egkeefffdvfeetuefgveefgffgffeiffeitdelieenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Apr 2024 20:17:13 -0400 (EDT) From: "Luke D. Jones" To: hdegoede@redhat.com Cc: corentin.chary@gmail.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" Subject: [PATCH v4 3/9] platform/x86: asus-wmi: add support variant of TUF RGB Date: Thu, 4 Apr 2024 13:16:46 +1300 Message-ID: <20240404001652.86207-4-luke@ljones.dev> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240404001652.86207-1-luke@ljones.dev> References: <20240404001652.86207-1-luke@ljones.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds support for a second TUF RGB wmi call that some versions of the TUF laptop come with. Also adjusts existing support to select whichever is available. Reviewed-by: Ilpo Järvinen Signed-off-by: Luke D. Jones --- drivers/platform/x86/asus-wmi.c | 13 +++++++++---- include/linux/platform_data/x86/asus-wmi.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 1ab4380e9771..6896d056d227 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -281,7 +281,7 @@ struct asus_wmi { bool nv_dyn_boost_available; bool nv_temp_tgt_available; - bool kbd_rgb_mode_available; + u32 kbd_rgb_dev; bool kbd_rgb_state_available; bool throttle_thermal_policy_available; @@ -881,6 +881,7 @@ static ssize_t kbd_rgb_mode_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { + struct asus_wmi *asus = dev_get_drvdata(dev); u32 cmd, mode, r, g, b, speed; int err; @@ -917,7 +918,7 @@ static ssize_t kbd_rgb_mode_store(struct device *dev, speed = 0xeb; } - err = asus_wmi_evaluate_method3(ASUS_WMI_METHODID_DEVS, ASUS_WMI_DEVID_TUF_RGB_MODE, + err = asus_wmi_evaluate_method3(ASUS_WMI_METHODID_DEVS, asus->kbd_rgb_dev, cmd | (mode << 8) | (r << 16) | (g << 24), b | (speed << 8), NULL); if (err) return err; @@ -1560,7 +1561,7 @@ static int asus_wmi_led_init(struct asus_wmi *asus) { int rv = 0, num_rgb_groups = 0, led_val; - if (asus->kbd_rgb_mode_available) + if (asus->kbd_rgb_dev) kbd_rgb_mode_groups[num_rgb_groups++] = &kbd_rgb_mode_group; if (asus->kbd_rgb_state_available) kbd_rgb_mode_groups[num_rgb_groups++] = &kbd_rgb_state_group; @@ -4505,7 +4506,6 @@ static int asus_wmi_add(struct platform_device *pdev) asus->egpu_enable_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_EGPU); asus->egpu_connect_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_EGPU_CONNECTED); asus->dgpu_disable_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_DGPU); - asus->kbd_rgb_mode_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_MODE); asus->kbd_rgb_state_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_STATE); asus->ppt_pl2_sppt_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_PPT_PL2_SPPT); asus->ppt_pl1_spl_available = asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_PPT_PL1_SPL); @@ -4528,6 +4528,11 @@ static int asus_wmi_add(struct platform_device *pdev) else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_GPU_MUX_VIVO)) asus->gpu_mux_dev = ASUS_WMI_DEVID_GPU_MUX_VIVO; + if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_MODE)) + asus->kbd_rgb_dev = ASUS_WMI_DEVID_TUF_RGB_MODE; + else if (asus_wmi_dev_is_present(asus, ASUS_WMI_DEVID_TUF_RGB_MODE2)) + asus->kbd_rgb_dev = ASUS_WMI_DEVID_TUF_RGB_MODE2; + err = fan_boost_mode_check_present(asus); if (err) goto fail_fan_boost_mode; diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h index b48b024dd844..3e9a01467c67 100644 --- a/include/linux/platform_data/x86/asus-wmi.h +++ b/include/linux/platform_data/x86/asus-wmi.h @@ -132,6 +132,7 @@ /* TUF laptop RGB modes/colours */ #define ASUS_WMI_DEVID_TUF_RGB_MODE 0x00100056 +#define ASUS_WMI_DEVID_TUF_RGB_MODE2 0x0010005A /* TUF laptop RGB power/state */ #define ASUS_WMI_DEVID_TUF_RGB_STATE 0x00100057 -- 2.44.0