# Brightness buttons work only with acpi=off[workaround found]

## erikderzweite

Greetings, fellows!

Recently, I have bought a Fujitsu-Siemens Amilo Pi 2515 laptop. First thing to do — install Gentoo, of cource.   :Smile: 

It works (mostly) fine, i'm planning to do a wiki article about this model.

Yet, there are some minor problems with this model. One rather annoying is that brightness buttons cease to work if I boot linux (while other stuff works - sound buttons, media key, lid switch etc.). They work in grub, however and they work if I start the kernel with acpi=off. Of cource, other acpi-related stuff isn't working anymore.  So, my guess is that I have to turn something in acpi off in order to make my brightness buttons work and don't break anything else.

I use tuxonice-sources-2.6.24 and 64-bit mostly stable gentoo. Here is my lspci:

```
00:00.0 Host bridge: Intel Corporation Mobile Memory Controller Hub (rev 03)

00:02.0 VGA compatible controller: Intel Corporation Mobile Integrated Graphics Controller (rev 03)

00:02.1 Display controller: Intel Corporation Mobile Integrated Graphics Controller (rev 03)

00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Contoller #4 (rev 03)

00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03)

00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03)

00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)

00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03)

00:1c.2 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 3 (rev 03)

00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03)

00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03)

00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03)

00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03)

00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3)

00:1f.0 ISA bridge: Intel Corporation Mobile LPC Interface Controller (rev 03)

00:1f.1 IDE interface: Intel Corporation Mobile IDE Controller (rev 03)

00:1f.2 SATA controller: Intel Corporation Mobile SATA AHCI Controller (rev 03)

00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03)

04:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)

06:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E PCI Express Fast Ethernet controller (rev 01)
```

Any idea, where do I have to look for a solution?

EDIT: Oh, yes, it doesn't matter whether I compile acpi with video support or not. Tried to compile video as module and unload it — no effect.Last edited by erikderzweite on Mon Feb 04, 2008 1:49 pm; edited 1 time in total

----------

## IvanMajhen

Do you have CONFIG_FUJITSU_LAPTOP selected in kernel?

----------

## erikderzweite

 *IvanMajhen wrote:*   

> Do you have CONFIG_FUJITSU_LAPTOP selected in kernel?

 

I see no CONFIG_FUJITSU_LAPTOP in .config. My kernel is x86-64 2.6.24-tuxonice (gentoo-sources + tuxonice patch). 32-bit option maybe? 

drivers/misc/fujitsu-laptop.c is there, however. How do I make it availible for my setup?Last edited by erikderzweite on Sun Feb 03, 2008 5:34 pm; edited 1 time in total

----------

## Veldrin

there is:

```
Device Drivers  --->

  [*] Misc devices  --->

    < >   Fujitsu Laptop Extras
```

----------

## IvanMajhen

Ups. It is only in zen sources. You could download it from http://tilos.csl.mech.ntua.gr/~apoikos/fujitsu-acpi-2.6.tar.bz2

----------

## erikderzweite

Stupid me!

I had to activate Sony Laptop Extras first in order to see Fujitsu Siemens Extras.

Thank you very much!

----------

## IvanMajhen

Hm... in zen sources there are two drivers.

Don't enable sony. Just enable BACKLIGHT_CLASS_DEVICE

----------

## erikderzweite

I have to enable SONY_LAPTOP in order to select FUJITSU_LAPTOP. Anyway, I still can't adjust brightness although I have 

```
/dev/input/event4

   bustype : BUS_HOST

   vendor  : 0x0

   product : 0x6

   version : 0

   name    : "Video Bus"

   phys    : "LNXVIDEO/video/input0"

   bits ev : EV_SYN EV_KEY

```

 in lsinput now. It doesn't generate any events, however.

Will try BACKLIGHT_CLASS_DEVICE now...

----------

## IvanMajhen

Do you have /sys/devices/platform/fujitsu-laptop/backlight/fujitsu-laptop/brightness?

```
config FUJITSU_LAPTOP

        tristate "Fujitsu Laptop Extras"

        depends on X86

        depends on ACPI

        depends on BACKLIGHT_CLASS_DEVICE

```

It only depends on BACKLIGHT_CLASS_DEVICE. You can choose fujitsu driver when selecting sony driver, becuse sony automatically selects BACKLIGHT_CLASS_DEVICE

```
config SONY_LAPTOP

        tristate "Sony Laptop Extras"

        depends on X86 && ACPI

        select BACKLIGHT_CLASS_DEVICE

        depends on INPUT

```

----------

## erikderzweite

```
# ls /sys/devices/platform/fujitsu-laptop/

bus  driver  lcd_level  modalias  power  subsystem  uevent

# cat /sys/devices/platform/fujitsu-laptop/lcd_level

0

# echo "1" > /sys/devices/platform/fujitsu-laptop/lcd_level

bash: echo: write error: No such device

```

BACKLIGHT_CLASS_DEVICE and FUJITSU_LAPTOP are compiled in (tried them as modules as well).

Now when I start gentoo, the monitor is set to maximum brightness (I run on AC, no battery is plugged in). I have an input device called "Video Bus" now.

```
/dev/input/event4

   bustype : BUS_HOST

   vendor  : 0x0

   product : 0x6

   version : 0

   name    : "Video Bus"

   phys    : "LNXVIDEO/video/input0"

   bits ev : EV_SYN EV_KEY

```

However, no events are generated if I press buttons. What could I miss?Last edited by erikderzweite on Sun Feb 03, 2008 9:15 pm; edited 1 time in total

----------

## IvanMajhen

I have acer and i have entries:

/sys/class/backlight/acer_acpi/brightness

Echoing some value to /sys/class/backlight/acer_acpi/brightness changes brightness.

Try

echo 5 > /sys/class/backlight/fujitsu_laptop/brightnes

----------

## erikderzweite

I am able to echo values from 0 to 7 (which is max_brightness) to /sys/class/backlight/fujitsu-laptop/brightness and these values remain there, but nothing else happens: actual_brightness stays on 0 and the screen remains by its default brightness. If I compile ACPI video, however, I am able to echo 25, 50, 75 and 100 to /sys/class/backlight/acpi_video0/brightness to get 4 different brightness levels or any other value to return to maximum brightness. Fn+F5/F6 still doesn't seem to do anything at all.

Well, this is at least something to start with. Thank you for your help. Any other advice will be of cource appreciated.

small update: if I modprobe the video module, I get following in dmesg:

```
ACPI Error (utobject-0502): Unsupported Reference opcode=88 in object ffff81007e585560 [20070126]

input: Video Bus as /class/input/input9

ACPI: Video Device [GFX0] (multi-head: yes  rom: no  post: no)

```

----------

## IvanMajhen

Then try with fuj02b1_acpi.

----------

## erikderzweite

Can't compile with current kernel (and I don't want to downgrade because of tickless 64-bit).

fjpanel doesn't seem to work, too. Oh, well... I'm still better as at the beginning.

----------

## IvanMajhen

I have updated driver that compiles on 2.6.24. Send me pm with your mail and i can send it to you.

----------

## erikderzweite

fuj02b1_acpi doesn't create anything in /sys/    :Sad: 

I guess, my lappy isn't supported yet. At least I can control my Brightness via video module.

----------

## IvanMajhen

It creates in /proc/acpi/fuj*. Is it recognized in dmesg?

----------

## erikderzweite

dmesg says nothing and /proc/acpi/fuj02b1/ is empty.

----------

## IvanMajhen

Try mapping fn+f5/6 keys. Emerge xev and see if they generate any events. Then you could make script for {in|de}creasing brightness.

----------

## erikderzweite

I've already made two scripts to increase/decrease brightness and mapped them to Win-F7/F8. 

Fn-F7/F8 don't generate any events - neither ACPI nor events from /dev/input/* nor xev events.

This will do as a temporary solution.

Another question is - what part of acpi controls brightness keys? I mean, with acpi=off they work just fine. Is there maybe a kernel bootup parameter to turn off this specific part of acpi  while keeping all the rest active?

----------

## erikderzweite

I've decided to post my simple scripts for all happy amilo pi 2515 users. These are just quick & dirty hacks but they seem to work

there are brightness_increase.sh:

```
!/bin/bash

BRIGHTNESS=/sys/class/backlight/acpi_video0/brightness

CHECK=$(cat $BRIGHTNESS)

START=0

MAXIMUM=100

STEP=25

if [ $CHECK != $MAXIMUM ]

then

 if [ $CHECK = $START ]

 then

 echo $MAXIMUM > $BRIGHTNESS

 else

  echo $(expr $CHECK + $STEP) > $BRIGHTNESS

 fi

fi

exit

```

and, in similar fashion brightness_decrease.sh

```
#!/bin/bash

BRIGHTNESS=/sys/class/backlight/acpi_video0/brightness

CHECK=$(cat $BRIGHTNESS)

START=0

MINIMUM=25

DEFAULT=75

STEP=25

if [ $CHECK != $MINIMUM ]

then

 if [ $CHECK = $START ]

 then

 echo $DEFAULT > $BRIGHTNESS

 else

  echo $(expr $CHECK - $STEP) > $BRIGHTNESS

 fi

fi

exit

```

I also added a chmod line to local.start to make /sys/class/backlight/acpi_video0/brightness accessible by user.

Hope that someone find this information useful.

----------

## IvanMajhen

Have you tried xbacklight?

----------

