Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5611841rwb; Tue, 9 Aug 2022 00:33:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR6aQxr1lcM59fuQUCpMXhSYe2d854/Qr0RarMS5tzYGGE2VgMXHbba9NJq4ZFAKBd/QyIYc X-Received: by 2002:a17:907:d08:b0:72f:b107:c07a with SMTP id gn8-20020a1709070d0800b0072fb107c07amr16353298ejc.340.1660030412637; Tue, 09 Aug 2022 00:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660030412; cv=none; d=google.com; s=arc-20160816; b=J85HZEUsPyvPC7vdRi7Y9jnYqMO3wUXmfTI4UGIW7d9HWIhowyYp7ezRnNcntcPKbZ olSyYJx5FLbKxBLYVClmNrheJV3RPntOkS5JxKqCB++ZdgdzY6mEJb94glmmzxzgo5gc SVRT9GMpE/Qf0ci+MzT+4vHGKRZQPFWVdWF78k5mZhfKDPz2NkLAU551znAw2ut5qQlZ pai6irQ2tWae7dQDIGkHueEs7RitxsGuzFHT+Q7eaSRuiuIGDprGXEVTvQBHcujHi0U/ zAJteyMlHQ6RV7UcUwe5RVhURx394aXh06Vyx0/4FO7LJLARgp2CmBkeFyQnNa6t5nSl XjMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Ewp+5qWhXCvBt991DQD6+zymRA8iDfvlDFfMmvB+0a4=; b=UHtXh1WZ5am76WACoQq0hxoW2Ry6dQFKjeE8U80lQJS6n2/hvUCC57YG1xT8CmK8pn y+UOTyqN0/6l+Nr4sps2l6g7AHq2/It7Yc9EkqlehdSbOP6skuTrbY3LkbZl1mDsb1Hm tbIsDDANWJVc6kRIUhWvYdaXei0D82rYls1eK1AZW7rgMoIf0KJCyAEIygkf5eLTmjQK yzNi1rNDxebTqWlSIOYr2cJjWI/zA+28ZvJk7755ZrL/uKf95mQLkVTOgZn9nRBr32G0 DBpcbrSWtnn16vKKEG/iaNRhaaRlTErZ743JweiuE1JwMeeD6uxeDntrYGgJhbGoAXu3 nL0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cHxXURJ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr10-20020a1709073f8a00b0073069573e2esi1393460ejc.667.2022.08.09.00.33.06; Tue, 09 Aug 2022 00:33:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cHxXURJ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233614AbiHIHVT (ORCPT + 99 others); Tue, 9 Aug 2022 03:21:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236313AbiHIHVM (ORCPT ); Tue, 9 Aug 2022 03:21:12 -0400 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 612E820F76; Tue, 9 Aug 2022 00:21:10 -0700 (PDT) Received: by mail-qk1-x72d.google.com with SMTP id b24so1720577qka.5; Tue, 09 Aug 2022 00:21:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=Ewp+5qWhXCvBt991DQD6+zymRA8iDfvlDFfMmvB+0a4=; b=cHxXURJ4qdC0PRqfs/Rqyhlqxif/QqExsU0VzM1rJRamsvm7Df7euPEo7UoRPTP6lI Ipi7F0SpeMjoQkBvkaFKygMuF0M95GfMz5wBaA8zLop8Z8ImS+wtsJIv/f7Jx0Z9QFOH vSCB1M+gHv5JEa4XAvQKWRn6zYXJtZFHHOlEVFA/2eADIZIOAZA+ATZv7EzRCeu8BxO8 rokyLIJScYwRYY5Xj4lRYksJW7jUppHWtK8Dy4qceb9Q7sUMo6QklzDp2EGxDobEjeam 66mpiRDm+ww6mvjZ9svyAdrlYnoi9xwfHitWQcLW+3OC5c9uKZONV6Ix9oIxOoZtPyKS V/8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=Ewp+5qWhXCvBt991DQD6+zymRA8iDfvlDFfMmvB+0a4=; b=t5Nk85pTTfut428eSfENLNB8PmW/GStI/KDYozFydHfobV5OsMfiymFAZvoso0Q/3f jI4xrLkO8UwJKUvan7KhQ3yngakbPr24pEwClw352QZpjhXo3X0FlE2UD1g8zOr1CauC 5D9F9rOhCO397WLcSRkYIJ7NLUbVXnMmgnykzP81g/kZkzOMzfqKrCaIrH/W0mP6OGBq bZIM30udo++e3Esm6T/uewdMc+sqjcGzjgpu1/9OdALYnzbkaWU1DgD/DRSD3eI2YvMo bP6XqHWuA0baQRRkDfHckoHZlt4y1k5uWrwYNxH0t152rdyhsgL5ZHZqjDymih313biA 2ZYw== X-Gm-Message-State: ACgBeo2SvJL8UgE3t5bIM/MWcWEY9MeZGCtcNAGckDMTJBuMWxepPrxZ M5oRjC0LfiqIzr4avL036bBLXYk16vt2RI/61i0OEBJAG10= X-Received: by 2002:a05:620a:254d:b0:6ab:84b8:25eb with SMTP id s13-20020a05620a254d00b006ab84b825ebmr16521415qko.383.1660029669459; Tue, 09 Aug 2022 00:21:09 -0700 (PDT) MIME-Version: 1.0 References: <20220808030420.8633-1-luke@ljones.dev> <20220808030420.8633-3-luke@ljones.dev> In-Reply-To: From: Andy Shevchenko Date: Tue, 9 Aug 2022 09:20:32 +0200 Message-ID: Subject: Re: [PATCH v2 2/6] asus-wmi: Implement TUF laptop keyboard LED modes To: Luke Jones Cc: Hans de Goede , Mark Gross , Platform Driver , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 8, 2022 at 11:43 PM Luke Jones wrote: ... > >> + if (sscanf(buf, "%hhd %hhd %hhd", &save, &mode, &speed) != > >> 3) > >> + return -EINVAL; > > > > Same comment as per v1. > > You wrote: > > > Usually we have three separate nodes for that, but they are kinda > > hidden in one driver, so I don't care much. > > I think that is the wrong direction to take. Doing so would mean that > every write to one of these values has to write-out to device. I don't > know how long writes on an i2c device take, but on the USB connected > versions they are 1ms, which means that to individually set colour, > save, mode, speed (also direction and sometimes a 2nd colour on USB) > adds up to 4-6ms - and I don't know what sort of impact that has in the > kernel itself, but I do know that users expect there to be fancy > effects available on par with Windows (like audio equalizer visuals on > the RGB, something that is in progress in asusctl). This is a good justification, but easy to workaround by using another node like "submit" or unifying it with one of the existing nodes implicitly (like setting savee will submit all changes at once). > Using multicolor LED class already breaks away from having a single > packet write, but the gain in API scope was worth the compromise. > Hopefully we can keep the single set of parameters here? > > Pavel suggested using triggers, I've yet to look at that, but will do > so after finalising this. The thing is you can't "finalize" this and go to another type of ABI, because we come with two ABIs - we may not drop the old one once it's established (yes, there are exceptions, but it's rare). So, knowing that we would drop an ABI we mustn't introduce it in the first place. > I suppose one alternative would be to store speed and mode as > attributes, but not write out until the "save" node is written to? Yes! > So > this raises the question of: we can't read from device, and speed+mode > must be saved in module for use with "save" now, should I then allow > showing these values in a _show? On fresh boot they will be incorrect.. Yep, they should be reset either by hardware, or provided somehow (device tree?) from the platform knowing what firmware sets and what kernel may use if you don't want to change the settings. > I'm going to go ahead and split those parameters in to individual nodes > now anyway - it may help with later work using triggers. Okay! -- With Best Regards, Andy Shevchenko