Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Wim de With" <wf@dewith.io>
Cc: linux-leds@vger.kernel.org, dri-devel@lists.freedesktop.org,
	robh@kernel.org, devicetree@vger.kernel.org, lee@kernel.org,
	conor+dt@kernel.org
Subject: Re: [PATCH v3 2/2] backlight: Add support for Orient Chip OCP8178
Date: Sun, 16 Aug 2026 11:07:51 +0000	[thread overview]
Message-ID: <20260816110752.5D7C61F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260816-ocp8178-backlight-v3-2-caf95c453c50@dewith.io>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing PM resume initialization causes backlight to fail after system suspend.
--

--- Patch [2]: [PATCH v3 2/2] backlight: Add support for Orient Chip OCP8178 ---
commit bfc20bddc55de3beb592431b21d9fc9bc3366d90
Author: Wim de With <wf@dewith.io>

backlight: Add support for Orient Chip OCP8178

This commit adds a driver for the Orient Chip OCP8178 backlight controller.
The driver implements a vendor-specific onewire protocol over GPIO to set
static brightness levels.

> diff --git a/drivers/video/backlight/ocp8178_bl.c b/drivers/video/backlight/ocp8178_bl.c
> new file mode 100644
> index 0000000000000..6c1e8c9451f12
> --- /dev/null
> +++ b/drivers/video/backlight/ocp8178_bl.c
[ ... ]
> +static int ocp8178_bl_update_status(struct backlight_device *bl)
> +{
> +	struct ocp8178_bl *ocp8178 = bl_get_data(bl);
> +	u8 brightness = backlight_get_brightness(bl);
> +
> +	ocp8178_bl_set_brightness(ocp8178, brightness);
> +	return 0;
> +}
> +
> +static const struct backlight_ops ocp8178_bl_ops = {
> +	.options = BL_CORE_SUSPENDRESUME,
> +	.update_status = ocp8178_bl_update_status,
> +};
[ ... ]
> +static struct platform_driver ocp8178_bl_driver = {
> +	.driver = {
> +		.name = "ocp8178-bl",
> +		.of_match_table = ocp8178_bl_of_match,
> +	},
> +	.probe = ocp8178_bl_probe,
> +};

[Severity: High]
Will the backlight fail to turn on after a system suspend cycle?

Since BL_CORE_SUSPENDRESUME is set in ocp8178_bl_ops, the backlight core
calls ocp8178_bl_update_status() upon system resume. During suspend, the
GPIO controller may pull the control pin low.

If the pin remains low for more than 2.5ms (OCP8178_T_OFF_US), the chip
shuts down and will power back up in its default PWM mode.

Because ocp8178_bl_update_status() immediately sends 1-wire commands without
verifying state or re-running ocp8178_bl_enable_onewire(), will the chip
misinterpret these 1-wire signals as tiny PWM pulses instead of restoring
the brightness level?

Does the platform driver need pm_ops to re-initialize the 1-wire mode state
before the backlight core attempts to update the brightness?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260816-ocp8178-backlight-v3-0-caf95c453c50@dewith.io?part=2

      reply	other threads:[~2026-08-16 11:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-16 10:57 [PATCH v3 0/2] backlight: Add support for Orient Chip OCP8178 Wim de With
2026-08-16 10:57 ` [PATCH v3 1/2] dt-bindings: backlight: Add " Wim de With
2026-08-16 11:04   ` sashiko-bot
2026-08-16 10:57 ` [PATCH v3 2/2] backlight: Add support for " Wim de With
2026-08-16 11:07   ` sashiko-bot [this message]

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=20260816110752.5D7C61F000E9@smtp.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=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wf@dewith.io \
    /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