Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src A driver for HP 3D DriverGuard; a LIS3LV02DL-based accelerom...



details:   https://anonhg.NetBSD.org/src/rev/a8bc6a028a4b
branches:  trunk
changeset: 767243:a8bc6a028a4b
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Wed Jul 13 07:52:48 2011 +0000

description:
A driver for HP 3D DriverGuard; a LIS3LV02DL-based accelerometer. Tested on
HP NC4400. Like aps(4), this is commented out in the GENERIC kernels.

diffstat:

 distrib/sets/lists/man/mi           |    5 +-
 distrib/sets/lists/modules/md.amd64 |    4 +-
 distrib/sets/lists/modules/md.i386  |    4 +-
 doc/CHANGES                         |    4 +-
 share/man/man4/Makefile             |    4 +-
 share/man/man4/hpacel.4             |   85 +++++
 sys/arch/amd64/conf/GENERIC         |    5 +-
 sys/arch/i386/conf/ALL              |    5 +-
 sys/arch/i386/conf/GENERIC          |    5 +-
 sys/dev/acpi/files.acpi             |    7 +-
 sys/dev/acpi/hpacel_acpi.c          |  611 ++++++++++++++++++++++++++++++++++++
 sys/modules/Makefile                |    3 +-
 sys/modules/hpacel/Makefile         |   13 +
 sys/modules/hpacel/hpacel.ioconf    |   10 +
 14 files changed, 751 insertions(+), 14 deletions(-)

diffs (truncated from 953 to 300 lines):

diff -r c1c331f90045 -r a8bc6a028a4b distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Wed Jul 13 07:48:19 2011 +0000
+++ b/distrib/sets/lists/man/mi Wed Jul 13 07:52:48 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1323 2011/07/03 21:59:31 tron Exp $
+# $NetBSD: mi,v 1.1324 2011/07/13 07:52:49 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1080,6 +1080,7 @@
 ./usr/share/man/cat4/hpcsh/j6x0tp.0            man-sys-catman          .cat
 ./usr/share/man/cat4/hpcsh/psh3lcd.0           man-sys-catman          .cat
 ./usr/share/man/cat4/hpcsh/psh3tp.0            man-sys-catman          .cat
+./usr/share/man/cat4/hpacel.0                  man-sys-catman          .cat
 ./usr/share/man/cat4/hpqlb.0                   man-sys-catman          .cat
 ./usr/share/man/cat4/hptide.0                  man-sys-catman          .cat
 ./usr/share/man/cat4/i386/PCIBIOS.0            man-sys-catman          .cat
@@ -3865,6 +3866,7 @@
 ./usr/share/man/html4/hpcsh/j6x0tp.html                man-sys-htmlman         html
 ./usr/share/man/html4/hpcsh/psh3lcd.html       man-sys-htmlman         html
 ./usr/share/man/html4/hpcsh/psh3tp.html                man-sys-htmlman         html
+./usr/share/man/html4/hpacel.html              man-sys-htmlman         html
 ./usr/share/man/html4/hpqlb.html               man-sys-htmlman         html
 ./usr/share/man/html4/hptide.html              man-sys-htmlman         html
 ./usr/share/man/html4/i386/PCIBIOS.html                man-sys-htmlman         html
@@ -6445,6 +6447,7 @@
 ./usr/share/man/man4/hpcsh/j6x0tp.4            man-sys-man             .man
 ./usr/share/man/man4/hpcsh/psh3lcd.4           man-sys-man             .man
 ./usr/share/man/man4/hpcsh/psh3tp.4            man-sys-man             .man
+./usr/share/man/man4/hpacel.4                  man-sys-man             .man
 ./usr/share/man/man4/hpqlb.4                   man-sys-man             .man
 ./usr/share/man/man4/hptide.4                  man-sys-man             .man
 ./usr/share/man/man4/i386/PCIBIOS.4            man-sys-man             .man
diff -r c1c331f90045 -r a8bc6a028a4b distrib/sets/lists/modules/md.amd64
--- a/distrib/sets/lists/modules/md.amd64       Wed Jul 13 07:48:19 2011 +0000
+++ b/distrib/sets/lists/modules/md.amd64       Wed Jul 13 07:52:48 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.22 2011/06/15 08:19:43 jruoho Exp $
+# $NetBSD: md.amd64,v 1.23 2011/07/13 07:52:49 jruoho Exp $
 ./@MODULEDIR@/acpiacad                         base-kernel-modules     kmod
 ./@MODULEDIR@/acpiacad/acpiacad.kmod           base-kernel-modules     kmod
 ./@MODULEDIR@/acpibat                          base-kernel-modules     kmod
@@ -57,6 +57,8 @@
 ./@MODULEDIR@/fujbp/fujbp.kmod                 base-kernel-modules     kmod
 ./@MODULEDIR@/fujhk                            base-kernel-modules     kmod
 ./@MODULEDIR@/fujhk/fujhk.kmod                 base-kernel-modules     kmod
+./@MODULEDIR@/hpacel                           base-kernel-modules     kmod
+./@MODULEDIR@/hpacel/hpacel.kmod               base-kernel-modules     kmod
 ./@MODULEDIR@/hpet                             base-kernel-modules     kmod
 ./@MODULEDIR@/hpet/hpet.kmod                   base-kernel-modules     kmod
 ./@MODULEDIR@/hpqlb                            base-kernel-modules     kmod
diff -r c1c331f90045 -r a8bc6a028a4b distrib/sets/lists/modules/md.i386
--- a/distrib/sets/lists/modules/md.i386        Wed Jul 13 07:48:19 2011 +0000
+++ b/distrib/sets/lists/modules/md.i386        Wed Jul 13 07:52:48 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.26 2011/06/15 08:19:43 jruoho Exp $
+# $NetBSD: md.i386,v 1.27 2011/07/13 07:52:49 jruoho Exp $
 ./@MODULEDIR@/acpiacad                         base-kernel-modules     kmod
 ./@MODULEDIR@/acpiacad/acpiacad.kmod           base-kernel-modules     kmod
 ./@MODULEDIR@/acpibat                          base-kernel-modules     kmod
@@ -59,6 +59,8 @@
 ./@MODULEDIR@/fujbp/fujbp.kmod                 base-kernel-modules     kmod
 ./@MODULEDIR@/fujhk                            base-kernel-modules     kmod
 ./@MODULEDIR@/fujhk/fujhk.kmod                 base-kernel-modules     kmod
+./@MODULEDIR@/hpacel                           base-kernel-modules     kmod
+./@MODULEDIR@/hpacel/hpacel.kmod               base-kernel-modules     kmod
 ./@MODULEDIR@/hpet                             base-kernel-modules     kmod
 ./@MODULEDIR@/hpet/hpet.kmod                   base-kernel-modules     kmod
 ./@MODULEDIR@/hpqlb                            base-kernel-modules     kmod
diff -r c1c331f90045 -r a8bc6a028a4b doc/CHANGES
--- a/doc/CHANGES       Wed Jul 13 07:48:19 2011 +0000
+++ b/doc/CHANGES       Wed Jul 13 07:52:48 2011 +0000
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:                   <$Revision: 1.1576 $>
+# LIST OF CHANGES FROM LAST RELEASE:                   <$Revision: 1.1577 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -1061,3 +1061,5 @@
                for AR71xx (24K) and AR9344 (74K) SoCs.
        dtv(4): Add digital TV framework. [jmcneill 20110709]
        auvitek(4): Add digital capture support. [jmcneill 20110709]
+       hpacel(4): Add a driver for HP 3D DriverGuard; a LIS3LV02DL-based
+               accelerometer. [jruoho 20110713]
diff -r c1c331f90045 -r a8bc6a028a4b share/man/man4/Makefile
--- a/share/man/man4/Makefile   Wed Jul 13 07:48:19 2011 +0000
+++ b/share/man/man4/Makefile   Wed Jul 13 07:52:48 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.560 2011/06/22 20:29:38 jruoho Exp $
+#      $NetBSD: Makefile,v 1.561 2011/07/13 07:52:49 jruoho Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/18/93
 
 MAN=   aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -27,7 +27,7 @@
        fast_ipsec.4 fd.4 finsio.4 flash.4 fpa.4 fms.4 fss.4 fujbp.4 fxp.4 \
        gcscaudio.4 gem.4 genfb.4 gentbi.4 geodeide.4 \
        glxtphy.4 gpib.4 gpio.4 gpiolock.4 gpiosim.4 gre.4 gphyter.4 gsip.4 \
-       hdaudio.4 hifn.4 hme.4 hpqlb.4 hptide.4 \
+       hdaudio.4 hifn.4 hme.4 hpacel.4 hpqlb.4 hptide.4 \
        ibmhawk.4 ichsmb.4 icmp.4 icp.4 icsphy.4 iee.4 ieee80211.4 \
        ifmedia.4 igphy.4 igsfb.4 iha.4 ihphy.4 iic.4 inet.4 ikphy.4 inphy.4 \
        intersil7170.4 \
diff -r c1c331f90045 -r a8bc6a028a4b share/man/man4/hpacel.4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/man/man4/hpacel.4   Wed Jul 13 07:52:48 2011 +0000
@@ -0,0 +1,85 @@
+.\" $NetBSD
+.\"
+.\" Copyright (c) 2011 Jukka Ruohonen <jruohonen%iki.fi@localhost>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Neither the name of the author nor the names of any
+.\"    contributors may be used to endorse or promote products derived
+.\"    from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd June 23, 2011
+.Dt HPACEL 4
+.Os
+.Sh NAME
+.Nm hpacel
+.Nd HP 3D DriveGuard accelerometer
+.Sh SYNOPSIS
+.Cd "hpacel* at acpi?"
+.Sh DESCRIPTION
+The
+.Nm
+device driver supports accelerometers that are
+commonly available in Hewlett-Packard laptops.
+The supported chip is
+.Dv LIS3LV02DL
+from STMicroelectronics, although other chips from the same family, such as
+.Dv LIS3LV02DQ ,
+may also work, provided that that the vendor has implemented suitable
+.Dv ACPI
+access methods.
+.Pp
+The
+.Nm
+driver reports the acceleration readings of the X-, Y-, and Z-axis
+via the
+.Xr envsys 4
+.Tn API
+and the
+.Xr envstat 8
+command.
+.Sh SEE ALSO
+.Xr acpi 4 ,
+.Xr aps 4 ,
+.Xr hpqlb 4 ,
+.Xr wmihp 4
+.Rs
+.%A STMicroelectronics
+.%T "TLIS3LV02DL: 3-Axis - \*(Pm\* 2g/\*(Pm\* 6g digital output \
+low voltage linear accelerometer. AN2381 Application Note"
+.%N Revision 1
+.%D June, 2006
+.%U http://www.st.com/stonline/products/literature/anp/12441.pdf
+.Re
+.Sh HISTORY
+The
+.Nm
+device driver appeared in
+.Nx 6.0 .
+.Sh AUTHORS
+.An Jukka Ruohonen
+.Aq jruohonen%iki.fi@localhost
+.Sh BUGS
+The used accelerometer chip is capable of generating wake-up,
+direction detection, and free-fall interrupts.
+In the ideal situation these could be used to evoke possible emergency action.
+However, the
+.Nm
+driver only reports the readings from the accelerometer via
+.Xr sysmon_envsys 9 .
diff -r c1c331f90045 -r a8bc6a028a4b sys/arch/amd64/conf/GENERIC
--- a/sys/arch/amd64/conf/GENERIC       Wed Jul 13 07:48:19 2011 +0000
+++ b/sys/arch/amd64/conf/GENERIC       Wed Jul 13 07:52:48 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.322 2011/07/03 10:40:16 bouyer Exp $
+# $NetBSD: GENERIC,v 1.323 2011/07/13 07:52:49 jruoho Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.322 $"
+#ident                 "GENERIC-$Revision: 1.323 $"
 
 maxusers       64              # estimated number of users
 
@@ -301,6 +301,7 @@
 #fdc*          at acpi?                # Floppy disk controller
 fujbp*         at acpi?                # Fujitsu Brightness & Pointer
 fujhk*         at acpi?                # Fujitsu Hotkeys
+#hpacel*       at acpi?                # HP 3D DriveGuard accelerometer
 #hpqlb*                at acpi?                # HP Quick Launch Buttons
 hpet*          at acpihpetbus?         # High Precision Event Timer (table)
 hpet*          at acpinodebus?         # High Precision Event Timer (device)
diff -r c1c331f90045 -r a8bc6a028a4b sys/arch/i386/conf/ALL
--- a/sys/arch/i386/conf/ALL    Wed Jul 13 07:48:19 2011 +0000
+++ b/sys/arch/i386/conf/ALL    Wed Jul 13 07:52:48 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.310 2011/07/11 18:31:10 jmcneill Exp $
+# $NetBSD: ALL,v 1.311 2011/07/13 07:52:48 jruoho Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "ALL-$Revision: 1.310 $"
+#ident                 "ALL-$Revision: 1.311 $"
 
 maxusers       64              # estimated number of users
 
@@ -376,6 +376,7 @@
 fdc*           at acpi?                # Floppy disk controller
 fujbp*         at acpi?                # Fujitsu Brightness & Pointer
 fujhk*         at acpi?                # Fujitsu Hotkeys
+hpacel*                at acpi?                # HP 3D DriveGuard accelerometer
 hpqlb*         at acpi?                # HP Quick Launch Buttons
 hpet*          at acpihpetbus?         # High Precision Event Timer (table)
 hpet*          at acpinodebus?         # High Precision Event Timer (device)
diff -r c1c331f90045 -r a8bc6a028a4b sys/arch/i386/conf/GENERIC
--- a/sys/arch/i386/conf/GENERIC        Wed Jul 13 07:48:19 2011 +0000
+++ b/sys/arch/i386/conf/GENERIC        Wed Jul 13 07:52:48 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1037 2011/07/11 18:31:10 jmcneill Exp $
+# $NetBSD: GENERIC,v 1.1038 2011/07/13 07:52:48 jruoho Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.1037 $"
+#ident                 "GENERIC-$Revision: 1.1038 $"
 
 maxusers       64              # estimated number of users
 
@@ -366,6 +366,7 @@
 #fdc*          at acpi?                # Floppy disk controller
 fujbp*         at acpi?                # Fujitsu Brightness & Pointer
 fujhk*         at acpi?                # Fujitsu Hotkeys
+#hpacel*       at acpi?                # HP 3D DriveGuard accelerometer
 #hpqlb*                at acpi?                # HP Quick Launch Buttons
 hpet*          at acpihpetbus?         # High Precision Event Timer (table)
 hpet*          at acpinodebus?         # High Precision Event Timer (device)
diff -r c1c331f90045 -r a8bc6a028a4b sys/dev/acpi/files.acpi
--- a/sys/dev/acpi/files.acpi   Wed Jul 13 07:48:19 2011 +0000
+++ b/sys/dev/acpi/files.acpi   Wed Jul 13 07:52:48 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.acpi,v 1.90 2011/06/14 13:59:23 jruoho Exp $
+#      $NetBSD: files.acpi,v 1.91 2011/07/13 07:52:48 jruoho Exp $
 
 include "dev/acpi/acpica/files.acpica"
 
@@ -144,6 +144,11 @@
 attach ug at acpinodebus with ug_acpi
 file   dev/acpi/ug_acpi.c              ug_acpi
 
+# HP 3D DriveGuard accelerometer
+device hpacel: sysmon_envsys
+attach hpacel at acpinodebus
+file   dev/acpi/hpacel_acpi.c          hpacel
+
 # HP Quick Launch Buttons
 device hpqlb: sysmon_power
 attach hpqlb at acpinodebus
diff -r c1c331f90045 -r a8bc6a028a4b sys/dev/acpi/hpacel_acpi.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/acpi/hpacel_acpi.c        Wed Jul 13 07:52:48 2011 +0000
@@ -0,0 +1,611 @@
+/*     $NetBSD: hpacel_acpi.c,v 1.1 2011/07/13 07:52:48 jruoho Exp $ */
+
+/*-
+ * Copyright (c) 2009, 2011 Jukka Ruohonen <jruohonen%iki.fi@localhost>
+ * All rights reserved.
+ *



Home | Main Index | Thread Index | Old Index