Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2822797rwb; Fri, 16 Dec 2022 07:00:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf4r2G1tKkdA28cZoKAIXhcr3ThJQxTdWDn5VIpaCLfuMWO9yDd0AlqZPegFEAshvW011gSi X-Received: by 2002:aa7:cad7:0:b0:461:b693:3d61 with SMTP id l23-20020aa7cad7000000b00461b6933d61mr28606891edt.6.1671202852888; Fri, 16 Dec 2022 07:00:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671202852; cv=none; d=google.com; s=arc-20160816; b=P0tBTM+sngOHX3WdG+fgE2LGZLf+rtbAZRt7Fu+zyoXldqkwUPUvzhkejU68a6JnwB Fm4HHWYBKAvLABju6zB4ViggGYkAYOXAUoqAh+tKBjzDoZw1URQAzu/JRVLFWCsbiRQK Oz3aMnclF2HlujobG3xcK9KfH6oX1Gp8vTyTgx3S7upt4QPt6RSo8s+Lovu7I9vOkFCG xWLY/TTwMVOOwUJkD8dJBYsMW3l+CQBdr7QM98tnLKctQLqmDrkZ6PPN5XzctA/wHy2D 7QWbi0NL0O20/lLa7jQMpWXNLNHOVYZjawJwkheQlP9cBrq9Di7zlRyqzxqJjSWzsxEK aYPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :date:to:from:subject:message-id; bh=tcKYH8WW3PBiQdpM5ScWNkVfQ7EPPtVc+1QLYUuVP14=; b=iFk2GDwgxD/54DLcyQTJLPc545cgcrpzpRFiQU6DgqjP7+DWGDau8QURa2uyLPgKWt kA2UTXinAj7w6N91dGUgOIbXLI04EQCk/29tEyK5R+dxXnkG//eYNImosykr4RnTqQFw KVuylDipdnGgEqXN+Zz1j8H1Ki4aN0PQAkKhcrYnnprNuopIpG2SRtkHkvQLGTF5PqbK yg2NdiN+fDf/bBeIx8LH+7lNKNLS/nvIOOXZgx9Cn95t6a375d+zxLog8TcvBtps4Xif siGxr+e6wL299lSDp+sW1FssmrFIkdSX3fC+Ql5W+GqkDdU0HTOMyRxUHG8utvFBwQbc UnNw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020a17090658c700b007c4f75345e7si2627923ejs.458.2022.12.16.07.00.36; Fri, 16 Dec 2022 07:00:52 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231124AbiLPO1l (ORCPT + 69 others); Fri, 16 Dec 2022 09:27:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229754AbiLPO1j (ORCPT ); Fri, 16 Dec 2022 09:27:39 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [217.70.178.231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B509F50D77; Fri, 16 Dec 2022 06:27:37 -0800 (PST) Received: (Authenticated sender: hadess@hadess.net) by mail.gandi.net (Postfix) with ESMTPSA id 826E610000C; Fri, 16 Dec 2022 14:27:34 +0000 (UTC) Message-ID: Subject: Re: [PATCH] hid: Support for Litra Glow From: Bastien Nocera To: Andreas Bergmeier , Jiri Kosina , Benjamin Tissoires , Filipe =?ISO-8859-1?Q?La=EDns?= , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 16 Dec 2022 15:27:33 +0100 In-Reply-To: <8f00ae9463b07fbd789af3840cd59a9e99caff34.camel@hadess.net> References: <9fca69c7-cc24-63d0-98f6-80c28fc69a5@9300> <8f00ae9463b07fbd789af3840cd59a9e99caff34.camel@hadess.net> Content-Type: multipart/mixed; boundary="=-OvH/z0DPZjhe91+lGS7D" User-Agent: Evolution 3.46.2 (3.46.2-1.fc37) MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 --=-OvH/z0DPZjhe91+lGS7D Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2022-12-16 at 10:53 +0100, Bastien Nocera wrote: > On Thu, 2022-12-15 at 22:09 +0100, Andreas Bergmeier wrote: > > Tries to implement as general support for Illumination Light as > > possible. Note that it is singular, which means by Logitech spec we > > are > > fine off with just handling one capability/device. >=20 > Your email client absolutely trashed the patch's indentation, it's > unreadable as-is. >=20 > > Implementation currently only exposes Brightness and On/Off > > controls. > > Does currently not expose Color Temperature because LEDs does not > > support it. > >=20 > > Introduces HIDPP_QUIRK_CLASS_SIMPLE_START to prevent reconnect on > > startup. Could not get Glow to work with that. >=20 > I'd really rather we didn't introduce a new quirk, but instead fixed > the fact that we need to restart the HID transport to support 3 (!) > devices. >=20 > Would something like the attached patch work? I haven't tested it > yet, > but if it works for you, I'll test it on the devices I have here. A tested version attached. I'll need to test it against a T650 before sending it for review. --=-OvH/z0DPZjhe91+lGS7D Content-Disposition: attachment; filename*0=0001-HID-logitech-hidpp-Don-t-restart-communication-if-no.pat; filename*1=ch Content-Type: text/x-patch; name="0001-HID-logitech-hidpp-Don-t-restart-communication-if-no.patch"; charset="UTF-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