Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Fenglin Wu <quic_fenglinw@quicinc.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: <linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<lee@kernel.org>, <krzysztof.kozlowski@linaro.org>,
	<linux-leds@vger.kernel.org>, <quic_collinsd@quicinc.com>,
	<quic_subbaram@quicinc.com>,
	Luca Weiss <luca.weiss@fairphone.com>
Subject: Re: [PATCH v8 1/2] leds: flash: add driver to support flash LED module in QCOM PMICs
Date: Tue, 28 Mar 2023 16:13:57 +0800	[thread overview]
Message-ID: <b06854ce-45e4-eeee-d5ec-51fb1d8d923f@quicinc.com> (raw)
In-Reply-To: <ZB8xKGgvlb5oC/pt@duo.ucw.cz>



On 3/26/2023 1:36 AM, Pavel Machek wrote:
> On Fri 2023-03-03 17:50:22, Fenglin Wu wrote:
>> Add initial driver to support flash LED module found in Qualcomm
>> Technologies, Inc. PMICs. The flash module can have 3 or 4 channels
>> and each channel can be controlled indepedently and support full scale
>> current up to 1.5 A. It also supports connecting two channels together
>> to supply one LED component with full scale current up to 2 A. In that
>> case, the current will be split on each channel symmetrically and the
>> channels will be enabled and disabled at the same time.
>>
>> Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
>> Tested-by: Luca Weiss <luca.weiss@fairphone.com> # sm7225-fairphone-fp4 + pm6150l
> 
>> +	flash->led_cdev.brightness_set_blocking = qcom_flash_led_brightness_set;
>> +
>> +	init_data.fwnode = node;
>> +	init_data.devicename = NULL;
>> +	init_data.default_label = NULL;
>> +	init_data.devname_mandatory = false;
>> +
>> +	rc = devm_led_classdev_flash_register_ext(dev, flash, &init_data);
>> +	if (rc < 0) {
>> +		dev_err(dev, "Register flash LED classdev failed, rc=%d\n", rc);
>> +		return rc;
>> +	}
> 
> I'd expect setting max_brightness somewhere around here.
> 
> What does cat /sys/class/leds/*/max_brightness say (and what directory
> name are you using)?

LED_FULL is used as the default max_brightness, the driver will do the 
calculation based on LED_FULL (as below) and set the corresponding 
current when brightness is updated :

u32 current_ma = brightness * led->max_torch_current_ma / LED_FULL;

This is how max_brightness shows on my device:

# cat /sys/class/leds/white:flash-0/max_brightness
255

> 
> BR,								Pavel

  reply	other threads:[~2023-03-28  8:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03  9:50 [PATCH v8 0/2] Add LED driver for flash module in QCOM PMICs Fenglin Wu
2023-03-03  9:50 ` [PATCH v8 1/2] leds: flash: add driver to support flash LED " Fenglin Wu
2023-03-15 17:09   ` Lee Jones
2023-03-25 17:09   ` Pavel Machek
2023-03-27  4:30     ` Fenglin Wu
2023-03-25 17:33   ` Pavel Machek
2023-03-28  8:02     ` Fenglin Wu
2023-03-25 17:36   ` Pavel Machek
2023-03-28  8:13     ` Fenglin Wu [this message]
2023-03-03  9:50 ` [PATCH v8 2/2] dt-bindings: leds: add QCOM flash LED controller Fenglin Wu
2023-03-15 17:10   ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b06854ce-45e4-eeee-d5ec-51fb1d8d923f@quicinc.com \
    --to=quic_fenglinw@quicinc.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=luca.weiss@fairphone.com \
    --cc=pavel@ucw.cz \
    --cc=quic_collinsd@quicinc.com \
    --cc=quic_subbaram@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox