From patchwork Sat Dec 5 22:48:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 553056 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3390F140322 for ; Sun, 6 Dec 2015 09:51:23 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b=ltrKAx/Q; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id BA07128BDA0; Sat, 5 Dec 2015 23:50:09 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 120A528BDA0 for ; Sat, 5 Dec 2015 23:50:04 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sat, 5 Dec 2015 23:50:01 +0100 (CET) Received: by wmec201 with SMTP id c201so119313025wme.0 for ; Sat, 05 Dec 2015 14:50:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=xEyDe6+0z1We6yelxz2kyMW8/a92P8BR6fUd9mwbSYI=; b=ltrKAx/QW3/7ShvDk/dL0WlL9hO14WafwntVyybhFpmF+IfKAVSYfTcFARsaGSyiqF zjN5eQOaI5WbsdGQVTX0p/IKiMrkHMGJJPNc409vQjjNwf2aOUpRuqk4ec7C1E8Dxs6m 1xf5VSERC0mZ1pHFp3UQuBJPDG/3ELDd4y0BXzY+EJ31imkShuUXJ4wgPpmmdMViDvow iDsFOTJTP+UN6FAmfQ1grIIfUYFWdcmQoUZHzSezN/oTDJM6LuroulMoKctK9stjDhRd usH0FFS/mr9XwQe5BAYd9NDCITZHsXQcqB0bQ5KS+Skin+Y4jlOlrNHb3LOLVXBliI4x 6fzw== X-Received: by 10.194.117.163 with SMTP id kf3mr24846895wjb.139.1449355808721; Sat, 05 Dec 2015 14:50:08 -0800 (PST) Received: from debian64 (pD9F88224.dip0.t-ipconnect.de. [217.248.130.36]) by smtp.googlemail.com with ESMTPSA id pn6sm18117076wjb.15.2015.12.05.14.50.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Dec 2015 14:50:08 -0800 (PST) Received: from chuck by debian64 with local (Exim 4.86) (envelope-from ) id 1a5LeZ-00021i-Eg; Sat, 05 Dec 2015 23:50:07 +0100 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Date: Sat, 5 Dec 2015 23:48:03 +0100 Message-Id: <644055f10fcfcf1ae75d93dacc52077bd13ef211.1449350080.git.chunkeey@googlemail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: References: In-Reply-To: References: Subject: [OpenWrt-Devel] [PATCH v6 1/6] base-files: use max_brightness to set LED X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" From: Chris R Blake LEDs which are controlled by a PWM need to use the supplied max_brightness instead. Otherwise they might appear to be very dim / broken. Signed-off-by: Chris R Blake --- package/base-files/files/etc/init.d/led | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index 3f45732..84cd028 100755 --- a/package/base-files/files/etc/init.d/led +++ b/package/base-files/files/etc/init.d/led @@ -44,7 +44,7 @@ load_led() { ret="$?" [ $default = 1 ] && - echo 1 >/sys/class/leds/${sysfs}/brightness + cat /sys/class/leds/${sysfs}/max_brightness > /sys/class/leds/${sysfs}/brightness [ $ret = 0 ] || { echo >&2 "Skipping trigger '$trigger' for led '$name' due to missing kernel module"