From: sashiko-bot@kernel.org
To: "Luka Panio" <lukapanio@gmail.com>
Cc: dri-devel@lists.freedesktop.org, linux-leds@vger.kernel.org,
devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
lee@kernel.org
Subject: Re: [PATCH v2 6/6] backlight: aw99706: Add AW99703 support
Date: Sat, 05 Dec 2026 01:11:53 +0000 [thread overview]
Message-ID: <sashiko-outbox-250886@kernel.org> (raw)
In-Reply-To: <20261205005118.884885-7-lukapanio@gmail.com>
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Medium] backlight: aw99706: skip hwen_delay_us in aw99706_probe()
without enable-gpios
- [Medium] backlight: aw99706: missing hwen_delay_us in
aw99706_hw_init() on resume
- [Medium] backlight: aw99706: aw->bl_enable desynced when enable-gpios
is omitted
--
commit 33423fef0e8fe321782e20dbb975455055809999
Author: Luka Panio <lukapanio@gmail.com>
backlight: aw99706: Add AW99703 support
This commit adds support for the Awinic AW99703 3-channel WLED backlight
driver to the aw99706 driver, including optional vin regulator and enable
GPIO handling, a label property, and an HWEN startup delay.
> diff --git a/drivers/video/backlight/aw99706.c b/drivers/video/backlight/aw99706.c
> index 5e0f8ccd3c88e..f898df0d4ed15 100644
> --- a/drivers/video/backlight/aw99706.c
> +++ b/drivers/video/backlight/aw99706.c
[ ... ]
> @@ -456,12 +611,19 @@ static int aw99706_probe(struct i2c_client *client)
>
> aw99706_dt_parse(aw, &props);
>
> - aw->hwen_gpio = devm_gpiod_get(aw->dev, "enable", GPIOD_OUT_LOW);
> + ret = devm_regulator_get_enable_optional(dev, "vin");
> + if (ret < 0 && ret != -ENODEV)
> + return dev_err_probe(dev, ret, "Failed to enable vin supply\n");
> +
> + aw->hwen_gpio = devm_gpiod_get_optional(aw->dev, "enable",
> + GPIOD_OUT_LOW);
> if (IS_ERR(aw->hwen_gpio))
> return dev_err_probe(dev, PTR_ERR(aw->hwen_gpio),
> "Failed to get enable gpio\n");
[Severity: Medium]
Can aw->bl_enable get out of sync with the hardware when enable-gpios is
omitted?
Without an enable GPIO, probe neither resets the chip nor reads
chip->en_reg, so aw->bl_enable stays false even if the bootloader left the
backlight enabled. A later aw99706_update_brightness(aw, 0) when blanking
the backlight then skips aw99706_bl_enable(aw, false), leaving the boost
converter active. Initializing aw->bl_enable from chip->en_reg or issuing
a software reset when no enable GPIO is present would keep the cached state
aligned.
>
> gpiod_set_value_cansleep(aw->hwen_gpio, 1);
> + if (aw->hwen_gpio && aw->chip->hwen_delay_us)
> + fsleep(aw->chip->hwen_delay_us);
>
> ret = aw99706_chip_id_read(aw);
[Severity: Medium]
Should the hwen_delay_us wait also run when vin-supply powers the chip
without enable-gpios?
When HWEN is tied high to VIN and enable-gpios is omitted,
devm_regulator_get_enable_optional() enables the supply but aw->hwen_gpio
is NULL, so fsleep() is skipped. aw99706_chip_id_read() then accesses the
chip before the 3.5 ms startup window completes, which can NACK over I2C
and fail probe with -ENODEV.
[Severity: Medium]
Does aw99706_hw_init() also need to wait aw->chip->hwen_delay_us after
asserting aw->hwen_gpio?
aw99706_resume() calls aw99706_hw_init() directly, which drives
aw->hwen_gpio high and immediately issues I2C writes for aw->init_tbl[].
If HWEN dropped low during suspend or hibernation, skipping the 3.5 ms
startup delay on AW99703 can cause those transfers to fail and leave the
backlight uninitialized after resume.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261205005118.884885-1-lukapanio@gmail.com?part=6
next prev parent reply other threads:[~2026-12-05 1:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-05 0:51 [PATCH v2 0/6] backlight: aw99706: Add Awinic AW99703 support Luka Panio
2026-12-05 0:51 ` [PATCH v2 1/6] dt-bindings: leds: backlight: aw99706: Use standard led-max-microamp Luka Panio
2026-12-05 1:01 ` sashiko-bot
2026-12-05 0:51 ` [PATCH v2 2/6] dt-bindings: leds: backlight: Add Awinic AW99703 backlight Luka Panio
2026-12-05 1:04 ` sashiko-bot
2026-12-05 9:55 ` Andreas Kemnade
2026-12-05 0:51 ` [PATCH v2 3/6] backlight: aw99706: Enable the chip before reading its ID Luka Panio
2026-12-05 1:05 ` sashiko-bot
2026-12-05 0:51 ` [PATCH v2 4/6] backlight: aw99706: Introduce per-chip data Luka Panio
2026-12-05 0:51 ` [PATCH v2 5/6] backlight: aw99706: Support the led-max-microamp property Luka Panio
2026-12-05 0:59 ` sashiko-bot
2026-12-05 0:51 ` [PATCH v2 6/6] backlight: aw99706: Add AW99703 support Luka Panio
2026-12-05 1:11 ` sashiko-bot [this message]
2026-12-05 1:11 ` [PATCH v2 0/6] backlight: aw99706: Add Awinic " sashiko-bot
2026-12-05 12:16 ` Andreas Kemnade
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=sashiko-outbox-250886@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=lee@kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=lukapanio@gmail.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.