Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jan 2008 11:12:57 -0800
From:      Nate Lawson <nate@root.org>
To:        =?ISO-8859-2?Q?Artur_Ba=E6?= <artur@ebasoft.com.pl>
Cc:        freebsd-acpi@freebsd.org
Subject:   Re: Need info about ACPI - implementing acer_acpi, amilo 1650g
Message-ID:  <479F7AB9.4080406@root.org>
In-Reply-To: <200801261837.26708.artur@ebasoft.com.pl>
References:  <200801261837.26708.artur@ebasoft.com.pl>

next in thread | previous in thread | raw e-mail | index | archive | help

Artur Baæ wrote:
> Abstract: I implement via acpi, a HotKey switch for enabling WiFi antena
> In linux community there is acerhk and acer_acpi module wich does this for 
> linux. It works even on FujitsuSiemens Amilo1650G when on linux.
> 
> So, i dumped DSDT , then corrected errors and I try to find namespace and 
> method in acpi which is responsible for enablig such radio antena.
> 
> Digging in acerhk i found :
> 
> #define EC_STATUS_REG		0x66	/* Status register of EC (R) */
> #define EC_CNTL_REG		    0x66	/* Controller command register of EC (W) */
> #define EC_DATA_REG		    0x62	/* EC data register (R/W) */
> 
> and in acer_acpi
> 
> /*
>  * Magic Number
>  * Meaning is unknown - this number is required for writing to ACPI for AMW0
>  * (it's also used in acerhk when directly accessing the EC)
>  */
> #define ACER_AMW0_WRITE	0x9610

FreeBSD tries to offer generic methods of accessing driver resources 
instead of direct bit-banging (and contention) by multiple drivers.

You can call the EC via the ACPI_EC_READ and WRITE functions:
#
# Read embedded controller (EC) address space
#
# device_t dev:  EC device
# u_int addr:  Address to read from in EC space
# ACPI_INTEGER *val:  Location to store read value
# int width:  Size of area to read in bytes
#
METHOD int ec_read {
	device_t	dev;
	u_int		addr;
	ACPI_INTEGER	*val;
	int		width;
};

#
# Write embedded controller (EC) address space
#
# device_t dev:  EC device
# u_int addr:  Address to write to in EC space
# ACPI_INTEGER val:  Value to write
# int width:  Size of value to write in bytes
#
METHOD int ec_write {
	device_t	dev;
	u_int		addr;
	ACPI_INTEGER	val;
	int		width;
};

An example driver that uses these methods is in sys/dev/acpica/acpi_smbat.c

> Questions:
> 2) Could any one give me hints/help how to move forward since there are 
> registers and normaly there should be some method to call,  is the Method 
> (_REG, 2, NotSerialized) the one that schould be called by me, or maybe i 
> should use AMW0 methods ?

_REG is already handled by acpi-ca, don't touch it.  AMW0 seems more 
promising.

> 3)the FreeBSD module acpi_fujitsu will not work since it has different OMEID, 
> FujitsuSiemens AMilo has got "FUJ   ", "W37     "

You can try modifying acpi_fujitsu to have the IDs for your particular 
laptop, then see what features work or not.

-- 
Nate



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