[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230325170957.GA2904@bug>
Date: Sat, 25 Mar 2023 18:09:57 +0100
From: Pavel Machek <pavel@....cz>
To: Fenglin Wu <quic_fenglinw@...cinc.com>
Cc: linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
lee@...nel.org, krzysztof.kozlowski@...aro.org,
linux-leds@...r.kernel.org, quic_collinsd@...cinc.com,
quic_subbaram@...cinc.com, Luca Weiss <luca.weiss@...rphone.com>
Subject: Re: [PATCH v8 1/2] leds: flash: add driver to support flash LED
module in QCOM PMICs
Hi!
> @@ -61,6 +61,21 @@ config LEDS_MT6360
> Independent current sources supply for each flash LED support torch
> and strobe mode.
>
> +config LEDS_QCOM_FLASH
> + tristate "LED support for flash module inside Qualcomm Technologies, Inc. PMIC"
> + depends on MFD_SPMI_PMIC || COMPILE_TEST
> + depends on LEDS_CLASS && OF
> + depends on V4L2_FLASH_LED_CLASS || !V4L2_FLASH_LED_CLASS
> + select REGMAP
> + help
> + This option enables support for the flash module found in Qualcomm
> + Technologies, Inc. PMICs. The flash module can have 3 or 4 flash LED
> + channels and each channel is programmable to support up to 1.5 A full
> + scale current. It also supports connecting two channels' output together
> + to supply one LED component to achieve current up to 2 A. In such case,
> + the total LED current will be split symmetrically on each channel and
> + they will be enabled/disabled at the same time.
"This can be built as a module, module will be called..."
> +static int qcom_flash_led_brightness_set(struct led_classdev *led_cdev,
> + enum led_brightness brightness)
> +{
> + struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev);
> + struct qcom_flash_led *led = flcdev_to_qcom_fled(fled_cdev);
> + u32 current_ma = brightness * led->max_torch_current_ma / LED_FULL;
> + bool enable = !!brightness;
> + int rc;
> +
> + rc = set_flash_current(led, current_ma, TORCH_MODE);
> + if (rc)
> + return rc;
I'd not mind supporting more than one brightness level -- AFAICT hw can do that.
BR,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Powered by blists - more mailing lists