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] [day] [month] [year] [list]
Message-ID: <0d99a9e8-5ad6-4826-9fb7-753724dc53ad@oss.qualcomm.com>
Date: Mon, 28 Jul 2025 11:18:20 +0200
From: Konrad Dybcio <konrad.dybcio@....qualcomm.com>
To: Fenglin Wu <fenglin.wu@....qualcomm.com>, kernel@....qualcomm.com,
        Lee Jones <lee@...nel.org>, Pavel Machek <pavel@...nel.org>,
        Fenglin Wu <quic_fenglinw@...cinc.com>
Cc: Subbaraman Narayanamurthy <subbaraman.narayanamurthy@....qualcomm.com>,
        linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] leds: flash: leds-qcom-flash: update torch current
 clamp setting

On 7/28/25 4:27 AM, Fenglin Wu wrote:
> 
> On 7/25/2025 8:37 PM, Konrad Dybcio wrote:
>> On 7/25/25 12:04 PM, 'Fenglin Wu via B4 Relay' via kernel wrote:
>>> From: Fenglin Wu <fenglin.wu@....qualcomm.com>
>>>
>>> There is a register to clamp the flash current per LED channel when
>>> safety timer is disabled. It needs to be updated according to the
>>> maximum torch LED current setting to ensure the torch current won't
>>> be clamped unexpectedly.
>>>
>>> Fixes: 96a2e242a5dc ("leds: flash: Add driver to support flash LED module in QCOM PMICs")
>>> Signed-off-by: Fenglin Wu <fenglin.wu@....qualcomm.com>
>>> ---
>>>   drivers/leds/flash/leds-qcom-flash.c | 16 +++++++++++++---
>>>   1 file changed, 13 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/leds/flash/leds-qcom-flash.c b/drivers/leds/flash/leds-qcom-flash.c
>>> index 89cf5120f5d55bbb7e24faa8c3a946416f8fed46..9c2e41cfddcf2d50d5a633cb157084371a631d74 100644
>>> --- a/drivers/leds/flash/leds-qcom-flash.c
>>> +++ b/drivers/leds/flash/leds-qcom-flash.c
>>> @@ -1,6 +1,6 @@
>>>   // SPDX-License-Identifier: GPL-2.0-only
>>>   /*
>>> - * Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
>>> + * Copyright (c) 2022, 2024-2025 Qualcomm Innovation Center, Inc. All rights reserved.
>>>    */
>>>     #include <linux/bitfield.h>
>>> @@ -111,6 +111,7 @@ enum {
>>>       REG_IRESOLUTION,
>>>       REG_CHAN_STROBE,
>>>       REG_CHAN_EN,
>>> +    REG_TORCH_CLAMP,
>> This is not the name of this register on at least PM8150L
> The register is referred to as 'TIMER_DISA_MITIGATION_CLAMP' in the documentation. 'TIMER_DISA' indicates the flash module operating in torch mode. We can remove 'MITIGATION' to create a shorter name for the enum.>>
>>>       REG_THERM_THRSH1,
>>>       REG_THERM_THRSH2,
>>>       REG_THERM_THRSH3,
>>> @@ -127,6 +128,7 @@ static const struct reg_field mvflash_3ch_regs[REG_MAX_COUNT] = {
>>>       REG_FIELD(0x47, 0, 5),                  /* iresolution    */
>>>       REG_FIELD_ID(0x49, 0, 2, 3, 1),         /* chan_strobe    */
>>>       REG_FIELD(0x4c, 0, 2),                  /* chan_en    */
>>> +    REG_FIELD(0xec, 0, 6),            /* torch_clamp    */
>> Please keep it sorted by address
> I need to keep the 'therm_thrsh1/2/3' register fields at the end of this array because 'mvflash_4ch_regs' doesn't include a 'therm_thrsh3' register. Placing the 'therm_thrshx' registers in the middle would require creating a placeholder, which I couldn't figure out how to do effectively. Do you have any suggestions?

Designated initializers (i.e. [REG_CHAN_EN] = REG_FIELD(...),)

Konrad

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ