| 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 142 times.
✓ Branch 1 taken 1740 times.
✓ Branch 2 taken 142 times.
✓ Branch 3 taken 142 times.
✗ Branch 4 not taken.
|
4332 | 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 | 474 | ppd_driver_platform_finalize (GObject *object) | |
| 42 | { | ||
| 43 | 474 | G_OBJECT_CLASS (ppd_driver_platform_parent_class)->finalize (object); | |
| 44 | 474 | } | |
| 45 | |||
| 46 | static void | ||
| 47 | 142 | ppd_driver_platform_class_init (PpdDriverPlatformClass *klass) | |
| 48 | { | ||
| 49 | 142 | GObjectClass *object_class; | |
| 50 | |||
| 51 | 142 | object_class = G_OBJECT_CLASS (klass); | |
| 52 | 142 | object_class->finalize = ppd_driver_platform_finalize; | |
| 53 | } | ||
| 54 | |||
| 55 | static void | ||
| 56 | 474 | ppd_driver_platform_init (PpdDriverPlatform *self) | |
| 57 | { | ||
| 58 | 474 | } | |
| 59 |