Sunday, 2 January 2011

Fedora 14 - How to make Samsung Fn Brightness buttons work

If you own a Samsung R510 the most important feature that does not work in Fedora 14 are the brightness buttons. Ubuntu users are fortunate to have a repository that enables Fn functionality, please see https://launchpad.net/~voria/+archive/ppa

I will be using files provided by this repository to enable brightness control in Fedora 14 on my Samsung R510.

Please make sure your Fedora system is fully up to date before proceeding. If you are not sure open a terminal and run the following command,

su -c 'yum -y update'

If advised to reboot, please do.

Are you ready?

Open a terminal and type the following,

su -c 'yum install kernel-devel gcc'

This will download some required tools. Next, edit the 95-keyboard-force-release.rules file.

su -c 'nano /lib/udev/rules.d/95-keyboard-force-release.rules'

Look for the following line

ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*E252*|*N120*|*N128*|*N130*|*N140*|*N148/N208*|*N150*|*N150/N210/N220*|*N220*|*N308*|*N310*|*N510*|*NB30*|*NC10/N110*|*ND10*|*Q210/P210*|*R410P*|*R425/R525*|*R428/P428*|*R460*|*R463*|*R468/R418*|*R480/R431/R481*|*R509*|*R518*|*R519/R719*|*R520/R522/R620*|*R528/R728*|*R530/R730*|*R530/R730/P590*|*R560*|*R580*|*R580/R590*|*R59/R60/R61*|*R59P/R60P/R61P*|*R710*|*R720*|*R780/R778*|*SR58P*|*SR700*|*SR70S/SR71S*|*SX22S*|*X118*|*X120*|*X460*", RUN+="keyboard-force-release.sh $devpath samsung-other"

Add R510/P510 as highlighted

ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*R510/P510*|*E252*|*N120*|*N128*|*N130*|*N140*|*N148/N208*|*N150*|*N150/N210/N220*|*N220*|*N308*|*N310*|*N510*|*NB30*|*NC10/N110*|*ND10*|*Q210/P210*|*R410P*|*R425/R525*|*R428/P428*|*R460*|*R463*|*R468/R418*|*R480/R431/R481*|*R509*|*R518*|*R519/R719*|*R520/R522/R620*|*R528/R728*|*R530/R730*|*R530/R730/P590*|*R560*|*R580*|*R580/R590*|*R59/R60/R61*|*R59P/R60P/R61P*|*R710*|*R720*|*R780/R778*|*SR58P*|*SR700*|*SR70S/SR71S*|*SX22S*|*X118*|*X120*|*X460*", RUN+="keyboard-force-release.sh $devpath samsung-other"

Press 'Ctrl-X' to exit nano, followed by ''Y' to save the file.

Edit your kernel grub entry,

su -c 'nano /boot/grub/grub.conf'

and add the following, acpi_backlight=vendor as illustrated below.

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/sda1
# initrd /boot/initrd-[generic-]version.img
#boot=/dev/sda1
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.35.10-74.fc14.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-2.6.35.10-74.fc14.x86_64 acpi_backlight=vendor ro root=UUID=........... rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=uk rhgb quiet
initrd /boot/initramfs-2.6.35.10-74.fc14.x86_64.img
title Fedora (2.6.35.6-45.fc14.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-2.6.35.6-45.fc14.x86_64 ro root=UUID=............ rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=uk rhgb quiet
initrd /boot/initramfs-2.6.35.6-45.fc14.x86_64.img
title Other
rootnoverify (hd1,0)
chainloader +1

Press 'Ctrl-X' to exit nano, followed by ''Y' to save the file.

Now we are going to download and compile the kernel module responsible for making the brightness buttons work.

mkdir samsung

cd samsung

wget http://dl.dropbox.com/u/16953763/samsung-backlight.c

wget http://dl.dropbox.com/u/16953763/Makefile

make

This will compile the samsung-backlight kernel module. The next step is to copy the module to your kernel.

su -c 'cp samsung-backlight.ko /lib/modules/$(uname -r)/kernel/'

su -c 'depmod -a'

su -c 'modprobe samsung-backlight'

Reboot your laptop and try out the FN brightness buttons.

Note:  You will have to rebuild / insert the samsung-backlight kernel module every time your kernel is updated.