Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5667880rwb; Tue, 9 Aug 2022 01:53:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR5+ip5CY5yg59LptJwmpI9N/OHQtZCiBF7YjDfeS+mDK7Mz54x7wriTtoIqv1p6jNj6qB1O X-Received: by 2002:aa7:cd51:0:b0:440:595d:aeed with SMTP id v17-20020aa7cd51000000b00440595daeedmr13054883edw.143.1660035223908; Tue, 09 Aug 2022 01:53:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660035223; cv=none; d=google.com; s=arc-20160816; b=v6450W6R3bYqKyMqNFeFEFvUcCVOEb4KZpZJXfnH0aKW2u3Nxls6KZ+44voZSRA8rW Sgvrb94XevVZ+YllTcCRmholkMpM7Q08K3vq0X8lxKLNhmKtWsuJA4LXC0uXozWRF+gc /E3KHOPLj1RRd3AcQgnN1itlE6UFqecPkW3JAx7pTkIl6/ALqdeJXEtKizHhtNjiEUvi SZIWBsV/XL7r87/fqJACTPvhZWI/be9Wnr8dAmVvXhsDP7vUjEaZrQJQ4pB91d62/ubi 305BK7PhCtLrDX4+w0o3HuZu0Gtf2Ern1FqoH0n8fX8QSykDbK4aElkoAfugMDTlwa64 fHhA== 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=atLp2imtTuw79d2ygzD1oZH2HrahdMCGvtEG58ejNaM=; b=j+rLhSF5hlEestJvaCKRiny4kizX4TOBo15iQ7lF23gL8P57Ozhic6nQBb3aUdhcQc IBKpO4CHz34NX3aS17lNDuvV12gcqPpGLPrtAOvdbvd9pOC47LEsvnDH40taHOQm1lM3 WHy9mjICwaeluvfzKVVaBQuW/2JIzvqF5QRVY20x16r4S9RFCnmoqXP3JpG/c6kp8+Pf R7w5KMfcur6lPfbxapx3s9m+Qben593dD8C7PZuvKuoirdXEA4G02z9rvt5oKxY5+7Tn JFOFUueyy98u50ynDzrYT4zLh02yvqXCKhFnLfUTe76UGOizvz4MmPMMx4ZMOIkLnXBf AuLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UJ3RaIj6; 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 zk19-20020a17090733d300b007313013c1adsi1458555ejb.259.2022.08.09.01.53.17; Tue, 09 Aug 2022 01:53:43 -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=UJ3RaIj6; 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 S236190AbiHII3t (ORCPT + 99 others); Tue, 9 Aug 2022 04:29:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231545AbiHII3s (ORCPT ); Tue, 9 Aug 2022 04:29:48 -0400 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91FA9656D; Tue, 9 Aug 2022 01:29:47 -0700 (PDT) Received: by mail-qv1-xf32.google.com with SMTP id l18so8010557qvt.13; Tue, 09 Aug 2022 01:29:47 -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=atLp2imtTuw79d2ygzD1oZH2HrahdMCGvtEG58ejNaM=; b=UJ3RaIj6CaDvFVKBXqaBm5uH8j7ybaSbEYHtAKuTGsAlTctYhmT2717QZyLImA9fRe n0wQ35iMTC8z8wZdc3XaJF/rpF5GCS/T+kQhOGWztSq5+6sWRhe5CnSGaYd1MAm0r05r rwHPEGXoDIvL33flYx4a/HVPB4WKFiHQse/lxwwG/VWDJXzEowDwRQyzcqnA5bkuzLjK hM/x2DF62aeEfeErrHpH7/maOBppYsfdP0837SLlAvnNiZ/ckV5hU5e96ziQfaEc40KH LMlTsaX/un6uEAfTDKKxwqK1iMfglliFPMXBbkyMa20+vS4Kzxb1Q7WxjCJf3Sl0xhS7 yVTg== 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=atLp2imtTuw79d2ygzD1oZH2HrahdMCGvtEG58ejNaM=; b=3Yua8ZYUiWOtnsL+8v8VJi7KnDmxKH2ZaQmBrAzEN74SBXBx7ElNb9IpvgymFVn9GR WsaRuyOeapRaLH8Ig/GBGWPM7EQjxRM4mvhF5VcnA0HQGyjuNwuJNAlyhiDitxxR3HY4 wgpmskoqNbbHTx3yWpey83A7w+bACROYM3d8+O6KoTHj+/o75usFYOYKRPZBBr1jMfSQ Lo7ZS5keRkmSeS98FmWTmaRzrdlC1Jzh57jGrJ1R1DmXMeFe00u8RHkpNJyt/JUo/GDE wveUVFXsBiFP8cBXoTOS6MIS8et+E8EahgR3lqT7ODiZ+83ObVhozhvf2tdvgWStdfH3 zSoQ== X-Gm-Message-State: ACgBeo05+W1xqzzM8a0/BtfhZMaJ2Z4UBj8KwJ5OQ6WhNDASpOodT7Y+ 6ZRUbk73GWxZEmpJsGP3RqHWma2XmnZ8toAWi1xW6Iu1Uvw= X-Received: by 2002:ad4:5baf:0:b0:476:6a9e:b5e1 with SMTP id 15-20020ad45baf000000b004766a9eb5e1mr18992238qvq.64.1660033786643; Tue, 09 Aug 2022 01:29:46 -0700 (PDT) MIME-Version: 1.0 References: <20220808030420.8633-1-luke@ljones.dev> <20220808030420.8633-4-luke@ljones.dev> In-Reply-To: From: Andy Shevchenko Date: Tue, 9 Aug 2022 10:29:09 +0200 Message-ID: Subject: Re: [PATCH v2 3/6] asus-wmi: Implement TUF laptop keyboard power states 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 Tue, Aug 9, 2022 at 1:27 AM Luke Jones wrote: ... > >> + if (sscanf(buf, "%hhd %hhd %hhd %hhd %hhd", &save, &boot, > >> &awake, &sleep, &keyboard) != 5) > >> + return -EINVAL; > > > > Same Q here: wouldn't it be better to put each of the parameters to a > > separate sysfs node? Or look at the LED ABI (that what Pavel mentioned > > for multi-color patterns) and see if there are already some > > established ways of how to represent necessary information? > > Same argument I make for the RGB mode nodes. But here I think it's > probably even more pertinent. The reasons I would like to keep this as > one node are: > > - It's separate to the RGB part > - We can't read the device to set defaults on boot Hmm... Maybe it's done via one of the WMI calls? > - Because of the above, if we set a default and the user wants to > change perhaps "sleep", then we're going to have to write some > incorrect guess data since the write requires all the flags at once > - One way to improve the UX is to add _show, but then this has to > display incorrect data on boot > - We end up with 5 more nodes > > The same reasons above apply to the RGB nodes, which right now I'm of > two minds about. We'll see which way the RGB mode patch goes after some > daily use. I just realized that in previous mail I mentioned Device Tree which is irrelevant here. We can't use it on x86 traditional platforms, so it means that platform should somehow pass the data to the OS one way or another. If there is no way to read back (bad designed interfaces), then we can only reset to whatever user provides. -- With Best Regards, Andy Shevchenko