pwm: pwm-qti-lpg: Don't disable PWM during probe for fixed PWM mode

Currently PWM output is disabled during probe before
DT settings are applied. This is mainly required for LUT
patterns(used for LED breathing effect) to work properly.

However, this can cause issues for the use cases where PWM
output needs to stay ON from early boot up Eg - Display brightness
control.

To fix it, avoid disabling PWM HW for non-LUT pattern use cases
during probe.

Change-Id: I58395a6309514a8b8997915c9f26d219de55b9d7
Fixes: 35b2a64a03 ("pwm: pwm-qti-lpg: Disable PWM output during probe")
Signed-off-by: Kavya Nunna <quic_knunna@quicinc.com>
This commit is contained in:
Kavya Nunna 2024-03-01 17:11:18 +05:30
parent 30ed5a366d
commit 24eeb83b3f

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2023, Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2024, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#define pr_fmt(fmt) "%s: " fmt, __func__
@ -2039,11 +2039,13 @@ static int qpnp_lpg_probe(struct platform_device *pdev)
lpg = &chip->lpgs[i];
lpg->output_type = PWM_OUTPUT_FIXED;
rc = qpnp_lpg_pwm_src_enable(lpg, false);
if (rc < 0) {
dev_err(chip->dev, "Disable PWM output failed for channel %d, rc=%d\n",
if (chip->lut != NULL) {
rc = qpnp_lpg_pwm_src_enable(lpg, false);
if (rc < 0) {
dev_err(chip->dev, "Disable PWM output failed for channel %d, rc=%d\n",
lpg->lpg_idx, rc);
return rc;
return rc;
}
}
if (lpg->enable_pfm) {