Skip to content

Commit 61945ed

Browse files
kernel/system: use libgpiod
1 parent 9e4c6c8 commit 61945ed

File tree

12 files changed

+319
-99
lines changed

12 files changed

+319
-99
lines changed

kernel/configs/vamos.config

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,3 @@ CONFIG_I2C_QCOM_GENI=y
4545

4646
# Power monitoring (INA231)
4747
CONFIG_SENSORS_INA2XX=y
48-
49-
# GPIO
50-
# TODO: migrate gpio.sh, lte.sh, and power_drop_monitor.py to chardev (libgpiod)
51-
# and remove GPIO_SYSFS (deprecated)
52-
CONFIG_EXPERT=y
53-
CONFIG_GPIO_SYSFS=y

kernel/dts/sdm845-comma-mici.dts

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,157 @@
88
qcom,msm-id = <341 0x20001>, <321 0x20001>, <321 0x20000>, <348 0x20001>;
99
qcom,board-id = <0x22 0>;
1010
};
11+
12+
&tlmm {
13+
gpio-line-names = "", /* GPIO_0 */
14+
"",
15+
"",
16+
"",
17+
"",
18+
"",
19+
"",
20+
"",
21+
"",
22+
"",
23+
"", /* GPIO_10 */
24+
"",
25+
"",
26+
"",
27+
"",
28+
"",
29+
"",
30+
"",
31+
"",
32+
"",
33+
"", /* GPIO_20 */
34+
"",
35+
"",
36+
"",
37+
"",
38+
"",
39+
"",
40+
"",
41+
"",
42+
"",
43+
"", /* GPIO_30 */
44+
"",
45+
"",
46+
"",
47+
"",
48+
"",
49+
"",
50+
"",
51+
"",
52+
"",
53+
"", /* GPIO_40 */
54+
"",
55+
"",
56+
"",
57+
"",
58+
"",
59+
"",
60+
"",
61+
"",
62+
"",
63+
"LTE_RST_N", /* GPIO_50 */
64+
"",
65+
"LTE_BOOT",
66+
"",
67+
"",
68+
"",
69+
"",
70+
"",
71+
"",
72+
"",
73+
"", /* GPIO_60 */
74+
"",
75+
"",
76+
"",
77+
"",
78+
"",
79+
"",
80+
"",
81+
"",
82+
"",
83+
"", /* GPIO_70 */
84+
"",
85+
"",
86+
"",
87+
"",
88+
"",
89+
"",
90+
"",
91+
"",
92+
"",
93+
"", /* GPIO_80 */
94+
"",
95+
"",
96+
"",
97+
"",
98+
"",
99+
"",
100+
"",
101+
"",
102+
"",
103+
"", /* GPIO_90 */
104+
"",
105+
"",
106+
"",
107+
"",
108+
"",
109+
"",
110+
"",
111+
"",
112+
"",
113+
"", /* GPIO_100 */
114+
"",
115+
"",
116+
"",
117+
"",
118+
"",
119+
"",
120+
"",
121+
"",
122+
"",
123+
"", /* GPIO_110 */
124+
"",
125+
"",
126+
"",
127+
"",
128+
"",
129+
"LTE_PWRKEY",
130+
"",
131+
"",
132+
"",
133+
"", /* GPIO_120 */
134+
"",
135+
"",
136+
"",
137+
"",
138+
"",
139+
"",
140+
"",
141+
"",
142+
"",
143+
"", /* GPIO_130 */
144+
"",
145+
"",
146+
"",
147+
"",
148+
"",
149+
"",
150+
"",
151+
"",
152+
"",
153+
"", /* GPIO_140 */
154+
"",
155+
"",
156+
"",
157+
"",
158+
"",
159+
"",
160+
"",
161+
"",
162+
"",
163+
""; /* GPIO_150 */
164+
};

kernel/dts/sdm845-comma-tizi.dts

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,157 @@
1919
shunt-resistor = <30000>;
2020
};
2121
};
22+
23+
&tlmm {
24+
gpio-line-names = "", /* GPIO_0 */
25+
"",
26+
"",
27+
"",
28+
"",
29+
"",
30+
"",
31+
"",
32+
"",
33+
"",
34+
"", /* GPIO_10 */
35+
"",
36+
"",
37+
"",
38+
"",
39+
"",
40+
"",
41+
"",
42+
"",
43+
"",
44+
"", /* GPIO_20 */
45+
"",
46+
"",
47+
"",
48+
"",
49+
"",
50+
"",
51+
"",
52+
"",
53+
"",
54+
"HUB_RST_N", /* GPIO_30 */
55+
"",
56+
"",
57+
"",
58+
"",
59+
"",
60+
"",
61+
"",
62+
"",
63+
"",
64+
"", /* GPIO_40 */
65+
"",
66+
"",
67+
"",
68+
"",
69+
"",
70+
"",
71+
"",
72+
"",
73+
"",
74+
"LTE_RST_N", /* GPIO_50 */
75+
"",
76+
"LTE_BOOT",
77+
"",
78+
"",
79+
"",
80+
"",
81+
"",
82+
"",
83+
"",
84+
"", /* GPIO_60 */
85+
"",
86+
"",
87+
"",
88+
"",
89+
"",
90+
"",
91+
"",
92+
"",
93+
"",
94+
"", /* GPIO_70 */
95+
"",
96+
"",
97+
"",
98+
"",
99+
"",
100+
"",
101+
"",
102+
"",
103+
"",
104+
"", /* GPIO_80 */
105+
"",
106+
"",
107+
"",
108+
"",
109+
"",
110+
"",
111+
"",
112+
"",
113+
"",
114+
"", /* GPIO_90 */
115+
"",
116+
"",
117+
"",
118+
"",
119+
"",
120+
"",
121+
"",
122+
"",
123+
"",
124+
"", /* GPIO_100 */
125+
"",
126+
"",
127+
"",
128+
"",
129+
"",
130+
"",
131+
"",
132+
"",
133+
"",
134+
"", /* GPIO_110 */
135+
"",
136+
"",
137+
"",
138+
"",
139+
"",
140+
"LTE_PWRKEY",
141+
"",
142+
"",
143+
"",
144+
"", /* GPIO_120 */
145+
"",
146+
"",
147+
"",
148+
"",
149+
"",
150+
"",
151+
"",
152+
"",
153+
"",
154+
"", /* GPIO_130 */
155+
"",
156+
"",
157+
"",
158+
"",
159+
"",
160+
"",
161+
"",
162+
"",
163+
"",
164+
"", /* GPIO_140 */
165+
"",
166+
"",
167+
"",
168+
"",
169+
"",
170+
"",
171+
"",
172+
"",
173+
"",
174+
""; /* GPIO_150 */
175+
};

tools/build/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ RUN mkdir -p /root/.config
7777

7878
# Enable runit services
7979
RUN for svc in \
80-
ipa_fws brightnessd fs_setup gpio init-qcom lte \
80+
ipa_fws brightnessd fs_setup usb-hub-gpio init-qcom lte \
8181
avahi-ssh-publish power_monitor power_drop_monitor \
8282
screen_calibration serial-hostname \
8383
sound varwatch busybox-ntpd \

userspace/base_setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ xbps-install -y \
6161
libarchive-devel \
6262
libcurl-devel \
6363
libffi-devel \
64-
libgpiod \
64+
libgpiod-tools \
6565
liblzma-devel \
6666
libomp-devel \
6767
libtool \

userspace/root/etc/sv/lte/run

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
# lte - LTE modem management
33
exec 2>&1
44

5-
# Wait for gpio setup to finish exporting all pins
6-
while [ ! -f /run/gpio.ready ]; do sleep 0.1; done
7-
85
# Run the lte script (stays running)
96
/usr/comma/lte/lte.sh start
107

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
# One-shot service - run once then sleep forever
3-
/usr/comma/gpio.sh
3+
/usr/comma/usb_hub_gpio.sh
44
exec sleep infinity

0 commit comments

Comments
 (0)