From owner-freebsd-mobile Mon May 14 8:41: 6 2001 Delivered-To: freebsd-mobile@freebsd.org Received: from unbeat.com (24-168-36-66.nyc.rr.com [24.168.36.66]) by hub.freebsd.org (Postfix) with ESMTP id A353F37B424 for ; Mon, 14 May 2001 08:40:59 -0700 (PDT) (envelope-from moxie@unbeat.com) Received: (from moxie@localhost) by unbeat.com (8.11.2/8.11.2) id f4EFeee03125; Mon, 14 May 2001 11:40:40 -0400 (EDT) (envelope-from moxie) Date: Mon, 14 May 2001 11:40:39 -0400 From: JT To: Richard Tobin Cc: freebsd-mobile@freebsd.org Subject: Re: Sony Z600-HEK - un-recommendation Message-ID: <20010514114039.E345@zed.unbeat.com> Mail-Followup-To: Richard Tobin , freebsd-mobile@freebsd.org References: <200105081353.OAA24182@rhymer.cogsci.ed.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200105081353.OAA24182@rhymer.cogsci.ed.ac.uk>; from richard@cogsci.ed.ac.uk on Tue, May 08, 2001 at 02:53:42PM +0100 Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org It does work on the Vaio PCG-Z505LS Obviously it's a proof of concept, so just for the record: it currently sets modulus 255; no argument cores it. Thanks! I was afraid to dump windows for this reason alone! I've had one or two crashes (well, I ran out of power) that dimmed the brightness afterwards. Somewhere else in this thread Warner Losh mentions tweaking the brightness before/after suspend - that's really a great idea for getting a little extra power saving! On Tue, May 08, 2001 at 02:53:42PM +0100, Richard Tobin wrote: > > 1. Screen brightess - Only works under windows. > > Here is a program to set the brightness under FreeBSD. 0 seems to be > full brightness, 255 minimum. You'll have to be root to run it. It's > based on a Linux program. > > -- Richard > > /* Set brightness of Vaio screen. Tested on Z600-TEK. */ > /* Based on http://us1.samba.org/ftp/unpacked/picturebook/setbrightness.c */ > > #include > #include > #include > #include > > #define DATA_REG 0x62 > #define CST_REG 0x66 > > typedef unsigned short u16; > > static void ecr_set(u16 addr, u16 value) > { > while (inw(CST_REG) & 3) usleep(1); > outw(CST_REG, 0x81); > while (inw(CST_REG) & 2) usleep(1); > outw(DATA_REG, addr); > while (inw(CST_REG) & 2) usleep(1); > outw(DATA_REG, value); > while (inw(CST_REG) & 2) usleep(1); > } > > static u16 ecr_get(u16 addr) > { > while (inw(CST_REG) & 3) usleep(1); > outb(CST_REG, 0x80); > while (inw(CST_REG) & 2) usleep(1); > outb(DATA_REG, addr); > while (inw(CST_REG) & 2) usleep(1); > return inw(DATA_REG); > } > > int main(int argc, char *argv[]) > { > if(open("/dev/io", O_RDWR, 0) < 0) > { > perror("/dev/io"); > return 1; > } > printf("currently %x\n", ecr_get(0x96)); > ecr_set(0x96, atoi(argv[1])); > return 0; > } > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-mobile" in the body of the message -- ------------------------------------------------------------------- Jason Thaxter Flashlight Media, Inc. jason@flashlightmedia.com www.flashlightmedia.com (212) 334-9378 ------------------------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message