summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2011-03-09Depend on stable GUdev APIMichael Biebl2-2/+0
The GUdev API was declared stable in udev release 147. Bump the version in the configure check and drop the G_UDEV_API_IS_SUBJECT_TO_CHANGE defines. Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-04up-input.c: fix bitmap checkArnaud Patard1-2/+2
In up_input_coldplug(), some checks are done on the input device found in order to detect if it's a lid switch or not. The following one is problematic : /* convert to a bitmask */ num_bits = up_input_str_to_bitmask (contents, bitmask, sizeof (bitmask)); if (num_bits != 1) { g_debug ("not one bitmask entry for %s", native_path); ret = FALSE; goto out; } Checking if there's only 1 bit set is wrong. It's nice if you have a x86 with acpi using 1 input device for the lid switch but it's not always nice. One can create input devices with gpios-keys like this: static struct gpio_keys_button keys[] = { { .code = SW_LID, .gpio = ..., .type = EV_SW, .desc = "Lid Switch", }, { .code = SW_RFKILL_ALL, .gpio = ..., .type = EV_SW, .desc = "rfkill", }, }; The resulting SW bitmap will be 9 and thus there are 2 bits sets and due to the mentionned check, the device is ignored by upower. As a fix, I'm checking if the number of bits is between 0 and SW_CNT bits. Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-03-03Add an option for polling dock devices in UPower.conf, defaulting to falseRichard Hughes4-3/+53
2011-02-23Drop devkit and devkit-power-daemon symlinksMichael Biebl1-3/+0
Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-02-02Add a LidForceSleep property to ensure that we don't melt any laptopsRichard Hughes3-0/+45
We still need to add the DMI quirks, but I'm waiting for the community to supply them now.
2011-01-04linux: use the number of active DRM devices to determine the system docked ↵Richard Hughes4-1/+256
status Not ideal, but better than relying on ACPI.
2011-01-04Add an IsDocked binary property to the main interfaceRichard Hughes3-0/+40
2011-01-04Support the power_now sysfs attribute to get time remaining on new kernelsRichard Hughes1-10/+14
The kernel has removed the insanity of providing current_now in either (and unspecified) units of uVh or uWh and instead provides power_now for the power rate value. Related commits: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=b137b9942a07843c64a934cfdb7d43155e507e13 http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=7faa144a518c456e2057918f030f50100144ccc6 Thanks to Florian Eitel for the initial patch.
2010-11-05Testsuite: Reduce race condition in history purging checkMartin Pitt1-1/+1
Previously we set the "max age" to seconds and then waited for exactly 2 seconds until we wrote the history data back to files. In a lot of cases this actually took a tad more than 2 seconds, which caused the second-last history entry to disappear as well. Reduce the waiting to 1.1 seconds, which will now give us 900 ms to write back the history file. Still not ideal, but the best we can do in the test suite.
2010-11-04Fix self check to work as non-rootMartin Pitt1-10/+17
In our test suite, create and use a temporary directory for our history. This makes the history check work as non-root. Consequently, drop the skipping of the history check for "make distcheck".
2010-11-04UpHistory: Add method to set history dirMartin Pitt2-1/+16
Add up_history_set_directory() method to change the directory for history files. This is mainly useful for our test suite.
2010-11-04Fix compilation eror against Linux 2.6.36Martin Pitt1-0/+1
Include <stdint.h> so that <linux/fs.h> can use uint64_t. Arguably a bug in the kernel headers, but it costs us nothing to safeguard against it. CC libupshared_la-up-device-idevice.lo In file included from sysfs-utils.c:39:0: /usr/include/linux/fs.h:37:2: error: expected specifier-qualifier-list before ‘uint64_t’
2010-11-01Ensure the self check code can find UPower.confRichard Hughes2-2/+18
2010-11-01Port from EggDebug to the GLib built-in logging frameworkRichard Hughes29-848/+237
2010-10-21remove the UP_DEVICE_SUPPLY_CHARGED_THRESHOLD heuristicMichal Schmidt1-8/+0
When a full battery starts to discharge, but reports its status as 'Unknown', it takes a few minutes before g-p-m notices any change. upowerd guesses the battery is fully charged as long as it has over 90% charge. I see no reason to delay the reporting of discharging of the battery. Let's remove this heuristic. Signed-off-by: Richard Hughes <richard@hughsie.com>
2010-10-18Keyboard backlight of zero is not an errorAlex Murray1-4/+5
Fixes a fail to detect keyboard backlight when initial value is zero Signed-off-by: Richard Hughes <richard@hughsie.com>
2010-10-11Add support for controlling leds keyboard backlightsAlex Murray6-0/+507
Add a new DBus interface based on the QoS one to provide for controlling a keyboard backlight via the Linux leds interface. Signed-off-by: Richard Hughes <richard@hughsie.com>
2010-09-20Do not continue to poll the serial port if there is no Watts Up Pro adaptorRichard Hughes1-5/+1
2010-09-17Only save by default 7 days data to stop the log files becoming huge. Fixes ↵Richard Hughes3-29/+176
rh#634228 Parsing huge log files at startup will demolish startup time. Cull old entries when the file is resaved to keep them sane. Also add the needed self tests to check this in the future.
2010-09-17trivial: fix make distcheckRichard Hughes1-1/+1
2010-08-19Fix up_polkit_get_subject() D-BUS error returnMatthias Clasen1-0/+7
All callers of up_polkit_get_subject() just exit without returning an error to the D-BUS caller if they fail to get the PolicyKit subject. Do that in up_polkit_get_subject() itself now, for convenience. Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-08-19Fix double D-BUS return in up_daemon_*_allowedMatthias Clasen3-10/+23
Do not send a D-BUS return message any more in up_polkit_is_allowed(), since this makes it hard for callers to ensure that they return exactly one result to the D-BUS caller. Instead, just pass a GError to the caller. Update up_daemon_suspend_allowed() and up_daemon_hibernate_allowed() accordingly, to always return either a result or an error. Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-08-19Add missing D-Bus return in up_qos_cancel_request()Matthias Clasen1-0/+2
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-08-19Revert "Add missing D-Bus return in up_qos_cancel_request()"Martin Pitt4-34/+12
This reverts commit 1fc5aae71f474f82ba62c7a92be3aef05cc7ebef.
2010-08-19Add missing D-Bus return in up_qos_cancel_request()Matthias Clasen4-12/+34
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-08-19Free GErrors after returning themMatthias Clasen2-0/+16
dbus_g_method_return_error() does not free or take ownership of the passed GError, we need to free it ourselves. Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-08-10Ensure we've initialized errors when calling into PolicyKitRichard Hughes1-4/+10
2010-08-10Fix compile with the latest PolicyKit releaseRichard Hughes1-0/+10
2010-07-12trivial: fix make distcheckRichard Hughes1-0/+8
2010-07-07Dynamic testing for enough hibernate swapMartin Pitt1-14/+27
Checking for enough hibernation swap space at the daemon startup is not sufficient, since both active memory as well as swap space change over time. Now check whenever we receive a hibernate request or read the can-hibernate property.
2010-07-07fix typo in numerical constantMartin Pitt1-1/+1
*brown paperbag*
2010-07-07Fix UP_DAEMON_WATERLINE harderMartin Pitt2-4/+5
Commmit fc7c6e003 had a thinko, UP_DAEMON_WATERLINE specifies (active memory)/(available swap), not the other way around. So replace it with 99% instead. Also update the documentation of up_backend_get_used_swap() to explain what the returned percentage actually means.
2010-07-07src/linux/up-backend.c: Add missing #includeMartin Pitt1-0/+1
We need sys/wait.h to get the WEXITSTATUS (and related) macros.
2010-07-07Increase UP_DAEMON_SWAP_WATERLINEMartin Pitt1-1/+4
Native Linux suspend-to-disk does not use compression, and needs 2 KB of page meta information for each MB of active memory. So bump the previous waterline of 80% of active memory to 100.2%. Add an extra .05% to prevent rounding errors. This should make the prediction whether hibernate is going to work very accurate. However, it might prevent hibernate for folks who use an alternative userspace solution like uswsusp which do support compression. http://lists.freedesktop.org/archives/devkit-devel/2010-July/000867.html
2010-07-07Get the powersave command from the backend rather than hardcoding Linux ↵Richard Hughes3-15/+31
specifics
2010-07-02up-device-supply.c: Fix #27902 Bug - Daemon Segmentation FaultMariusz Ceier2-18/+18
In linux backend, g_object_set was called with wrong argument types for time-to-empty,time-to-full and percentage properties. This patch uses explicit casts in the same way as freebsd backend. Signed-off-by: Mariusz Ceier <mceier@gmail.com>
2010-06-14Use pm-is-supported to test if various sleep modes are supported.Victor Lowther1-13/+15
pm-is-supported does all the work upower was duplicating, and it handles more use cases than the old upower code did. No point in duplicating functionality. Signed-off-by: Richard Hughes <richard@hughsie.com>
2010-06-14Cast cnt to int to stop gcc from complaining.Victor Lowther1-1/+1
GCC was complaining about int and ssize_t being differnt types. Make it quit doing that.
2010-06-05Port to GTestRichard Hughes15-721/+143
2010-06-05Assign names to our idle sources when using new versions of glib2Richard Hughes12-7/+69
This makes it possible to profile more accurately using systemtap
2010-06-01Add UP_DEVICE_KIND_COMPUTER as we'll need UP_DEVICE_KIND_TABLET for wacom ↵Richard Hughes1-1/+1
tablets
2010-05-29When calculating used swap space, only use anonymous pagesSteven Walter1-1/+1
up_daemon_check_swap_space uses the Active: line from /proc/meminfo to determine the amount of swap the system needs to be able to suspend. However, because Active: includes both anonymous and file-backed pages, this greatly overestimates the amount of swap needed. File-backed pages can be written back to disk and so do not consume swap. Instead, up_daemon_check_swap_space should use Active(anon): from /proc/meminfo because only anonymous pages need to be written out to swap during a suspend. Signed-off-by: Richard Hughes <richard@hughsie.com>
2010-05-28trivial: print the specific error from libusb1Richard Hughes1-2/+10
2010-05-28trivial: Get rid of some over-verbose debuggingRichard Hughes1-2/+0
2010-05-28trivial: Rename a few 'DeviceKit-power' strings we missedRichard Hughes3-3/+3
2010-05-28Fix compilation of the idevice deviceBastien Nocera1-1/+2
My fault :(
2010-05-28Fix up a few leaks Richard introduced...Bastien Nocera1-15/+23
Signed-off-by: Richard Hughes <richard@hughsie.com>
2010-05-28trivial: fix a tiny warning reported by clang with the capacity code intial ↵Richard Hughes1-1/+1
value
2010-05-28Fix up a potential crasher in the CSR device codeRichard Hughes1-1/+6
2010-05-28Add battery query support for iDevicesBastien Nocera5-2/+366
https://bugs.freedesktop.org/show_bug.cgi?id=28286 Signed-off-by: Richard Hughes <richard@hughsie.com>