Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1489918pxb; Thu, 24 Mar 2022 22:37:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKkRopUUivVYL0SsT12IzPQKQQmL1zk1wxpY+Ej7t2CfDjvY6ueD93JlyB7Rf74pdBg4YQ X-Received: by 2002:a17:902:f605:b0:154:aa89:bd13 with SMTP id n5-20020a170902f60500b00154aa89bd13mr9851781plg.112.1648186646621; Thu, 24 Mar 2022 22:37:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648186646; cv=none; d=google.com; s=arc-20160816; b=uOQbXgzQFRFa/FfYmzw9KtW1fPhfS/dBaclfuOeYH7EpvtAsVzVK3ai4zxXfYOE7aL qX4M8GWDTQec+J2JF4DAoUbSzElqrGEBd0c7/Pc+KiE+T4dO1dJGt12FD3Z0Tyt1J9X1 gJEq5fftOVd7XQ8pGBdC83ASh1pnTi3p5lkkNGrk9Mr7riVFixQ03+/cFpfE6YdBxV5Y pDTBtRz750cGFYhB5Lrk/EPgXRK7sZ4FegIJC7jLrIb+oy9ZxjsWT71rR2wUKxvY/eLA vmJl2XAWZ0svr4JMT/PsG4kEypL42ipl1+cguVrXo1MoX5hGjw8iouXRwue7eA99Tj4l 6+3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=mdYDWTYECuLIafc6e23p/YKZqEma3phzCNCrwtbaXcs=; b=VofZAjEdh9W5Pjb/6llCwlYYYOidTK36Segs1CNXCsGfUa/zzrfBYtr9OMy0UOhPYc aTF3stMyW8gu4KO0nEiHrCHwDplIIaqID2vsMgwWqWTyaisOXXid3pSPaSDgFJUTfQL2 w40gcq7vZI324ntGqoPbkPXYmRnA7Xt52GguITT1k5WlFzpBnlXCsim7yk1n/NYFYVUN ha+YRq2WacpyofeEXU5vzs/ebObz69ToN8eHcx50TBpncaNgVpsF8Fy+W7J9vIfyOZJq I6zDloUe0scSUyz2ZBeUpjrPwfqgs73eSNRR8UXlkVF1/6tEt5+8U9l1dsZng61+3VbE xi+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aqwg0EG5; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f27-20020a63101b000000b003816043f018si1290160pgl.525.2022.03.24.22.37.11; Thu, 24 Mar 2022 22:37:26 -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=@redhat.com header.s=mimecast20190719 header.b=aqwg0EG5; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353079AbiCXT4S (ORCPT + 99 others); Thu, 24 Mar 2022 15:56:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232830AbiCXT4Q (ORCPT ); Thu, 24 Mar 2022 15:56:16 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E9482A1458 for ; Thu, 24 Mar 2022 12:54:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648151683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mdYDWTYECuLIafc6e23p/YKZqEma3phzCNCrwtbaXcs=; b=aqwg0EG5G0nHN/V8oaJyO8H6Knh7H1kTnpVRV/bMS42lGTTzYQ0ekRxKZ/WZyy8bMiDYeT Q9oxD2MN47uK/dxmCIo47r655SgF6oFKxYo7Mw2zxMT0vKoZtW0ZQTOkuA93Zqg5RKeoQe POy8h//JfyS3La7LdnKaW26i9ukXjBc= Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-225-hqhBF7IwNzKMkVK6ka3Yuw-1; Thu, 24 Mar 2022 15:54:41 -0400 X-MC-Unique: hqhBF7IwNzKMkVK6ka3Yuw-1 Received: by mail-pg1-f200.google.com with SMTP id l6-20020a637006000000b003811a27370aso2791074pgc.2 for ; Thu, 24 Mar 2022 12:54:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=mdYDWTYECuLIafc6e23p/YKZqEma3phzCNCrwtbaXcs=; b=fNy94ri8bQx5o7aQGawl4M7koHbgE7+pRFU6pp9fgESfkRNtFc05XxB6JH9zp2cz19 4lrmfAhJFhgKpyRcTXpkMK5uZ4fXOymCXuINsXVWGWVD1/YmSSYpiaebuNsaudEWiDwI qAlEF2u6i5XPo19fvtefOMKTP0zr61vldmnTCyz3fV11hXc69c+sD4SQKBlMJQ2HxRqD HpWpZapej7CJqGyg1SH3m8B6DCPp03yYDyN5bi3yuMtLZUzNWfGasNFuYvO8EOXh4TOQ fbYiH/5mEIn+bDnDuAo9wJ7oVW3ZBsNuyEbfCUh8i5PpcsTRN3akrwSrwu21AwO9hZoj yxFw== X-Gm-Message-State: AOAM5321a6NwU3HSw+k86kiIkgkR3GCbPBsbsCb1rAdMTnMkbsbZWTMZ UKND7qP+vB9mJrmjlWh3zP+BU+P1vx34mcKIgzpvzjFQLflNfVAuyq0NvI9FnZQCxJevQe45kLP mMOsnD8YKQpMVif2lGJ/b2E3ZObD1Sw4Kl+wRWGYT X-Received: by 2002:a65:5bc3:0:b0:378:4f82:d73d with SMTP id o3-20020a655bc3000000b003784f82d73dmr5280055pgr.191.1648151680349; Thu, 24 Mar 2022 12:54:40 -0700 (PDT) X-Received: by 2002:a65:5bc3:0:b0:378:4f82:d73d with SMTP id o3-20020a655bc3000000b003784f82d73dmr5280039pgr.191.1648151680008; Thu, 24 Mar 2022 12:54:40 -0700 (PDT) MIME-Version: 1.0 References: <275245e8048fa124055d9ff3d10ce6562294483a.camel@riseup.net> In-Reply-To: From: Benjamin Tissoires Date: Thu, 24 Mar 2022 20:54:29 +0100 Message-ID: Subject: Re: [PATCH] HID: logitech-hidpp: support Color LED feature (8071). To: =?UTF-8?Q?Manuel_Sch=C3=B6nlaub?= Cc: =?UTF-8?Q?Filipe_La=C3=ADns?= , Jiri Kosina , "open list:HID CORE LAYER" , lkml Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 Thu, Mar 24, 2022 at 4:34 AM Manuel Sch=C3=B6nlaub wrote: > > On Wed, Mar 23, 2022 at 09:22:49PM +0000, Filipe La=C3=ADns wrote: > > On Tue, 2022-03-08 at 16:50 -0700, Manuel Sch=C3=B6nlaub wrote: > > > The HID++ protocol allows to set multicolor (RGB) to a static color. > > > Multiple of such LED zones per device are supported. > > > This patch exports said LEDs so that they can be set from userspace. > > > > > > Signed-off-by: Manuel Sch=C3=B6nlaub > > > --- > > > drivers/hid/hid-logitech-hidpp.c | 188 +++++++++++++++++++++++++++++= ++ > > > 1 file changed, 188 insertions(+) > > > > *snip* > > > > Hi Manuel, > > > > Thanks for putting this forward, although I am not sure if this is the = best way > > to handle this. > > > > Before anything, could you elaborate a bit on what lead to you wanting = this? > > > > There are a couple of reasons why merging this in the kernel might be > > problematic. > > > > 1) I don't think we will ever support the full capabilities of the devi= ces, so > > configuration via userspace apps will always be required, and here we a= re > > introducing a weird line between the two. > > > > 2) There is already an ecosystem of userspace configuration apps, with = which > > this would conflict. They might not be in the best maintenance state du= e to lack > > of time from the maintainers, but moving this functionality to the kern= el, which > > is harder change, and harder to ship to users, will only make that wors= e. > > > > Cheers, > > Filipe La=C3=ADns > > Hi Filipe, > > sure. > > While I realize that there is e.g. ratbagd which supports a great deal of= the > HIDPP features and should allow you to control LEDs, unfortunately for my= G305 > it does not support the LED (and as far as I remember my G403 does not > work at all with it). > > Then I figured that actually having the LEDs in kernel would allow led tr= iggers > to work with them, so you could do fancy stuff like showing disk or CPU a= ctivity > or free physical memory... and here we are now. The one thing that concerns me with those gaming LEDs, is that there is much more than just color/intensity. Those LEDs have effects that you can enable (breathing, pulse, color changing, etc...) and I am not sure how much you are going to be able to sync with the simple LED class. > > As for supporting the full capabilities of these devices: The patch just = adds > RGB leds, which is something already quite standardized in the linux kern= el for > a variety of devices. > Some roccat mice even have support for changing the actual DPI in their k= ernel > driver, which arguably is a whole different story though and not scope of= this patch. > There are also other features (like on-board profiles) which I would defi= nitely > see being better off in user space, especially as long as there is no add= itional > benefit in having them in the kernel. > > Regarding the conflict in userspace: ratbagd currently seems to always wr= ite > LED state in RAM and the on-board profiles at the same time, so I would > argue that the use case here is different: The user space tools want to > set the LED color in a persistent way, while here we want to have interac= tion with > LED triggers and a more transient way. E.g. the driver would overwrite > only the transient LED color, not the onboard-profiles. > > If that is already too much, what about a module option that allows a use= r to > deactivate the feature? Please no. I am tired of having way too many options that nobody uses except for a couple of people and we can not remove/change them because of those 2 persons. Either you manage to sync the LED class state somehow (in a sensible manner), or I don't think having such LEDs in the kernel is a good thing because we are going to fight against userspace. Cheers, Benjamin > > Best Regards, > > Manuel >