From owner-freebsd-mobile@FreeBSD.ORG Sun Sep 30 13:38:35 2012 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8C7D106566C for ; Sun, 30 Sep 2012 13:38:35 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) by mx1.freebsd.org (Postfix) with ESMTP id 255E58FC0A for ; Sun, 30 Sep 2012 13:38:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id q8UDcR3U044876; Sun, 30 Sep 2012 23:38:27 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Sun, 30 Sep 2012 23:38:27 +1000 (EST) From: Ian Smith To: =?windows-1251?B?y/7h7uzo8CDD8Ojj7vDu4g==?= In-Reply-To: Message-ID: <20120930220701.I43208@sola.nimnet.asn.au> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-mobile@freebsd.org Subject: Re: Turning off battery while on AC X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Sep 2012 13:38:35 -0000 On Fri, 28 Sep 2012 13:01:02 -0700, nm.knife@gmail.com wrote: > Sorry if this has been answered, but is there a way to set a laptop (I have > ThinkPad X220) not to draw energy from the battery when it's on AC? In > Windows once the battery is not charging and you are on AC, the battery is > totally bypassed. You can imagine this being better than it constantly > charging and being used. > > Is this something that is hardware built in, or is it controlled by the OS? > Is there an equivalent in FreeBSD? (or maybe GNU/Linux)? What indicates that it's using energy from the battery while on AC? Please show: % acpiconf -i0 when the battery is fully charged and running on AC power? Earlier Thinkpads (I have a couple of T23s) always fully charge the battery then disconnect it, letting it slowly self-discharge until the reported capacity drops to ~95%, over some days usually, when it gets boosted back to 100% IBM were careful not to trickle-charge Li-Ion batteries, avoiding risk of fire or explosion - Lenovo too, I guess. If yours is not behaving like that, then acpiconf -i0 should show something happening on 'Present rate', which shows charge rate during charging, and discharge rate while running from battery. When fully charged (State: high) running on AC, it should show 0mW (on some, mA): smithi on t23% acpiconf -i0 Design capacity: 43200 mWh Last full capacity: 31850 mWh Technology: secondary (rechargeable) Design voltage: 10800 mV Capacity (warn): 2160 mWh Capacity (low): 432 mWh Low/warn granularity: 1 mWh Warn/full granularity: 1 mWh Model number: IBM-02K7026 Serial number: 932 Type: LION OEM info: Panasonic State: high Remaining capacity: 100% Remaining time: unknown Present rate: 0 mW Present voltage: 12381 mV > Lyubomir Grigorov (bgalakazam) cheers, Ian From owner-freebsd-mobile@FreeBSD.ORG Fri Oct 5 21:55:35 2012 Return-Path: Delivered-To: mobile@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D1483106566C; Fri, 5 Oct 2012 21:55:35 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 8E6798FC0C; Fri, 5 Oct 2012 21:55:35 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 0BA8D1E00700; Fri, 5 Oct 2012 23:55:27 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.4/8.14.4) with ESMTP id q95LrGIY039123; Fri, 5 Oct 2012 23:53:16 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.4/8.14.3/Submit) id q95LrG6g039122; Fri, 5 Oct 2012 23:53:16 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Fri, 5 Oct 2012 23:53:16 +0200 To: mobile@freebsd.org, acpi@freebsd.org Message-ID: <20121005215316.GA38707@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: avilla@freebsd.org Subject: Dell acpi_video patch X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Oct 2012 21:55:35 -0000 Hi! I finally took a closer look why acpi_video found nothing on my Dell laptop (Precision M4500), and came up with this patch: --- sys/dev/acpica/acpi_video.c.orig +++ sys/dev/acpica/acpi_video.c @@ -906,7 +906,7 @@ vid_enum_outputs_subr(ACPI_HANDLE handle for (i = 0; i < argset->dod_pkg->Package.Count; i++) { if (acpi_PkgInt32(argset->dod_pkg, i, &val) == 0 && - (val & DOD_DEVID_MASK_FULL) == adr) { + (val & (DOD_DEVID_MASK_FULL | 0x80000000)) == adr) { argset->callback(handle, val, argset->context); argset->count++; } which gives me: % sysctl hw.acpi.video. hw.acpi.video.crt0.active: 0 hw.acpi.video.lcd0.active: 0 hw.acpi.video.lcd0.brightness: 100 hw.acpi.video.lcd0.fullpower: 100 hw.acpi.video.lcd0.economy: 46 hw.acpi.video.lcd0.levels: 100 46 0 6 13 20 26 33 40 46 53 60 66 73 80 86 93 100 hw.acpi.video.ext0.active: 0 hw.acpi.video.ext1.active: 0 hw.acpi.video.ext2.active: 0 hw.acpi.video.ext3.active: 0 % and I can change the lcd brightness. hw.acpi.video.lcd0.active is still 0 tho and can't be changed regardless if the display is off or on - maybe that also explains the blank screen after suspend/resume w/o X running or when exiting X or switching from X to a textconsole? I also took a cursory look at Linux' drivers/platform/x86/dell-laptop.c and drivers/platform/x86/dell-wmi.c and found Linux seems to do smi calls, tho it wasn't immediately obvious if that affects all Dell laptops or only older models. (The blank screen problem doesn't occur on Linux.) See also my FLCL entry: https://laptop.bsdgroup.de/freebsd/index.html?action=show_laptop_detail&laptop=13061 Thanx! :) Juergen