mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2026-12-04 23:13:29 +01:00
raspberry-pi: remove DigiAMP+ module
This commit is contained in:
1 parent
44d95795ee
commit
db65e8d432
1 file changed
+33
-82
@@ -1,91 +1,42 @@
|
|||||||
{ config, lib, ... }:
|
{ lib, ... }:
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.hardware.raspberry-pi."4".digi-amp-plus;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
options.hardware = {
|
imports = [
|
||||||
raspberry-pi."4".digi-amp-plus = {
|
(lib.mkRemovedOptionModule
|
||||||
enable = lib.mkEnableOption "support for the IQaudIO DigiAMP+ Hat";
|
[
|
||||||
|
"hardware"
|
||||||
|
"raspberry-pi"
|
||||||
|
"4"
|
||||||
|
"digi-amp-plus"
|
||||||
|
]
|
||||||
|
''
|
||||||
|
Use the stock iqaudio-dacplus firmware overlay instead:
|
||||||
|
|
||||||
unmuteAmp = lib.mkOption {
|
{
|
||||||
type = lib.types.bool;
|
boot.loader.generic-extlinux-compatible.useGenerationDeviceTree =
|
||||||
default = false;
|
false;
|
||||||
description = ''
|
|
||||||
Whether to "one-shot" unmute when kernel module first loads.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
autoMuteAmp = lib.mkOption {
|
hardware.raspberry-pi.configtxt.deviceTreeOverlays.pi4 = [
|
||||||
type = lib.types.bool;
|
{
|
||||||
default = true;
|
iqaudio-dacplus = {
|
||||||
description = ''
|
auto_mute_amp = true;
|
||||||
Unmute the amp when an ALSA device is opened by a client. Mute, with a five-second delay when the ALSA device is closed.
|
unmute_amp = false;
|
||||||
(Reopening the device within the five-second close window will cancel mute.)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
hardware.raspberry-pi."4".apply-overlays-dtmerge.enable = lib.mkDefault true;
|
|
||||||
|
|
||||||
hardware.deviceTree = {
|
|
||||||
overlays = [
|
|
||||||
# Adapted from to: https://github.com/raspberrypi/linux/blob/3ed6d34d53e94ecbebc64c8fa3d1b6d3c41db8fb/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts
|
|
||||||
# changes:
|
|
||||||
# - modified top-level "compatible" field from bcm2835 to bcm2711
|
|
||||||
# - s/i2s_clk_producer/i2s/ (name on bcm2711 platform)
|
|
||||||
{
|
|
||||||
name = "iqaudio-digiampplus-overlay";
|
|
||||||
dtsText = ''
|
|
||||||
/dts-v1/;
|
|
||||||
/plugin/;
|
|
||||||
|
|
||||||
/ {
|
|
||||||
compatible = "brcm,bcm2711";
|
|
||||||
|
|
||||||
fragment@0 {
|
|
||||||
target = <&i2s>;
|
|
||||||
__overlay__ {
|
|
||||||
status = "okay";
|
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
fragment@1 {
|
Keep the old boolean values. Map autoMuteAmp to auto_mute_amp and
|
||||||
target = <&i2c1>;
|
unmuteAmp to unmute_amp.
|
||||||
__overlay__ {
|
|
||||||
#address-cells = <1>;
|
|
||||||
#size-cells = <0>;
|
|
||||||
status = "okay";
|
|
||||||
|
|
||||||
pcm5122@4c {
|
On a running system, set hardware.raspberry-pi.firmware.enable to true.
|
||||||
#sound-dai-cells = <0>;
|
|
||||||
compatible = "ti,pcm5122";
|
|
||||||
reg = <0x4c>;
|
|
||||||
AVDD-supply = <&vdd_3v3_reg>;
|
|
||||||
DVDD-supply = <&vdd_3v3_reg>;
|
|
||||||
CPVDD-supply = <&vdd_3v3_reg>;
|
|
||||||
status = "okay";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
fragment@2 {
|
For NixOS-Hardware specific firmware setup, read:
|
||||||
target = <&sound>;
|
raspberry-pi/README.md.
|
||||||
iqaudio_dac: __overlay__ {
|
|
||||||
compatible = "iqaudio,iqaudio-dac";
|
For digiamp specific details, see:
|
||||||
i2s-controller = <&i2s>;
|
https://www.raspberrypi.com/documentation/accessories/audio.html#raspberry-pi-digiamp
|
||||||
mute-gpios = <&gpio 22 0>;
|
''
|
||||||
status = "okay";
|
)
|
||||||
${lib.optionalString cfg.unmuteAmp "iqaudio-dac,unmute-amp;"}
|
];
|
||||||
${lib.optionalString cfg.autoMuteAmp "iqaudio-dac,auto-mute-amp;"}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user