Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp344542lqb; Tue, 28 May 2024 18:30:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBsIfheoYA9Q4Wmcnb4hmyy8B8SN0WRH7Kiad66c+rviV0wdxS91rIaMNrJzUHyzRp8gbxaaD0DJEaTffxoBqqvDyTtxdVUczVVqcZLw== X-Google-Smtp-Source: AGHT+IFaBqefNSLa7GfvlLL7h5f6phGs+2KaWvXupKLx6w/MWJmn79uMxLfSMN+vlWEZjupSLr4a X-Received: by 2002:a17:906:2343:b0:a60:c514:31d9 with SMTP id a640c23a62f3a-a62641c2e74mr1370708466b.6.1716946258285; Tue, 28 May 2024 18:30:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716946258; cv=pass; d=google.com; s=arc-20160816; b=tsw4wPJuFvHf6NA6zAANoOJn4rml51pCjmliS55K+sqRXJuSRWHheAs4NAPaC/Z7Kp km95UC8MLBUzFNnDm6DDOuGtJ6XeWoqIkMv2Q790XkVtqYp4QJYS4oTYLBXB4FODFVH4 Re9/VAnli613QhCPPtD4PwYnoJqtRxn8eD3ft8lXrNRXdny3+AR/spWY48tdJgzxWsgV rhu17Ltj+t+my8BCiRKIghpGN7Me7s1iIm5QU/zVBV1RXjqsoOeHKQpvdBt2j3vfLh6s qDAhp+OMZp1XGWxkDFYzLCftN2x0lICDsMQklABilZoz4Cuj+5IND9ouUuws6zhiqC4J lzDQ== 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=b+Ph6oLBNud09yeKziOGHOeZzPdVlwgT/NYdwJyJwDc=; fh=jzXLxdnvd+xmbBv9+2oN706jbly2zKnVnrKkDHhWt3o=; b=yYFdOJ0r6iL59ZICKYsJc9eVFIimU/JtqzhG1xdLryhzUZCiqaREH0k7oVPvdvkAJh kQ/O785BuxHYeT86B3G0cLMDBBA4q+WEz0iKLdrQwfNnp3q9z4ugTWWbcIRyCRTbXc+C +t/B/4ZTk8A8o6a3fzR0j12+eWJm+G9qdukqoP3fbVwTLTMp5rOwQRt4fsrCeft5DGME 1+8C5ycNCNnM3qnu1VvxkTT4sSd+wXeoHEzoEolN4Dk5t3ZliYx5T3baEwmGpduLli24 58pYuwRfr5KW868JP9Ascz9/DNKRb9+WG2WCkNUoES6m2ZqnAJk67HWINyB3kRPGOZ3n fYeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm2 header.b=XcXcHwRX; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="MZvuoPm/"; arc=pass (i=1 dkim=pass dkdomain=ljones.dev dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-193301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193301-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626c80060csi560011166b.176.2024.05.28.18.30.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 18:30:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm2 header.b=XcXcHwRX; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="MZvuoPm/"; arc=pass (i=1 dkim=pass dkdomain=ljones.dev dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-193301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193301-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 am.mirrors.kernel.org (Postfix) with ESMTPS id D38251F26ECB for ; Wed, 29 May 2024 01:30:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF37315AAD5; Wed, 29 May 2024 01:30:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="XcXcHwRX"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="MZvuoPm/" Received: from wfout4-smtp.messagingengine.com (wfout4-smtp.messagingengine.com [64.147.123.147]) (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 3BB687F6; Wed, 29 May 2024 01:30:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.147 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716946248; cv=none; b=se2UxX4DsgmNpRHYCNcNIlOZqAytkwPpvSwHt3hnnipnpexG5d5IXhjY/0TJaQ9mVlo1I7kRkwr3Y1KoV9K20XNgD2FijmudUtXYrZvQ/JrON9sSeYzx6h7vkR/4g1Y0Xigi6XBiKYIJqJKEhP72TUrTGct0pi3QTaga7rfiH2k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716946248; c=relaxed/simple; bh=Zxowav663I4us3VlL74j5SzvZntOcAZwBh3FnfjX6mk=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=Ih0tw7z9mSZfDgxZKlhnApdzArz8wBbh1/g+CQCJ8Ky5eem+f+BkV88BlW1TjDPB5BLw8J1zLMHsm0DSdxTlK/CaJKY+sAFxnZqa6BrNfiLmdSa2M46TwtHIzjCvN+MsQBtm0Y7K4Oqtb183uDLwdp9CCDGSvZwwVoNfwzI1DLY= 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=XcXcHwRX; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=MZvuoPm/; arc=none smtp.client-ip=64.147.123.147 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.west.internal (Postfix) with ESMTP id 18CF21C00190; Tue, 28 May 2024 21:30:46 -0400 (EDT) Received: from imap41 ([10.202.2.91]) by compute2.internal (MEProxy); Tue, 28 May 2024 21:30:46 -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=fm2; t=1716946245; x=1717032645; bh=b+Ph6oLBNu d09yeKziOGHOeZzPdVlwgT/NYdwJyJwDc=; b=XcXcHwRXWdw+cGws0gjW5HMN/X JgiA0zx3fiOoMp2sZn82GHBKG963xwnaUgs7LMe/VeDepST5FvegKWJaVJqem1WF eeSrERESb1CkbWQu9HRaRELmyTLMRgCzyINNDqkn/gyvZXUSzlQ1X5b1NJ7K77Ao 8/EQUW5tppNiLlibAErE9kFR15B68tUTOwQvUua3tQ/6xf+YAyZZLnmaYbaWEZw0 TQakQr9WW8lz8Uki931s4e9q00+8lrihGzyLyxzW/cEx62U4hsAS5MFYXedUj+IR hBPV2rU7+EGOdrBGmW2ZkiBYBzpBMd40biSJGQEZJSgcRC6f5pFdjbVihhtA== 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=1716946245; x=1717032645; bh=b+Ph6oLBNud09yeKziOGHOeZzPdV lwgT/NYdwJyJwDc=; b=MZvuoPm/2aY3dqSWunai1Nr0VkKYDCg/L7o48vZov6vo FFn3ud2Wu0mq+aXSmEoL8tABaSzSW8QfkNuciUrqbPruJONox10JAJw50/sTNX6q LRpyWop+8/vGjt6PmNJrHkhiY4k7GejCf+4DYkYIY5QvON3oYo+8Cik8+WBujGRn fr7GBL8ymDuebIl+/7ub9mjPFTdw2VlBlyIB1Q7EIE9DX6hV7Pg7NU+1fTYft+NY T809Gcxu36yNDYpXN3FeqF2hNyoG5mHlTK7Pkp1SPWsDS8w8WIlALftaDhvq359U DNS+qk0oO8ev4v9wadWW/vhaxo7jp4d1Hx1L5U18zQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdejledggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedfnfhu khgvucflohhnvghsfdcuoehluhhkvgeslhhjohhnvghsrdguvghvqeenucggtffrrghtth gvrhhnpeelffevveffhfeuteetteevteelteduudfgjedvleejteetlefhieeiudfgveel feenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheplhhukhgvsehljhhonhgvshdruggvvh X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6C8322340080; Tue, 28 May 2024 21:30:45 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-491-g033e30d24-fm-20240520.001-g033e30d2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: In-Reply-To: <20240529012447.145088-2-luke@ljones.dev> References: <20240529012447.145088-1-luke@ljones.dev> <20240529012447.145088-2-luke@ljones.dev> Date: Wed, 29 May 2024 13:30:25 +1200 From: "Luke Jones" To: "Jiri Kosina" Cc: "Hans de Goede" , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , corentin.chary@gmail.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, bentiss@kernel.org Subject: Re: [PATCH v1 2/2] hid-asus: change the report_id used for HID LED control Content-Type: text/plain Sorry about the doubleup. Wifi is spotty and it looked like the initial send didn't work. See https://lore.kernel.org/linux-input/20240529012827.146005-1-luke@ljones.dev/T/#t for cover-letter On Wed, 29 May 2024, at 1:24 PM, Luke D. Jones wrote: > On some laptops the report_id used for LED brightness control must be > 0x5D instead of 0x5A. > > Signed-off-by: Luke D. Jones > --- > drivers/hid/hid-asus.c | 26 +++++++++++++++++++++++++- > 1 file changed, 25 insertions(+), 1 deletion(-) > > diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c > index 4cba8e143031..ec3556cc4eef 100644 > --- a/drivers/hid/hid-asus.c > +++ b/drivers/hid/hid-asus.c > @@ -94,6 +94,8 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad"); > > #define TRKID_SGN ((TRKID_MAX + 1) >> 1) > > +static const char * const use_alt_led_report_id[] = { "GU605", "GA403" }; > + > struct asus_kbd_leds { > struct led_classdev cdev; > struct hid_device *hdev; > @@ -101,6 +103,7 @@ struct asus_kbd_leds { > unsigned int brightness; > spinlock_t lock; > bool removed; > + int report_id; > }; > > struct asus_touchpad_info { > @@ -473,7 +476,7 @@ static enum led_brightness asus_kbd_backlight_get(struct led_classdev *led_cdev) > static void asus_kbd_backlight_work(struct work_struct *work) > { > struct asus_kbd_leds *led = container_of(work, struct asus_kbd_leds, work); > - u8 buf[] = { FEATURE_KBD_REPORT_ID, 0xba, 0xc5, 0xc4, 0x00 }; > + u8 buf[] = { led->report_id, 0xba, 0xc5, 0xc4, 0x00 }; > int ret; > unsigned long flags; > > @@ -513,6 +516,23 @@ static bool asus_kbd_wmi_led_control_present(struct hid_device *hdev) > return !!(value & ASUS_WMI_DSTS_PRESENCE_BIT); > } > > +static bool asus_kbd_is_input_led(void) > +{ > + const char *product; > + int i; > + > + product = dmi_get_system_info(DMI_PRODUCT_NAME); > + if (!product) > + return false; > + > + for (i = 0; i < ARRAY_SIZE(use_alt_led_report_id); i++) { > + if (strstr(product, use_alt_led_report_id[i])) > + return true; > + } > + > + return false; > +} > + > static int asus_kbd_register_leds(struct hid_device *hdev) > { > struct asus_drvdata *drvdata = hid_get_drvdata(hdev); > @@ -555,6 +575,10 @@ static int asus_kbd_register_leds(struct hid_device *hdev) > if (!drvdata->kbd_backlight) > return -ENOMEM; > > + drvdata->kbd_backlight->report_id = FEATURE_KBD_REPORT_ID; > + if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD && asus_kbd_is_input_led()) > + drvdata->kbd_backlight->report_id = FEATURE_KBD_LED_REPORT_ID1; > + > drvdata->kbd_backlight->removed = false; > drvdata->kbd_backlight->brightness = 0; > drvdata->kbd_backlight->hdev = hdev; > -- > 2.45.1 > >