diff --git a/README.md b/README.md index fe92f58..57400f8 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,10 @@ See code for all available configurations. | [Lenovo ThinkPad L14 (Intel)](lenovo/thinkpad/l14/intel) | `` | | [Lenovo ThinkPad L480](lenovo/thinkpad/l480) | `` | | [Lenovo ThinkPad P1 Gen 3](lenovo/thinkpad/p1/3th-gen) | `` | +| [Lenovo ThinkPad P14s AMD Gen 1](lenovo/thinkpad/p14s/amd/gen1) | `` | | [Lenovo ThinkPad P14s AMD Gen 2](lenovo/thinkpad/p14s/amd/gen2) | `` | +| [Lenovo ThinkPad P14s AMD Gen 3](lenovo/thinkpad/p14s/amd/gen3) | `` | +| [Lenovo ThinkPad P14s AMD Gen 4](lenovo/thinkpad/p14s/amd/gen4) | `` | | [Lenovo ThinkPad P16s AMD Gen 1](lenovo/thinkpad/p16s/amd/gen1) | `` | | [Lenovo ThinkPad P1](lenovo/thinkpad/p1) | `` | | [Lenovo ThinkPad P50](lenovo/thinkpad/p50) | `` | @@ -200,6 +203,7 @@ See code for all available configurations. | [Lenovo ThinkPad T14 AMD Gen 1](lenovo/thinkpad/t14/amd/gen1) | `` | | [Lenovo ThinkPad T14 AMD Gen 2](lenovo/thinkpad/t14/amd/gen2) | `` | | [Lenovo ThinkPad T14 AMD Gen 3](lenovo/thinkpad/t14/amd/gen3) | `` | +| [Lenovo ThinkPad T14 AMD Gen 4](lenovo/thinkpad/t14/amd/gen4) | `` | | [Lenovo ThinkPad T14](lenovo/thinkpad/t14) | `` | | [Lenovo ThinkPad T14s AMD Gen 1](lenovo/thinkpad/t14s/amd/gen1) | `` | | [Lenovo ThinkPad T14s](lenovo/thinkpad/t14s) | `` | diff --git a/flake.nix b/flake.nix index 69e0a31..15dd442 100644 --- a/flake.nix +++ b/flake.nix @@ -125,7 +125,10 @@ lenovo-thinkpad-l480 = import ./lenovo/thinkpad/l480; lenovo-thinkpad-p1 = import ./lenovo/thinkpad/p1; lenovo-thinkpad-p1-gen3 = import ./lenovo/thinkpad/p1/3th-gen; + lenovo-thinkpad-p14s-amd-gen1 = import ./lenovo/thinkpad/p14s/amd/gen1; lenovo-thinkpad-p14s-amd-gen2 = import ./lenovo/thinkpad/p14s/amd/gen2; + lenovo-thinkpad-p14s-amd-gen3 = import ./lenovo/thinkpad/p14s/amd/gen3; + lenovo-thinkpad-p14s-amd-gen4 = import ./lenovo/thinkpad/p14s/amd/gen4; lenovo-thinkpad-p16s-amd-gen1 = import ./lenovo/thinkpad/p16s/amd/gen1; lenovo-thinkpad-p50 = import ./lenovo/thinkpad/p50; lenovo-thinkpad-p51 = import ./lenovo/thinkpad/p51; @@ -135,6 +138,7 @@ lenovo-thinkpad-t14-amd-gen1 = import ./lenovo/thinkpad/t14/amd/gen1; lenovo-thinkpad-t14-amd-gen2 = import ./lenovo/thinkpad/t14/amd/gen2; lenovo-thinkpad-t14-amd-gen3 = import ./lenovo/thinkpad/t14/amd/gen3; + lenovo-thinkpad-t14-amd-gen4 = import ./lenovo/thinkpad/t14/amd/gen4; lenovo-thinkpad-t14s = import ./lenovo/thinkpad/t14s; lenovo-thinkpad-t14s-amd-gen1 = import ./lenovo/thinkpad/t14s/amd/gen1; lenovo-thinkpad-t410 = import ./lenovo/thinkpad/t410; diff --git a/lenovo/thinkpad/p14s/amd/default.nix b/lenovo/thinkpad/p14s/amd/default.nix new file mode 100644 index 0000000..cbef7c0 --- /dev/null +++ b/lenovo/thinkpad/p14s/amd/default.nix @@ -0,0 +1,12 @@ +{ lib, pkgs, ... }: + +{ + imports = [ + ../. + ../../../../common/cpu/amd + ../../../../common/gpu/amd + ]; + + # For support of newer AMD GPUs, backlight and internal microphone + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.8") pkgs.linuxPackages_latest; +} diff --git a/lenovo/thinkpad/p14s/amd/gen1/default.nix b/lenovo/thinkpad/p14s/amd/gen1/default.nix new file mode 100644 index 0000000..665d3d4 --- /dev/null +++ b/lenovo/thinkpad/p14s/amd/gen1/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ../. + ]; +} diff --git a/lenovo/thinkpad/p14s/amd/gen2/default.nix b/lenovo/thinkpad/p14s/amd/gen2/default.nix index 89632e2..7c496f6 100644 --- a/lenovo/thinkpad/p14s/amd/gen2/default.nix +++ b/lenovo/thinkpad/p14s/amd/gen2/default.nix @@ -1,9 +1,8 @@ { lib, pkgs, config, ... }: { imports = [ - ../../../../../common/pc/laptop/acpi_call.nix - ../../../../../common/cpu/amd - ../../../../../common/gpu/amd + ../. + ../../../../../common/cpu/amd/pstate.nix ]; # For suspending to RAM, set Config -> Power -> Sleep State to "Linux" in EFI. diff --git a/lenovo/thinkpad/p14s/amd/gen3/default.nix b/lenovo/thinkpad/p14s/amd/gen3/default.nix new file mode 100644 index 0000000..f70dde4 --- /dev/null +++ b/lenovo/thinkpad/p14s/amd/gen3/default.nix @@ -0,0 +1,12 @@ +{ lib, pkgs, ... }: + +{ + imports = [ + ../. + ../../../../../common/cpu/amd/pstate.nix + ]; + + # For the Qualcomm NFA-725A (Device 1103) wireless network controller + # See https://bugzilla.redhat.com/show_bug.cgi?id=2047878 + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") pkgs.linuxPackages_latest; +} diff --git a/lenovo/thinkpad/p14s/amd/gen4/default.nix b/lenovo/thinkpad/p14s/amd/gen4/default.nix new file mode 100644 index 0000000..cc6244e --- /dev/null +++ b/lenovo/thinkpad/p14s/amd/gen4/default.nix @@ -0,0 +1,11 @@ +{ lib, pkgs, config, ... }: +{ + imports = [ + ../. + ../../../../../common/cpu/amd/pstate.nix + ]; + + # For the Qualcomm NFA765 [17cb:1103] wireless network controller + # See https://bugzilla.redhat.com/show_bug.cgi?id=2047878 + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") pkgs.linuxPackages_latest; +} diff --git a/lenovo/thinkpad/p14s/default.nix b/lenovo/thinkpad/p14s/default.nix new file mode 100644 index 0000000..401eba9 --- /dev/null +++ b/lenovo/thinkpad/p14s/default.nix @@ -0,0 +1,22 @@ +{ lib, pkgs, ... }: + +{ + # P14s is a rebadged T14 with slight internal differences. + # This may change for future models, so we duplicate the T14 hierarchy here. + + imports = [ + ../. + ../../../common/pc/laptop/acpi_call.nix + ../../../common/pc/laptop/ssd + ]; + + # Force use of the amdgpu driver for backlight control on kernel versions where the + # native backlight driver is not already preferred. This is preferred over the + # "vendor" setting, in this case the thinkpad_acpi driver. + # See https://hansdegoede.livejournal.com/27130.html + # See https://lore.kernel.org/linux-acpi/20221105145258.12700-1-hdegoede@redhat.com/ + boot.kernelParams = lib.mkIf (lib.versionOlder pkgs.linux.version "6.2") [ "acpi_backlight=native" ]; + + # see https://github.com/NixOS/nixpkgs/issues/69289 + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.2") pkgs.linuxPackages_latest; +} diff --git a/lenovo/thinkpad/t14/amd/gen2/default.nix b/lenovo/thinkpad/t14/amd/gen2/default.nix index 795b9a8..0e74572 100644 --- a/lenovo/thinkpad/t14/amd/gen2/default.nix +++ b/lenovo/thinkpad/t14/amd/gen2/default.nix @@ -3,6 +3,7 @@ { imports = [ ../. + ../../../../../common/cpu/amd/pstate.nix ]; # For support of MEDIATEK Corp. Device 7961 wireless network controller, see https://lwn.net/Articles/843303/ diff --git a/lenovo/thinkpad/t14/amd/gen3/default.nix b/lenovo/thinkpad/t14/amd/gen3/default.nix index 617a3a4..f70dde4 100644 --- a/lenovo/thinkpad/t14/amd/gen3/default.nix +++ b/lenovo/thinkpad/t14/amd/gen3/default.nix @@ -3,6 +3,7 @@ { imports = [ ../. + ../../../../../common/cpu/amd/pstate.nix ]; # For the Qualcomm NFA-725A (Device 1103) wireless network controller diff --git a/lenovo/thinkpad/t14/amd/gen4/default.nix b/lenovo/thinkpad/t14/amd/gen4/default.nix new file mode 100644 index 0000000..e61a3a0 --- /dev/null +++ b/lenovo/thinkpad/t14/amd/gen4/default.nix @@ -0,0 +1,12 @@ +{ lib, pkgs, config, ... }: + +{ + imports = [ + ../. + ../../../../../common/cpu/amd/pstate.nix + ]; + + # For the Qualcomm NFA765 [17cb:1103] wireless network controller + # See https://bugzilla.redhat.com/show_bug.cgi?id=2047878 + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") pkgs.linuxPackages_latest; +}