From owner-freebsd-acpi@FreeBSD.ORG Tue Jan 29 19:13:03 2008 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8506716A469 for ; Tue, 29 Jan 2008 19:13:03 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id 695BB13C4DD for ; Tue, 29 Jan 2008 19:13:03 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 39281 invoked from network); 29 Jan 2008 19:13:04 -0000 Received: from adsl-71-141-123-117.dsl.snfc21.pacbell.net (HELO ?192.168.1.77?) (nate-mail@71.141.123.117) by root.org with ESMTPA; 29 Jan 2008 19:13:04 -0000 Message-ID: <479F7AB9.4080406@root.org> Date: Tue, 29 Jan 2008 11:12:57 -0800 From: Nate Lawson User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: =?ISO-8859-2?Q?Artur_Ba=E6?= References: <200801261837.26708.artur@ebasoft.com.pl> In-Reply-To: <200801261837.26708.artur@ebasoft.com.pl> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit Cc: freebsd-acpi@freebsd.org Subject: Re: Need info about ACPI - implementing acer_acpi, amilo 1650g X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jan 2008 19:13:03 -0000 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