Commit graph

35 commits

Author SHA1 Message Date
Bastien Nocera
5a550fcb64 main: Remove ProfileData struct
It only contained a single element, so address the element directly.
2020-08-05 17:14:44 +02:00
Bastien Nocera
91e5f564d2 main: Remove unused per-profile actions member 2020-08-05 17:11:59 +02:00
Bastien Nocera
17b655f9f5 main: Make PpdProfile into a bitmask
So that drivers can support multiple profiles.
2020-08-05 15:29:27 +02:00
Bastien Nocera
6be395152f main: Remove profile property from PpdAction
This is unused now that all actions are activated when switching
profiles.
2020-08-05 11:25:14 +02:00
Bastien Nocera
f0f48abc26 main: Remove profile specificity from actions
Make the actions handle transitions themselves, so they can minimise the
work they have to do when they know both the origin and the target
profiles.
2020-08-05 11:24:06 +02:00
Bastien Nocera
3a84c5b77c utils: Fix implicit declaration
The declaration was still using the old name.

src/ppd-action-trickle-charge.c: In function ‘set_charge_type’:
src/ppd-action-trickle-charge.c:61:5: warning: implicit declaration of function ‘ppd_utils_write_sysfs’ [-Wimplicit-function-declaration]
   61 |     ppd_utils_write_sysfs (dev, CHARGE_TYPE_SYSFS_NAME, charge_type, NULL);
      |     ^~~~~~~~~~~~~~~~~~~~~
2020-08-05 11:24:06 +02:00
Bastien Nocera
c45e572860 trickle-charge: Use new sysfs helper 2020-08-04 15:28:23 +02:00
Bastien Nocera
2b70350dff main: Add sysfs writing utility function 2020-08-04 15:28:23 +02:00
Bastien Nocera
2be3f651cd docs: Fix copyright year 2020-07-24 11:23:44 +02:00
Bastien Nocera
84c6470803 tests: Add trickle-charge action integration test 2020-07-20 17:04:17 +02:00
Bastien Nocera
19835b1f3e main: Add trickle charge action 2020-07-20 17:04:17 +02:00
Bastien Nocera
5078e578bd main: Initialise state for actions
Run "deactivate" on all the actions that don't correspond to the initial
selected profile so that non-power-saving get correctly applied if
they're not the default.
2020-07-20 17:04:17 +02:00
Bastien Nocera
ab360e4498 main: Implement action activation on profile switch 2020-07-17 15:55:41 +02:00
Bastien Nocera
394d84187c main: Register actions 2020-07-17 15:47:37 +02:00
Bastien Nocera
2b9c52b93a main: Sort drivers and actions list 2020-07-17 15:38:07 +02:00
Bastien Nocera
367797f97d main: Remove unneeded header include 2020-07-17 15:36:25 +02:00
Bastien Nocera
a2972329fa main: Implement PpdAction object class 2020-07-17 15:36:07 +02:00
Bastien Nocera
844b4f43f1 main: Activate/deactivate drivers on profile change 2020-07-17 14:39:21 +02:00
Bastien Nocera
af447097ea main: Add activate/deactivate to drivers 2020-07-17 13:36:57 +02:00
Bastien Nocera
2a1eaac709 README: Remove mention of accelerometers 2020-07-16 18:31:16 +02:00
Bastien Nocera
3c1eea8e67 README: Explain how to set the profile using gdbus 2020-07-16 17:36:32 +02:00
Bastien Nocera
e938780c96 main: Better debug when selecting drivers 2020-07-16 17:27:33 +02:00
Bastien Nocera
46ea9c7875 tests: Add integration tests 2020-07-16 17:07:10 +02:00
Bastien Nocera
c6cdc7fb1c ci: Add packages for integration tests 2020-07-16 17:07:10 +02:00
Bastien Nocera
dcf1b8b518 ci: One package per line
Makes it easier to remove/add items.
2020-07-16 17:07:10 +02:00
Bastien Nocera
5d2bbcc019 main: Implement switching profile on inhibition
The activation/deactivation of profile still is just a stub, but the
logic should be correct.
2020-07-16 17:02:15 +02:00
Bastien Nocera
761fd8b700 main: Fix transitioning to uninhibited profiles
They would always fail because the ppd_profile_driver_get_inhibited()
doesn't return NULL, only empty strings.
2020-07-16 17:02:14 +02:00
Bastien Nocera
979a47b7ef main: Fix sending "Inhibited" D-Bus property updates
Copy-pasta error.
2020-07-16 17:02:14 +02:00
Bastien Nocera
791fab922f main: Simplify loop limit
from:
G_N_ELEMENTS(data->profile_data) with profile_data[NUM_PROFILES]
to:
NUM_PROFILES
2020-07-16 17:02:14 +02:00
Bastien Nocera
fe11d1ae3a main: Remove dead variable 2020-07-16 17:02:14 +02:00
Bastien Nocera
ba0850806c main: Add inhibited property helper
The existing C API for this property makes it easier to stuff the
results into a GVariant, but makes it harder to know whether there is an
inhibition. Add a helper with a gboolean return to simplify that.
2020-07-16 17:02:14 +02:00
Bastien Nocera
f7ad2b97af drivers: Add Lenovo DYTC driver
Add a driver for Lenovo laptops with the lap detection feature exported
through DYTC. Performance mode is inhibited when the dytc_lapmode is
"1".
2020-07-16 17:02:14 +02:00
Bastien Nocera
b991fbb1a8 main: Add driver selection
Probe whether drivers should be used on the system before selecting them
as the driver for a particular profile.
2020-07-16 17:02:14 +02:00
Bastien Nocera
f4035f41ee main: Add ->probe member for profile drivers 2020-07-16 17:02:14 +02:00
Bastien Nocera
4ea7c96949 power-profiles-daemon 2020-07-10 17:29:23 +02:00