Received: by 10.192.165.148 with SMTP id m20csp3964972imm; Tue, 8 May 2018 00:04:49 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrxN2NfIWu/FnMEd+NK1bJjbkkLmJ993cVUhnMkmlfFtUxzEvTde6avGAVyHeyvUNuq6DXh X-Received: by 10.98.178.4 with SMTP id x4mr38951300pfe.21.1525763089034; Tue, 08 May 2018 00:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525763088; cv=none; d=google.com; s=arc-20160816; b=ARnai/KEILsgyU+PjjrnUXS7CWLwK/KdHhRiKeRex2PWFJlbAEZhpZ6ZAi1aBwPL3j 9oBcDCIRseAIU9BNHzKt+HM+MCMTcUumT3AF4fOqL0kYFn6q3JkDyWym2RMgPjBrWj46 alk/v0UH/L9nudm9v8xQZkF93xhrFdF5QE9EfzZc7AtUPk0vTCoXWPDrcGxFpybAndKH L8oIAmeOF+KiB69eokD2vExXTEkUF2feIaK6dTGEx1xQ1oinTfxdP/rnTlivW2Mfklr1 RileCtsSFP1QEd9XvvpeCCWBwXK43jsFfklYe2xMA6EWG0pQb1pbNZ7/7z+4a5B8AWQx pYjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=f2DWBXo8E7om7O+k6nFxSGVY87rhANcq19IFHk9AnjA=; b=oN4YYuScXQTqrcsmFJlldMCbfnXgoYQoI3JSMkZKLPZUwJEEzR8w95OM4POLTR8dVN sYmQ+VSWcCGgG8jmQ7MVQIIwiMwlRHBIKIkOdFr939MnyIGY4l8OFDu9vhHVwqH+mxHj VkarMhqlGUvc4gqcJ0wwG+3rI/TyUMpuu+ztlo9aY1c/x+EkkzJCCfdLvfJq3HX53Nxx iTiOOgwCM3SLd9qqkX9ROLArlGDEl8R6f4UWub9VP8aTXym1xXOlUlRQLMZ19NlXWU7T yS4tLI1dZWvyRf+IfqM64hRIR2horNT1yuJGUozKswATxuhe/J5K7ELZMTnROCcCLtKQ 7yTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=uFrLTAXt; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si12404515pfm.183.2018.05.08.00.04.34; Tue, 08 May 2018 00:04:48 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=uFrLTAXt; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754599AbeEHHDy (ORCPT + 99 others); Tue, 8 May 2018 03:03:54 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:38696 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754361AbeEHHDw (ORCPT ); Tue, 8 May 2018 03:03:52 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w4873mDX002553; Tue, 8 May 2018 02:03:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1525763028; bh=f2DWBXo8E7om7O+k6nFxSGVY87rhANcq19IFHk9AnjA=; h=From:To:CC:Subject:Date; b=uFrLTAXtT3zGWD9P5ljWum4GgPArG56dTjyQXJSlD0k7YdrkeNu86vsx/wT9G/mVh pSi55rTQIn5gIey2q2NhnrP4IhA3/n9/MQW5qrMrQHzwA/3h94jSf7zh4IfNx5zMBb QgUdwfrFxYIaUAk0bl1YGk8YOASTt4Ll3fSskJ3U= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4873mYh004808; Tue, 8 May 2018 02:03:48 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Tue, 8 May 2018 02:03:48 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Tue, 8 May 2018 02:03:48 -0500 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4873jEE016320; Tue, 8 May 2018 02:03:46 -0500 From: Peter Ujfalusi To: , , CC: , , Subject: [PATCH RESEND] backlight: gpio-backlight: Correct initial power state handling Date: Tue, 8 May 2018 10:04:26 +0300 Message-ID: <20180508070426.32211-1-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The default-on property - or the def_value via legacy pdata) should be handled as: if it is 1, the backlight must be enabled (kept enabled) if it is 0, the backlight must be disabled (kept disabled) This only works for the case when default-on is set. If it is not set then the brightness of the backlight is set to 0. Now if the backlight is enabled by external driver (graphics) the backlight will stay disabled since the brightness is configured as 0. The backlight will not turn on. The correct action at probe time is to configure the props.power to FB_BLANK_UNBLANK if we want the backlight on by default or to FB_BLANK_POWERDOWN if the backlight should be off by default. The initial brightness should be set to 1. Signed-off-by: Peter Ujfalusi --- Hi, for some reason the original patch got lost: https://patchwork.kernel.org/patch/9445539/ But it is still valid, so I'm resending it. Regards, Peter drivers/video/backlight/gpio_backlight.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index e470da95d806..904a4462cefe 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -142,7 +142,9 @@ static int gpio_backlight_probe(struct platform_device *pdev) return PTR_ERR(bl); } - bl->props.brightness = gbl->def_value; + bl->props.power = gbl->def_value ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN; + bl->props.brightness = 1; + backlight_update_status(bl); platform_set_drvdata(pdev, bl); -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki