Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp839620imu; Tue, 11 Dec 2018 08:20:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/VxSPuAUXNZBrordluk2vYZa+SMAHJO/UxL1TIhgQhnPZWubm7wBEGv0fb+ISIYuEwy8SxW X-Received: by 2002:a17:902:7e4f:: with SMTP id a15mr16234005pln.149.1544545240189; Tue, 11 Dec 2018 08:20:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544545240; cv=none; d=google.com; s=arc-20160816; b=e1g8OSd+MDVTjWv27sixu3mFTBj7jOZkAOk2ZEN1TI20E+QZXrtOzH1XHA8bwO6ddE 6fRHFHBOigT2iTOF/BbfgAWhlAZSW+sEd/5loVCjoOw7JNPud4YyJyNOEPh1auXlelQU +HjAsFoPief7PEhqA1CnVwGVeHlD+G9kW8Ur2j/3P8SaNfqDQ6G3EvY9IKhv9Bq0UuUH nMHOPh1lmTQ/lSNlPL3NsHU1xP8DW+v1uraXq+pqX40XhYuVf/eXcu0Q7MOI+styyOC6 3QvmJTTD83FOCSa7E5hkzOUNoXjVDfxysMBFV5JwBzGAuwVHIoW6dfphtsIjdv+XOV4u R2Bg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+ini7L95V7/AryPKO7uRyzrIbovnlTC1KBnF6Hn2pu8=; b=Vu2ULh1PV42zJLN1jxmf4Pf3NSZIFHJAftP7LvW+0CJIXQuSqxaBDxx1y05fU6fsMR oJx2YdlBawCcwMJi24DHqvOzWrJfbpEqO85qyV+u2N4076nMRcR0nUp1toFYUsPdiORG zlEidW+uEzeA0aIAWDVRaVYpVijhNgNdFzfCKzNonknOLTfqQ/kwKBp3YILv0m3Pnytf BsH9vUC25LjlidH7elrD46qIwcIfeC6DcdPo3jyO/DAp4zZmaMCFKebtwRW0vS+kS/i5 cgCfeHWMaQbyW3KTQT8B26VQ+I3P0KAJAPirzMhzPr1Gj1zWdhaFUUm3iDsiQFe1CUJA zmxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cIe3guQW; 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 s73si12709095pfs.54.2018.12.11.08.20.25; Tue, 11 Dec 2018 08:20:40 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=cIe3guQW; 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 S1728730AbeLKQSs (ORCPT + 99 others); Tue, 11 Dec 2018 11:18:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:34734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728312AbeLKPqT (ORCPT ); Tue, 11 Dec 2018 10:46:19 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1857A2087F; Tue, 11 Dec 2018 15:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543178; bh=JCfFih1gqxUaNACFlTxrYKZLLt5CJlEv6lqxsKf7mg8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cIe3guQW5raGn2+aXsWdheBjxcIlm4migVqmdm9nAOV/TTJXOywelzwGuVO8Yh5eo 0aXC2jM1054Zkq/4x0evg6elpTtmq2Ix++93mIz18S1CRVUFkvcVF74dsT7JmCfrnb yxee6wV/Mqr7XliOnPo1iBNSmbqIDpz2T0hELMzE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Markus Hofstaetter , Jacek Anaszewski , Krzysztof Kozlowski Subject: [PATCH 4.4 42/91] leds: call led_pwm_set() in leds-pwm to enforce default LED_OFF Date: Tue, 11 Dec 2018 16:41:01 +0100 Message-Id: <20181211151609.360457680@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151606.026852373@linuxfoundation.org> References: <20181211151606.026852373@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Markus Hofstaetter commit f16703360da7731a057df2ffa902306819c22398 upstream. Some PWMs are disabled by default or the default pin setting does not match the LED_OFF state (e.g., active-low leds). Hence, the driver may end up reporting 0 brightness, but the leds are actually on using full brightness, because it never enforces its default configuration. So enforce it by calling led_pwm_set() after successfully registering the device. Tested on a Phytec phyFLEX i.MX6Q board based on kernel v3.19.5. Signed-off-by: Markus Hofstaetter Tested-by: Markus Hofstaetter Signed-off-by: Jacek Anaszewski Signed-off-by: Krzysztof Kozlowski Signed-off-by: Greg Kroah-Hartman --- drivers/leds/leds-pwm.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/leds/leds-pwm.c +++ b/drivers/leds/leds-pwm.c @@ -132,6 +132,7 @@ static int led_pwm_add(struct device *de ret = led_classdev_register(dev, &led_data->cdev); if (ret == 0) { priv->num_leds++; + led_pwm_set(&led_data->cdev, led_data->cdev.brightness); } else { dev_err(dev, "failed to register PWM led for %s: %d\n", led->name, ret);