Re: [PATCH] backlight: qcom-wled: Fix unbalanced OVP IRQ enable at probe

From: Konrad Dybcio

Date: Wed Sep 09 2026 - 05:27:48 EST


On 9/8/26 10:53 PM, David Heidelberg via B4 Relay wrote:
> From: David Heidelberg <david@xxxxxxx>
>
> wled_configure_ovp_irq() derives the initial state of the OVP interrupt
> from the hardware:

[...]

> + val = WLED_DEFAULT_BRIGHTNESS;
> + of_property_read_u32(pdev->dev.of_node, "default-brightness", &val);
> +
> + /*
> + * The module may already be enabled, either by a bootloader that left
> + * the backlight lit or by the setup above. Record that, so that the
> + * first brightness update does not enable an already enabled module,
> + * and so that the OVP irq is armed from probe rather than from that
> + * first update.
> + */
> + rc = regmap_read(wled->regmap, wled->ctrl_addr + WLED3_CTRL_REG_MOD_EN,
> + &mod_en);
> + if (rc < 0)
> + return rc;
> +
> + if (mod_en & WLED3_CTRL_REG_MOD_EN_MASK)
> + wled->brightness = val;

This won't work for WLED5, you can implement backlight_ops.get_brightness()
and take advantage of having that function pointer

Otherwise I believe what this patch is good

Konrad