So I've recently installed Ubuntu 14.04 (kernel: 3.13.0-24-generic). It's mostly working with my Samsung NP540U4E laptop, just having some trouble with the keyboard brightness change function keys.

dmesg | grep -i setkeycodes

shows me that the scancodes are e017 for brightness down (Fn + F9) and e016 for brightness up (Fn + F10).

xmodmap -pke

gives me the output (among other things)

keycode 237 = XF86KbdBrightnessDown NoSymbol XF86KbdBrightnessDown
keycode 238 = XF86KbdBrightnessUp NoSymbol XF86KbdBrightnessUp

which I think are correct commands because

xdotool key XF86KbdBrightnessUp
xdotool key XF86KbdBrightnessDown

change the keyboard brightness up and down. I then tried

sudo setkeycodes e017 237
sudo setkeycodes e016 238

which didn't work, but for some reason if I subtract 8 from the keycodes they work for keyboard brightness up and down but now I have another problem. My laptop doesn't register these keys being released so they both only work once as my laptop thinks they are still held. And I couldn't see a scancode for the release of the keys


NP540? I think it's close enough to NP300 to try the following fix (worked for me on 12.04 and 14.04):

  1. In /etc/default/grub, append two kernel options acpi_osi=Linux and acpi_backlight=vendor so the line looks like this (leave any previously existing options not related to acpi):

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor"
    

    Then run

    update-grub
    
  2. Blacklist samsung_laptop module by creating /etc/modprobe.d/blacklist-np450.conf with the following contents:

    blacklist samsung_laptop
    
  3. Reboot, see if this works. If not, revert the changes (remove modifications to /etc/default/grub and /etc/modprobe.d/blacklist-np450.conf)