mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-12-27 12:09:45 +01:00
raspberry-pi/4: Add audio option
This commit is contained in:
parent
7da029f268
commit
745dd44071
2 changed files with 41 additions and 0 deletions
40
raspberry-pi/4/audio.nix
Normal file
40
raspberry-pi/4/audio.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.hardware.raspberry-pi."4".audio;
|
||||
in
|
||||
{
|
||||
options.hardware = {
|
||||
raspberry-pi."4".audio = {
|
||||
enable = lib.mkEnableOption ''
|
||||
configuration for audio
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
hardware.deviceTree = {
|
||||
overlays = [
|
||||
# Equivalent to dtparam=audio=on
|
||||
{
|
||||
name = "audio-on-overlay";
|
||||
dtsText = ''
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
/ {
|
||||
compatible = "brcm,bcm2711";
|
||||
fragment@0 {
|
||||
target = <&audio>;
|
||||
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
./audio.nix
|
||||
./dwc2.nix
|
||||
./modesetting.nix
|
||||
./poe-hat.nix
|
||||
|
|
Loading…
Reference in a new issue