File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,43 @@ def generate_gpios(options: Options):
2222 for name , flags in options .gpios .items ():
2323 flags = "GPIO_ACTIVE_LOW" if flags & GpioFlag .ACTIVE_LOW else "GPIO_ACTIVE_HIGH"
2424 s += f"\t \t { name } -gpios = <&tlmm XY { flags } >;\n "
25+
26+ if 'backlight' in options .gpios :
27+ s += '''
28+ pinctrl-0 = <&lcd_bl_en_default>;
29+ pinctrl-names = "default";
30+ '''
31+ return s
32+
33+
34+ def generate_tlmm (options : Options ):
35+ s = "&tlmm {"
36+ if 'backlight' in options .gpios :
37+ s += '''
38+ lcd_bl_en_default: lcd-bl-en-default-state {
39+ pins = "gpioXY";
40+ function = "gpio";
41+ drive-strength = <2>;
42+ bias-disable;
43+ };
44+ '''
45+
46+ s += '''
47+ mdss_default: mdss-default-state {
48+ pins = "gpioXY";
49+ function = "gpio";
50+ drive-strength = <8>;
51+ bias-disable;
52+ };
53+
54+ mdss_sleep: mdss-sleep-state {
55+ pins = "gpioXY";
56+ function = "gpio";
57+ drive-strength = <2>;
58+ bias-pull-down;
59+ };
60+ };
61+ '''
2562 return s
2663
2764
@@ -35,6 +72,10 @@ def generate_panel_dtsi(p: Panel, options: Options) -> None:
3572''' )
3673 f .write (f'''\
3774 &mdss_dsi0 {{
75+ pinctrl-0 = <&mdss_default>;
76+ pinctrl-1 = <&mdss_sleep>;
77+ pinctrl-names = "default", "sleep";
78+
3879 panel@0 {{
3980 compatible = "{ options .compatible } ";
4081 reg = <0>;
@@ -69,3 +110,5 @@ def generate_panel_dtsi(p: Panel, options: Options) -> None:
69110 phy-type = <PHY_TYPE_CPHY>;
70111};
71112''' )
113+
114+ f .write (generate_tlmm (options ))
You can’t perform that action at this time.
0 commit comments