Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 May 2001 15:01:50 +0100
From:      simond@irrelevant.org
To:        Richard Tobin <richard@cogsci.ed.ac.uk>
Cc:        wayne.pascoe@realtime.co.uk, freebsd-mobile@freebsd.org, freebsd-questions@freebsd.org
Subject:   Re: Sony Z600-HEK - un-recommendation
Message-ID:  <20010508150150.A17471@irrelevant.org>
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 %2B0100
References:  <200105081353.OAA24182@rhymer.cogsci.ed.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
That actually works on my PCG-F807K too, thanks :)

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 <stdio.h>
> #include <unistd.h>
> #include <fcntl.h>
> #include <machine/cpufunc.h>
> 
> #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

-- 
Simon Dick					simond@irrelevant.org
"Why do I get this urge to go bowling everytime I see Tux?"

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010508150150.A17471>