mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-11-26 21:09:42 +01:00
544: Fix copy-paste typo: "CONFIG_" prefix in structuredExtraConfig patches r=Mic92 a=mexisme 545: Add kernel 6.1.6 to Microsoft Surface profile r=Mic92 a=mexisme 546: lenovo/thinkpad/t440p: force load thinkpad_acpi r=Mic92 a=surfaceflinger Co-authored-by: mexisme <wildjim+dev@kiwinet.org> Co-authored-by: surfaceflinger <nat@nekopon.pl> Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
This commit is contained in:
commit
b7ac0a5602
7 changed files with 201 additions and 35 deletions
|
@ -7,8 +7,9 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
extraModprobeConfig = lib.mkDefault ''
|
extraModprobeConfig = ''
|
||||||
options bbswitch use_acpi_to_detect_card_state=1
|
options bbswitch use_acpi_to_detect_card_state=1
|
||||||
|
options thinkpad_acpi force_load=1 fan_control=1
|
||||||
'';
|
'';
|
||||||
# TODO: probably enable tcsd? Is this line necessary?
|
# TODO: probably enable tcsd? Is this line necessary?
|
||||||
kernelModules = [ "tpm-rng" ];
|
kernelModules = [ "tpm-rng" ];
|
||||||
|
|
|
@ -7,6 +7,7 @@ in {
|
||||||
imports = [
|
imports = [
|
||||||
./linux-5.19.17
|
./linux-5.19.17
|
||||||
./linux-6.0.17
|
./linux-6.0.17
|
||||||
|
./linux-6.1.6
|
||||||
];
|
];
|
||||||
|
|
||||||
options.microsoft-surface.kernelVersion = mkOption {
|
options.microsoft-surface.kernelVersion = mkOption {
|
||||||
|
|
|
@ -11,28 +11,28 @@
|
||||||
#
|
#
|
||||||
# Surface Aggregator Module
|
# Surface Aggregator Module
|
||||||
#
|
#
|
||||||
CONFIG_SURFACE_AGGREGATOR = module;
|
SURFACE_AGGREGATOR = module;
|
||||||
CONFIG_SURFACE_AGGREGATOR_ERROR_INJECTION = no;
|
SURFACE_AGGREGATOR_ERROR_INJECTION = no;
|
||||||
CONFIG_SURFACE_AGGREGATOR_BUS = yes;
|
SURFACE_AGGREGATOR_BUS = yes;
|
||||||
CONFIG_SURFACE_AGGREGATOR_CDEV = module;
|
SURFACE_AGGREGATOR_CDEV = module;
|
||||||
CONFIG_SURFACE_AGGREGATOR_HUB = module;
|
SURFACE_AGGREGATOR_HUB = module;
|
||||||
CONFIG_SURFACE_AGGREGATOR_REGISTRY = module;
|
SURFACE_AGGREGATOR_REGISTRY = module;
|
||||||
CONFIG_SURFACE_AGGREGATOR_TABLET_SWITCH = module;
|
SURFACE_AGGREGATOR_TABLET_SWITCH = module;
|
||||||
|
|
||||||
CONFIG_SURFACE_ACPI_NOTIFY = module;
|
SURFACE_ACPI_NOTIFY = module;
|
||||||
CONFIG_SURFACE_DTX = module;
|
SURFACE_DTX = module;
|
||||||
CONFIG_SURFACE_PLATFORM_PROFILE = module;
|
SURFACE_PLATFORM_PROFILE = module;
|
||||||
|
|
||||||
CONFIG_SURFACE_HID = module;
|
SURFACE_HID = module;
|
||||||
CONFIG_SURFACE_KBD = module;
|
SURFACE_KBD = module;
|
||||||
|
|
||||||
CONFIG_BATTERY_SURFACE = module;
|
BATTERY_SURFACE = module;
|
||||||
CONFIG_CHARGER_SURFACE = module;
|
CHARGER_SURFACE = module;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Surface Hotplug
|
# Surface Hotplug
|
||||||
#
|
#
|
||||||
CONFIG_SURFACE_HOTPLUG = module;
|
SURFACE_HOTPLUG = module;
|
||||||
|
|
||||||
#
|
#
|
||||||
# IPTS touchscreen
|
# IPTS touchscreen
|
||||||
|
@ -40,39 +40,39 @@
|
||||||
# This only enables the user interface for IPTS data.
|
# This only enables the user interface for IPTS data.
|
||||||
# For the touchscreen to work, you need to install iptsd.
|
# For the touchscreen to work, you need to install iptsd.
|
||||||
#
|
#
|
||||||
CONFIG_MISC_IPTS = module;
|
MISC_IPTS = module;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Cameras: IPU3
|
# Cameras: IPU3
|
||||||
#
|
#
|
||||||
CONFIG_VIDEO_DW9719 = module;
|
VIDEO_DW9719 = module;
|
||||||
CONFIG_VIDEO_IPU3_IMGU = module;
|
VIDEO_IPU3_IMGU = module;
|
||||||
CONFIG_VIDEO_IPU3_CIO2 = module;
|
VIDEO_IPU3_CIO2 = module;
|
||||||
CONFIG_CIO2_BRIDGE = yes;
|
CIO2_BRIDGE = yes;
|
||||||
CONFIG_INTEL_SKL_INT3472 = module;
|
INTEL_SKL_INT3472 = module;
|
||||||
CONFIG_REGULATOR_TPS68470 = module;
|
REGULATOR_TPS68470 = module;
|
||||||
CONFIG_COMMON_CLK_TPS68470 = module;
|
COMMON_CLK_TPS68470 = module;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Cameras: Sensor drivers
|
# Cameras: Sensor drivers
|
||||||
#
|
#
|
||||||
CONFIG_VIDEO_OV5693 = module;
|
VIDEO_OV5693 = module;
|
||||||
CONFIG_VIDEO_OV7251 = module;
|
VIDEO_OV7251 = module;
|
||||||
CONFIG_VIDEO_OV8865 = module;
|
VIDEO_OV8865 = module;
|
||||||
|
|
||||||
#
|
#
|
||||||
# ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7
|
# ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7
|
||||||
#
|
#
|
||||||
CONFIG_APDS9960 = module;
|
APDS9960 = module;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Other Drivers
|
# Other Drivers
|
||||||
#
|
#
|
||||||
CONFIG_INPUT_SOC_BUTTON_ARRAY = module;
|
INPUT_SOC_BUTTON_ARRAY = module;
|
||||||
CONFIG_SURFACE_3_POWER_OPREGION = module;
|
SURFACE_3_POWER_OPREGION = module;
|
||||||
CONFIG_SURFACE_PRO3_BUTTON = module;
|
SURFACE_PRO3_BUTTON = module;
|
||||||
CONFIG_SURFACE_GPE = module;
|
SURFACE_GPE = module;
|
||||||
CONFIG_SURFACE_BOOK1_DGPU_SWITCH = module;
|
SURFACE_BOOK1_DGPU_SWITCH = module;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|
38
microsoft/surface/common/kernel/linux-6.1.6/default.nix
Normal file
38
microsoft/surface/common/kernel/linux-6.1.6/default.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf mkOption types;
|
||||||
|
inherit (pkgs) fetchurl;
|
||||||
|
|
||||||
|
inherit (pkgs.callPackage ../linux-package.nix { }) linuxPackage repos;
|
||||||
|
|
||||||
|
cfg = config.microsoft-surface;
|
||||||
|
|
||||||
|
version = "6.1.6";
|
||||||
|
extraMeta.branch = "6.1";
|
||||||
|
patchDir = repos.linux-surface + "/patches/${extraMeta.branch}";
|
||||||
|
kernelPatches = pkgs.callPackage ./patches.nix {
|
||||||
|
inherit (lib) kernel;
|
||||||
|
inherit version patchDir;
|
||||||
|
};
|
||||||
|
|
||||||
|
kernelPackages = linuxPackage {
|
||||||
|
inherit version extraMeta kernelPatches;
|
||||||
|
src = fetchurl {
|
||||||
|
url = "mirror://kernel/linux/kernel/v6.x/linux-${version}.tar.xz";
|
||||||
|
sha256 = "sha256-Pk2OVh2lcDogWujXsr7WxcZPxCme68v9IEgeY7V9XuM=";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
in {
|
||||||
|
options.microsoft-surface.kernelVersion = mkOption {
|
||||||
|
type = types.enum [ "6.1.6" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf (cfg.kernelVersion == "6.1.6") {
|
||||||
|
boot = {
|
||||||
|
inherit kernelPackages;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
124
microsoft/surface/common/kernel/linux-6.1.6/patches.nix
Normal file
124
microsoft/surface/common/kernel/linux-6.1.6/patches.nix
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
{ kernel,
|
||||||
|
patchDir,
|
||||||
|
version,
|
||||||
|
}:
|
||||||
|
|
||||||
|
[
|
||||||
|
{
|
||||||
|
name = "microsoft-surface-patches-linux-${version}";
|
||||||
|
patch = null;
|
||||||
|
structuredExtraConfig = with kernel; {
|
||||||
|
STREAMING_MEDIA = yes;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Surface Aggregator Module
|
||||||
|
#
|
||||||
|
SURFACE_AGGREGATOR = module;
|
||||||
|
SURFACE_AGGREGATOR_ERROR_INJECTION = no;
|
||||||
|
SURFACE_AGGREGATOR_BUS = yes;
|
||||||
|
SURFACE_AGGREGATOR_CDEV = module;
|
||||||
|
SURFACE_AGGREGATOR_HUB = module;
|
||||||
|
SURFACE_AGGREGATOR_REGISTRY = module;
|
||||||
|
SURFACE_AGGREGATOR_TABLET_SWITCH = module;
|
||||||
|
|
||||||
|
SURFACE_ACPI_NOTIFY = module;
|
||||||
|
SURFACE_DTX = module;
|
||||||
|
SURFACE_PLATFORM_PROFILE = module;
|
||||||
|
|
||||||
|
SURFACE_HID = module;
|
||||||
|
SURFACE_KBD = module;
|
||||||
|
|
||||||
|
BATTERY_SURFACE = module;
|
||||||
|
CHARGER_SURFACE = module;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Surface Hotplug
|
||||||
|
#
|
||||||
|
SURFACE_HOTPLUG = module;
|
||||||
|
|
||||||
|
#
|
||||||
|
# IPTS touchscreen
|
||||||
|
#
|
||||||
|
# This only enables the user interface for IPTS data.
|
||||||
|
# For the touchscreen to work, you need to install iptsd.
|
||||||
|
#
|
||||||
|
MISC_IPTS = module;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Cameras: IPU3
|
||||||
|
#
|
||||||
|
VIDEO_DW9719 = module;
|
||||||
|
VIDEO_IPU3_IMGU = module;
|
||||||
|
VIDEO_IPU3_CIO2 = module;
|
||||||
|
CIO2_BRIDGE = yes;
|
||||||
|
INTEL_SKL_INT3472 = module;
|
||||||
|
REGULATOR_TPS68470 = module;
|
||||||
|
COMMON_CLK_TPS68470 = module;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Cameras: Sensor drivers
|
||||||
|
#
|
||||||
|
VIDEO_OV5693 = module;
|
||||||
|
VIDEO_OV7251 = module;
|
||||||
|
VIDEO_OV8865 = module;
|
||||||
|
|
||||||
|
#
|
||||||
|
# ALS Sensor for Surface Book 3, Surface Laptop 3, Surface Pro 7
|
||||||
|
#
|
||||||
|
APDS9960 = module;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Other Drivers
|
||||||
|
#
|
||||||
|
INPUT_SOC_BUTTON_ARRAY = module;
|
||||||
|
SURFACE_3_POWER_OPREGION = module;
|
||||||
|
SURFACE_PRO3_BUTTON = module;
|
||||||
|
SURFACE_GPE = module;
|
||||||
|
SURFACE_BOOK1_DGPU_SWITCH = module;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "ms-surface/0001-surface3-oemb";
|
||||||
|
patch = patchDir + "/0001-surface3-oemb.patch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "ms-surface/0002-mwifiex";
|
||||||
|
patch = patchDir + "/0002-mwifiex.patch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "ms-surface/0003-ath10k";
|
||||||
|
patch = patchDir + "/0003-ath10k.patch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "ms-surface/0004-ipts";
|
||||||
|
patch = patchDir + "/0004-ipts.patch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "ms-surface/0005-surface-sam";
|
||||||
|
patch = patchDir + "/0005-surface-sam.patch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "ms-surface/0006-surface-sam-over-hid";
|
||||||
|
patch = patchDir + "/0006-surface-sam-over-hid.patch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "ms-surface/0007-surface-button";
|
||||||
|
patch = patchDir + "/0007-surface-button.patch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "ms-surface/0008-surface-typecover";
|
||||||
|
patch = patchDir + "/0008-surface-typecover.patch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "ms-surface/0009-cameras";
|
||||||
|
patch = patchDir + "/0009-cameras.patch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "ms-surface/0010-amd-gpio";
|
||||||
|
patch = patchDir + "/0010-amd-gpio.patch";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "ms-surface/0011-rtc";
|
||||||
|
patch = patchDir + "/0011-rtc.patch";
|
||||||
|
}
|
||||||
|
]
|
|
@ -4,8 +4,8 @@
|
||||||
linux-surface = fetchFromGitHub {
|
linux-surface = fetchFromGitHub {
|
||||||
owner = "linux-surface";
|
owner = "linux-surface";
|
||||||
repo = "linux-surface";
|
repo = "linux-surface";
|
||||||
rev = "487e64047ca047dde9a062909a87410e7bb86845";
|
rev = "91240ac43dfdfb3e68bbc604def84685a218fab9";
|
||||||
sha256 = "sha256-HTIuRBZk0prhUPd2KnsXGo+ZyBsMwERN7P8WJH1RG3M=";
|
sha256 = "sha256-Jf7tthFWj67Esjx+/ZwG7BYlN7zWS26e1TbsznNxE9Q=";
|
||||||
};
|
};
|
||||||
|
|
||||||
# This is the owner and repo for the pre-patched kernel from the "linux-surface" project:
|
# This is the owner and repo for the pre-patched kernel from the "linux-surface" project:
|
||||||
|
|
|
@ -17,6 +17,8 @@ in {
|
||||||
../../../common/cpu/intel/kaby-lake
|
../../../common/cpu/intel/kaby-lake
|
||||||
];
|
];
|
||||||
|
|
||||||
|
microsoft-surface.kernelVersion = "6.1.6";
|
||||||
|
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [
|
||||||
"i915.enable_rc6=1"
|
"i915.enable_rc6=1"
|
||||||
"i915.modeset=1"
|
"i915.modeset=1"
|
||||||
|
|
Loading…
Reference in a new issue