Re: [PATCH 2/2] backlight: add ktd3137 support
From: Daniel Thompson
Date: Tue Nov 03 2026 - 10:14:18 EST
On Tue, Nov 03, 2026 at 02:45:52PM +0000, Roman Vivchar wrote:
> On Tuesday, November 3rd, 2026 at 4:15 PM, Daniel Thompson <danielt@xxxxxxxxxx> wrote:
> > On Mon, Nov 02, 2026 at 09:58:49PM +0200, Roman Vivchar via B4 Relay wrote:
> > > +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.