Skip to content

Commit f233a71

Browse files
committed
dtsi: Generate qcom,dsi-phy-regulator-ldo-mode; if necessary
If qcom,regulator-ldo-mode is set on the DSI controller, qcom,dsi-phy-regulator-ldo-mode; should be set on mainline Linux for the DSI PHY.
1 parent f23fa5b commit f233a71

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

dtsi.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,11 @@ def generate_panel_dtsi(p: Panel, options: Options) -> None:
5050
data-lanes = <{' '.join(map(str, p.lane_map.phys2log[:p.lanes]))}>;
5151
remote-endpoint = <&panel_in>;
5252
}};
53+
''')
54+
55+
if p.ldo_mode:
56+
f.write('''
57+
&dsi_phy0 {
58+
qcom,dsi-phy-regulator-ldo-mode;
59+
};
5360
''')

panel.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,13 @@ def __init__(self, name: str, fdt: Fdt2, node: int) -> None:
276276
self.h.size = phy_size_mm[0]
277277
self.v.size = phy_size_mm[1]
278278

279+
# Check DSI controller if LDO mode is needed
280+
self.ldo_mode = False
281+
dsi_ctrl = fdt.getprop_int32(node, 'qcom,mdss-dsi-panel-controller')
282+
if dsi_ctrl is not None:
283+
dsi_ctrl = fdt.node_offset_by_phandle(dsi_ctrl)
284+
self.ldo_mode = fdt.getprop_or_none(dsi_ctrl, 'qcom,regulator-ldo-mode') is not None
285+
279286
@staticmethod
280287
def parse(fdt: Fdt2, node: int) -> Panel:
281288
name = fdt.getprop_or_none(node, 'qcom,mdss-dsi-panel-name')

0 commit comments

Comments
 (0)