Support for panasonic hotkeys missing

Bug #222324 reported by regelatwork
46
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Unassigned
Declined for Intrepid by Andy Whitcroft

Bug Description

pcc_acpi module missing in Hardy Heron.

$ lsb_release -rd
Description: Ubuntu 8.04
Release: 8.04

$ lsmod
Module Size Used by
ieee80211_crypt_wep 6272 1
8139too 27520 0
ipw2200 146120 0
ieee80211 35528 1 ipw2200
michael_mic 3456 0
arc4 2944 2
ecb 4480 2
blkcipher 8324 1 ecb
ieee80211_crypt_tkip 11648 0
ieee80211_crypt_ccmp 7936 0
af_packet 23812 4
binfmt_misc 12808 1
rfcomm 41744 2
l2cap 25728 13 rfcomm
bluetooth 61156 4 rfcomm,l2cap
i915 32512 2
drm 82580 3 i915
ppdev 10372 0
bay 6912 0
dock 11280 1 bay
container 5632 0
sbs 15112 0
sbshc 7680 1 sbs
iptable_filter 3840 0
ip_tables 14820 1 iptable_filter
x_tables 16132 1 ip_tables
aes_i586 33536 0
dm_crypt 15364 0
dm_mod 62660 1 dm_crypt
parport_pc 36260 0
lp 12324 0
parport 37832 3 ppdev,parport_pc,lp
ipv6 267780 16
joydev 13120 0
pcmcia 40876 0
evdev 13056 6
snd_intel8x0 35356 3
snd_ac97_codec 101028 1 snd_intel8x0
ac97_bus 3072 1 snd_ac97_codec
snd_pcm_oss 42144 0
snd_mixer_oss 17920 1 snd_pcm_oss
video 19856 0
snd_pcm 78596 3 snd_intel8x0,snd_ac97_codec,snd_pcm_oss
output 4736 1 video
serio_raw 7940 0
psmouse 40336 0
yenta_socket 27276 1
rsrc_nonstatic 13696 1 yenta_socket
pcmcia_core 40596 3 pcmcia,yenta_socket,rsrc_nonstatic
ieee80211_crypt 7040 4 ieee80211_crypt_wep,ieee80211,ieee80211_crypt_tkip,ieee80211_crypt_ccmp
snd_seq_dummy 4868 0
battery 14212 0
ac 6916 0
button 9232 0
snd_seq_oss 35584 0
snd_seq_midi 9376 0
snd_rawmidi 25760 1 snd_seq_midi
pcspkr 4224 0
snd_seq_midi_event 8320 2 snd_seq_oss,snd_seq_midi
snd_seq 54224 6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
snd_timer 24836 2 snd_pcm,snd_seq
snd_seq_device 9612 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq
snd 56996 17 snd_intel8x0,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_dummy,snd_seq_oss,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
iTCO_wdt 13092 0
iTCO_vendor_support 4868 1 iTCO_wdt
soundcore 8800 1 snd
snd_page_alloc 11400 2 snd_intel8x0,snd_pcm
shpchp 34452 0
pci_hotplug 30880 1 shpchp
intel_agp 25492 1
agpgart 34760 3 drm,intel_agp
ext3 136712 1
jbd 48404 1 ext3
mbcache 9600 1 ext3
sg 36880 0
sr_mod 17956 0
cdrom 37408 1 sr_mod
sd_mod 30720 3
ata_piix 19588 2
pata_acpi 8320 0
8139cp 24704 0
ata_generic 8324 0
mii 6400 2 8139too,8139cp
libata 159344 3 ata_piix,pata_acpi,ata_generic
ehci_hcd 37900 0
uhci_hcd 27024 0
scsi_mod 151436 4 sg,sr_mod,sd_mod,libata
usbcore 146028 3 ehci_hcd,uhci_hcd
thermal 16796 0
processor 36872 2 thermal
fan 5636 0
fbcon 42912 0
tileblit 3456 1 fbcon
font 9472 1 fbcon
bitblit 6784 1 fbcon
softcursor 3072 1 bitblit
fuse 50580 5

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Confirming. pcc_acpi.ko is not shipped with linux-ubuntu-modules as it was in Gutsy.

Does anyone know why it's not in Hardy anymore ?

Changed in linux-ubuntu-modules-2.6.24:
status: New → Confirmed
Revision history for this message
agostinomaurotto (agostino-maurotto) wrote :

confirmed..
pity, instead of offering better support its dropping compatibilities...

Revision history for this message
Aaron Hill (aaron-hill) wrote :

Confirming--hotkeys on a Panasonic CF-50 are inoperative, screen brightness cannot be changed, and "cat /proc/acpi/video/VGA0/LCD/brightness" yields "<not supported>". Of course, all of this worked on the same laptop in Gutsy prior to upgrading to Hardy.

Revision history for this message
captive (salvo-schifani) wrote :

Same here on CF-W2, very annoying..

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

It seems that support for pcc_acpi has been dropped since kernel 2.6.23 due to acpi changes.

A patch version of pcc_acpi needs to be built from latest sources and shipped with linux-ubuntu-modules. If someone wants to help then he's welcomed.

Revision history for this message
captive (salvo-schifani) wrote :

googling around I found this page:
http://rclermont.blogspot.com/2007/10/panasonic-fn-keys-in-ubuntu.html

In the comments someone says that is possible to patch the module to make it work with 2.6.24 kernels.

I've been able to build a working pcc_acpi.ko from the source for my CF-74 and gutsy w/2.6.24 kernel (this should work for hardy 8.04) found here:

http://www.da-cha.jp/files/pcc-acpi-0.9.tar.bz2

and applying the following patch. The patch is the sum of two patches from the source rpm used in opensuse 10.3 basically the make things compatible with the 2.6.23 kernel. (it also works with .24 kernels)

*** pcc_acpi.c 2006-11-21 00:38:41.000000000 -0700
--- pcc_acpi.c.new 2008-05-10 12:58:14.000000000 -0600
***************
*** 168,174 ****
#define METHOD_HKEY_SQTY "SQTY"
#define METHOD_HKEY_SINF "SINF"
#define METHOD_HKEY_SSET "SSET"
- #define HKEY_HID "MAT0012,MAT0013,MAT0018,MAT0019"
#define HKEY_NOTIFY 0x80

/* for brightness control */
--- 168,173 ----
***************
*** 212,224 ****

static int acpi_pcc_hotkey_add(struct acpi_device *device);
static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type);
! static int acpi_pcc_hotkey_resume(struct acpi_device *device, int state);

static struct acpi_driver acpi_pcc_driver = {
.name = ACPI_PCC_DRIVER_NAME,
.class = ACPI_PCC_CLASS,
! .ids = HKEY_HID,
.ops = {
.add = acpi_pcc_hotkey_add,
.remove = acpi_pcc_hotkey_remove,
--- 211,231 ----

static int acpi_pcc_hotkey_add(struct acpi_device *device);
static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type);
! static int acpi_pcc_hotkey_resume(struct acpi_device *device);

+ static const struct acpi_device_id pcc_device_ids[] = {
+ {"MAT0012", 0},
+ {"MAT0013", 0},
+ {"MAT0018", 0},
+ {"MAT0019", 0},
+ {"", 0},
+ };
+ MODULE_DEVICE_TABLE(acpi, pcc_device_ids);

static struct acpi_driver acpi_pcc_driver = {
.name = ACPI_PCC_DRIVER_NAME,
.class = ACPI_PCC_CLASS,
! .ids = pcc_device_ids,
.ops = {
.add = acpi_pcc_hotkey_add,
.remove = acpi_pcc_hotkey_remove,
***************
*** 622,628 ****
case HKEY_NOTIFY:
if (acpi_pcc_hotkey_get_key(hotkey)) {
/* generate event like '"pcc HKEY 00000080 00000084"' when Fn+F4 pressed */
! acpi_bus_generate_event(hotkey->device, event, hotkey->status);
}
acpi_pcc_generete_keyinput(hotkey);
break;
--- 629,635 ----
case HKEY_NOTIFY:
if (acpi_pcc_hotkey_get_key(hotkey)) {
/* generate event like '"pcc HKEY 00000080 00000084"' when Fn+F4 pressed */
! acpi_bus_generate_proc_event(hotkey->device, event, hotkey->status);
}
acpi_pcc_generete_keyinput(hotkey);
break;
***************
*** 834,840 ****
module init
-------------------------------------------------------------------------- */

! static int acpi_pcc_hotkey_resume(struct acpi_device *device, int state)
{
struct acpi_hotkey *hotkey = acpi_driver_data(device);
acpi_status status = AE_OK;
--- 841,847 ----
module init
-------------------------------------------------------------------------- */

! static int acpi_pcc_hotkey_resume(struct acpi_device *device)
{
struct acpi_hotkey *hotkey = acpi_driver_data(device);
acpi_status status = AE_OK;

Revision history for this message
Eric Drechsel (ericdrex) wrote :

captive: I think we should use the original patches from the suse src.rpm. I found 3 patches in the opensuse 11.1 src.rpm. I can confirm that they applied without error and allow the module to build and load, and that all module functionality seems to be working properly (brightness, volume, suspend). They do not allow building with kernel 2.6.26 in Intrepid, but are a step in the right direction. What options do we have for getting this in a .deb for Hardy? Certainly not main, backports doesn't seem appropriate. Maybe the original author just needs to get these patches upstream. I sent him a message a few days ago, but haven't gotten a reply yet.

Revision history for this message
Eric Drechsel (ericdrex) wrote :

I guess opensuse has had a patch since July to support 2.6.26 and 27:
http://download.opensuse.org/repositories/home:/seife:/Factory/openSUSE_11.0/repodata/repoview/pcc-acpi-0-0.9-5.1.html
I'm testing the patches with 0.9 tarball and kernel 2.6.27 in Intrepid currently, will report results. Possible to get this into Intrepid for us toughbook users?

Revision history for this message
James Whitlock (wiggleraway) wrote :

There is currently a updated panasonic driver that is about to be accepted for inclusion in the kernel tree which is based upon the lately ill maintained pcc-acpi. This driver uses the same core code but exposes backlight and input interfaces allowing it to interface better with hal and gnome-power-manager.

http://marc.info/?l=linux-acpi&m=122224264520623&w=2

I'm currently using this driver on Hardy but perhaps some could try it on intrepid and see whether it's a better candidate for inclusion. Since it now utilises backlight and input interfaces the panasonic specific event descriptors and scripts should be removed from acpi-support to prevent acpi events being processed twice.

Revision history for this message
Eric Drechsel (ericdrex) wrote :

Great news, James, thanks!

Did you apply the patch to Hardy's kernel source to build? I'm not used to working with kernel tree patches since I stopped building my own kernels many years ago. Should I just install linux-source, patch, build the module, copy into place, depmod -a ?

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Moving this bug forward to target the actively developed linux kernel package. Beginning with the Intrepid development cycle the linux-ubuntu-modules was merged with the linux kernel package. I don't see the panasonic driver to be in the Intrepid kernel source so it's likely this will be resolved for Jaunty. Thanks.

Changed in linux-ubuntu-modules-2.6.24:
assignee: nobody → ubuntu-kernel-team
status: Confirmed → Triaged
Changed in linux:
importance: Undecided → Medium
Revision history for this message
Andy Whitcroft (apw) wrote :

Can confirm that this driver was be included in v2.6.28-rc3, so it should be in the Jaunty kernels.

Revision history for this message
Andy Whitcroft (apw) wrote :

We are expecting this to be fixed by the new panasonic module which should come with the upstream kernel update in Jaunty.

Changed in linux:
assignee: ubuntu-kernel-team → apw
status: Triaged → In Progress
Revision history for this message
Vincent Arnoux (vincent-arnoux) wrote :

Is there a way to have this new panasonic module available in Intrepid?

Thanks.

Revision history for this message
Andy Whitcroft (apw) wrote :

I have had a look at the module and it appears to be pretty small and self contained and therefore it may be possible to be possible to back port it to Intrepid. If it is possible then we would need to get some test kernels built and those tested by those of you with the hardware to confirm that (1) it fixes the problem, and (2) there are no obvious regressions.

I have pulled the driver as it appears in mainline and applied it to the intrepid kernel. It seems to apply and build cleanly. I have built some test kernels with this modules enabled (based on the current -proposed kernel) and pushed them up to the URL below. If those of you with Panasonic laptops could test these kernels and report back, we can then consider whether this can be applied as an SRU to Intrepid.

Note that these are binary only kernels and will not work if you are using out of tree graphics drivers via DKMS.

Revision history for this message
Andy Whitcroft (apw) wrote :

Those test kernels can be found here:

    http://people.ubuntu.com/~apw/lp222324/

Revision history for this message
Nil (nicolas-limare) wrote :

Thanks for the efforts, Andy. A backport from Intrepid would be very nice, indeed.

I tried the proposed kernel images on my Panasonic Y5. It seems to fail, X can't start. I didn't try the hotkeys from console mode.

Previously, everything was working with gutsy kernel + pcc-acpi-0.9 + SUSE patches + make/install/modprobe.

Currrently, with the default Intrepid kernel, sound and brightness hotkeys don't work, but brightness is automatically adjusted (moved down/up) whether I am on battery or plugged.

For further tests, could you provide the bare module sources for simple make/install/modprobe tests?

Revision history for this message
Nil (nicolas-limare) wrote :

Mistake

- A backport from Intrepid would be very nice, indeed.
+ A backport from Jaunty would be very nice, indeed.

Revision history for this message
Andy Whitcroft (apw) wrote :

@Nil -- if you have an out of tree graphics driver that would happen. I have uploaded the header files too now which should allow dkms to install your graphics in that case against this kernel. The ones at the URL above are Intrepid ports BTW.

Revision history for this message
Dan Egnor (egnor) wrote :

FYI, Andy's test kernels work for me (Panasonic Toughbook CF-19), but I have this other problem where at times the screen just starts getting dimmer and dimmer, and the bright/dim keys (or direct writes to /sys/class/backlight/panasonic/... files), but then suddenly after a minute or so it will suddenly start working again and recognize that the backlight is dim or off and allow me to turn it back up.

I didn't see this under hardy at all (where I used pcc_acpi), it showed up when I moved to intrepid, even before moving to these test kernels (when I couldn't adjust brightness at all -- it would just get dimmer and brighter on its own, very frustrating). At least now I can fix it some of the time.

There are also issues where the UI (GNOME) doesn't seem to recognize the full range of the backlight, which goes from 0 to 21; using the bright/dim keys, I can only get it up to 9 or so. Writing directly to the files I can up it to the full 21 (in its full outdoor-readable battery-draining glory).

Revision history for this message
Andy Whitcroft (apw) wrote :

In order to support the case for merging these patches into the intrepid kernel I have rebased these changes to the latest Intrepid kernel and build new kernel test images. If you could test those and report back here that would be helpful supporting data for the request. The new kernels can be found at the URL below:

    http://people.ubuntu.com/~apw/lp222324/

NOTE: that these are updated kernels in the same location.

Revision history for this message
Andy Whitcroft (apw) wrote :

@Nil, @Dan -- any chance you could test these newer kernels for me.

Andy Whitcroft (apw)
Changed in linux:
status: In Progress → Incomplete
Revision history for this message
Nil (nicolas-limare) wrote :

@Andy

I just rebooted with your kernel (2.6.27-11lb222324apw2). The kernel just works, no problem. But I see no support for the hotkeys. No pcc-acpi module, no response to any hotkey pressed, and
    $ cat /proc/acpi/video/GFX0/LCD1/brightness
    <not supported>

Am I missing something?

Revision history for this message
Peter Silva (peter-bsqt) wrote :

the old independently maintained pcc-acpi kernel module I had been using with 8.10 no longer builds (lvalue) So I found a module which appears to be a close
cousin included in Jaunty's 2.6.28. however when I do

modprobe panasonic-laptop

it just hangs (modprobe never completes, cannot add any more kernel modules...)

This is a three year old Panasonic CF-51. worked fine with pcc-acpi on 8.10

Revision history for this message
Peter Silva (peter-bsqt) wrote :

modprobe no longer hangs in 2.6.28-8-generic, and the volume keys now work with the module loaded. Brightness adjustment doesn't though...

Revision history for this message
Andy Whitcroft (apw) wrote :

As the module now does load and some keys are working I will mark this bug as Fix Released. As there are some keys which do not still work could we get those tested on the latest Jaunty live CD and if they are not working there can we get a new bug filed for those. Thanks for your help with this bug.

Changed in linux (Ubuntu):
status: Incomplete → Fix Released
Revision history for this message
Peter Silva (peter-bsqt) wrote :

I am uptodate on Jaunty as of today...
Linux tough 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux

and the brightness keys still do not work.

Revision history for this message
Eric Drechsel (ericdrex) wrote :

Confirming that panasonic_laptop module in Jaunty fails to support brightness keys, since it does not create the /proc/acpi/pcc/* interfaces which the panasonic brightness scripts in acpi-support expect.

I've been using the pcc_acpi module with the suse patches (http://software.opensuse.org/search?baseproject=openSUSE%3AFactory&p=1&q=pcc-acpi) module up until 2.6.28, when a compile error showed up due to this (http://kerneltrap.org/mailarchive/linux-kernel/2008/9/11/3261284) kernel acpi change. This was simple to patch, and the module works.

Patch attached, meant to be applied after all patches in http://download.opensuse.org/repositories/openSUSE:/Factory/snapshot/src/pcc-acpi-0.9-4.15.src.rpm

Revision history for this message
Eric Drechsel (ericdrex) wrote :

not fixed

Changed in linux (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Eric Drechsel (ericdrex) wrote :

Confirming that panasonic_laptop module in Jaunty fails to support brightness keys, since it does not create the /proc/acpi/pcc/* interfaces which the panasonic brightness scripts in acpi-support expect.

I've been using the pcc_acpi module with the suse patches (http://software.opensuse.org/search?baseproject=openSUSE%3AFactory&p=1&q=pcc-acpi) module up until 2.6.28, when a compile error showed up due to this (http://kerneltrap.org/mailarchive/linux-kernel/2008/9/11/3261284) kernel acpi change. This was simple to patch, and the module works.

Patch attached, meant to be applied after all patches in http://download.opensuse.org/repositories/openSUSE:/Factory/snapshot/src/pcc-acpi-0.9-4.15.src.rpm

Revision history for this message
Eric Drechsel (ericdrex) wrote :

Confirming that panasonic_laptop module in Jaunty fails to support brightness keys, since it does not create the /proc/acpi/pcc/* interfaces which the panasonic brightness scripts in acpi-support expect.

I've been using the pcc_acpi module with the suse patches (http://software.opensuse.org/search?baseproject=openSUSE%3AFactory&p=1&q=pcc-acpi) module up until 2.6.28, when a compile error showed up due to this (http://kerneltrap.org/mailarchive/linux-kernel/2008/9/11/3261284) kernel acpi change. This was simple to patch, and the module works.

Patch attached, meant to be applied after all patches in http://download.opensuse.org/repositories/openSUSE:/Factory/snapshot/src/pcc-acpi-0.9-4.15.src.rpm

Revision history for this message
Eric Drechsel (ericdrex) wrote :

oops, bad whitespace in patch

Revision history for this message
Eric Drechsel (ericdrex) wrote :

for those like me who just need working brightness control for now, here is a quick script to patch and build the old module.

insmod /tmp/pcc_acpi_build/pcc-acpi-0.9/pcc_acpi.ko or make install from there and modprobe pcc_acpi (making sure panasonic_laptop module isn't loaded)

Revision history for this message
Eric Drechsel (ericdrex) wrote :

I think http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524838 is the relevant upstream bug for getting brightness key events working with the new driver. rebooting to test

(note: not sure why my comment shows up multiple times, maybe wanky browser, sorry)

Revision history for this message
Eric Drechsel (ericdrex) wrote :

Success! Installing acpi-support and acpi-support-base 0.123-1 from Debian Sid enables brightness up/down keys to work with the in-kernel driver. NOTE: acpi-support 0.125 from Karmic DOES NOT support the brightness keys. gnome-power-manager still can't send or receive brightness events.

Revision history for this message
Vassili Yu. Titov (vtitov) wrote :

Could the developers include PCC_ACPI package into release Kubuntu 9.10 coming?
 I'm emplyee of Panasonic Russia an would like to help our customers use Kubuntu on Panasonic's laptops. I have found the original sources from http://www.da-cha.jp/files/pcc-acpi-0.9.tar.bz2 can be compile on Hardy Heron (I did it on 8.04.1 LTS), but I cannot compile them neither on Kubuntu 9.04 nor Kubuntu 9.10alpha6. This module is really needed and, I think, it's great when it can be installed by apt-get command.

Revision history for this message
Mante (mante) wrote : Re: [Bug 222324] Re: Support for panasonic hotkeys missing

I have no problem in the Karmic Koala beta with PCC_ACPI so far.
I Have a Let's not PANASONIC CF-Y4. Are you sure that PCC_ACPI is not
working on your note?

Quoting "Vassili Yu. Titov" <email address hidden>:

> Could the developers include PCC_ACPI package into release Kubuntu
> 9.10 coming?
> I'm emplyee of Panasonic Russia an would like to help our customers
> use Kubuntu on Panasonic's laptops. I have found the original
> sources from http://www.da-cha.jp/files/pcc-acpi-0.9.tar.bz2 can be
> compile on Hardy Heron (I did it on 8.04.1 LTS), but I cannot
> compile them neither on Kubuntu 9.04 nor Kubuntu 9.10alpha6. This
> module is really needed and, I think, it's great when it can be
> installed by apt-get command.
>
> --
> Support for panasonic hotkeys missing
> https://bugs.launchpad.net/bugs/222324
> You received this bug notification because you are a direct subscriber
> of a duplicate bug.
>

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Revision history for this message
James Whitlock (wiggleraway) wrote :

Karmic includes panasonic-laptop instead of pcc_acpi. A userspace program is required to receive input events (shortcut keys) and control the backlight In gnome this is gnome-power-manager, KDE will have something similar.

Bar the suspend keys, karmic works out of the box for me (let's note CF-T2).

Revision history for this message
Eric Drechsel (ericdrex) wrote :

agreed, brightness, volume keys work out of box in karmic (Let's Note CF-T2)

Revision history for this message
Vassili Yu. Titov (vtitov) wrote :

Thank you for advice. I have installed Kubuntu 9.10 recently released. Hotkeys (Brightness and sound) are working from a box. Questions are:
What package is responsible for Panasonic hotkeys? I cannot find panasonic-laptop.
What about another hotkeys (video out switch, hibernate, harddisk)?

Andy Whitcroft (apw)
Changed in linux (Ubuntu):
assignee: Andy Whitcroft (apw) → nobody
Revision history for this message
linuxrules (linuxrules) wrote :
Download full text (3.8 KiB)

here is some code I wrote (I own a CF-51)
first try this:
# modprobe panasonic_laptop

save the below as: /etc/acpi/events/hotkey

event=HKEY\ 00000080\ 000000(8[1-689]|0[37a])
action=/etc/acpi/hotkey.pl %e

save the below as: /etc/acpi/hotkeys.pl

then chmod +x /etc/acpi/hotkeys.pl

#!/usr/bin/perl

=begin comment

    Copyright (C) 2010 Mitchell Lafferty (<email address hidden>)

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program. If not, see L<"http://www.gnu.org/licenses/">.

=end comment

=cut

use feature ":5.10";
use strict;
use warnings;

# 00000081 dn b
# 00000082 up b
# 00000084 mute
# 00000085 v dn
# 00000086 v up
# 00000007 ram sleep
# 00000089 batt
# 0000000a hdd sleep

#use YAML qw(DumpFile);
#$hash = {'BRIGHT_DN_STEPS' => 10,'BRIGHT_UP_STEPS' => 10};
#print DumpFile('/home/mitch/.acpi_config', $hash);

use constant {
    ACPI_BRIGHT_DN => '00000081',
    ACPI_BRIGHT_UP => '00000082',
    ACPI_SND_MUTE => '00000084',
    ACPI_SND_DN => '00000085',
    ACPI_SND_UP => '00000086',
    ACPI_CRT_OUT => '00000088',
    ACPI_BATT_KEY => '00000089',
    ACPI_SLEEP_RAM => '00000007',
    ACPI_SLEEP_HDD => '0000000a',
    ACPI_PCC_BRIGHT => '/sys/devices/virtual/backlight/panasonic'
};

my $BRIGHT_UP_STEPS = 10;
my $BRIGHT_DN_STEPS = $BRIGHT_UP_STEPS;

my $SND_UP_STEPS = 1;
my $SND_DN_STEPS = $SND_UP_STEPS;

my ( $max_bright, $new_bright, $now_bright );

given ( $ARGV[3] ) {
    when (undef) {
        exit 0;
    }

    when (ACPI_BRIGHT_DN) {
        $max_bright = QuickOpen( ACPI_PCC_BRIGHT . '/max_brightness' );
        $now_bright = QuickOpen( ACPI_PCC_BRIGHT . '/brightness' );
        chomp($max_bright);
        chomp($now_bright);

        $new_bright = $now_bright - $BRIGHT_UP_STEPS;
        $new_bright = 0 if ( $new_bright < 0 );

        #~ print $max_bright," ", $now_bright," ", $new_bright, "\n";
        QuickWrite( ACPI_PCC_BRIGHT . '/brightness', "$new_bright\n" );
    }

    when (ACPI_BRIGHT_UP) {
        $max_bright = QuickOpen( ACPI_PCC_BRIGHT . '/max_brightness' );
        $now_bright = QuickOpen( ACPI_PCC_BRIGHT . '/brightness' );
        chomp($max_bright);
        chomp($now_bright);

        $new_bright = $now_bright + $BRIGHT_UP_STEPS;
        $new_bright = $max_bright if ( $new_bright > $max_bright );

        #~ print $max_bright," ", $now_bright," ", $new_bright, "\n";
        QuickWrite( ACPI_PCC_BRIGHT . '/brightness', "$new_bright\n" );
    }

    when (ACPI_SND_MUTE) {

        # don't care
        ...;
    }

    when (ACPI_SND_DN) {

        # don't care
        #~ system("amixer -q sset PCM,0 $SND_DN_STEPS-");
        ...;

    }

    when (AC...

Read more...

Revision history for this message
Andy Whitcroft (apw) wrote :

As this is confirmed fixed in Karmic and later I am closing out the development task as Fix Released.

Changed in linux (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.