Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1566411ybh; Sun, 8 Mar 2020 07:28:02 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv4WJdg40G4tMt9wZnPjTiie7F3CsKo1zEKWh4N6k50XqkHRjqlQMD/pPCu+XDGzwVSMVtQ X-Received: by 2002:a9d:6951:: with SMTP id p17mr9335967oto.24.1583677682812; Sun, 08 Mar 2020 07:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583677682; cv=none; d=google.com; s=arc-20160816; b=gWSjbulUYYf0u0Zk6cVumZtcOwqPWgRhVPKBjJnyRatIIpI8nltpWTAqhZ1KVF6jLp U8NAVa2YooaXh52dyY+V+W8xakq/qYkzSm886G1SgK2938nK8sYMHm2On9HRXczJeOxf aY0qD6au6nwlxE+yr8ywKEY/nWTjLspAn6wriAr/K2qmvbP1yzh59nWM0JIFDKmrpjgQ 3Wc/lcBuwje/w/Ej1EGTJ7YR9t+KbZ86uK63U0UvT2nZHLZnaYPBCe0jG4pCKWy9rzXH HRnWzkA1IvtzDr1LlI9eDdBwvIgNdjKyeubMtgITye2OXFB4vMkudRBJhu2FiFEY9nDy kcww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=VhRNSFx4iPIbaFbNWbOz8+MTQxEoG0TMd4ziu1vR8Bg=; b=Iyb+jc7v2vW7J4Wu7B3ltszDCyV78Mg+BVdzhaNoRwCDOqrQic99qHo8KaF/3USSEw P1svG2XbD7UzfIy3JmF9d/E5CF2dStRjwO17rJcr69FX75My/akLMavJl838VnWXMOUu kt9z7a81SIag75QI5xaDZwUiCeJXtMrupScgYmJ8X43LHICKaGoDKWvYiAzW6pAvd985 aJ0Hs+h0e25HRTj8IZKgYunjogW+pZuE9uoZbj9wZemIFnKy5vc480PQe0iUNo/07vP1 OMKmNNEnzeeKy6+LkvOzRXnG2MWnm7bQ/D/aHZfnP/11cNPMFRgFXe3Nu7iXqSjbIsRV eEig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1si5017900otq.81.2020.03.08.07.27.49; Sun, 08 Mar 2020 07:28:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726291AbgCHO1d (ORCPT + 99 others); Sun, 8 Mar 2020 10:27:33 -0400 Received: from mail.manjaro.org ([176.9.38.148]:44406 "EHLO mail.manjaro.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726259AbgCHO1c (ORCPT ); Sun, 8 Mar 2020 10:27:32 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.manjaro.org (Postfix) with ESMTP id 8158337A1C4A; Sun, 8 Mar 2020 15:27:31 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at manjaro.org Received: from mail.manjaro.org ([127.0.0.1]) by localhost (manjaro.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OeG10X-an8uS; Sun, 8 Mar 2020 15:27:29 +0100 (CET) From: Tobias Schramm To: Jacek Anaszewski , Pavel Machek , Dan Murphy Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Tobias Schramm Subject: [RFC PATCH 0/1] Add generic inverted led triggers Date: Sun, 8 Mar 2020 15:27:21 +0100 Message-Id: <20200308142722.1199260-1-t.schramm@manjaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds generic inverted LED triggers. With this patch applied any trigger can be used with inverted brightness levels by appending "-inverted" to the name of a trigger. This is can be useful for devices that do not have dedicated LEDs for e.g. disk activity indication. With this patch applied the power led can be set to default-state = on and trigger = disk-activity-inverted. Then the led will be on by default, indicating the power state of the device but it will turn off briefly whenever there is disk activity. I think dual-use of LEDs might come in handy for quite a few devices since a lot of embedded boards and upcoming ARM based notebooks do only have one or two LEDs. Best regards, Tobias Tobias Schramm (1): leds: add generic inverted led trigger support drivers/leds/led-triggers.c | 148 +++++++++++++++++++++++++++--------- include/linux/leds.h | 1 + 2 files changed, 111 insertions(+), 38 deletions(-) -- 2.24.1