From owner-freebsd-acpi@FreeBSD.ORG Fri Jun 10 07:30:38 2005 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BE80E16A41C; Fri, 10 Jun 2005 07:30:38 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 88FAD43D1F; Fri, 10 Jun 2005 07:30:37 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id j5A7UaQ5038611; Fri, 10 Jun 2005 10:30:36 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua ([82.193.96.10]) by localhost (rocky.ipnet [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 37647-11; Fri, 10 Jun 2005 10:30:35 +0300 (EEST) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id j5A7UZ0e038608 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Jun 2005 10:30:35 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.3/8.13.3) id j5A7V3hs078682; Fri, 10 Jun 2005 10:31:03 +0300 (EEST) (envelope-from ru) Date: Fri, 10 Jun 2005 10:31:03 +0300 From: Ruslan Ermilov To: Markus Brueffer Message-ID: <20050610073103.GC78035@ip.net.ua> References: <200505301857.20346.markus@FreeBSD.org> <200506100131.14008.markus@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kA1LkgxZ0NN7Mz3A" Content-Disposition: inline In-Reply-To: <200506100131.14008.markus@FreeBSD.org> User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at ip.net.ua Cc: freebsd-acpi@freebsd.org, freebsd-mobile@freebsd.org Subject: Re: Call for testers: New acpi_ibm driver 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: Fri, 10 Jun 2005 07:30:39 -0000 --kA1LkgxZ0NN7Mz3A Content-Type: multipart/mixed; boundary="11Y7aswkeuHtSBEs" Content-Disposition: inline --11Y7aswkeuHtSBEs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Markus, On Fri, Jun 10, 2005 at 01:31:03AM +0200, Markus Brueffer wrote: > thanks to everyone who has sent me the DSDT and/or tested the driver. > I have just committed the driver and manpage along with a port of tpb,a= =20 > utility that makes use of it: >=20 The attached patch fixes two bugs in the updated acpi_ibm(4) driver for my ThinkPad 600X, you have my ASL: - it doesn't have ThinkLight, so there's no real benefit from having /dev/led/thinklight; - it doesn't have "cmos_handle", so acpi_ibm_sysctl_set() was using uninitialized values of "val_ec" in ACPI_IBM_METHOD_VOLUME and ACPI_IBM_METHOD_MUTE handlers, which resulted in volume to be programmed incorrectly, and muting/unmuting would screw the volume. Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --11Y7aswkeuHtSBEs Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Content-Transfer-Encoding: quoted-printable Index: acpi_ibm.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/dev/acpi_support/acpi_ibm.c,v retrieving revision 1.5 diff -u -p -r1.5 acpi_ibm.c --- acpi_ibm.c 9 Jun 2005 20:17:32 -0000 1.5 +++ acpi_ibm.c 10 Jun 2005 06:57:48 -0000 @@ -376,7 +376,8 @@ acpi_ibm_attach(device_t dev) acpi_ibm_notify, dev); =20 /* Hook up light to led(4) */ - sc->led_dev =3D led_create(ibm_led, sc, "thinklight"); + if (sc->light_get_supported || sc->light_set_supported) + sc->led_dev =3D led_create(ibm_led, sc, "thinklight"); =20 return (0); } @@ -396,7 +397,8 @@ acpi_ibm_detach(device_t dev) =20 AcpiRemoveNotifyHandler(sc->handle, ACPI_DEVICE_NOTIFY, acpi_ibm_notify); =20 - led_destroy(sc->led_dev); + if (sc->led_dev !=3D NULL) + led_destroy(sc->led_dev); return (0); } =20 @@ -522,7 +524,7 @@ acpi_ibm_sysctl_get(struct acpi_ibm_soft =20 case ACPI_IBM_METHOD_VOLUME: ACPI_EC_READ(sc->ec_dev, IBM_EC_VOLUME, &val_ec, 1); - val =3D val_ec &IBM_EC_MASK_VOL; + val =3D val_ec & IBM_EC_MASK_VOL; break; =20 case ACPI_IBM_METHOD_MUTE: @@ -632,10 +634,10 @@ acpi_ibm_sysctl_set(struct acpi_ibm_soft if (arg < 0 || arg > 14) return (EINVAL); =20 + status =3D ACPI_EC_READ(sc->ec_dev, IBM_EC_VOLUME, &val_ec, 1); + if (ACPI_FAILURE(status)) + return (status); if (sc->cmos_handle) { - status =3D ACPI_EC_READ(sc->ec_dev, IBM_EC_VOLUME, &val_ec, 1); - if (ACPI_FAILURE(status)) - return (status); val =3D val_ec & IBM_EC_MASK_VOL; =20 Args.Count =3D 1; @@ -657,10 +659,10 @@ acpi_ibm_sysctl_set(struct acpi_ibm_soft if (arg < 0 || arg > 1) return (EINVAL); =20 + status =3D ACPI_EC_READ(sc->ec_dev, IBM_EC_VOLUME, &val_ec, 1); + if (ACPI_FAILURE(status)) + return (status); if (sc->cmos_handle) { - status =3D ACPI_EC_READ(sc->ec_dev, IBM_EC_VOLUME, &val_ec, 1); - if (ACPI_FAILURE(status)) - return (status); val =3D val_ec & IBM_EC_MASK_VOL; =20 Args.Count =3D 1; --11Y7aswkeuHtSBEs-- --kA1LkgxZ0NN7Mz3A Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFCqUG3qRfpzJluFF4RAtYwAJ0edBkHyXFsl9GMgIVh9MIB+tL24wCeObNY ouRXunr0yhB8NasOQafwMCY= =httP -----END PGP SIGNATURE----- --kA1LkgxZ0NN7Mz3A--