From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: [GIT PULL RFC] directly poll battery strength when reading power_supply Date: Wed, 07 Dec 2011 09:36:35 -0800 Message-ID: <4EDFA423.70701@goop.org> References: <4EC75224.7070207@goop.org> <4EC820F8.4070900@goop.org> <4ECA7E7D.80207@goop.org> <4ECAE019.4000409@goop.org> <4ECCB38A.8000503@goop.org> <4ED90E6D.8090402@goop.org> <4ED9BDF8.3010600@goop.org> <4EDE4C7A.1010802@goop.org> <4EDFA192.7000602@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from claw.goop.org ([74.207.240.146]:57660 "EHLO claw.goop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756641Ab1LGRgh (ORCPT ); Wed, 7 Dec 2011 12:36:37 -0500 In-Reply-To: Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Richard Hughes Cc: Daniel Nicoletti , linux-input@vger.kernel.org, Jiri Kosina , vojtech@ucw.cz, Przemo Firszt , Richard Hughes , Anton Vorontsov , David Woodhouse On 12/07/2011 09:29 AM, Richard Hughes wrote: > On 7 December 2011 17:25, Jeremy Fitzhardinge wrote: >> Something like this? >> @@ -63,6 +63,9 @@ static ssize_t power_supply_show_property(struct device *dev, >> static char *capacity_level_text[] = { >> "Unknown", "Critical", "Low", "Normal", "High", "Full" >> }; >> + static char *scope_text[] = { >> + "Unknown", "System", "Device" >> + }; > That looks perfect. OK, I'll put it into a submittable form when I get the chance (oh, and compile and test it). > > Well, upower just assigns a "kind" to each battery which means the > clients can for instance show all the laptop batteries, but ignore any > mice and keyboards. For practical purposes, it's so we suspend the > computer for a low power laptop battery, but not for a low power > keyboard :) So you could make that determination from the scope? J