From owner-freebsd-questions Tue May 8 6:53:58 2001 Delivered-To: freebsd-questions@freebsd.org Received: from rhymer.cogsci.ed.ac.uk (rhymer.cogsci.ed.ac.uk [129.215.144.8]) by hub.freebsd.org (Postfix) with ESMTP id 1A40437B422; Tue, 8 May 2001 06:53:44 -0700 (PDT) (envelope-from richard@cogsci.ed.ac.uk) Received: (from richard@localhost) by rhymer.cogsci.ed.ac.uk (8.9.3/8.9.3) id OAA24182; Tue, 8 May 2001 14:53:42 +0100 (BST) Date: Tue, 8 May 2001 14:53:42 +0100 (BST) Message-Id: <200105081353.OAA24182@rhymer.cogsci.ed.ac.uk> From: Richard Tobin Subject: Re: Sony Z600-HEK - un-recommendation To: wayne.pascoe@realtime.co.uk, freebsd-mobile@FreeBSD.ORG, freebsd-questions@FreeBSD.ORG In-Reply-To: Wayne Pascoe's message of 08 May 2001 10:19:51 +0100 Organization: just say no Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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-questions" in the body of the message