diff --git a/uconsole/audio.nix b/uconsole/audio.nix deleted file mode 100644 index 292a5e2..0000000 --- a/uconsole/audio.nix +++ /dev/null @@ -1,44 +0,0 @@ -{pkgs, ...}: let - rpi-utils = pkgs.callPackage ../raspberry-pi/packages/rpi-utils {}; - audio-patch = pkgs.writeText "audio_3.5_patch.py" '' - import os - import time - - def init_gpio(): - os.popen("${rpi-utils}/bin/pinctrl set 11 op") - os.popen("${rpi-utils}/bin/pinctrl set 10 ip pn") - - def check_3_5(): - tmp = os.popen("${rpi-utils}/bin/pinctrl 10").readline().strip("\n") - return tmp - - def enable_speaker_gpio(): - os.popen("${rpi-utils}/bin/pinctrl set 11 op dh") - - def disable_speaker_gpio(): - os.popen("${rpi-utils}/bin/pinctrl set 11 op dl") - - init_gpio() - - while True: - tmp = check_3_5() - if tmp == "10: ip pn | lo // GPIO10 = input": - enable_speaker_gpio() - elif tmp == "10: ip pn | hi // GPIO10 = input": - disable_speaker_gpio() - time.sleep(1) - ''; -in { - config = { - systemd.services."audio_3.5_patch" = { - description = "cpi audio patch"; - after = ["multi-user.target"]; - wantedBy = ["multi-user.target"]; - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.python3Minimal}/bin/python ${audio-patch}"; - RemainAfterExit = "no"; - }; - }; - }; -} diff --git a/uconsole/default.nix b/uconsole/default.nix index 38256ae..a0e67de 100644 --- a/uconsole/default.nix +++ b/uconsole/default.nix @@ -11,8 +11,7 @@ in { [nixos-hardware.nixosModules.raspberry-pi-4] ++ [./kernel] ++ [../raspberry-pi/overlays] - ++ [../raspberry-pi/apply-overlays] - ++ [./audio.nix]; + ++ [../raspberry-pi/apply-overlays]; config = { environment.systemPackages = [rpi-utils]; @@ -25,10 +24,10 @@ in { cpu-revision.enable = mkDefault true; audremap.enable = mkDefault true; vc4-kms-v3d.enable = mkDefault true; - disable-pcie.enable = mkDefault true; - disable-genet.enable = mkDefault true; - panel-uc.enable = mkDefault true; - cpi-pmu.enable = mkDefault true; + cpi-disable-pcie.enable = mkDefault true; + cpi-disable-genet.enable = mkDefault true; + cpi-uconsole.enable = mkDefault true; + # cpi-pmu.enable = mkDefault true; cpi-i2c1.enable = mkDefault false; cpi-spi4.enable = mkDefault false; cpi-bluetooth.enable = mkDefault true; @@ -42,7 +41,7 @@ in { { name = "bcm2711-rpi-cm4"; params = { - ant2 = mkDefault "off"; + ant2 = mkDefault "on"; audio = mkDefault "on"; spi = mkDefault "off"; i2c_arm = mkDefault "on";