Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754595AbbGXRlQ (ORCPT ); Fri, 24 Jul 2015 13:41:16 -0400 Received: from mail-yk0-f176.google.com ([209.85.160.176]:33615 "EHLO mail-yk0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752532AbbGXRlO (ORCPT ); Fri, 24 Jul 2015 13:41:14 -0400 MIME-Version: 1.0 In-Reply-To: References: <1437681127-15760-1-git-send-email-bjorn.andersson@sonymobile.com> Date: Fri, 24 Jul 2015 13:41:13 -0400 Message-ID: Subject: Re: [PATCH] backlight: pm8941-wled: Add default-brightness property From: Rob Clark To: Rob Herring Cc: Bjorn Andersson , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Jingoo Han , Lee Jones , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , "devicetree@vger.kernel.org" , Linux Kernel Mailing List , Linux Fbdev development list , linux-arm-msm Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3747 Lines: 82 On Fri, Jul 24, 2015 at 11:39 AM, Rob Herring wrote: > On Fri, Jul 24, 2015 at 8:10 AM, Rob Clark wrote: >> On Thu, Jul 23, 2015 at 3:52 PM, Bjorn Andersson >> wrote: >>> Add the possibility of specifying the default brightness in DT. >>> >>> Signed-off-by: Bjorn Andersson >>> --- >>> >>> This depends on the patch moving pm8941-wled to backlight [1]. The dt property >>> is used by several other backlight drivers, so I considered this to be a >>> "common" property and it's hence not prefixed with "qcom,". >>> >>> [1] https://lkml.org/lkml/2015/7/21/906 >>> >>> Documentation/devicetree/bindings/video/backlight/pm8941-wled.txt | 1 + >>> drivers/video/backlight/pm8941-wled.c | 4 ++++ >>> 2 files changed, 5 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/video/backlight/pm8941-wled.txt b/Documentation/devicetree/bindings/video/backlight/pm8941-wled.txt >>> index 424f8444a6cd..37503f8c3620 100644 >>> --- a/Documentation/devicetree/bindings/video/backlight/pm8941-wled.txt >>> +++ b/Documentation/devicetree/bindings/video/backlight/pm8941-wled.txt >>> @@ -5,6 +5,7 @@ Required properties: >>> - reg: slave address >>> >>> Optional properties: >>> +- default-brightness: value from: 0-4095 >>> - label: The name of the backlight device >>> - qcom,cs-out: bool; enable current sink output >>> - qcom,cabc: bool; enable content adaptive backlight control >>> diff --git a/drivers/video/backlight/pm8941-wled.c b/drivers/video/backlight/pm8941-wled.c >>> index c704c3236034..b875e58df0fc 100644 >>> --- a/drivers/video/backlight/pm8941-wled.c >>> +++ b/drivers/video/backlight/pm8941-wled.c >>> @@ -373,6 +373,7 @@ static int pm8941_wled_probe(struct platform_device *pdev) >>> struct backlight_device *bl; >>> struct pm8941_wled *wled; >>> struct regmap *regmap; >>> + u32 val = 0; >>> int rc; >> >> as discussed on IRC, it would be better if the default read back the >> current settings (so-as to inherit bootloader splash smoothly.. >> drm/msm supports a memory-region phandle, for example, so it can take >> over the bootloader splash-screen as stolen-mem) >> >> and it would I think be useful to have a comment in the bindings file >> explaining that you *should* use the default-brightness property to >> set a sane default if bootloader isn't putting up a splash, and you >> should *not* use the property if it is.. > > +1 > > What if you have neither? Set to max brightness? 75%? I did chat w/ Bjorn a bit about that on irc.. his concern was some arbitrary percentage (like 50%) might be more or less bright depending on the device (although that implies to me that maybe we should have min and max bindings as well, rather than just assuming hw limits? idk) my preference is the default is somehow at least not 0%.. possibly motivated by the expectation that when people see a dark screen at boot they assume the display driver is broken :-P BR, -R > This could also be used for the bootloader to communicate to the > kernel what the current level is if it is not readable. I've seen one > backlight recently which you change the level by doing some number of > pulses on a gpio and a long pulse to turn off. So there is no way to > know current level without turning off the backlight (unless you > hardcode the bootloader's level in the kernel like the vendor did). > > Rob -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/