Skip to contentSkip to conversation

Panasonic Hotkey Driver

PATCH David Bronaugh 1 participant 1 message Aug 19, 2004 ACPI

lore
Share & tools
lore
#0 lore raw

Hi,

The following patch adds brightness setting support to the driver and cleans up the code a bit. It builds on the work of Hiroshi Miura and takes into account the comments of Len Brown and John Belmonte. The patch is against 2.6.8.1-mm1 (though the only thing that might differ between -mm1 and vanilla is the Makefile).

I've tested this on my Panasonic CF-R1, and it works beautifully.

As far as I am concerned, besides code cleanups (and possibly figuring out the monitor switch thing) this driver is complete.

I hope I haven't stepped on any toes here.

David Bronaugh
ps: I'm not on linux-kernel; I am on acpi-devel; forgot to CC this list when sending to acpi-devel
---------

Supporting bits:

# /etc/acpi/events/hotkey
# This script handles hotkey events on Panasonic notebooks

event=HKEY.*
action=/etc/acpi/hotkey.sh %e

----------------------

#!/bin/bash
# Handles hotkey events for Panasonic notebooks
KEY=$4

BRIGHTNESS_CONTROL=/proc/acpi/pcc/brightness
VOLADJUST=5
GETVOLCMD="amixer cget numid=2"
GETMUTECMD="amixer cget numid=1"
SETVOLCMD="amixer cset numid=2"
SETMUTECMD="amixer cset numid=1"

case "$KEY" in
00000001)
logger "acpid: received a down brightness event" BRIGHT=cat /proc/acpi/pcc/brightness
let BRIGHT=BRIGHT-1
echo $BRIGHT > $BRIGHTNESS_CONTROL
;;
00000002)
logger "acpid: received an up brightness event" BRIGHT=cat /proc/acpi/pcc/brightness
let BRIGHT=BRIGHT+1
echo $BRIGHT > $BRIGHTNESS_CONTROL
;;
00000003)
logger "acpid: received a monitor switch event (unhandled)" ;;
00000004)
logger "acpid: received a sound mute event"
;;
00000005)
logger "acpid: received a volume down event"
;;
00000006)
logger "acpid: received a volume up event"
;;
00000007)
logger "acpid: received a suspend-to-RAM event (unhandled)" ;;
00000009)
logger "acpid: received a disk spindown event"
;;
0000000a)
logger "acpid: received a suspend-to-disk event" ;;
*)
logger "acpid: received unhandled event $KEY"
;;
esac

drivers/acpi/Kconfig +19 -0
diff -Nru lb-2.6.8.1/drivers/acpi/Kconfig linux-2.6.8.1/drivers/acpi/Kconfig
@@ -204,6 +204,25 @@
 	  If you have a legacy free Toshiba laptop (such as the Libretto L1
 	  series), say Y.
 
+config ACPI_PCC
+	tristate "Panasonic Laptop Extras"
+	depends on X86
+	default m
+	---help---
+	  This driver adds support for hotkeys and screen brightness setting
+	  on Panasonic Let's Note laptops. 
+
+          For CRT/LCD switching, see the userspace utility i810switch.
+
+	  More information about this driver is available at
+	  <http://www.da-cha.org/letsnote/>
+
+	  Note: In order to effectively use this driver, you must set up your 
+	  acpid to handle 'hotkey' events. See the website for more details.
+
+	  If you have a panasonic lets note laptop (such as the CF-T2, Y2,
+	  R1, R2, W2, R3), say Y.
+
 config ACPI_DEBUG
 	bool "Debug Statements"
 	depends on ACPI_INTERPRETER
drivers/acpi/Makefile +1 -0
diff -Nru lb-2.6.8.1/drivers/acpi/Makefile linux-2.6.8.1/drivers/acpi/Makefile
@@ -47,4 +47,5 @@
 obj-$(CONFIG_ACPI_NUMA)		+= numa.o
 obj-$(CONFIG_ACPI_ASUS)		+= asus_acpi.o
 obj-$(CONFIG_ACPI_TOSHIBA)	+= toshiba_acpi.o
+obj-$(CONFIG_ACPI_PCC)          += pcc_acpi.o
 obj-$(CONFIG_ACPI_BUS)		+= scan.o motherboard.o
drivers/acpi/pcc_acpi.c +566 -0

566 lines not on this page · raw message