Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754187AbZFLWbz (ORCPT ); Fri, 12 Jun 2009 18:31:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752146AbZFLWbr (ORCPT ); Fri, 12 Jun 2009 18:31:47 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:57479 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752089AbZFLWbr (ORCPT ); Fri, 12 Jun 2009 18:31:47 -0400 Date: Sat, 13 Jun 2009 00:31:42 +0200 From: Pavel Machek To: Brian Swetland Cc: Ian Molton , Russell King - ARM Linux , kernel list , linux-arm-kernel , san@android.com, rlove@google.com, Greg KH Subject: Re: HTC Dream aka. t-mobile g1 support Message-ID: <20090612223141.GF17688@elf.ucw.cz> References: <20090610194852.GA28787@n2100.arm.linux.org.uk> <20090610213710.GA8472@elf.ucw.cz> <20090611082532.GE8592@elf.ucw.cz> <20090612150504.GA15084@elf.ucw.cz> <4A32D079.9030707@mnementh.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1750 Lines: 36 On Fri 2009-06-12 15:27:01, Brian Swetland wrote: > On Fri, Jun 12, 2009 at 3:02 PM, Ian Molton wrote: > > Brian Swetland wrote: > > > >> Yup. ?It's an HTC specific thing -- some of their devices don't have a > >> battery gauge IC and estimate current drain based on hints provided to > >> the baseband from the apps processor. ?I'm not particularly thrilled > >> with the interface, but without it the battery level estimation is > >> flakier. > > > > Is there a reason that this couldnt be done in userspace? > > It'd be a lot more overhead -- in some cases it's updated with > relatively fine granularity (wifi driver changing state, backlight > changing, etc), and on the kernel side it's just updating a shared > memory location with the current estimate. Userspace doesn't > necessarily have the visibility into driver state to update it > accurately, and punching that information down to userspace and then > having userspace feed it back up to the kernel seems like more > overhead and code to maintain to me. Actually I agree with Brian here, this is better done at kernel level. OTOH, at least initially, it does not need to be done at all. It will make battery readings less reliable but hey... the battery meter does not work reliably anyway and estimating capacity left from voltage acceptably on other platforms... Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/