Skip to content

Commit ba6fab2

Browse files
authored
Merge pull request #1530 from Gigahawk/tc358743-4-lane
raspberry-pi/4: support 4lane csi
2 parents da1b459 + 0033186 commit ba6fab2

File tree

1 file changed

+50
-13
lines changed

1 file changed

+50
-13
lines changed

raspberry-pi/4/tc358743.nix

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ in
1313
running ustreamer (which starts webservice providing a camera stream):
1414
''${pkgs.ustreamer}/bin/ustreamer --persistent --dv-timings
1515
'';
16+
lanes = lib.mkOption {
17+
type = lib.types.enum [
18+
2
19+
4
20+
];
21+
default = 2;
22+
description = ''
23+
Number of CSI lanes available
24+
'';
25+
};
1626
media-controller = lib.mkEnableOption ''
1727
Enable support for the Media Controller API.
1828
@@ -89,17 +99,31 @@ in
8999
fragment@2 {
90100
target = <0x03>;
91101
92-
__overlay__ {
93-
data-lanes = <0x01 0x02>;
94-
};
102+
${
103+
if cfg.lanes == 2 then
104+
''
105+
__overlay__ {
106+
data-lanes = <0x01 0x02>;
107+
};
108+
''
109+
else
110+
""
111+
}
95112
};
96113
97114
fragment@3 {
98115
target = <0x03>;
99116
100-
__dormant__ {
101-
data-lanes = <0x01 0x02 0x03 0x04>;
102-
};
117+
${
118+
if cfg.lanes == 4 then
119+
''
120+
__overlay__ {
121+
data-lanes = <0x01 0x02 0x03 0x04>;
122+
};
123+
''
124+
else
125+
""
126+
}
103127
};
104128
105129
fragment@4 {
@@ -135,21 +159,34 @@ in
135159
fragment@7 {
136160
target = <0x02>;
137161
138-
__overlay__ {
139-
data-lanes = <0x01 0x02>;
140-
};
162+
${
163+
if cfg.lanes == 2 then
164+
''
165+
__overlay__ {
166+
data-lanes = <0x01 0x02>;
167+
};
168+
''
169+
else
170+
""
171+
}
141172
};
142173
143174
fragment@8 {
144175
target = <0x02>;
145176
146-
__dormant__ {
147-
data-lanes = <0x01 0x02 0x03 0x04>;
148-
};
177+
${
178+
if cfg.lanes == 4 then
179+
''
180+
__overlay__ {
181+
data-lanes = <0x01 0x02 0x03 0x04>;
182+
};
183+
''
184+
else
185+
""
186+
}
149187
};
150188
151189
__overrides__ {
152-
4lane = "\0\0\0\0-2+3-7+8";
153190
link-frequency = [00 00 00 03 6c 69 6e 6b 2d 66 72 65 71 75 65 6e 63 69 65 73 23 30 00];
154191
};
155192

0 commit comments

Comments
 (0)