Compare commits
4 Commits
95f3f072da
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 0569ea2dd4 | |||
| 1fb1fe06fa | |||
| 2e28a8f948 | |||
|
f4bc76c1dc
|
@@ -62,6 +62,12 @@
|
|||||||
"clk_ignore_unused"
|
"clk_ignore_unused"
|
||||||
"pd_ignore_unused"
|
"pd_ignore_unused"
|
||||||
"iomem=relaxed"
|
"iomem=relaxed"
|
||||||
|
"mem_sleep_default=s2idle"
|
||||||
|
];
|
||||||
|
|
||||||
|
blacklistedKernelModules = [
|
||||||
|
"qcom_battmgr"
|
||||||
|
"qcrypto"
|
||||||
];
|
];
|
||||||
|
|
||||||
supportedFilesystems = {
|
supportedFilesystems = {
|
||||||
|
|||||||
@@ -15,6 +15,11 @@ in
|
|||||||
config = {
|
config = {
|
||||||
nixpkgs.hostPlatform = "aarch64-linux";
|
nixpkgs.hostPlatform = "aarch64-linux";
|
||||||
|
|
||||||
|
services.udev.extraRules = ''
|
||||||
|
ACTION=="add", SUBSYSTEM=="platform", DRIVER=="dwc3-qcom-legacy", ATTR{power/control}="auto"
|
||||||
|
ACTION=="add", SUBSYSTEM=="usb", ATTR{power/control}="auto"
|
||||||
|
'';
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
enableRedistributableFirmware = lib.mkForce true;
|
enableRedistributableFirmware = lib.mkForce true;
|
||||||
enableAllFirmware = lib.mkForce true;
|
enableAllFirmware = lib.mkForce true;
|
||||||
|
|||||||
+4
-4
@@ -4,13 +4,13 @@
|
|||||||
kernelPackages =
|
kernelPackages =
|
||||||
let
|
let
|
||||||
linux_x1e = pkgs.buildLinux rec {
|
linux_x1e = pkgs.buildLinux rec {
|
||||||
version = "7.0.0-rc5";
|
version = "7.0.0";
|
||||||
modDirVersion = "7.0.0-rc5";
|
modDirVersion = "7.0.0";
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
owner = "torvalds";
|
owner = "torvalds";
|
||||||
repo = "linux";
|
repo = "linux";
|
||||||
rev = "d1d81e9d1a4dd846aee9ae77ff9ecc2800d72148"; # v7.0-rc5
|
rev = "028ef9c96e96197026887c0f092424679298aae8"; # v7.0
|
||||||
hash = "sha256-UN1xOwSyn5YzdxQzEF6vTKev6vtN3iE2aiv7OT7TBAM=";
|
hash = "sha256-7TjYHhJdD67P3lquusrjjVtUIUzhLPtA5Oy7tc82gYA=";
|
||||||
};
|
};
|
||||||
ignoreConfigErrors = true;
|
ignoreConfigErrors = true;
|
||||||
structuredExtraConfig = with lib.kernel; {
|
structuredExtraConfig = with lib.kernel; {
|
||||||
|
|||||||
@@ -1,99 +1,124 @@
|
|||||||
--- a/drivers/acpi/platform_profile.c
|
diff -ruN a/drivers/acpi/platform_profile.c b/drivers/acpi/platform_profile.c
|
||||||
+++ b/drivers/acpi/platform_profile.c
|
--- a/drivers/acpi/platform_profile.c 2026-04-22 13:09:37.943936485 +0400
|
||||||
@@ -176,7 +176,8 @@ static ssize_t profile_store(struct device *dev,
|
+++ b/drivers/acpi/platform_profile.c 2026-04-22 13:12:09.080175395 +0400
|
||||||
|
@@ -16,6 +16,9 @@
|
||||||
|
|
||||||
|
static DEFINE_MUTEX(profile_lock);
|
||||||
|
|
||||||
|
+static struct kobject *legacy_kobj;
|
||||||
|
+static struct kobject *legacy_kobj_created;
|
||||||
|
+
|
||||||
|
struct platform_profile_handler {
|
||||||
|
const char *name;
|
||||||
|
struct device dev;
|
||||||
|
@@ -215,7 +218,7 @@
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
- sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
- sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
||||||
+ if (acpi_kobj)
|
+ sysfs_notify(legacy_kobj, NULL, "platform_profile");
|
||||||
+ sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
@@ -341,7 +342,8 @@ static ssize_t platform_profile_store(struct kobject *kobj,
|
@@ -435,7 +438,7 @@
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
- sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
- sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
||||||
+ if (acpi_kobj)
|
+ sysfs_notify(legacy_kobj, NULL, "platform_profile");
|
||||||
+ sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
@@ -377,7 +379,8 @@ void platform_profile_notify(struct device *dev)
|
@@ -481,7 +484,7 @@
|
||||||
scoped_cond_guard(mutex_intr, return, &profile_lock) {
|
scoped_cond_guard(mutex_intr, return, &profile_lock) {
|
||||||
_notify_class_profile(dev, NULL);
|
_notify_class_profile(dev, NULL);
|
||||||
}
|
}
|
||||||
- sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
- sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
||||||
+ if (acpi_kobj)
|
+ sysfs_notify(legacy_kobj, NULL, "platform_profile");
|
||||||
+ sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(platform_profile_notify);
|
EXPORT_SYMBOL_GPL(platform_profile_notify);
|
||||||
|
|
||||||
@@ -425,7 +428,8 @@ int platform_profile_cycle(void)
|
@@ -529,7 +532,7 @@
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
- sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
- sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
||||||
+ if (acpi_kobj)
|
+ sysfs_notify(legacy_kobj, NULL, "platform_profile");
|
||||||
+ sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -487,9 +491,11 @@ struct device *platform_profile_register(struct device *dev, const char *name,
|
@@ -603,9 +606,9 @@
|
||||||
goto cleanup_ida;
|
goto cleanup_ida;
|
||||||
}
|
}
|
||||||
|
|
||||||
- sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
- sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
||||||
+ if (acpi_kobj)
|
+ sysfs_notify(legacy_kobj, NULL, "platform_profile");
|
||||||
+ sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
|
||||||
|
|
||||||
- err = sysfs_update_group(acpi_kobj, &platform_profile_group);
|
- err = sysfs_update_group(acpi_kobj, &platform_profile_group);
|
||||||
+ err = acpi_kobj ? sysfs_update_group(acpi_kobj, &platform_profile_group)
|
+ err = sysfs_update_group(legacy_kobj, &platform_profile_group);
|
||||||
+ : 0;
|
|
||||||
if (err)
|
if (err)
|
||||||
goto cleanup_cur;
|
goto cleanup_cur;
|
||||||
|
|
||||||
@@ -519,8 +525,10 @@ void platform_profile_remove(struct device *dev)
|
@@ -639,8 +642,8 @@
|
||||||
ida_free(&platform_profile_ida, pprof->minor);
|
ida_free(&platform_profile_ida, pprof->minor);
|
||||||
device_unregister(&pprof->dev);
|
device_unregister(&pprof->dev);
|
||||||
|
|
||||||
- sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
- sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
||||||
- sysfs_update_group(acpi_kobj, &platform_profile_group);
|
- sysfs_update_group(acpi_kobj, &platform_profile_group);
|
||||||
+ if (acpi_kobj) {
|
+ sysfs_notify(legacy_kobj, NULL, "platform_profile");
|
||||||
+ sysfs_notify(acpi_kobj, NULL, "platform_profile");
|
+ sysfs_update_group(legacy_kobj, &platform_profile_group);
|
||||||
+ sysfs_update_group(acpi_kobj, &platform_profile_group);
|
|
||||||
+ }
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(platform_profile_remove);
|
EXPORT_SYMBOL_GPL(platform_profile_remove);
|
||||||
|
|
||||||
@@ -567,14 +575,16 @@ static int __init platform_profile_init(void)
|
@@ -688,24 +691,45 @@
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
- if (acpi_disabled)
|
- if (acpi_disabled)
|
||||||
- return -EOPNOTSUPP;
|
- return -EOPNOTSUPP;
|
||||||
-
|
+ if (acpi_kobj) {
|
||||||
|
+ legacy_kobj = acpi_kobj;
|
||||||
|
+ } else {
|
||||||
|
+ legacy_kobj_created = kobject_create_and_add("acpi", firmware_kobj);
|
||||||
|
+ if (!legacy_kobj_created)
|
||||||
|
+ return -ENOMEM;
|
||||||
|
+ legacy_kobj = legacy_kobj_created;
|
||||||
|
+ }
|
||||||
|
|
||||||
err = class_register(&platform_profile_class);
|
err = class_register(&platform_profile_class);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
- return err;
|
||||||
|
+ goto put_kobj;
|
||||||
|
|
||||||
- err = sysfs_create_group(acpi_kobj, &platform_profile_group);
|
- err = sysfs_create_group(acpi_kobj, &platform_profile_group);
|
||||||
+ /*
|
- if (err)
|
||||||
+ * Legacy sysfs interface under /sys/firmware/acpi/ is only available
|
+ err = sysfs_create_group(legacy_kobj, &platform_profile_group);
|
||||||
+ * when ACPI is enabled. The class-based interface works regardless.
|
+ if (err) {
|
||||||
+ */
|
|
||||||
+ err = acpi_kobj ? sysfs_create_group(acpi_kobj, &platform_profile_group)
|
|
||||||
+ : 0;
|
|
||||||
if (err)
|
|
||||||
class_unregister(&platform_profile_class);
|
class_unregister(&platform_profile_class);
|
||||||
|
+ goto put_kobj;
|
||||||
@@ -584,7 +594,8 @@ static int __init platform_profile_init(void)
|
+ }
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
|
||||||
|
+put_kobj:
|
||||||
|
+ if (legacy_kobj_created) {
|
||||||
|
+ kobject_put(legacy_kobj_created);
|
||||||
|
+ legacy_kobj_created = NULL;
|
||||||
|
+ legacy_kobj = NULL;
|
||||||
|
+ }
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
static void __exit platform_profile_exit(void)
|
static void __exit platform_profile_exit(void)
|
||||||
{
|
{
|
||||||
- sysfs_remove_group(acpi_kobj, &platform_profile_group);
|
- sysfs_remove_group(acpi_kobj, &platform_profile_group);
|
||||||
+ if (acpi_kobj)
|
+ sysfs_remove_group(legacy_kobj, &platform_profile_group);
|
||||||
+ sysfs_remove_group(acpi_kobj, &platform_profile_group);
|
|
||||||
class_unregister(&platform_profile_class);
|
class_unregister(&platform_profile_class);
|
||||||
|
+ if (legacy_kobj_created) {
|
||||||
|
+ kobject_put(legacy_kobj_created);
|
||||||
|
+ legacy_kobj_created = NULL;
|
||||||
|
+ legacy_kobj = NULL;
|
||||||
|
+ }
|
||||||
}
|
}
|
||||||
module_init(platform_profile_init);
|
module_init(platform_profile_init);
|
||||||
|
module_exit(platform_profile_exit);
|
||||||
|
|||||||
Reference in New Issue
Block a user