lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 27 Aug 2019 07:44:09 -0500
From:   Dan Murphy <dmurphy@...com>
To:     Pavel Machek <pavel@....cz>, Tony Lindgren <tony@...mide.com>
CC:     <jacek.anaszewski@...il.com>, <sre@...nel.org>,
        <nekit1000@...il.com>, <mpartap@....net>, <merlijn@...zup.org>,
        <linux-leds@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 1/5] leds: lm3532: Fix brightness control for i2c mode

Tony

On 8/27/19 7:18 AM, Pavel Machek wrote:
> On Mon 2019-08-26 15:44:37, Tony Lindgren wrote:
>> * Pavel Machek <pavel@....cz> [190826 22:14]:
>>> On Mon 2019-08-26 14:58:22, Tony Lindgren wrote:
>>>> Hi,
>>>>
>>>> * Dan Murphy <dmurphy@...com> [190820 19:53]:
>>>>> Fix the brightness control for I2C mode.  Instead of
>>>>> changing the full scale current register update the ALS target
>>>>> register for the appropriate banks.
>>>>>
>>>>> In addition clean up some code errors and random misspellings found
>>>>> during coding.
>>>>>
>>>>> Tested on Droid4 as well as LM3532 EVM connected to a BeagleBoneBlack
>>>>>
>>>>> Fixes: e37a7f8d77e1 ("leds: lm3532: Introduce the lm3532 LED driver")
>>>>> Reported-by: Pavel Machek <pavel@....cz>
>>>>> Signed-off-by: Dan Murphy <dmurphy@...com>
>>>>> ---
>>>>>
>>>>> v3 - Removed register define updates - https://lore.kernel.org/patchwork/patch/1114542/
>>>> Looks like starting with this patch in Linux next the LCD on droid4
>>>> is so dim it's unreadable even with brightness set to 255. Setting
>>>> brightness to 0 does blank it completely though.
>>>>
>>>> Did something maybe break with the various patch revisions or are
>>>> we now missing some dts patch?
>>> Maybe missing dts patch. We should provide maximum current the LED can
>>> handle...
>> Or i2c control is somehow broken and only als control now works?

With only setting CONFIG_LEDS_LM3532=m to the next branch I get full 
brightness with 255.

I also see half brightness at 128 with the ramp down working.

I am not able to reproduce this issue on my device.

> Well, max current led is obviously missing. Plus code does not check
> the return from reading led-max-microamp.

led-max-microamp is optional so there is no need to check the return.

full_scale_current should be 0 if not populated and in the init only if 
this variable is set does

the code program the register otherwise it is default of 20.2 mA.

Dan


>
> ret = fwnode_property_read_u32(child, "led-max-microamp",
>                                                 &led->full_scale_current);
>
> Untested, but something like this is neccessary according to code
> review.
>
> Signed-off-by: Pavel Machek <pavel@....cz>
> 								Pavel
>
> diff --git a/arch/arm/boot/dts/omap4-droid4-xt894.dts b/arch/arm/boot/dts/omap4-droid4-xt894.dts
> index 4454449..b883b84 100644
> --- a/arch/arm/boot/dts/omap4-droid4-xt894.dts
> +++ b/arch/arm/boot/dts/omap4-droid4-xt894.dts
> @@ -395,6 +395,7 @@
>   			ti,led-mode = <0>;
>   			label = ":backlight";
>   			linux,default-trigger = "backlight";
> +			led-max-microamp = 29800;
>   		};
>   
>   		led@1 {
> @@ -402,6 +403,7 @@
>   			led-sources = <1>;
>   			ti,led-mode = <0>;
>   			label = ":kbd_backlight";
> +			led-max-microamp = 29800;
>   		};
>   	};
>   };
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ