Skip to content

Commit f17f79c

Browse files
BhasherBELmergify[bot]
authored andcommitted
rpi4: bluetooth fix
1 parent 5ca7d12 commit f17f79c

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

raspberry-pi/4/bluetooth.nix

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{ config, lib, ... }:
2+
3+
let
4+
cfg = config.hardware.raspberry-pi."4".bluetooth;
5+
in
6+
{
7+
options.hardware = {
8+
raspberry-pi."4".bluetooth = {
9+
enable = lib.mkEnableOption ''
10+
configuration for bluetooth
11+
'';
12+
};
13+
};
14+
15+
config = lib.mkIf cfg.enable {
16+
hardware.raspberry-pi."4".apply-overlays-dtmerge.enable = lib.mkDefault true;
17+
# doesn't work for the CM module, so we exclude e.g. bcm2711-rpi-cm4.dts
18+
hardware.deviceTree.filter = "bcm2711-rpi-4*.dtb";
19+
20+
hardware.deviceTree = {
21+
overlays = [
22+
{
23+
name = "bluetooth-overlay";
24+
dtsText = ''
25+
/dts-v1/;
26+
/plugin/;
27+
28+
/ {
29+
compatible = "brcm,bcm2711";
30+
31+
fragment@0 {
32+
target = <&uart0_pins>;
33+
__overlay__ {
34+
brcm,pins = <30 31 32 33>;
35+
brcm,pull = <2 0 0 2>;
36+
};
37+
};
38+
};
39+
'';
40+
}
41+
];
42+
};
43+
};
44+
}

raspberry-pi/4/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
imports = [
55
./audio.nix
66
./backlight.nix
7+
./bluetooth.nix
78
./cpu-revision.nix
89
./digi-amp-plus.nix
910
./dwc2.nix

0 commit comments

Comments
 (0)