Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1162755pxb; Thu, 24 Mar 2022 14:06:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiZ5YtHWl3aCRzta6wEgG59oEcEWluKgFp4ymA3GhK8AUTdf4zNpuwss7KK79zVgatmI+J X-Received: by 2002:a17:907:1c89:b0:6e0:cc9:345a with SMTP id nb9-20020a1709071c8900b006e00cc9345amr7882746ejc.332.1648155982410; Thu, 24 Mar 2022 14:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648155982; cv=none; d=google.com; s=arc-20160816; b=E5uN30YTXvSQT4f/a0svrWTbxVW10pH9PjNbthuyzJ8Ymx1vIiKF6K/fVdnsjEVaws rOlPN7nmSq5Nnf2UDLVYtOL3ocnbgk25D4Yij+sjL7DHVZgDvG2HKSfghom5qywYbIrG mg7PPmvDtBeGNnlID1Jx0wimpYKbhCXA6pcixCaQEk8Y7aXT/oH+Ft/HJ5XJlARsH7CV pOEicG3IDa5ZGrMqKa1k6Gd7DV/kPwo9cRbYpnb3rfDpVNTw8uR9t/k1nzgQFnyK7rpb Z6oWmeu1gdERcJnRBDeyADB5+NjeIKdo8MtVnGr3GYJtwgNFToGs/PQdaC+3nkqqUHwg Ki7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3qclwzwUGtDFwZwOazh4jA3jMuR+ekMkvwqZKLbIrEo=; b=biWd+DYZvjfm42GE3teykuuVtrvhR/hoLEoTobh76/ucyUYgbEqPUMubsnxpXSvtT/ FnDHLSh3AUqSYY1Yd2/Aplc/qKbgKUp8xsslZIsuMPTZxrYgsCKgws8cGex2Ugx+xea3 eLN+XTzobD9KL/RhlJUpBazU6RrJPR1VXh7+nEmAxwVx1eFBJgQji6bK+M/y7H9+hrSU RWdsKyvD0CH/I6redAIbjCCHoTo9pq1kDXaLKJcOP8bPX/7Z2SWprEWYsGx2UlP9pikI wKNoTs7zSSS7VXOUqQjj7Bcs29K9xj9aWpz8e8P0J1dA+7iCoxY+G6EF+5WKoShpYPGn iNJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=IN6kcMcq; 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 d22-20020a170906305600b006df76385c70si555544ejd.272.2022.03.24.14.05.56; Thu, 24 Mar 2022 14:06:22 -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=IN6kcMcq; 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 S1347754AbiCXCXE (ORCPT + 99 others); Wed, 23 Mar 2022 22:23:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240525AbiCXCXD (ORCPT ); Wed, 23 Mar 2022 22:23:03 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD9A793995; Wed, 23 Mar 2022 19:21:32 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id u16so4652080wru.4; Wed, 23 Mar 2022 19:21:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=3qclwzwUGtDFwZwOazh4jA3jMuR+ekMkvwqZKLbIrEo=; b=IN6kcMcqkbzgaWq0PMKkxOy/Ro8RXyXtkuQaqY5vJTuTTjfZHJy/RpaWJpjReKg+UR auf1BvzN+SKkqvpLl1yUDxCb7TlxSN/tKYRKQI2yIATSWXRj1RY2Ac2UX2cc3Lg/NWn6 3zb8nki0AnDe6QMK6Rqv8ba7ytJIM61EV2RPycDgNEYdwHt1ajt4TkVsK5u6AZeKCpwE Q2nugzeGqWTCjVQNEXrbv8Lb6t6SCBhginCnDvWwgJPR4/qclkHs0/OmLjX8a1izP84x hO25fLctmlZrXIKOT3uAbD2sFfHlXOMnQcBSxEzvighgy5SnVWQ34DbZTb81WRNk9Ggj Sl3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=3qclwzwUGtDFwZwOazh4jA3jMuR+ekMkvwqZKLbIrEo=; b=WyGAVRfBcV6NrFGw+tTF4swzWDOJConPFzU9sNNcI5vhU/Uayol5MYkzDfp9QXqIUg Rlm7GTq4EDIrPzaywiTQUobownAWRKsAIjTp3KbSl142hyTolZQdDhgJBW2sZYBpJp5l 1X+fuuAVjo/0z3CDtUqqi7gXObg+Fj1BbXPNZTJV9EnyHw4QOAwhdaiRyhu/1nVoOhmH DfwNmXSPQnHA0q2NuxsiGRCheGG+xNbfj11FPen8zwbY9ihKueoEkoTK+DJCMElc2wrP DgW4oxYcG0cyWgUKsG+68Z+vebFXOqyy+/i9Lid9EYJO9IQmOFt5fFKjc3BbqTClJo07 l6ew== X-Gm-Message-State: AOAM532H4kCP11EFB7shVFmIeRxz6svygZQxeC6jis35JQoOOPhXkXvq nwO1GrjLb4WhkEmk//845Mo= X-Received: by 2002:a5d:660e:0:b0:203:eda6:e983 with SMTP id n14-20020a5d660e000000b00203eda6e983mr2554104wru.544.1648088491171; Wed, 23 Mar 2022 19:21:31 -0700 (PDT) Received: from hermes ([2604:3d09:e80:800::72d9]) by smtp.gmail.com with ESMTPSA id p16-20020a5d6390000000b00203ffebddf3sm1670165wru.99.2022.03.23.19.21.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Mar 2022 19:21:30 -0700 (PDT) Date: Wed, 23 Mar 2022 20:21:26 -0600 From: Manuel =?iso-8859-1?Q?Sch=F6nlaub?= To: Pavel Machek Cc: lains@riseup.net, jikos@kernel.org, benjamin.tissoires@redhat.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] HID: logitech-hidpp: support Color LED feature (8071). Message-ID: References: <20220323210423.GA10741@duo.ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220323210423.GA10741@duo.ucw.cz> 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 Wed, Mar 23, 2022 at 10:04:23PM +0100, Pavel Machek wrote: > Hi! > > > 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?nlaub > > Please cc LEDs stuff to the LED lists. > Will do. Though it seems like first we should discuss whether the kernel in fact is the right place, no? > > +static int hidpp_mc_led_register(struct hidpp_device *hidpp_dev, > > + struct led_classdev_mc *mc_dev, > > + int zone) > > +{ > > + struct hid_device *hdev = hidpp_dev->hid_dev; > > + struct mc_subled *mc_led_info; > > + struct led_classdev *cdev; > > + int ret; > > + > > + mc_led_info = devm_kmalloc_array(&hdev->dev, 3, > > + sizeof(*mc_led_info), > > + GFP_KERNEL | __GFP_ZERO); > > + if (!mc_led_info) > > + return -ENOMEM; > > + > > + mc_led_info[0].color_index = LED_COLOR_ID_RED; > > + mc_led_info[1].color_index = LED_COLOR_ID_GREEN; > > + mc_led_info[2].color_index = LED_COLOR_ID_BLUE; > > + > > + mc_dev->subled_info = mc_led_info; > > + mc_dev->num_colors = 3; > > + > > + cdev = &mc_dev->led_cdev; > > + cdev->name = devm_kasprintf(&hdev->dev, GFP_KERNEL, > > + "%s:rgb:indicator-%d", hdev->uniq, zone); > > So this is keyboard backlight? We should add the documentation at the > very least, so that other drivers use same name. > > Best regards, > Pavel > > -- > People of Russia, stop Putin before his war on Ukraine escalates. I do not own a Logitech keyboard, but some mice. There are RGB leds that you can normally control with Windows software. I'd suppose (but could not verify) that supported keyboards by Logitech work with the same feature. Best Regards, Manuel