Re: [PATCH 2/2] backlight: add ktd3137 support

From
Daniel Thompson <danielt@kernel.org>
Date
2026-11-03 14:58:43
Also in
dri-devel, linux-devicetree, linux-leds, lkml
Reply to
Roman Vivchar, 2026-11-03
On Tue, Nov 03, 2026 at 02:45:52PM +0000, Roman Vivchar wrote:
On Tuesday, November 3rd, 2026 at 4:15 PM, Daniel Thompson [off-list ref] wrote:
quoted
On Mon, Nov 02, 2026 at 09:58:49PM +0200, Roman Vivchar via B4 Relay wrote:
quoted
+static void ktd3137_remove(struct i2c_client *client)
+{
+	struct backlight_device *backlight_dev = i2c_get_clientdata(client);
+	struct ktd3137 *ktd = bl_get_data(backlight_dev);
+
+	backlight_dev->props.brightness = 0;
+	backlight_update_status(backlight_dev);
+
+	gpiod_set_value_cansleep(ktd->enable_gpio, 0);
Is this needed?
The datasheet says "When HWEN is set high, ... if SCL/SDA’s pull up voltage
is much less than VIN voltage, it can cause a small leakage current ...,
there will be around 7uA additional leakage current from VIN in this standby
mode."

It's better to put chip into shutdown mode, which won't cause power leakage
according to the datasheet, and ensures that I2C registers will be reset in
case chip needs to be cleanly re-initialized.
Right but this is the remove path which as about to free the gpiod anyway
(allowing the GPIO driver to do whatever it likes and which will often
be HiZ rather than pull-down).


Daniel.
Thread (11 messages) 11 messages, 3 authors, last reply 1d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help