From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1845DC19F2D for ; Tue, 9 Aug 2022 08:58:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239249AbiHII6h (ORCPT ); Tue, 9 Aug 2022 04:58:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231147AbiHII6b (ORCPT ); Tue, 9 Aug 2022 04:58:31 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34F6E220FF; Tue, 9 Aug 2022 01:58:31 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 98B2E5C0107; Tue, 9 Aug 2022 04:58:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 09 Aug 2022 04:58:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1660035510; x=1660121910; bh=G2NhCb66cb 19eINodXsc2D+4/M/84dcn7QljyzSwVWg=; b=koXXtds2oHmQJyH6Qn+1botDjJ 74bB5oOkvE8JpeBjk/n3kQrf0aBVpcPc6aoyg1BAnGtkpJRA1IJtZCOZXmdFY3Jx 39pOk4ajHm0296SOxEl0oQLmW2+PfSkz3qE9q6h9ijyQuYKriU1eW2ACiQJjYmMy Wa84SAXb75NPyH+hU+IfOoEXhYz/iw3hVZhy0HsG1DI0k1ldBFPnYyn5MTpNr5UE SwSQJREJMpq6BsimScgy6jYERUvbCSgy6xTNhZIz3f3CSZ56c6eW00mwckuZ9mcB 7mK401DqvNPwYjkVWEO01JRS+THa1YqOjmO52N5f11VwY6baXIvFZNSaW0wQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1660035510; x=1660121910; bh=G2NhCb66cb19eINodXsc2D+4/M/8 4dcn7QljyzSwVWg=; b=WhbaeE9kQ4DppP8fW7HJQiuP+ZXn/vT9/nf4pIIzapN1 Dzu7MRr5KNSr4lA//H+zA5CTbXfsfLPWLur9IWQ/AoaA5O/oLqXKFSBGbx14/Ar/ nfXU27f55T9I+nlFYd7jo8IGdb+5WIXvlJnzn7NgmZKDhUGWHGnhL3CR61pyB0mp rcEQEx0BodHUnNOAb/0DS8wMRIAjUegWl1T9k63a93ych4O5uM1Xw65gd4kyuP3d ShmVGuh+Dp1LMEj3jOqqdndCNW1vyhguxA3o8UTFLjJUHowoBfptLdp+1mfOGpf/ Ubn7UWHE+btPut7m9RjqrzXGE+wfNsney0CFO0qhIg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdegtddgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhuffvvefkjghfofggtgesthdtredtredtvdenucfhrhhomhepnfhukhgv ucflohhnvghsuceolhhukhgvsehljhhonhgvshdruggvvheqnecuggftrfgrthhtvghrnh epvddvgeeltdehfeeijefgveegfeeihfdtveetfeetudfhvedtfeeltefhteegledunecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhhukhgvse hljhhonhgvshdruggvvh X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Aug 2022 04:58:24 -0400 (EDT) Date: Tue, 09 Aug 2022 20:58:12 +1200 From: Luke Jones Subject: Re: [PATCH v3 3/6] asus-wmi: Implement TUF laptop keyboard power states To: Andy Shevchenko Cc: Hans de Goede , =?iso-8859-2?q?Barnab=E1s_P=F5cze?= , Pavel Machek , Platform Driver , Linux Kernel Mailing List Message-Id: <0LBCGR.NDLPJAR4JTJQ@ljones.dev> In-Reply-To: References: <20220809025054.1626339-1-luke@ljones.dev> <20220809025054.1626339-4-luke@ljones.dev> X-Mailer: geary/40.0 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, On Tue, Aug 9 2022 at 10:52:21 +0200, Andy Shevchenko wrote: > On Tue, Aug 9, 2022 at 4:51 AM Luke D. Jones wrote: >> >> Adds support for setting various power states of TUF keyboards. >> These states are combinations of: >> - boot, set if a boot animation is shown on keyboard >> - awake, set if the keyboard LEDs are visible while laptop is on >> - sleep, set if an animation is displayed while the laptop is >> suspended >> - keyboard (unknown effect) >> >> Adds two sysfs attributes to asus-nb-wmi: >> - keyboard_rgb_state >> - keyboard_rgb_state_index > > ... > >> until the keyboard_rgb_save attribute is set >> (write-only): >> * 0 - slow >> * 1 - medium >> - * 2 - fast >> \ No newline at end of file > > ^^^ > >> + * 2 - fast >> + >> +What: /sys/devices/platform//keyboard_rgb_state >> +Date: Aug 2022 >> +KernelVersion: 6.1 >> +Contact: "Luke Jones" >> +Description: >> + Set some RGB keyboard power states (write-only). >> + >> + The accepted input is "boot awake sleep keyboard", >> where "n n n n n" >> + options are: >> + * save - 0 or 1, if 0 then settings are not >> retained on boot >> + * boot - 0 or 1, controls if a boot >> animation is shown >> + * awake - 0 or 1, controls if the keyboard >> LED are on during awake >> + * sleep - 0 or 1, controls if a suspended >> animation is shown. >> + This is only active >> if the AC is connected. >> + * keyboard - 0 or 1, unknown what effect >> this really has >> \ No newline at end of file > > ^^^ > > Be sure of not repeating the same mistake. I.e. add a newline as > suggested. > > >> + flags = 0; > > Seems you ignored my comment here... > >> + if (sscanf(buf, "%hhd %hhd %hhd %hhd %hhd", &save, &boot, >> &awake, &sleep, &keyboard) != 5 >> + return -EINVAL; > >> + save = save == 0 ? 0x0100 : 0x0000; > > ...and here... > >> + if (boot) >> + flags |= 0x02; >> + if (awake) >> + flags |= 0x08; >> + if (sleep) >> + flags |= 0x20; >> + if (keyboard) >> + flags |= 0x80; > > ...and here. > Umm... I know for sure I fixed all those. I must have screwed up a git rebase :( I'll fix again.