Panasonic Hotkey Driver

The Panasonic Hotkey Driver implements hotkey functionality for Panasonic R1(N variant), R2, R3, T2, W2, and Y2 laptops on linux for machines running a 2.6 kernel.

Status

The hotkey driver currently implements:

The hotkey driver currently does not implement:

Suspending to RAM is intentionally disabled because it does not work well on Linux. If you want it to work, you can add code to hotkey.pl to implement it.

Requirements

In order to get the driver working, you will need:

For anything more than the bare minimum of raising and lowering screen brightness, you'll want to have:

files

Hotkey Handler and AC Power Handler are in the etc sub-directories.

Kernel patch

Instructions

You will need to download an appropriate patch for your kernel. You'll also need a script to handle the hotkey events; one which works is available below.

Patching the kernel

Download an appropriate patch for your kernel. cd into your kernel source directory. Run the following command:

patch -p1 < location_of_patch

Now make menuconfig or use your favourite method of kernel configuration.

Kernel configuration

  1. Go under "Code maturity level options" and enable "Prompt for development and/or incomplete code/drivers". Then exit this menu.
  2. Go under "Power Management Options (ACPI, APM)" and enable "Power Management support".
  3. If you want suspend-to-disk (hibernate) to work, enable "Software Suspend"
  4. Enter the "ACPI (Advanced Configuration and Power Interface) Support" menu.
  5. Enable "ACPI support"
  6. Select "AC Adapter" as a built-in
  7. Select all other ACPI options you want
  8. Select "Panasonic Laptop Extras" as a built-in

Exit menuconfig (or your favourite configuration utility) and build and install the kernel.

Setting up acpid

To configure acpid for using the new Hotkey driver, you will need to download the "Hotkey Handler" package (listed under downloads). Untar this file in /etc/acpi (or your distribution's acpid configuration location).

If you want acpid to reduce the screen brightness when on battery power, you should also download the "AC Power Handler" package (listed under downloads) Untar this file in /etc/acpi (or your distribution's acpid configuration location).

Final steps

Now you are ready to restart the system. Reboot. Try the hotkeys. Do they work? If so, great! If not, please see the Troubleshooting section.

Troubleshooting

So, it isn't working for you. To try and save you (and us!) a lot of time, I've assembled a checklist of things to check before reporting a bug. Please go through the following steps before sending us an email:

If this does not solve your problem and you are sure that it should work, please email (dbronaugh (at) linuxboxen (dot) org) or (miura (at) da-cha (dot) org). Make sure you include:

Technical Details

The hotkey part of the kernel driver emits ACPI events (like the AC adapter does, etc). These are caught by acpid and dispatched via /etc/acpi/events/hotkey to /etc/acpi/hotkey.pl . hotkey.pl in turn performs the appropriate action, be it setting volume, muting the sound card, changing the brightness, spinning down the hard drive, or suspending to disk.

Screen brightness controls on the Panasonic laptops look complicated, but in the end they make sense. The driver implements these using 6 files: ac_brightness, ac_brightness_max, ac_brightness_min, dc_brightness, dc_brightness_max, dc_brightness_min. All the files prefixed with ac_ are for controlling the brightness when the laptop is under AC power. They affect persistent (across reboot) status registers which store the screen brightness, as well as controlling the actual brightness. The files prefixed with dc_ do the same for when the laptop is under battery power.

When the AC Power Handler script is being used, when AC power is connected the ac_brightness value is loaded. The dc_brightness field is not affected by this. Likewise, when AC power is disconnected, the dc_brightness value is loaded; the ac_brightness register is not affected by this. So, there are effectively 2 sets of brightness -- one set for when the laptop is under DC power, and one set for when the laptop is under AC power.

The *_brightness_min files show the minimum brightness for their respective power levels. Likewise, the *_brightness_max files show the maximum brightness for their respective power levels.


Site created by
David Bronaugh
Last modified by
Hiroshi Miura
Last modified: Thu Sep 16 10:58:00 JST 2004