Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp782711imm; Wed, 13 Jun 2018 08:12:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJPzrnX/3QdzaoN+02ik+37oissSkltxDwpFpz7FlzUtTafVCqSX0LeyauDF9FFumyWV0vL X-Received: by 2002:a62:f5da:: with SMTP id b87-v6mr5361430pfm.113.1528902750259; Wed, 13 Jun 2018 08:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528902750; cv=none; d=google.com; s=arc-20160816; b=qQ5Ldkl0q1VWSR3XPeuPrHlbcWFJf5m4N6g2G14qw8ENbblkzktLfgwGclzclZb+y8 fw2MaTtj71iuGjD+282us4Uqze5ZIzH3+KFBQsbq0ORbY2fz5PuEXR+3TeGO7THaewna tuSWKgAWVP4Uwwpp2nSf2KvrzJG2BPJfpX+o6FGmyFE1m4uJvMQNjX0YJVkXr418kmLz DndPAoBBVpy+7ZDE0ijbQgk90cVVDpo2RQr42O4qcx1VfheMUoT9pCOCbJePYryVzKec QfEEW+Qbm2HpFbhAf+LfVc6Mlu5j9wkGD6QsazlnznexiKRKjxzWa09W40S8iOHbOY5V 1TBA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=WGxTlhrvhDpbRi1uDdODFz7hC2HjpM2QHHQvRmlTp2E=; b=FSjrSjSQN3G5VdPUNxsLAklKK+4x5Fl/8IuVmMarFlLS2K3RfhCVzpHnQPtoxiNxqa 9Whfxok3yNdtKm1T5/Ua8E9izQt1Tf++bbeAvXjGTWuVBbija7szx/piO6MX7kPeTgKr jDq2EYPPx4uMsrh+UdWBJy9ZqOCCM7zGGhmLOcuhssYKc7nbSP7FlLGPVzP6pvSZMcl4 fBhJqXxMWT8lBVnm5PPifDENP2f1DyQg3I8RWmJx9F4dvMFs80530qiZH7WScpRufic4 CRzeLRS05iZ/KoTllcXrkWQ6Ojw/8Tugkl7qps62H8E5LCEV0eN2690oSVDVdaADnkMP wIuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BudgBffL; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 199-v6si2681542pgd.74.2018.06.13.08.12.15; Wed, 13 Jun 2018 08:12:30 -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=@linaro.org header.s=google header.b=BudgBffL; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964887AbeFMPLQ (ORCPT + 99 others); Wed, 13 Jun 2018 11:11:16 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:37308 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935656AbeFMPLO (ORCPT ); Wed, 13 Jun 2018 11:11:14 -0400 Received: by mail-wr0-f196.google.com with SMTP id d8-v6so3160456wro.4 for ; Wed, 13 Jun 2018 08:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=WGxTlhrvhDpbRi1uDdODFz7hC2HjpM2QHHQvRmlTp2E=; b=BudgBffLLmUqAgj+45oBMetJtMlYQtt9RtaRE3vNSI0GM4npD1mI8DV2RtS7c8xLT1 iqsoD+b3asfC6iVpOgIIW4uniRmarQJlUQ4FDN8etet4rheZm1vBCS32YO062Im8/9Ug u/QHL/vSrSR8YDLrSOjboexeFPmeWyKLKy+Y0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WGxTlhrvhDpbRi1uDdODFz7hC2HjpM2QHHQvRmlTp2E=; b=iGBnaPeJgrV+qtt0RLnuYzWLpKI2MulntEWLs4TCNdNtTfnzNTo6L76eEPIF+d0Dki 9qZflBerigvZa6v99CJmpkaX68eez+NfcmbvRFtplUdRJoSoA+XHKfoGZdJ9KoQCEdCg 3pkjyHLS28ZgGf4Af8MhVI4akUbPHtIx1UqKzgPMEUEetH5AdNHYdTnP79Rau9QPfDs2 RxkYWJxKchEeDiSGYXrRkOd37xxMKgLpOyoHgRkDtwEwLUPGYcdT3C8plEYxvWZAqWQ8 vjVOHjFP6DM4OCjal0iTjZrH7bxaEVCyOTwiOGpgCVPyKjMe2ZsaqKO3MhCulyVVFO/7 P37A== X-Gm-Message-State: APt69E288PTCyKaWGNMoaLg/+s9U9P1gnB4T/lRqRnzi9aTIio/3p0cb aoIEnr3OfczFQQY+aKrKbXsAQZ67Sac= X-Received: by 2002:adf:9525:: with SMTP id 34-v6mr4275516wrs.99.1528902672771; Wed, 13 Jun 2018 08:11:12 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.googlemail.com with ESMTPSA id n56-v6sm6082264wrn.72.2018.06.13.08.11.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 08:11:11 -0700 (PDT) Subject: Re: [PATCH RESEND] backlight: gpio-backlight: Correct initial power state handling To: Peter Ujfalusi , lee.jones@linaro.org, jingoohan1@gmail.com Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180508070426.32211-1-peter.ujfalusi@ti.com> From: Daniel Thompson Message-ID: Date: Wed, 13 Jun 2018 16:11:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180508070426.32211-1-peter.ujfalusi@ti.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/05/18 08:04, Peter Ujfalusi wrote: > 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. Hmnn... I guess this comes down to the definition of "on" for a binary Actually I'm a little worried that backlight already has too many different behaviors and that this patch introduces another way for them to be different! Is there any mileage in adopting the same approach as PWM backlight for blank/unblank management as a way to get a flicker free boot? For PWM the default property controls the initial brightness and the initial power state is unblanked *unless* there is a phandle link to the node, in which case we inherit whatever the power state the bootloader had configured before the driver probed. Put another way, what happens is we implement gpio_backlight_initial_power_state() to perform a similar task to pwm_backlight_initial_power_state(). Daniel. > > 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); >