Skip to content

Commit 7259132

Browse files
committed
raspberry-pi/4: support 4lane csi
1 parent 497ae13 commit 7259132

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

raspberry-pi/4/tc358743.nix

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ 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 [ 2 4 ];
18+
default = 2;
19+
description = ''
20+
Number of CSI lanes available
21+
'';
22+
};
1623
};
1724
};
1825

@@ -74,17 +81,21 @@ in
7481
fragment@2 {
7582
target = <0x03>;
7683
77-
__overlay__ {
78-
data-lanes = <0x01 0x02>;
79-
};
84+
${if cfg.lanes == 2 then ''
85+
__overlay__ {
86+
data-lanes = <0x01 0x02>;
87+
};
88+
'' else ""}
8089
};
8190
8291
fragment@3 {
8392
target = <0x03>;
8493
85-
__dormant__ {
86-
data-lanes = <0x01 0x02 0x03 0x04>;
87-
};
94+
${if cfg.lanes == 4 then ''
95+
__overlay__ {
96+
data-lanes = <0x01 0x02 0x03 0x04>;
97+
};
98+
'' else ""}
8899
};
89100
90101
fragment@4 {
@@ -120,21 +131,24 @@ in
120131
fragment@7 {
121132
target = <0x02>;
122133
123-
__overlay__ {
124-
data-lanes = <0x01 0x02>;
125-
};
134+
${if cfg.lanes == 2 then ''
135+
__overlay__ {
136+
data-lanes = <0x01 0x02>;
137+
};
138+
'' else ""}
126139
};
127140
128141
fragment@8 {
129142
target = <0x02>;
130143
131-
__dormant__ {
132-
data-lanes = <0x01 0x02 0x03 0x04>;
133-
};
144+
${if cfg.lanes == 4 then ''
145+
__overlay__ {
146+
data-lanes = <0x01 0x02 0x03 0x04>;
147+
};
148+
'' else ""}
134149
};
135150
136151
__overrides__ {
137-
4lane = "\0\0\0\0-2+3-7+8";
138152
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];
139153
};
140154

0 commit comments

Comments
 (0)