Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1672223lqs; Sat, 15 Jun 2024 22:26:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXgdNcVeiHVw2MAC6kFWdbe0DWSC3Y86vVzOQpRVljkmHzPDIsMc68BUXRUyBFO1CgMEA/iu3LEpdvxnhpMHdcsYV3MBbbWGTcBnZMTgw== X-Google-Smtp-Source: AGHT+IEIvkz7i0IfcS8VMi2qycqJxGOm8zRkxLlbv3iZydhovBeOy3q2P+QqDe1rOsQN2KqalKC4 X-Received: by 2002:a17:902:e742:b0:1f7:3a70:9e71 with SMTP id d9443c01a7336-1f8620c0f84mr109888905ad.13.1718515580877; Sat, 15 Jun 2024 22:26:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718515580; cv=pass; d=google.com; s=arc-20160816; b=m2bD9/zKXA2PqrDJnVpF2NYjtGmH+vr+uFo0S4oDzj17zPBzAaTo3HM519joF6W2LQ DLLBEMsysqg/yHIWH5pLKEC1RrTKjnfoAuGTsoe/pWhfKM5CQavDBABwCOxPYcE6hWoJ Sl4sU6i1vZOe4wme4BRV4VaEhdaHhkOGc8YUjFI5Q2Rw3JxAmvJLjZ9tJAr0yvzwna5Z n0AMzXhEKVOFYm0aO23JISw2Cp8+qCdoo/u57qqE78io+g9HCRHQ0EZjQMkXXnd+f6Wh NyXdPkddBStCL2S+R0OyMNP+QZDEbeo2hMuJ9n3mhNJH9QzBb0zViXm41xQ6cz9QR+Fh 74mQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=rUwmRTCgqSXeqVWcrGCH1x5heTSIxOLsk0NzrbrzKa8=; fh=QEJAxR/SW04Fhf+IVibFmhap3w4yFEZU+87NFrUcKLY=; b=J7ozHU7vIogvQPkyUT+aflbU0DeeMxy9IajDbNzpy0ZTRWlcXXI1lp+n7Wu3FTqBMr GtipL7/HmWDbX19IlP11HwTHENgZqxIXCnSW90+BDRjIieEqgCdMzEaBvRl+SMihfLHi UBaV3i2WkU/bySIX/RHtbCZJAcoOxujLBfxcjRgTFN5c4H7VS7zyuXctz469dJtcwq8f dazv46+IFWbZacOrhI+xH+eW6Z6nmj451tNfFffUIcKNdyIN2V0z3G72b8okk0+9uEa8 ixyjWIqrkGHQYgOHxViaC5SOhMmh4vkzxdrEn2WfDjb0eqa6APBP+scRKBRegj8ult1t +41A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm3 header.b=LjytOtrz; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="Bm/Xh44i"; arc=pass (i=1 dkim=pass dkdomain=ljones.dev dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-216118-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216118-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f855e52c0bsi67166235ad.143.2024.06.15.22.26.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jun 2024 22:26:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-216118-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm3 header.b=LjytOtrz; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="Bm/Xh44i"; arc=pass (i=1 dkim=pass dkdomain=ljones.dev dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-216118-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216118-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 62195282D81 for ; Sun, 16 Jun 2024 05:26:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B8FC716D338; Sun, 16 Jun 2024 05:26:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="LjytOtrz"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Bm/Xh44i" Received: from fout6-smtp.messagingengine.com (fout6-smtp.messagingengine.com [103.168.172.149]) (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 A77991849; Sun, 16 Jun 2024 05:26:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718515572; cv=none; b=q7rX0WI9dDZtomsYoAZ5TE1U2eGS/BejnZ5yIdMeoA6qUgmiifbv2ne8vHbmbqG/k5hTh3bqLSZAv4eZzvY7tO12EdVppkaXk8ue/D9ICVIWkb9SdnF4BieDHgHl+YC6DRT1x6Yj4WqrB+qRvDu33o8FT3/F7slF6WFnaAy8Bh4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718515572; c=relaxed/simple; bh=d1zVEtisKd1xtMgJN8TQAPiTovdMAXswWCOPUjrXPTI=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=tPbuJjNfXPpXVwPt8PKWrlbsx06jhSP7fgQMSYvqKD9G4iEjAwHaozcjywoGZBv2LJnpdjmgS/cwioj9UDcMSg6lmnNEvx88RpNI+Yft0hCWYKtF7eR1D+Y5hBClKQEiEUumuG8Z37atJlpaNCqfIUVtnTVcZjSJK5TyvYmK7H0= 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=LjytOtrz; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Bm/Xh44i; arc=none smtp.client-ip=103.168.172.149 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 compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfout.nyi.internal (Postfix) with ESMTP id 9A81213801A1; Sun, 16 Jun 2024 01:26:08 -0400 (EDT) Received: from imap41 ([10.202.2.91]) by compute2.internal (MEProxy); Sun, 16 Jun 2024 01:26:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc: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=1718515568; x=1718601968; bh=rUwmRTCgqS XeqVWcrGCH1x5heTSIxOLsk0NzrbrzKa8=; b=LjytOtrzmxhoZ7B48HAa5WFYKu Ocd+ETL1gFbU4rFWZ2PWgYbLtzjmpx5YqZ6QShSlhcVcVtVch95F7ZUF3sIgMLnt FdVT/Sptm2DhjF4YJFT0w0Fw1MXrjtKPeqTy6M1YW0lwuIM0Z93RdF+HolUQCec5 YMtFfOycjujto0S8AoWQayPs4BJ3qk3EtOwzt+R2Sfls6jTxVHgx9jU/Q/dzHIqt KFz31Y8RbLB6IfMwy/SN4KHD/CRpVI3aq/vr7tpu6WipnY6I4b2qkfzlaWh8iKEg Ev5L5qh7JrAlL3BB7nbKB6Sa1BL4exkfOeIGUd3M6p68ir+jviWvVKpYrlow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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= fm1; t=1718515568; x=1718601968; bh=rUwmRTCgqSXeqVWcrGCH1x5heTSI xOLsk0NzrbrzKa8=; b=Bm/Xh44iQP3ofD3JZD9U4BUGMIcdMmQUREThgTS2hddm oW9MG3MftD4NI/p8F0+Wb2vLk8VTpvPADwpiTHbdoAN5Tnm+OCo4iv9s5TCNVCPM hM7DcEsPIDPUqzxgb8FyjjCzT3YVj31A6/+1mVNzWgUcxCJDhPjqWs/9aSn9f7uF neOq1buDAEffm6asKWkhuKj5TJEyNgeC6DTf9ViO+feH6j0hHZGOwoLA1eqSpjkF GAO4/50UfI18svsDh2MXNOC7uJ+lCFMfbq2sJNWkRpcLhE7AwcPuOeDdvsSLTcsF dHfimWiDEY6fYQ8OUvcX5R6aESEM+LJ6WEYuKV/yOg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedvvddgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedfnfhu khgvucflohhnvghsfdcuoehluhhkvgeslhhjohhnvghsrdguvghvqeenucggtffrrghtth gvrhhnpedutdelgfdvgeekueeuteevffelfedukeeitedugfdvtdeutdetjeduudeuvdeg gfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehluh hkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4E7762340080; Sun, 16 Jun 2024 01:26:08 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-515-g87b2bad5a-fm-20240604.001-g87b2bad5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <9e4ee526-2b94-45f3-9fe9-0f1d0918916b@app.fastmail.com> In-Reply-To: References: <20240607040532.1074379-1-luke@ljones.dev> <20240607040532.1074379-2-luke@ljones.dev> Date: Sun, 16 Jun 2024 17:25:46 +1200 From: "Luke Jones" To: "Jiri Kosina" Cc: "Benjamin Tissoires" , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/1] hid-asus: use hid for brightness control on keyboard Content-Type: text/plain On Sat, 8 Jun 2024, at 11:24 AM, Luke Jones wrote: > I thought this was finalised but I'm still getting conflicting reports. > Please don't merge until I confirm the fix. This is ready for merge now. I have more confirmation that the single patch with no adjustment to report_id works well. > On Fri, 7 Jun 2024, at 4:05 PM, Luke D. Jones wrote: > > On almost all ASUS ROG series laptops the MCU used for the USB keyboard > > also has a HID packet used for setting the brightness. This is usually > > the same as the WMI method. But in some laptops the WMI method either > > is missing or doesn't work, so we should default to the HID control. > > > > Signed-off-by: Luke D. Jones > > --- > > drivers/hid/hid-asus.c | 7 ++++ > > drivers/platform/x86/asus-wmi.c | 3 +- > > include/linux/platform_data/x86/asus-wmi.h | 45 ++++++++++++++++++++++ > > 3 files changed, 54 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c > > index 02de2bf4f790..0ed3708ef7e2 100644 > > --- a/drivers/hid/hid-asus.c > > +++ b/drivers/hid/hid-asus.c > > @@ -492,12 +492,19 @@ static void asus_kbd_backlight_work(struct work_struct *work) > > */ > > static bool asus_kbd_wmi_led_control_present(struct hid_device *hdev) > > { > > + struct asus_drvdata *drvdata = hid_get_drvdata(hdev); > > u32 value; > > int ret; > > > > if (!IS_ENABLED(CONFIG_ASUS_WMI)) > > return false; > > > > + if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD && > > + dmi_check_system(asus_use_hid_led_dmi_ids)) { > > + hid_info(hdev, "using HID for asus::kbd_backlight\n"); > > + return false; > > + } > > + > > ret = asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS, > > ASUS_WMI_DEVID_KBD_BACKLIGHT, 0, &value); > > hid_dbg(hdev, "WMI backlight check: rc %d value %x", ret, value); > > diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c > > index 3f9b6285c9a6..799d928c7d3d 100644 > > --- a/drivers/platform/x86/asus-wmi.c > > +++ b/drivers/platform/x86/asus-wmi.c > > @@ -1681,7 +1681,8 @@ static int asus_wmi_led_init(struct asus_wmi *asus) > > goto error; > > } > > > > - if (!kbd_led_read(asus, &led_val, NULL)) { > > + if (!kbd_led_read(asus, &led_val, NULL) && !dmi_check_system(asus_use_hid_led_dmi_ids)) { > > + pr_info("using asus-wmi for asus::kbd_backlight\n"); > > asus->kbd_led_wk = led_val; > > asus->kbd_led.name = "asus::kbd_backlight"; > > asus->kbd_led.flags = LED_BRIGHT_HW_CHANGED; > > diff --git a/include/linux/platform_data/x86/asus-wmi.h b/include/linux/platform_data/x86/asus-wmi.h > > index 3eb5cd6773ad..6ba0015e4386 100644 > > --- a/include/linux/platform_data/x86/asus-wmi.h > > +++ b/include/linux/platform_data/x86/asus-wmi.h > > @@ -4,6 +4,7 @@ > > > > #include > > #include > > +#include > > > > /* WMI Methods */ > > #define ASUS_WMI_METHODID_SPEC 0x43455053 /* BIOS SPECification */ > > @@ -160,4 +161,48 @@ static inline int asus_wmi_evaluate_method(u32 method_id, u32 arg0, u32 arg1, > > } > > #endif > > > > +/* To be used by both hid-asus and asus-wmi to determine which controls kbd_brightness */ > > +#if IS_ENABLED(CONFIG_ASUS_WMI) > > +bool asus_use_hid_led(void); > > +#else > > +static inline bool asus_use_hid_led(void) > > +{ > > + return true; > > +} > > +#endif > > + > > +static const struct dmi_system_id asus_use_hid_led_dmi_ids[] = { > > + { > > + .matches = { > > + DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Zephyrus"), > > + }, > > + }, > > + { > > + .matches = { > > + DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Strix"), > > + }, > > + }, > > + { > > + .matches = { > > + DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Flow"), > > + }, > > + }, > > + { > > + .matches = { > > + DMI_MATCH(DMI_BOARD_NAME, "GA403"), > > + }, > > + }, > > + { > > + .matches = { > > + DMI_MATCH(DMI_BOARD_NAME, "GU605"), > > + }, > > + }, > > + { > > + .matches = { > > + DMI_MATCH(DMI_BOARD_NAME, "RC71L"), > > + }, > > + }, > > + NULL, > > +}; > > + > > #endif /* __PLATFORM_DATA_X86_ASUS_WMI_H */ > > -- > > 2.45.1 > > > >