Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | * Copyright (c) 2023 Mario Limonciello <superm1@gmail.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License version 3 as published by | ||
6 | * the Free Software Foundation. | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | #define G_LOG_DOMAIN "PlatformDriver" | ||
11 | |||
12 | #include "ppd-driver-platform.h" | ||
13 | |||
14 |
4/5✓ Branch 0 taken 130 times.
✓ Branch 1 taken 1502 times.
✓ Branch 2 taken 130 times.
✓ Branch 3 taken 130 times.
✗ Branch 4 not taken.
|
3784 | G_DEFINE_TYPE (PpdDriverPlatform, ppd_driver_platform, PPD_TYPE_DRIVER) |
15 | |||
16 | /** | ||
17 | * SECTION:ppd-driver-platform | ||
18 | * @Short_description: Profile Drivers | ||
19 | * @Title: Platform Profile Drivers | ||
20 | * | ||
21 | * Platform drivers are the implementation of the different profiles for | ||
22 | * the whole system. A driver will need to implement support for `power-saver` | ||
23 | * and `balanced` at a minimum. | ||
24 | * | ||
25 | * If no system-specific platform driver is available, a placeholder driver | ||
26 | * will be put in place, and the `performance` profile will be unavailable. | ||
27 | * | ||
28 | * There should not be a need to implement system-specific drivers, as the | ||
29 | * [`platform_profile`] (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/ABI/testing/sysfs-platform_profile) | ||
30 | * kernel API offers a way to implement system-specific profiles which | ||
31 | * `power-profiles-daemon` can consume. | ||
32 | * | ||
33 | * When a driver implements the `performance` profile, it might set the | ||
34 | * #PpdDriver:performance-degraded property if the profile isn't running to | ||
35 | * its fullest performance for any reason, such as thermal limits being | ||
36 | * reached, or because a part of the user's body is too close for safety, | ||
37 | * for example. | ||
38 | */ | ||
39 | |||
40 | static void | ||
41 | 402 | ppd_driver_platform_finalize (GObject *object) | |
42 | { | ||
43 | 402 | G_OBJECT_CLASS (ppd_driver_platform_parent_class)->finalize (object); | |
44 | 402 | } | |
45 | |||
46 | static void | ||
47 | 130 | ppd_driver_platform_class_init (PpdDriverPlatformClass *klass) | |
48 | { | ||
49 | 130 | GObjectClass *object_class; | |
50 | |||
51 | 130 | object_class = G_OBJECT_CLASS (klass); | |
52 | 130 | object_class->finalize = ppd_driver_platform_finalize; | |
53 | } | ||
54 | |||
55 | static void | ||
56 | 402 | ppd_driver_platform_init (PpdDriverPlatform *self) | |
57 | { | ||
58 | 402 | } | |
59 |