* [PATCH v2 0/8] arm64: qcom: enable display card support on SM8150 HDK
@ 2026-10-19 11:25 Dmitry Baryshkov
2026-10-19 11:25 ` [PATCH v2 1/8] backlight: qcom-wled: fix string detection brightness on WLED5 Dmitry Baryshkov
` (8 more replies)
0 siblings, 9 replies; 17+ messages in thread
From: Dmitry Baryshkov @ 2026-10-19 11:25 UTC (permalink / raw)
To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Kiran Gunda,
Subbaraman Narayanamurthy, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephen Boyd, Bjorn Andersson,
Konrad Dybcio, Abel Vesa, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, linux-fbdev, linux-kernel, devicetree,
mfd, Konrad Dybcio, Krzysztof Kozlowski
The Qualcomm SM8150 HDK can be equipped with an optional display card
having the same panel as the display card for SDM845 HDK. Reuse the
driver submitted at [1] and enable display card support on this HDK.
Unlike SDM845, this also requires a new LCDB driver, providing voltage
for the panel and several fixes in the WLED driver. The FSA4480 address
fix is independent and can be applied earlier.
[1] https://lore.kernel.org/dri-devel/20261014-sdm845-hdk-v2-0-6d0b4b42f267@oss.qualcomm.com/
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
Changes in v2:
- Dropped WLED patch, duplicating one of the applied patches (Konrad)
- Rework the WLED auto-calibration patch, also dropping the reviews.
- Tighten voltages in LCDB example (Konrad) and in the DTSO.
- Renamed the node to regulator@ (Krzysztof)
- In LCDB driver, fixed handling of pull-down on disable, fixed caching
of the state, added REGULATOR_EVENT_FAIL and fixesd short-circuit
recovery (Sashiko)
- Link to v1: https://patch.msgid.link/20261015-sm8150-display-card-v1-0-5c14928cef29@oss.qualcomm.com
---
Dmitry Baryshkov (8):
backlight: qcom-wled: fix string detection brightness on WLED5
regulator: dt-bindings: add Qualcomm LCDB regulator
dt-bindings: mfd: qcom,spmi-pmic: add LCDB
regulator: add Qualcomm LCDB driver
arm64: dts: qcom: pm8150l: add LCDB regulators
arm64: dts: qcom: sm8150: add MDSS reset
arm64: dts: qcom: sm8150-hdk: fix FSA4480 address
arm64: dts: qcom: sm8150-hdk: add display card overlay
.../devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 4 +
.../bindings/regulator/qcom,pm8150l-lcdb.yaml | 81 ++++
arch/arm64/boot/dts/qcom/Makefile | 4 +
arch/arm64/boot/dts/qcom/pm8150l.dtsi | 14 +
.../boot/dts/qcom/sm8150-hdk-display-card.dtso | 113 +++++
arch/arm64/boot/dts/qcom/sm8150-hdk.dts | 4 +-
arch/arm64/boot/dts/qcom/sm8150.dtsi | 1 +
drivers/regulator/Kconfig | 8 +
drivers/regulator/Makefile | 1 +
drivers/regulator/qcom-lcdb-regulator.c | 494 +++++++++++++++++++++
drivers/video/backlight/qcom-wled.c | 56 +--
11 files changed, 746 insertions(+), 34 deletions(-)
---
base-commit: 2efb7a11f1aa4d2dc285fe2680cca22cb9f72f64
change-id: 20261014-sm8150-display-card-e43ee5b08c61
prerequisite-change-id: 20260122-sdm845-hdk-9466530c4267:v5
prerequisite-patch-id: cb272273cdb260eb5049ba5cfffe13e7904e7a70
prerequisite-patch-id: de7bcd02cfa3baa997e973220d71791b4e74b4cf
prerequisite-patch-id: efe1cd41bd8c1ddf7c9491a6fca5aec877afce3d
prerequisite-patch-id: 98360ae85418d09598608b3a6337aabd76eff717
prerequisite-patch-id: e46e47c4d158362a382efc455438ef1fd5c95f42
prerequisite-change-id: 20260908-qcom-wled-backlight-fd9574027353:v4
prerequisite-patch-id: ad71f17b07fe258da495c7df319d77c63ab9db7a
prerequisite-patch-id: 0403e028ec3ecac35344dbd6dfa430abb71d45f5
prerequisite-patch-id: 2294f3f59a928fb80b92ff9f1ea57d7eb47365cd
prerequisite-patch-id: 74b7c8ba3cc2e3d9475f4f219a8e8d10fc381d44
Best regards,
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 1/8] backlight: qcom-wled: fix string detection brightness on WLED5
2026-10-19 11:25 [PATCH v2 0/8] arm64: qcom: enable display card support on SM8150 HDK Dmitry Baryshkov
@ 2026-10-19 11:25 ` Dmitry Baryshkov
2026-10-19 11:25 ` [PATCH v2 2/8] regulator: dt-bindings: add Qualcomm LCDB regulator Dmitry Baryshkov
` (7 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Dmitry Baryshkov @ 2026-10-19 11:25 UTC (permalink / raw)
To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Kiran Gunda,
Subbaraman Narayanamurthy, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephen Boyd, Bjorn Andersson,
Konrad Dybcio, Abel Vesa, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, linux-fbdev, linux-kernel, devicetree,
mfd, Konrad Dybcio
The string detection sets the test brightness through
wled4_set_brightness(). On WLED5 that writes to unrelated registers and
the detection runs with whatever brightness has been programmed before.
Use the per-version callback. A WLED5 brightness write also only takes
effect once the module sync bit is toggled, which so far was done by
wled_update_status() alone. Toggle it in wled5_set_brightness() instead,
so that every caller of the callback gets the new value.
Fixes: 62a1d3f623ac ("backlight: qcom-wled: Add support for WLED5 peripheral that is present on PM8150L PMICs")
Assisted-by: LLM
Reviewed-by: Daniel Thompson (RISCstar) <danielt@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/video/backlight/qcom-wled.c | 56 ++++++++++++++++---------------------
1 file changed, 24 insertions(+), 32 deletions(-)
diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c
index ca350f320e17..c5243a6d547e 100644
--- a/drivers/video/backlight/qcom-wled.c
+++ b/drivers/video/backlight/qcom-wled.c
@@ -269,6 +269,24 @@ static int wled4_set_brightness(struct wled *wled, u16 brightness)
return 0;
}
+static int wled5_mod_sync_toggle(struct wled *wled)
+{
+ int rc;
+ u8 val;
+
+ rc = regmap_update_bits(wled->regmap,
+ wled->sink_addr + WLED5_SINK_REG_MOD_SYNC_BIT,
+ WLED5_SINK_REG_SYNC_MASK, 0);
+ if (rc < 0)
+ return rc;
+
+ val = (wled->cfg.mod_sel == MOD_A) ? WLED5_SINK_REG_SYNC_MOD_A_BIT :
+ WLED5_SINK_REG_SYNC_MOD_B_BIT;
+ return regmap_update_bits(wled->regmap,
+ wled->sink_addr + WLED5_SINK_REG_MOD_SYNC_BIT,
+ WLED5_SINK_REG_SYNC_MASK, val);
+}
+
static int wled5_set_brightness(struct wled *wled, u16 brightness)
{
int rc, offset;
@@ -287,7 +305,10 @@ static int wled5_set_brightness(struct wled *wled, u16 brightness)
rc = regmap_bulk_write(wled->regmap, wled->sink_addr + offset,
&v, sizeof(v));
- return rc;
+ if (rc < 0)
+ return rc;
+
+ return wled5_mod_sync_toggle(wled);
}
static int wled_read_brightness(struct wled *wled)
@@ -391,24 +412,6 @@ static int wled3_sync_toggle(struct wled *wled)
return rc;
}
-static int wled5_mod_sync_toggle(struct wled *wled)
-{
- int rc;
- u8 val;
-
- rc = regmap_update_bits(wled->regmap,
- wled->sink_addr + WLED5_SINK_REG_MOD_SYNC_BIT,
- WLED5_SINK_REG_SYNC_MASK, 0);
- if (rc < 0)
- return rc;
-
- val = (wled->cfg.mod_sel == MOD_A) ? WLED5_SINK_REG_SYNC_MOD_A_BIT :
- WLED5_SINK_REG_SYNC_MOD_B_BIT;
- return regmap_update_bits(wled->regmap,
- wled->sink_addr + WLED5_SINK_REG_MOD_SYNC_BIT,
- WLED5_SINK_REG_SYNC_MASK, val);
-}
-
static int wled_ovp_fault_status(struct wled *wled, bool *fault_set)
{
int rc;
@@ -494,17 +497,6 @@ static int wled_update_status(struct backlight_device *bl)
dev_err(wled->dev, "wled sync failed rc:%d\n", rc);
goto unlock_mutex;
}
- } else {
- /*
- * For WLED5 toggling the MOD_SYNC_BIT updates the
- * brightness
- */
- rc = wled5_mod_sync_toggle(wled);
- if (rc < 0) {
- dev_err(wled->dev, "wled mod sync failed rc:%d\n",
- rc);
- goto unlock_mutex;
- }
}
}
@@ -651,7 +643,7 @@ static void wled_auto_string_detection(struct wled *wled)
}
/* Set low brightness across all sinks */
- rc = wled4_set_brightness(wled, AUTO_DETECT_BRIGHTNESS);
+ rc = wled->wled_set_brightness(wled, AUTO_DETECT_BRIGHTNESS);
if (rc < 0) {
dev_err(wled->dev, "Failed to set brightness for auto detection rc=%d\n",
rc);
@@ -791,7 +783,7 @@ static void wled_auto_string_detection(struct wled *wled)
}
/* Restore brightness */
- rc = wled4_set_brightness(wled, wled->brightness);
+ rc = wled->wled_set_brightness(wled, wled->brightness);
if (rc < 0) {
dev_err(wled->dev, "Failed to set brightness after auto detection rc=%d\n",
rc);
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 2/8] regulator: dt-bindings: add Qualcomm LCDB regulator
2026-10-19 11:25 [PATCH v2 0/8] arm64: qcom: enable display card support on SM8150 HDK Dmitry Baryshkov
2026-10-19 11:25 ` [PATCH v2 1/8] backlight: qcom-wled: fix string detection brightness on WLED5 Dmitry Baryshkov
@ 2026-10-19 11:25 ` Dmitry Baryshkov
2026-10-19 11:25 ` [PATCH v2 3/8] dt-bindings: mfd: qcom,spmi-pmic: add LCDB Dmitry Baryshkov
` (6 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Dmitry Baryshkov @ 2026-10-19 11:25 UTC (permalink / raw)
To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Kiran Gunda,
Subbaraman Narayanamurthy, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephen Boyd, Bjorn Andersson,
Konrad Dybcio, Abel Vesa, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, linux-fbdev, linux-kernel, devicetree,
mfd, Krzysztof Kozlowski
Several Qualcomm PMICs have an LCDB block providing the positive and
negative bias rails for LCD panels. It is not supported by Linux, so
boards using it either model the rails as dummy fixed regulators and
depend on the state left by the bootloader.
Describe the LCDB regulator present on the PM8150L. Use it as a fallback
compatible for LCDB blocks on PMI632 and PM6150L. PM660L has a different
version of LCDB block, so it's not being covered.
Assisted-by: LLM
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
.../bindings/regulator/qcom,pm8150l-lcdb.yaml | 81 ++++++++++++++++++++++
1 file changed, 81 insertions(+)
diff --git a/Documentation/devicetree/bindings/regulator/qcom,pm8150l-lcdb.yaml b/Documentation/devicetree/bindings/regulator/qcom,pm8150l-lcdb.yaml
new file mode 100644
index 000000000000..d3cba1aa0c2e
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/qcom,pm8150l-lcdb.yaml
@@ -0,0 +1,81 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/qcom,pm8150l-lcdb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm LCDB (LCD Bias) regulator
+
+maintainers:
+ - Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
+
+description:
+ LCDB is the LCD panel bias supply found on Qualcomm PMICs such as PMI632,
+ PM6150L and PM8150L. It consists of a boost converter feeding an LDO, which
+ provides the positive bias rail, and an inverting charge pump (NCP), which
+ provides the negative one. Both rails are switched together by a single
+ module enable.
+
+properties:
+ compatible:
+ oneOf:
+ - const: qcom,pm8150l-lcdb
+ - items:
+ - enum:
+ - qcom,pm6150l-lcdb
+ - qcom,pmi632-lcdb
+ - const: qcom,pm8150l-lcdb
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ items:
+ - description: short circuit on one of the outputs
+
+ ldo:
+ type: object
+ $ref: regulator.yaml#
+ unevaluatedProperties: false
+ description: Positive bias rail.
+
+ ncp:
+ type: object
+ $ref: regulator.yaml#
+ unevaluatedProperties: false
+ description:
+ Negative bias rail. The voltage is specified as an absolute value.
+
+required:
+ - compatible
+ - reg
+ - interrupts
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ pmic {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ regulator@ec00 {
+ compatible = "qcom,pm8150l-lcdb";
+ reg = <0xec00>;
+ interrupts = <0x5 0xec 0x1 IRQ_TYPE_EDGE_RISING>;
+
+ ldo {
+ regulator-min-microvolt = <5500000>;
+ regulator-max-microvolt = <5500000>;
+ };
+
+ ncp {
+ regulator-min-microvolt = <5500000>;
+ regulator-max-microvolt = <5500000>;
+ };
+ };
+ };
+
+...
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 3/8] dt-bindings: mfd: qcom,spmi-pmic: add LCDB
2026-10-19 11:25 [PATCH v2 0/8] arm64: qcom: enable display card support on SM8150 HDK Dmitry Baryshkov
2026-10-19 11:25 ` [PATCH v2 1/8] backlight: qcom-wled: fix string detection brightness on WLED5 Dmitry Baryshkov
2026-10-19 11:25 ` [PATCH v2 2/8] regulator: dt-bindings: add Qualcomm LCDB regulator Dmitry Baryshkov
@ 2026-10-19 11:25 ` Dmitry Baryshkov
2026-10-19 11:25 ` [PATCH v2 4/8] regulator: add Qualcomm LCDB driver Dmitry Baryshkov
` (5 subsequent siblings)
8 siblings, 0 replies; 17+ messages in thread
From: Dmitry Baryshkov @ 2026-10-19 11:25 UTC (permalink / raw)
To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Kiran Gunda,
Subbaraman Narayanamurthy, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephen Boyd, Bjorn Andersson,
Konrad Dybcio, Abel Vesa, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, linux-fbdev, linux-kernel, devicetree,
mfd
Allow the LCDB regulator block as a child of the SPMI PMIC node.
Assisted-by: LLM
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
index f6534e9e9912..3ca32d741e68 100644
--- a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
+++ b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
@@ -191,6 +191,10 @@ patternProperties:
type: object
$ref: /schemas/power/reset/qcom,pon.yaml#
+ "^regulator@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/regulator/qcom,pm8150l-lcdb.yaml#
+
"^rtc@[0-9a-f]+$":
type: object
$ref: /schemas/rtc/qcom-pm8xxx-rtc.yaml#
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 4/8] regulator: add Qualcomm LCDB driver
2026-10-19 11:25 [PATCH v2 0/8] arm64: qcom: enable display card support on SM8150 HDK Dmitry Baryshkov
` (2 preceding siblings ...)
2026-10-19 11:25 ` [PATCH v2 3/8] dt-bindings: mfd: qcom,spmi-pmic: add LCDB Dmitry Baryshkov
@ 2026-10-19 11:25 ` Dmitry Baryshkov
2026-10-19 11:59 ` Konrad Dybcio
2026-10-19 11:25 ` [PATCH v2 5/8] arm64: dts: qcom: pm8150l: add LCDB regulators Dmitry Baryshkov
` (4 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Dmitry Baryshkov @ 2026-10-19 11:25 UTC (permalink / raw)
To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Kiran Gunda,
Subbaraman Narayanamurthy, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephen Boyd, Bjorn Andersson,
Konrad Dybcio, Abel Vesa, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, linux-fbdev, linux-kernel, devicetree,
mfd
LCD panels on boards with PMI632, PM6150L or PM8150L take their bias
rails from the LCDB block. Without a driver they only work as long as
the bootloader has enabled it and nothing turns it off.
Both rails sit behind a single module enable, so the module is kept on
while at least one of them is in use. The boost output is not exposed:
it follows the higher of the two rails plus the headroom. Enabling
starts at a lower voltage and ramps up in steps, and the LDO pull-down
is forced while disabling, both as done by the vendor driver.
On a short circuit the module is restarted, up to ten times within a
second. After that the outputs are kept off and the consumers are
notified.
Touch-to-wake and the current limit and soft start tuning are not
supported. Neither is PM660L, whose boost is programmed differently.
Assisted-by: LLM
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/regulator/Kconfig | 8 +
drivers/regulator/Makefile | 1 +
drivers/regulator/qcom-lcdb-regulator.c | 494 ++++++++++++++++++++++++++++++++
3 files changed, 503 insertions(+)
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index be6b72daa76f..9fd3f2c7e365 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -1915,4 +1915,12 @@ config REGULATOR_QCOM_LABIBB
boost regulator and IBB can be used as a negative boost regulator
for LCD display panel.
+config REGULATOR_QCOM_LCDB
+ tristate "Qualcomm LCDB regulator support"
+ depends on SPMI || COMPILE_TEST
+ help
+ This driver supports the LCDB (LCD bias) block found on Qualcomm
+ PMICs such as PMI632, PM6150L and PM8150L. It provides the positive
+ (LDO) and negative (NCP) bias rails for LCD panels.
+
endif
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 6aabcc54382a..84164d2b6c45 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -123,6 +123,7 @@ obj-$(CONFIG_REGULATOR_MT6397) += mt6397-regulator.o
obj-$(CONFIG_REGULATOR_MTK_DVFSRC) += mtk-dvfsrc-regulator.o
obj-$(CONFIG_REGULATOR_NEX10000UB) += nex10000ub-regulator.o
obj-$(CONFIG_REGULATOR_QCOM_LABIBB) += qcom-labibb-regulator.o
+obj-$(CONFIG_REGULATOR_QCOM_LCDB) += qcom-lcdb-regulator.o
obj-$(CONFIG_REGULATOR_QCOM_PM8008) += qcom-pm8008-regulator.o
obj-$(CONFIG_REGULATOR_QCOM_REFGEN) += qcom-refgen-regulator.o
obj-$(CONFIG_REGULATOR_QCOM_RPM) += qcom_rpm-regulator.o
diff --git a/drivers/regulator/qcom-lcdb-regulator.c b/drivers/regulator/qcom-lcdb-regulator.c
new file mode 100644
index 000000000000..bb2d4ee23ad5
--- /dev/null
+++ b/drivers/regulator/qcom-lcdb-regulator.c
@@ -0,0 +1,494 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#include <linux/bits.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/ktime.h>
+#include <linux/minmax.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/property.h>
+#include <linux/regmap.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/of_regulator.h>
+
+#define LCDB_INT_RT_STS 0x10
+#define LCDB_VREG_OK_RT_STS BIT(0)
+#define LCDB_SC_ERROR_RT_STS BIT(1)
+
+#define LCDB_BST_OUTPUT_VOLTAGE 0x41
+#define LCDB_BST_OUTPUT_VOLTAGE_MASK GENMASK(5, 0)
+
+#define LCDB_MODULE_RDY 0x45
+#define LCDB_MODULE_RDY_BIT BIT(7)
+
+#define LCDB_ENABLE_CTL1 0x46
+#define LCDB_MODULE_EN BIT(7)
+
+#define LCDB_LDO_OUTPUT_VOLTAGE 0x71
+#define LCDB_LDO_FORCE_PD_CTL 0x79
+#define LCDB_LDO_FORCE_PD_EN BIT(0)
+#define LCDB_LDO_FORCE_PD_MODE BIT(7)
+
+#define LCDB_NCP_OUTPUT_VOLTAGE 0x81
+
+#define LCDB_OUTPUT_VOLTAGE_MASK GENMASK(4, 0)
+
+#define LCDB_MIN_UV 4000000
+#define LCDB_STEP_100MV_UV 100000
+#define LCDB_50MV_MIN_UV 4950000
+#define LCDB_STEP_50MV_UV 50000
+#define LCDB_50MV_MIN_SEL 10
+#define LCDB_N_VOLTAGES 32
+
+#define LCDB_BST_MIN_UV 4700000
+#define LCDB_BST_MAX_UV 6275000
+#define LCDB_BST_STEP_UV 25000
+#define LCDB_BST_HEADROOM_UV 150000
+
+#define LCDB_RAMP_START_UV 4500000
+#define LCDB_RAMP_STEP_UV 500000
+
+#define LCDB_OFF_ON_DELAY_US 20000
+#define LCDB_VREG_OK_TIMEOUT_US 50000
+
+#define LCDB_SC_RESET_CNT_DLY_US 1000000
+#define LCDB_SC_CNT_MAX 10
+
+enum {
+ LCDB_LDO,
+ LCDB_NCP,
+ LCDB_NUM_RAILS,
+};
+
+struct qcom_lcdb {
+ struct device *dev;
+ struct regmap *regmap;
+ u32 base;
+
+ struct mutex lock;
+ struct regulator_dev *rdev[LCDB_NUM_RAILS];
+ int uV[LCDB_NUM_RAILS];
+ unsigned int enabled_mask;
+ ktime_t off_time;
+
+ bool sc_disabled;
+ int sc_count;
+ ktime_t sc_time;
+};
+
+static const u8 qcom_lcdb_vreg[LCDB_NUM_RAILS] = {
+ [LCDB_LDO] = LCDB_LDO_OUTPUT_VOLTAGE,
+ [LCDB_NCP] = LCDB_NCP_OUTPUT_VOLTAGE,
+};
+
+static unsigned int qcom_lcdb_uV_to_sel(int uV)
+{
+ if (uV < LCDB_50MV_MIN_UV)
+ return (uV - LCDB_MIN_UV) / LCDB_STEP_100MV_UV;
+
+ return LCDB_50MV_MIN_SEL + (uV - LCDB_50MV_MIN_UV) / LCDB_STEP_50MV_UV;
+}
+
+static int qcom_lcdb_sel_to_uV(unsigned int sel)
+{
+ if (sel < LCDB_50MV_MIN_SEL)
+ return LCDB_MIN_UV + sel * LCDB_STEP_100MV_UV;
+
+ return LCDB_50MV_MIN_UV + (sel - LCDB_50MV_MIN_SEL) * LCDB_STEP_50MV_UV;
+}
+
+static int qcom_lcdb_write_voltages(struct qcom_lcdb *lcdb, int ldo_uV, int ncp_uV)
+{
+ const int uV[LCDB_NUM_RAILS] = { ldo_uV, ncp_uV };
+ unsigned int bst_sel, cur_sel;
+ int bst_uV, ret, i;
+
+ bst_uV = clamp(max(ldo_uV, ncp_uV) + LCDB_BST_HEADROOM_UV,
+ LCDB_BST_MIN_UV, LCDB_BST_MAX_UV);
+ bst_sel = DIV_ROUND_UP(bst_uV - LCDB_BST_MIN_UV, LCDB_BST_STEP_UV);
+
+ ret = regmap_read(lcdb->regmap, lcdb->base + LCDB_BST_OUTPUT_VOLTAGE, &cur_sel);
+ if (ret)
+ return ret;
+ cur_sel &= LCDB_BST_OUTPUT_VOLTAGE_MASK;
+
+ /* The boost has to stay above both outputs while they are changing */
+ if (bst_sel > cur_sel) {
+ ret = regmap_update_bits(lcdb->regmap,
+ lcdb->base + LCDB_BST_OUTPUT_VOLTAGE,
+ LCDB_BST_OUTPUT_VOLTAGE_MASK, bst_sel);
+ if (ret)
+ return ret;
+ }
+
+ for (i = 0; i < LCDB_NUM_RAILS; i++) {
+ ret = regmap_update_bits(lcdb->regmap,
+ lcdb->base + qcom_lcdb_vreg[i],
+ LCDB_OUTPUT_VOLTAGE_MASK,
+ qcom_lcdb_uV_to_sel(uV[i]));
+ if (ret)
+ return ret;
+ }
+
+ if (bst_sel < cur_sel)
+ ret = regmap_update_bits(lcdb->regmap,
+ lcdb->base + LCDB_BST_OUTPUT_VOLTAGE,
+ LCDB_BST_OUTPUT_VOLTAGE_MASK, bst_sel);
+
+ return ret;
+}
+
+static int qcom_lcdb_write_limited(struct qcom_lcdb *lcdb, int limit_uV)
+{
+ return qcom_lcdb_write_voltages(lcdb,
+ min(lcdb->uV[LCDB_LDO], limit_uV),
+ min(lcdb->uV[LCDB_NCP], limit_uV));
+}
+
+static int qcom_lcdb_module_disable(struct qcom_lcdb *lcdb)
+{
+ int ret, pd_ret;
+
+ /* Force the LDO pull-down to discharge the output quickly */
+ ret = regmap_write(lcdb->regmap, lcdb->base + LCDB_LDO_FORCE_PD_CTL,
+ LCDB_LDO_FORCE_PD_EN | LCDB_LDO_FORCE_PD_MODE);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(lcdb->regmap, lcdb->base + LCDB_ENABLE_CTL1, 0);
+ if (!ret) {
+ lcdb->off_time = ktime_get();
+ usleep_range(10000, 11000);
+ }
+
+ pd_ret = regmap_write(lcdb->regmap, lcdb->base + LCDB_LDO_FORCE_PD_CTL, 0);
+
+ return ret ?: pd_ret;
+}
+
+static int qcom_lcdb_module_enable(struct qcom_lcdb *lcdb)
+{
+ int target_uV = max(lcdb->uV[LCDB_LDO], lcdb->uV[LCDB_NCP]);
+ int uV = LCDB_RAMP_START_UV;
+ unsigned int val;
+ s64 off_us;
+ int ret;
+
+ off_us = ktime_us_delta(ktime_get(), lcdb->off_time);
+ if (off_us < LCDB_OFF_ON_DELAY_US)
+ usleep_range(LCDB_OFF_ON_DELAY_US - off_us,
+ LCDB_OFF_ON_DELAY_US - off_us + 1000);
+
+ /* Start low and ramp the outputs up in steps to limit the inrush current */
+ ret = qcom_lcdb_write_limited(lcdb, uV);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(lcdb->regmap, lcdb->base + LCDB_ENABLE_CTL1,
+ LCDB_MODULE_EN);
+ if (ret)
+ return ret;
+
+ ret = regmap_read_poll_timeout(lcdb->regmap,
+ lcdb->base + LCDB_INT_RT_STS, val,
+ val & LCDB_VREG_OK_RT_STS,
+ 1000, LCDB_VREG_OK_TIMEOUT_US);
+ if (ret) {
+ dev_err(lcdb->dev, "outputs failed to come up: %d\n", ret);
+ goto err_disable;
+ }
+
+ usleep_range(10000, 11000);
+
+ while (uV < target_uV) {
+ uV += LCDB_RAMP_STEP_UV;
+
+ ret = qcom_lcdb_write_limited(lcdb, uV);
+ if (ret)
+ goto err_disable;
+
+ usleep_range(1000, 1100);
+ }
+
+ return 0;
+
+err_disable:
+ qcom_lcdb_module_disable(lcdb);
+
+ return ret;
+}
+
+static int qcom_lcdb_enable(struct regulator_dev *rdev)
+{
+ struct qcom_lcdb *lcdb = rdev_get_drvdata(rdev);
+ int ret = 0;
+
+ guard(mutex)(&lcdb->lock);
+
+ if (lcdb->sc_disabled)
+ return -EIO;
+
+ if (!lcdb->enabled_mask)
+ ret = qcom_lcdb_module_enable(lcdb);
+ if (ret)
+ return ret;
+
+ lcdb->enabled_mask |= BIT(rdev_get_id(rdev));
+
+ return 0;
+}
+
+static int qcom_lcdb_disable(struct regulator_dev *rdev)
+{
+ struct qcom_lcdb *lcdb = rdev_get_drvdata(rdev);
+ unsigned int mask;
+ int ret;
+
+ guard(mutex)(&lcdb->lock);
+
+ mask = lcdb->enabled_mask & ~BIT(rdev_get_id(rdev));
+ if (!mask && !lcdb->sc_disabled) {
+ ret = qcom_lcdb_module_disable(lcdb);
+ if (ret)
+ return ret;
+ }
+
+ lcdb->enabled_mask = mask;
+
+ return 0;
+}
+
+static int qcom_lcdb_is_enabled(struct regulator_dev *rdev)
+{
+ struct qcom_lcdb *lcdb = rdev_get_drvdata(rdev);
+
+ guard(mutex)(&lcdb->lock);
+
+ return !lcdb->sc_disabled && (lcdb->enabled_mask & BIT(rdev_get_id(rdev)));
+}
+
+static int qcom_lcdb_set_voltage_sel(struct regulator_dev *rdev, unsigned int sel)
+{
+ struct qcom_lcdb *lcdb = rdev_get_drvdata(rdev);
+ int id = rdev_get_id(rdev);
+ int uV[LCDB_NUM_RAILS];
+ int ret;
+
+ guard(mutex)(&lcdb->lock);
+
+ memcpy(uV, lcdb->uV, sizeof(uV));
+ uV[id] = qcom_lcdb_sel_to_uV(sel);
+
+ ret = qcom_lcdb_write_voltages(lcdb, uV[LCDB_LDO], uV[LCDB_NCP]);
+ if (ret)
+ return ret;
+
+ lcdb->uV[id] = uV[id];
+
+ return 0;
+}
+
+static int qcom_lcdb_get_voltage_sel(struct regulator_dev *rdev)
+{
+ struct qcom_lcdb *lcdb = rdev_get_drvdata(rdev);
+
+ guard(mutex)(&lcdb->lock);
+
+ return qcom_lcdb_uV_to_sel(lcdb->uV[rdev_get_id(rdev)]);
+}
+
+static const struct regulator_ops qcom_lcdb_ops = {
+ .enable = qcom_lcdb_enable,
+ .disable = qcom_lcdb_disable,
+ .is_enabled = qcom_lcdb_is_enabled,
+ .set_voltage_sel = qcom_lcdb_set_voltage_sel,
+ .get_voltage_sel = qcom_lcdb_get_voltage_sel,
+ .list_voltage = regulator_list_voltage_linear_range,
+ .map_voltage = regulator_map_voltage_linear_range,
+};
+
+static const struct linear_range qcom_lcdb_ranges[] = {
+ REGULATOR_LINEAR_RANGE(LCDB_MIN_UV, 0, LCDB_50MV_MIN_SEL - 1,
+ LCDB_STEP_100MV_UV),
+ REGULATOR_LINEAR_RANGE(LCDB_50MV_MIN_UV, LCDB_50MV_MIN_SEL,
+ LCDB_N_VOLTAGES - 1, LCDB_STEP_50MV_UV),
+};
+
+static const struct regulator_desc qcom_lcdb_descs[LCDB_NUM_RAILS] = {
+ [LCDB_LDO] = {
+ .name = "lcdb_ldo",
+ .of_match = "ldo",
+ .id = LCDB_LDO,
+ .ops = &qcom_lcdb_ops,
+ .type = REGULATOR_VOLTAGE,
+ .linear_ranges = qcom_lcdb_ranges,
+ .n_linear_ranges = ARRAY_SIZE(qcom_lcdb_ranges),
+ .n_voltages = LCDB_N_VOLTAGES,
+ .owner = THIS_MODULE,
+ },
+ [LCDB_NCP] = {
+ .name = "lcdb_ncp",
+ .of_match = "ncp",
+ .id = LCDB_NCP,
+ .ops = &qcom_lcdb_ops,
+ .type = REGULATOR_VOLTAGE,
+ .linear_ranges = qcom_lcdb_ranges,
+ .n_linear_ranges = ARRAY_SIZE(qcom_lcdb_ranges),
+ .n_voltages = LCDB_N_VOLTAGES,
+ .owner = THIS_MODULE,
+ },
+};
+
+static bool qcom_lcdb_handle_sc(struct qcom_lcdb *lcdb)
+{
+ guard(mutex)(&lcdb->lock);
+
+ if (!lcdb->enabled_mask || lcdb->sc_disabled)
+ return false;
+
+ qcom_lcdb_module_disable(lcdb);
+
+ if (ktime_us_delta(ktime_get(), lcdb->sc_time) > LCDB_SC_RESET_CNT_DLY_US) {
+ lcdb->sc_count = 0;
+ } else if (lcdb->sc_count > LCDB_SC_CNT_MAX) {
+ dev_err(lcdb->dev, "persistent short circuit, keeping the outputs off\n");
+ lcdb->sc_disabled = true;
+ return true;
+ }
+
+ lcdb->sc_count++;
+ lcdb->sc_time = ktime_get();
+
+ if (qcom_lcdb_module_enable(lcdb)) {
+ dev_err(lcdb->dev, "failed to recover from a short circuit\n");
+ lcdb->sc_disabled = true;
+ return true;
+ }
+
+ return false;
+}
+
+static irqreturn_t qcom_lcdb_sc_irq(int irq, void *data)
+{
+ struct qcom_lcdb *lcdb = data;
+ unsigned int val;
+ int ret, i;
+
+ ret = regmap_read(lcdb->regmap, lcdb->base + LCDB_INT_RT_STS, &val);
+ if (ret || !(val & LCDB_SC_ERROR_RT_STS))
+ return IRQ_HANDLED;
+
+ /* Blanking time, a real short circuit is still reported afterwards */
+ usleep_range(2000, 2100);
+
+ ret = regmap_read(lcdb->regmap, lcdb->base + LCDB_INT_RT_STS, &val);
+ if (ret || !(val & LCDB_SC_ERROR_RT_STS))
+ return IRQ_HANDLED;
+
+ if (qcom_lcdb_handle_sc(lcdb)) {
+ for (i = 0; i < LCDB_NUM_RAILS; i++)
+ regulator_notifier_call_chain(lcdb->rdev[i],
+ REGULATOR_EVENT_FAIL, NULL);
+ }
+
+ return IRQ_HANDLED;
+}
+
+static int qcom_lcdb_hw_init(struct qcom_lcdb *lcdb)
+{
+ unsigned int val;
+ int ret, i;
+
+ for (i = 0; i < LCDB_NUM_RAILS; i++) {
+ ret = regmap_read(lcdb->regmap, lcdb->base + qcom_lcdb_vreg[i], &val);
+ if (ret)
+ return ret;
+
+ lcdb->uV[i] = qcom_lcdb_sel_to_uV(val & LCDB_OUTPUT_VOLTAGE_MASK);
+ }
+
+ ret = regmap_read(lcdb->regmap, lcdb->base + LCDB_ENABLE_CTL1, &val);
+ if (ret)
+ return ret;
+
+ if (val & LCDB_MODULE_EN) {
+ lcdb->enabled_mask = GENMASK(LCDB_NUM_RAILS - 1, 0);
+ return 0;
+ }
+
+ return regmap_set_bits(lcdb->regmap, lcdb->base + LCDB_MODULE_RDY,
+ LCDB_MODULE_RDY_BIT);
+}
+
+static int qcom_lcdb_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct regulator_config cfg = {};
+ struct qcom_lcdb *lcdb;
+ int irq, ret, i;
+
+ lcdb = devm_kzalloc(dev, sizeof(*lcdb), GFP_KERNEL);
+ if (!lcdb)
+ return -ENOMEM;
+
+ lcdb->dev = dev;
+
+ lcdb->regmap = dev_get_regmap(dev->parent, NULL);
+ if (!lcdb->regmap)
+ return dev_err_probe(dev, -ENODEV, "failed to get the parent regmap\n");
+
+ ret = device_property_read_u32(dev, "reg", &lcdb->base);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to get the base address\n");
+
+ ret = devm_mutex_init(dev, &lcdb->lock);
+ if (ret)
+ return ret;
+
+ ret = qcom_lcdb_hw_init(lcdb);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to read the initial state\n");
+
+ cfg.dev = dev;
+ cfg.regmap = lcdb->regmap;
+ cfg.driver_data = lcdb;
+
+ for (i = 0; i < LCDB_NUM_RAILS; i++) {
+ lcdb->rdev[i] = devm_regulator_register(dev, &qcom_lcdb_descs[i], &cfg);
+ if (IS_ERR(lcdb->rdev[i]))
+ return dev_err_probe(dev, PTR_ERR(lcdb->rdev[i]),
+ "failed to register %s\n",
+ qcom_lcdb_descs[i].name);
+ }
+
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;
+
+ return devm_request_threaded_irq(dev, irq, NULL, qcom_lcdb_sc_irq,
+ IRQF_ONESHOT, "lcdb-sc", lcdb);
+}
+
+static const struct of_device_id qcom_lcdb_match[] = {
+ { .compatible = "qcom,pm8150l-lcdb" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, qcom_lcdb_match);
+
+static struct platform_driver qcom_lcdb_driver = {
+ .driver = {
+ .name = "qcom-lcdb-regulator",
+ .of_match_table = qcom_lcdb_match,
+ },
+ .probe = qcom_lcdb_probe,
+};
+module_platform_driver(qcom_lcdb_driver);
+
+MODULE_DESCRIPTION("Qualcomm LCDB (LCD bias) regulator driver");
+MODULE_LICENSE("GPL");
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 5/8] arm64: dts: qcom: pm8150l: add LCDB regulators
2026-10-19 11:25 [PATCH v2 0/8] arm64: qcom: enable display card support on SM8150 HDK Dmitry Baryshkov
` (3 preceding siblings ...)
2026-10-19 11:25 ` [PATCH v2 4/8] regulator: add Qualcomm LCDB driver Dmitry Baryshkov
@ 2026-10-19 11:25 ` Dmitry Baryshkov
2026-10-19 11:47 ` Abel Vesa
2026-10-19 11:48 ` Konrad Dybcio
2026-10-19 11:25 ` [PATCH v2 6/8] arm64: dts: qcom: sm8150: add MDSS reset Dmitry Baryshkov
` (3 subsequent siblings)
8 siblings, 2 replies; 17+ messages in thread
From: Dmitry Baryshkov @ 2026-10-19 11:25 UTC (permalink / raw)
To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Kiran Gunda,
Subbaraman Narayanamurthy, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephen Boyd, Bjorn Andersson,
Konrad Dybcio, Abel Vesa, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, linux-fbdev, linux-kernel, devicetree,
mfd
Describe the LCDB block providing the LCD bias rails. Leave empty
regulator nodes, forcing board files to provide correct voltage.
Assisted-by: LLM
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
arch/arm64/boot/dts/qcom/pm8150l.dtsi | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/pm8150l.dtsi b/arch/arm64/boot/dts/qcom/pm8150l.dtsi
index 3911d6d0d2e2..8d2136d165b1 100644
--- a/arch/arm64/boot/dts/qcom/pm8150l.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm8150l.dtsi
@@ -141,5 +141,19 @@ pm8150l_wled: leds@d800 {
status = "disabled";
};
+
+ pm8150l_lcdb: regulator@ec00 {
+ compatible = "qcom,pm8150l-lcdb";
+ reg = <0xec00>;
+ interrupts = <0x5 0xec 0x1 IRQ_TYPE_EDGE_RISING>;
+
+ status = "disabled";
+
+ pm8150l_lcdb_ldo: ldo {
+ };
+
+ pm8150l_lcdb_ncp: ncp {
+ };
+ };
};
};
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 6/8] arm64: dts: qcom: sm8150: add MDSS reset
2026-10-19 11:25 [PATCH v2 0/8] arm64: qcom: enable display card support on SM8150 HDK Dmitry Baryshkov
` (4 preceding siblings ...)
2026-10-19 11:25 ` [PATCH v2 5/8] arm64: dts: qcom: pm8150l: add LCDB regulators Dmitry Baryshkov
@ 2026-10-19 11:25 ` Dmitry Baryshkov
2026-10-19 11:46 ` Abel Vesa
2026-10-19 11:25 ` [PATCH v2 7/8] arm64: dts: qcom: sm8150-hdk: fix FSA4480 address Dmitry Baryshkov
` (2 subsequent siblings)
8 siblings, 1 reply; 17+ messages in thread
From: Dmitry Baryshkov @ 2026-10-19 11:25 UTC (permalink / raw)
To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Kiran Gunda,
Subbaraman Narayanamurthy, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephen Boyd, Bjorn Andersson,
Konrad Dybcio, Abel Vesa, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, linux-fbdev, linux-kernel, devicetree,
mfd, Konrad Dybcio
The bootloader can leave the display running, as it does on the SM8150
HDK with the display card attached. Describe the MDSS reset so that the
driver can bring the hardware into a known state before using it.
Assisted-by: LLM
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
arch/arm64/boot/dts/qcom/sm8150.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
index 293fcbacff34..a2d6e6947c4c 100644
--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
@@ -3817,6 +3817,7 @@ mdss: display-subsystem@ae00000 {
iommus = <&apps_smmu 0x800 0x420>;
+ resets = <&dispcc DISP_CC_MDSS_CORE_BCR>;
status = "disabled";
#address-cells = <2>;
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 7/8] arm64: dts: qcom: sm8150-hdk: fix FSA4480 address
2026-10-19 11:25 [PATCH v2 0/8] arm64: qcom: enable display card support on SM8150 HDK Dmitry Baryshkov
` (5 preceding siblings ...)
2026-10-19 11:25 ` [PATCH v2 6/8] arm64: dts: qcom: sm8150: add MDSS reset Dmitry Baryshkov
@ 2026-10-19 11:25 ` Dmitry Baryshkov
2026-10-19 11:46 ` Abel Vesa
2026-10-19 11:25 ` [PATCH v2 8/8] arm64: dts: qcom: sm8150-hdk: add display card overlay Dmitry Baryshkov
2026-10-19 11:32 ` [PATCH v2 0/8] arm64: qcom: enable display card support on SM8150 HDK Konrad Dybcio
8 siblings, 1 reply; 17+ messages in thread
From: Dmitry Baryshkov @ 2026-10-19 11:25 UTC (permalink / raw)
To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Kiran Gunda,
Subbaraman Narayanamurthy, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephen Boyd, Bjorn Andersson,
Konrad Dybcio, Abel Vesa, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, linux-fbdev, linux-kernel, devicetree,
mfd, Konrad Dybcio
The FSA4480 on the SM8150 HDK responds at 0x43 rather than 0x42. With
the wrong address the mux driver fails to probe, the Type-C controller
and the DisplayPort controller keep waiting for it and the display
subsystem never binds.
Fixes: ba712fd55c7b ("arm64: dts: qcom: sm8150-hdk: enable DisplayPort and USB-C altmode")
Assisted-by: LLM
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
arch/arm64/boot/dts/qcom/sm8150-hdk.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sm8150-hdk.dts b/arch/arm64/boot/dts/qcom/sm8150-hdk.dts
index cdced5c848d3..8f4ea981bb89 100644
--- a/arch/arm64/boot/dts/qcom/sm8150-hdk.dts
+++ b/arch/arm64/boot/dts/qcom/sm8150-hdk.dts
@@ -434,9 +434,9 @@ &i2c4 {
status = "okay";
- typec-mux@42 {
+ typec-mux@43 {
compatible = "fcs,fsa4480";
- reg = <0x42>;
+ reg = <0x43>;
interrupts-extended = <&tlmm 152 IRQ_TYPE_LEVEL_LOW>;
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v2 8/8] arm64: dts: qcom: sm8150-hdk: add display card overlay
2026-10-19 11:25 [PATCH v2 0/8] arm64: qcom: enable display card support on SM8150 HDK Dmitry Baryshkov
` (6 preceding siblings ...)
2026-10-19 11:25 ` [PATCH v2 7/8] arm64: dts: qcom: sm8150-hdk: fix FSA4480 address Dmitry Baryshkov
@ 2026-10-19 11:25 ` Dmitry Baryshkov
2026-10-19 11:47 ` Konrad Dybcio
2026-10-19 11:47 ` Abel Vesa
2026-10-19 11:32 ` [PATCH v2 0/8] arm64: qcom: enable display card support on SM8150 HDK Konrad Dybcio
8 siblings, 2 replies; 17+ messages in thread
From: Dmitry Baryshkov @ 2026-10-19 11:25 UTC (permalink / raw)
To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Kiran Gunda,
Subbaraman Narayanamurthy, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephen Boyd, Bjorn Andersson,
Konrad Dybcio, Abel Vesa, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, linux-fbdev, linux-kernel, devicetree,
mfd
The SM8150 HDK can be fitted with a display card carrying a Truly
NT36850 WQHD dual-DSI panel. It uses the PM8150L WLED for the backlight
and LCDB for the bias rails, and it is mutually exclusive with the
on-board LT9611 HDMI bridge.
Only two of the three WLED strings are connected on the card: the
backlight stays dark and the boost runs into the overvoltage limit if
only the third string is driven.
Assisted-by: LLM
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
arch/arm64/boot/dts/qcom/Makefile | 4 +
.../boot/dts/qcom/sm8150-hdk-display-card.dtso | 113 +++++++++++++++++++++
2 files changed, 117 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
index 85d06a950b4a..571bda210d63 100644
--- a/arch/arm64/boot/dts/qcom/Makefile
+++ b/arch/arm64/boot/dts/qcom/Makefile
@@ -409,6 +409,10 @@ dtb-$(CONFIG_ARCH_QCOM) += sm7325-nothing-spacewar.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm7325-xiaomi-lisa.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm7325-xiaomi-taoyao.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm8150-hdk.dtb
+
+sm8150-hdk-display-card-dtbs := sm8150-hdk.dtb sm8150-hdk-display-card.dtbo
+
+dtb-$(CONFIG_ARCH_QCOM) += sm8150-hdk-display-card.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm8150-microsoft-surface-duo.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm8150-mtp.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm8150-sony-xperia-kumano-bahamut.dtb
diff --git a/arch/arm64/boot/dts/qcom/sm8150-hdk-display-card.dtso b/arch/arm64/boot/dts/qcom/sm8150-hdk-display-card.dtso
new file mode 100644
index 000000000000..bd57459f9c86
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/sm8150-hdk-display-card.dtso
@@ -0,0 +1,113 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+/*
+ * Display Card kit overlay.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/dts-v1/;
+/plugin/;
+
+/* Disable HDMI bridge related nodes (mutually exclusive with the display card) */
+<9611_codec {
+ status = "disabled";
+};
+
+&mdss_dsi0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ panel@0 {
+ compatible = "truly,wqhd60-nt36850";
+ reg = <0>;
+
+ reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>;
+
+ vddio-supply = <&vreg_l14a_1p8>;
+ avdd-supply = <&pm8150l_lcdb_ldo>;
+ avee-supply = <&pm8150l_lcdb_ncp>;
+
+ backlight = <&pm8150l_wled>;
+
+ pinctrl-0 = <&disp0_reset_n_active>, <&mdp_vsync>;
+ pinctrl-1 = <&disp0_reset_n_suspend>, <&mdp_vsync>;
+ pinctrl-names = "default", "sleep";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+
+ panel0_in: endpoint {
+ remote-endpoint = <&mdss_dsi0_out>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+
+ panel1_in: endpoint {
+ remote-endpoint = <&mdss_dsi1_out>;
+ };
+ };
+ };
+ };
+};
+
+&mdss_dsi0_out {
+ remote-endpoint = <&panel0_in>;
+};
+
+&mdss_dsi1_out {
+ remote-endpoint = <&panel1_in>;
+};
+
+&pm8150l_lcdb {
+ status = "okay";
+};
+
+&pm8150l_lcdb_ldo {
+ regulator-min-microvolt = <5500000>;
+ regulator-max-microvolt = <5500000>;
+};
+
+&pm8150l_lcdb_ncp {
+ regulator-min-microvolt = <5500000>;
+ regulator-max-microvolt = <5500000>;
+};
+
+&pm8150l_wled {
+ qcom,num-strings = <2>;
+
+ status = "okay";
+};
+
+&tlmm {
+ disp0_reset_n_active: disp0-reset-n-active-state {
+ pins = "gpio6";
+ function = "gpio";
+ drive-strength = <8>;
+ bias-disable;
+ };
+
+ disp0_reset_n_suspend: disp0-reset-n-suspend-state {
+ pins = "gpio6";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-pull-down;
+ };
+
+ mdp_vsync: mdp-vsync-state {
+ pins = "gpio8";
+ function = "mdp_vsync";
+ drive-strength = <2>;
+ bias-pull-down;
+ };
+};
--
2.47.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v2 0/8] arm64: qcom: enable display card support on SM8150 HDK
2026-10-19 11:25 [PATCH v2 0/8] arm64: qcom: enable display card support on SM8150 HDK Dmitry Baryshkov
` (7 preceding siblings ...)
2026-10-19 11:25 ` [PATCH v2 8/8] arm64: dts: qcom: sm8150-hdk: add display card overlay Dmitry Baryshkov
@ 2026-10-19 11:32 ` Konrad Dybcio
8 siblings, 0 replies; 17+ messages in thread
From: Konrad Dybcio @ 2026-10-19 11:32 UTC (permalink / raw)
To: Dmitry Baryshkov, Lee Jones, Daniel Thompson, Jingoo Han,
Helge Deller, Kiran Gunda, Subbaraman Narayanamurthy,
Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Stephen Boyd, Bjorn Andersson, Konrad Dybcio,
Abel Vesa, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, linux-fbdev, linux-kernel, devicetree,
mfd, Krzysztof Kozlowski
On 10/19/26 1:25 PM, Dmitry Baryshkov wrote:
> The Qualcomm SM8150 HDK can be equipped with an optional display card
> having the same panel as the display card for SDM845 HDK. Reuse the
> driver submitted at [1] and enable display card support on this HDK.
>
> Unlike SDM845, this also requires a new LCDB driver, providing voltage
> for the panel and several fixes in the WLED driver. The FSA4480 address
> fix is independent and can be applied earlier.
>
> [1] https://lore.kernel.org/dri-devel/20261014-sdm845-hdk-v2-0-6d0b4b42f267@oss.qualcomm.com/
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> Changes in v2:
> - Dropped WLED patch, duplicating one of the applied patches (Konrad)
> - Rework the WLED auto-calibration patch, also dropping the reviews.
The latter failed to complete
Konrad
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 7/8] arm64: dts: qcom: sm8150-hdk: fix FSA4480 address
2026-10-19 11:25 ` [PATCH v2 7/8] arm64: dts: qcom: sm8150-hdk: fix FSA4480 address Dmitry Baryshkov
@ 2026-10-19 11:46 ` Abel Vesa
0 siblings, 0 replies; 17+ messages in thread
From: Abel Vesa @ 2026-10-19 11:46 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Kiran Gunda,
Subbaraman Narayanamurthy, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephen Boyd, Bjorn Andersson,
Konrad Dybcio, Abel Vesa, Dmitry Baryshkov, linux-arm-msm,
dri-devel, linux-fbdev, linux-kernel, devicetree, mfd,
Konrad Dybcio
On 26-10-19 14:25:43, Dmitry Baryshkov wrote:
> The FSA4480 on the SM8150 HDK responds at 0x43 rather than 0x42. With
> the wrong address the mux driver fails to probe, the Type-C controller
> and the DisplayPort controller keep waiting for it and the display
> subsystem never binds.
>
> Fixes: ba712fd55c7b ("arm64: dts: qcom: sm8150-hdk: enable DisplayPort and USB-C altmode")
> Assisted-by: LLM
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 6/8] arm64: dts: qcom: sm8150: add MDSS reset
2026-10-19 11:25 ` [PATCH v2 6/8] arm64: dts: qcom: sm8150: add MDSS reset Dmitry Baryshkov
@ 2026-10-19 11:46 ` Abel Vesa
0 siblings, 0 replies; 17+ messages in thread
From: Abel Vesa @ 2026-10-19 11:46 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Kiran Gunda,
Subbaraman Narayanamurthy, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephen Boyd, Bjorn Andersson,
Konrad Dybcio, Abel Vesa, Dmitry Baryshkov, linux-arm-msm,
dri-devel, linux-fbdev, linux-kernel, devicetree, mfd,
Konrad Dybcio
On 26-10-19 14:25:42, Dmitry Baryshkov wrote:
> The bootloader can leave the display running, as it does on the SM8150
> HDK with the display card attached. Describe the MDSS reset so that the
> driver can bring the hardware into a known state before using it.
>
> Assisted-by: LLM
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 5/8] arm64: dts: qcom: pm8150l: add LCDB regulators
2026-10-19 11:25 ` [PATCH v2 5/8] arm64: dts: qcom: pm8150l: add LCDB regulators Dmitry Baryshkov
@ 2026-10-19 11:47 ` Abel Vesa
2026-10-19 11:48 ` Konrad Dybcio
1 sibling, 0 replies; 17+ messages in thread
From: Abel Vesa @ 2026-10-19 11:47 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Kiran Gunda,
Subbaraman Narayanamurthy, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephen Boyd, Bjorn Andersson,
Konrad Dybcio, Abel Vesa, Dmitry Baryshkov, linux-arm-msm,
dri-devel, linux-fbdev, linux-kernel, devicetree, mfd
On 26-10-19 14:25:41, Dmitry Baryshkov wrote:
> Describe the LCDB block providing the LCD bias rails. Leave empty
> regulator nodes, forcing board files to provide correct voltage.
>
> Assisted-by: LLM
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 8/8] arm64: dts: qcom: sm8150-hdk: add display card overlay
2026-10-19 11:25 ` [PATCH v2 8/8] arm64: dts: qcom: sm8150-hdk: add display card overlay Dmitry Baryshkov
@ 2026-10-19 11:47 ` Konrad Dybcio
2026-10-19 11:47 ` Abel Vesa
1 sibling, 0 replies; 17+ messages in thread
From: Konrad Dybcio @ 2026-10-19 11:47 UTC (permalink / raw)
To: Dmitry Baryshkov, Lee Jones, Daniel Thompson, Jingoo Han,
Helge Deller, Kiran Gunda, Subbaraman Narayanamurthy,
Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Stephen Boyd, Bjorn Andersson, Konrad Dybcio,
Abel Vesa, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, linux-fbdev, linux-kernel, devicetree,
mfd
On 10/19/26 1:25 PM, Dmitry Baryshkov wrote:
> The SM8150 HDK can be fitted with a display card carrying a Truly
> NT36850 WQHD dual-DSI panel. It uses the PM8150L WLED for the backlight
> and LCDB for the bias rails, and it is mutually exclusive with the
> on-board LT9611 HDMI bridge.
>
> Only two of the three WLED strings are connected on the card: the
> backlight stays dark and the boost runs into the overvoltage limit if
> only the third string is driven.
>
> Assisted-by: LLM
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 8/8] arm64: dts: qcom: sm8150-hdk: add display card overlay
2026-10-19 11:25 ` [PATCH v2 8/8] arm64: dts: qcom: sm8150-hdk: add display card overlay Dmitry Baryshkov
2026-10-19 11:47 ` Konrad Dybcio
@ 2026-10-19 11:47 ` Abel Vesa
1 sibling, 0 replies; 17+ messages in thread
From: Abel Vesa @ 2026-10-19 11:47 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Kiran Gunda,
Subbaraman Narayanamurthy, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Stephen Boyd, Bjorn Andersson,
Konrad Dybcio, Abel Vesa, Dmitry Baryshkov, linux-arm-msm,
dri-devel, linux-fbdev, linux-kernel, devicetree, mfd
On 26-10-19 14:25:44, Dmitry Baryshkov wrote:
> The SM8150 HDK can be fitted with a display card carrying a Truly
> NT36850 WQHD dual-DSI panel. It uses the PM8150L WLED for the backlight
> and LCDB for the bias rails, and it is mutually exclusive with the
> on-board LT9611 HDMI bridge.
>
> Only two of the three WLED strings are connected on the card: the
> backlight stays dark and the boost runs into the overvoltage limit if
> only the third string is driven.
>
> Assisted-by: LLM
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 5/8] arm64: dts: qcom: pm8150l: add LCDB regulators
2026-10-19 11:25 ` [PATCH v2 5/8] arm64: dts: qcom: pm8150l: add LCDB regulators Dmitry Baryshkov
2026-10-19 11:47 ` Abel Vesa
@ 2026-10-19 11:48 ` Konrad Dybcio
1 sibling, 0 replies; 17+ messages in thread
From: Konrad Dybcio @ 2026-10-19 11:48 UTC (permalink / raw)
To: Dmitry Baryshkov, Lee Jones, Daniel Thompson, Jingoo Han,
Helge Deller, Kiran Gunda, Subbaraman Narayanamurthy,
Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Stephen Boyd, Bjorn Andersson, Konrad Dybcio,
Abel Vesa, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, linux-fbdev, linux-kernel, devicetree,
mfd
On 10/19/26 1:25 PM, Dmitry Baryshkov wrote:
> Describe the LCDB block providing the LCD bias rails. Leave empty
> regulator nodes, forcing board files to provide correct voltage.
>
> Assisted-by: LLM
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2 4/8] regulator: add Qualcomm LCDB driver
2026-10-19 11:25 ` [PATCH v2 4/8] regulator: add Qualcomm LCDB driver Dmitry Baryshkov
@ 2026-10-19 11:59 ` Konrad Dybcio
0 siblings, 0 replies; 17+ messages in thread
From: Konrad Dybcio @ 2026-10-19 11:59 UTC (permalink / raw)
To: Dmitry Baryshkov, Lee Jones, Daniel Thompson, Jingoo Han,
Helge Deller, Kiran Gunda, Subbaraman Narayanamurthy,
Liam Girdwood, Mark Brown, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Stephen Boyd, Bjorn Andersson, Konrad Dybcio,
Abel Vesa, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, linux-fbdev, linux-kernel, devicetree,
mfd
On 10/19/26 1:25 PM, Dmitry Baryshkov wrote:
> LCD panels on boards with PMI632, PM6150L or PM8150L take their bias
> rails from the LCDB block. Without a driver they only work as long as
> the bootloader has enabled it and nothing turns it off.
[...]
> +static bool qcom_lcdb_handle_sc(struct qcom_lcdb *lcdb)
> +{
> + guard(mutex)(&lcdb->lock);
> +
> + if (!lcdb->enabled_mask || lcdb->sc_disabled)
> + return false;
> +
> + qcom_lcdb_module_disable(lcdb);
> +
> + if (ktime_us_delta(ktime_get(), lcdb->sc_time) > LCDB_SC_RESET_CNT_DLY_US) {
> + lcdb->sc_count = 0;
> + } else if (lcdb->sc_count > LCDB_SC_CNT_MAX) {
> + dev_err(lcdb->dev, "persistent short circuit, keeping the outputs off\n");
> + lcdb->sc_disabled = true;
> + return true;
> + }
> +
> + lcdb->sc_count++;
> + lcdb->sc_time = ktime_get();
GPT:
The commit message says to restart up to ten times within one second,
but sc_time is updated on every fault.
Konrad
> +
> + if (qcom_lcdb_module_enable(lcdb)) {
> + dev_err(lcdb->dev, "failed to recover from a short circuit\n");
> + lcdb->sc_disabled = true;
> + return true;
> + }
> +
> + return false;
> +}
> +
> +static irqreturn_t qcom_lcdb_sc_irq(int irq, void *data)
> +{
> + struct qcom_lcdb *lcdb = data;
> + unsigned int val;
> + int ret, i;
> +
> + ret = regmap_read(lcdb->regmap, lcdb->base + LCDB_INT_RT_STS, &val);
> + if (ret || !(val & LCDB_SC_ERROR_RT_STS))
> + return IRQ_HANDLED;
> +
> + /* Blanking time, a real short circuit is still reported afterwards */
> + usleep_range(2000, 2100);
> +
> + ret = regmap_read(lcdb->regmap, lcdb->base + LCDB_INT_RT_STS, &val);
> + if (ret || !(val & LCDB_SC_ERROR_RT_STS))
> + return IRQ_HANDLED;
> +
> + if (qcom_lcdb_handle_sc(lcdb)) {
> + for (i = 0; i < LCDB_NUM_RAILS; i++)
> + regulator_notifier_call_chain(lcdb->rdev[i],
> + REGULATOR_EVENT_FAIL, NULL);
> + }
> +
> + return IRQ_HANDLED;
> +}
> +
> +static int qcom_lcdb_hw_init(struct qcom_lcdb *lcdb)
> +{
> + unsigned int val;
> + int ret, i;
> +
> + for (i = 0; i < LCDB_NUM_RAILS; i++) {
> + ret = regmap_read(lcdb->regmap, lcdb->base + qcom_lcdb_vreg[i], &val);
> + if (ret)
> + return ret;
> +
> + lcdb->uV[i] = qcom_lcdb_sel_to_uV(val & LCDB_OUTPUT_VOLTAGE_MASK);
> + }
> +
> + ret = regmap_read(lcdb->regmap, lcdb->base + LCDB_ENABLE_CTL1, &val);
> + if (ret)
> + return ret;
> +
> + if (val & LCDB_MODULE_EN) {
> + lcdb->enabled_mask = GENMASK(LCDB_NUM_RAILS - 1, 0);
> + return 0;
> + }
> +
> + return regmap_set_bits(lcdb->regmap, lcdb->base + LCDB_MODULE_RDY,
> + LCDB_MODULE_RDY_BIT);
> +}
> +
> +static int qcom_lcdb_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct regulator_config cfg = {};
> + struct qcom_lcdb *lcdb;
> + int irq, ret, i;
> +
> + lcdb = devm_kzalloc(dev, sizeof(*lcdb), GFP_KERNEL);
> + if (!lcdb)
> + return -ENOMEM;
> +
> + lcdb->dev = dev;
> +
> + lcdb->regmap = dev_get_regmap(dev->parent, NULL);
> + if (!lcdb->regmap)
> + return dev_err_probe(dev, -ENODEV, "failed to get the parent regmap\n");
> +
> + ret = device_property_read_u32(dev, "reg", &lcdb->base);
> + if (ret)
> + return dev_err_probe(dev, ret, "failed to get the base address\n");
> +
> + ret = devm_mutex_init(dev, &lcdb->lock);
> + if (ret)
> + return ret;
> +
> + ret = qcom_lcdb_hw_init(lcdb);
> + if (ret)
> + return dev_err_probe(dev, ret, "failed to read the initial state\n");
> +
> + cfg.dev = dev;
> + cfg.regmap = lcdb->regmap;
> + cfg.driver_data = lcdb;
> +
> + for (i = 0; i < LCDB_NUM_RAILS; i++) {
> + lcdb->rdev[i] = devm_regulator_register(dev, &qcom_lcdb_descs[i], &cfg);
> + if (IS_ERR(lcdb->rdev[i]))
> + return dev_err_probe(dev, PTR_ERR(lcdb->rdev[i]),
> + "failed to register %s\n",
> + qcom_lcdb_descs[i].name);
> + }
> +
> + irq = platform_get_irq(pdev, 0);
> + if (irq < 0)
> + return irq;
> +
> + return devm_request_threaded_irq(dev, irq, NULL, qcom_lcdb_sc_irq,
> + IRQF_ONESHOT, "lcdb-sc", lcdb);
> +}
> +
> +static const struct of_device_id qcom_lcdb_match[] = {
> + { .compatible = "qcom,pm8150l-lcdb" },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, qcom_lcdb_match);
> +
> +static struct platform_driver qcom_lcdb_driver = {
> + .driver = {
> + .name = "qcom-lcdb-regulator",
> + .of_match_table = qcom_lcdb_match,
> + },
> + .probe = qcom_lcdb_probe,
> +};
> +module_platform_driver(qcom_lcdb_driver);
> +
> +MODULE_DESCRIPTION("Qualcomm LCDB (LCD bias) regulator driver");
> +MODULE_LICENSE("GPL");
>
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2026-10-19 12:00 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 11:25 [PATCH v2 0/8] arm64: qcom: enable display card support on SM8150 HDK Dmitry Baryshkov
2026-10-19 11:25 ` [PATCH v2 1/8] backlight: qcom-wled: fix string detection brightness on WLED5 Dmitry Baryshkov
2026-10-19 11:25 ` [PATCH v2 2/8] regulator: dt-bindings: add Qualcomm LCDB regulator Dmitry Baryshkov
2026-10-19 11:25 ` [PATCH v2 3/8] dt-bindings: mfd: qcom,spmi-pmic: add LCDB Dmitry Baryshkov
2026-10-19 11:25 ` [PATCH v2 4/8] regulator: add Qualcomm LCDB driver Dmitry Baryshkov
2026-10-19 11:59 ` Konrad Dybcio
2026-10-19 11:25 ` [PATCH v2 5/8] arm64: dts: qcom: pm8150l: add LCDB regulators Dmitry Baryshkov
2026-10-19 11:47 ` Abel Vesa
2026-10-19 11:48 ` Konrad Dybcio
2026-10-19 11:25 ` [PATCH v2 6/8] arm64: dts: qcom: sm8150: add MDSS reset Dmitry Baryshkov
2026-10-19 11:46 ` Abel Vesa
2026-10-19 11:25 ` [PATCH v2 7/8] arm64: dts: qcom: sm8150-hdk: fix FSA4480 address Dmitry Baryshkov
2026-10-19 11:46 ` Abel Vesa
2026-10-19 11:25 ` [PATCH v2 8/8] arm64: dts: qcom: sm8150-hdk: add display card overlay Dmitry Baryshkov
2026-10-19 11:47 ` Konrad Dybcio
2026-10-19 11:47 ` Abel Vesa
2026-10-19 11:32 ` [PATCH v2 0/8] arm64: qcom: enable display card support on SM8150 HDK Konrad Dybcio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox