Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1171151pxf; Fri, 12 Mar 2021 03:45:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwY4YSFrMjmWL4QfE15wHHQnN//43BvUQHij50JQ3Fte9DevqphWhbQV1K6WLe9Zt1XqFq1 X-Received: by 2002:a17:906:3496:: with SMTP id g22mr8320259ejb.143.1615549550209; Fri, 12 Mar 2021 03:45:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615549550; cv=none; d=google.com; s=arc-20160816; b=n5nPdVM42Z/51bnxVYW01hJSF0bpqaONb3hhoVRgQdCBNk7WiM/a3dq9+asd8gE3GB WSBCG/eSjop7HIuLd6ccrvRM/VGmhs58a8MCi5qqgfcFEk6eajCkLlE7bp1KiTC7j54X XJCWDDTOCK+6uus7as4AbV9ss2AFpO2cdE1vg00gTRH6tuGQgaf/sC2LdwQ2xkh2WgL0 pRNCVM8dWTHDNLgnx7GHP9lzDAs4uqnWgDOkqSo8u+Wt1vBZv6vTn3crS1N/3sIL+us5 UqL6SQQ7l1vccfAlI1d8U9199tAoqGsJYwQP+yuP76KY1JLsic0/hqq/hZpUuUk2pdq1 j6qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:references:in-reply-to :message-id:date:subject:cc:to:from; bh=lvDWInSbmI+hBh07Ak3cYILT9/GCQH7aaZUtlr4RGpE=; b=S0WyJaikzcwr5uagROwIZ7az7UFXJbm2wSRn0FWouqodaIMW4YzOt/ZhtKZojAbTpS gnSrtFmNhMB1Z3vlGGm1EfIlEj5ABjYWwj6BRwGPS4Y1yx0MBg3HCGaR2/FtWPnZwEjR Lc4WaRLfX6Oqsscl8Rec0ULLFbocp22gWX8UUDNQXRNJgFGx8i20KpakJ1ookowIpNtH Dn+KXSmknS6Hsv9CC4T2Tzby4x0M5hwPTFqcKU09Dylntt1JPj4f2L/msifE59ciI0Ir w1DaBG4h1AdGW6ehENSdapmC38QnLTD4tc+onCk/vUJgBU7JSOg5C4RJ+0QGxQPhiWyx 6uzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i15si3742973edl.581.2021.03.12.03.45.28; Fri, 12 Mar 2021 03:45:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232314AbhCLIie (ORCPT + 99 others); Fri, 12 Mar 2021 03:38:34 -0500 Received: from mail.thorsis.com ([92.198.35.195]:55028 "EHLO mail.thorsis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232443AbhCLIiF (ORCPT ); Fri, 12 Mar 2021 03:38:05 -0500 X-Greylist: delayed 357 seconds by postgrey-1.27 at vger.kernel.org; Fri, 12 Mar 2021 03:38:04 EST Received: from localhost (localhost [127.0.0.1]) by mail.thorsis.com (Postfix) with ESMTP id EF9C33356; Fri, 12 Mar 2021 09:32:06 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.thorsis.com Received: from mail.thorsis.com ([127.0.0.1]) by localhost (mail.thorsis.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JI1aur4oo8wz; Fri, 12 Mar 2021 09:32:06 +0100 (CET) Received: by mail.thorsis.com (Postfix, from userid 109) id C62C235C5; Fri, 12 Mar 2021 09:32:04 +0100 (CET) X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_RECEIVED, NO_RELAYS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 From: Alexander Dahl To: linux-leds@vger.kernel.org Cc: Hermes Zhang , Pavel Machek , Dan Murphy , kernel@axis.com, Hermes Zhang , linux-kernel@vger.kernel.org Subject: Re: [PATCH] leds: leds-dual-gpio: Add dual GPIO LEDs driver Date: Fri, 12 Mar 2021 09:31:58 +0100 Message-ID: <2315048.uTtSMl1LR1@ada> In-Reply-To: <20210311130408.10820-1-chenhui.zhang@axis.com> References: <20210311130408.10820-1-chenhui.zhang@axis.com> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hallo Hermes, thanks for your effort. Am Donnerstag, 11. M=E4rz 2021, 14:04:08 CET schrieb Hermes Zhang: > From: Hermes Zhang >=20 > Introduce a new Dual GPIO LED driver. These two GPIOs LED will act as > one LED as normal GPIO LED but give the possibility to change the > intensity in four levels: OFF, LOW, MIDDLE and HIGH. Interesting use case. Is there any real world hardware wired like that you= =20 could point to? > +config LEDS_DUAL_GPIO > + tristate "LED Support for Dual GPIO connected LEDs" > + depends on LEDS_CLASS > + depends on GPIOLIB || COMPILE_TEST > + help > + This option enables support for the two LEDs connected to GPIO > + outputs. These two GPIO LEDs act as one LED in the sysfs and > + perform different intensity by enable either one of them or both. Well, although I never had time to implement that, I suspect that could=20 conflict if someone will eventually write a driver for two pin dual color L= EDs=20 connected to GPIO pins. We actually do that on our hardware and I know oth= ers=20 do, too. I asked about that back in 2019, see this thread: https://www.spinics.net/lists/linux-leds/msg11665.html At the time the multicolor framework was not yet merged, so today I would=20 probably make something which either uses the multicolor framework or at le= ast=20 has a similar interface to userspace. However, it probably won't surprise y= ou=20 all, this is not highest priority on my ToDo list. ;-) (What we actually do is pretend those are separate LEDs and ignore the=20 conflicting case where both GPIOs are on and the LED is dark then.) Greets Alex