# backlight on new Macbook (mbp_nvidia_bl for macbook 5,2 5,3

## noremac

Ubuntu users have a package that includes support for backilght dimming on the newer generation macbooks with the nvidia chipset. I could not find any support for this in gentoo.

I hav got backilight dimming to work by downloading the mbp-nvidia-bl-dkms_0.22~jaunty.tar.gz package from the mactel ppa repository ( https://launchpad.net/~mactel-support/+archive/ppa). I extracte it then copied the mbp_nvidia_bl.c file into my kernel tree, replacing the old one

```
#cp mbp-nvidia-bl-dkms-0.22.0/usr/src/dkms_source_tree/mbp_nvidia_bl.c /usr/src/linux/drivers/video/backlight/mbp_nvidia_bl.c 

```

I then recompiled my kernel and backlight dimming works - sort of. It only works if I change terminal out of my x-server to one of the text terminals and echo a value of 1 to 15 to /sys/class/backlight/mbp_backlight/brightness

Does anyone know how I could get the backlight control keys working?

 Do I need to change my keymap? 

Am I likely to damage anything by my sneaky modifaction fo the kernel tree?  

noremac

----------

## Arthanis

I have a macbook alluminium Unicase (It has very close, if not the same, hardware configuration as the macbook pro5,1 I guess)

my lspci -k:

00:00.0 Host bridge: nVidia Corporation MCP79 Host Bridge (rev b1)

00:00.1 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1)

00:03.0 ISA bridge: nVidia Corporation MCP79 LPC Bridge (rev b2)

00:03.1 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1)

00:03.2 SMBus: nVidia Corporation MCP79 SMBus (rev b1)

	Kernel driver in use: nForce2_smbus

	Kernel modules: i2c-nforce2

00:03.3 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1)

00:03.4 RAM memory: nVidia Corporation Device 0a98 (rev b1)

00:03.5 Co-processor: nVidia Corporation MCP79 Co-processor (rev b1)

00:04.0 USB Controller: nVidia Corporation MCP79 OHCI USB 1.1 Controller (rev b1)

	Kernel driver in use: ohci_hcd

	Kernel modules: ohci-hcd

00:04.1 USB Controller: nVidia Corporation MCP79 EHCI USB 2.0 Controller (rev b1)

	Kernel driver in use: ehci_hcd

00:06.0 USB Controller: nVidia Corporation MCP79 OHCI USB 1.1 Controller (rev b1)

	Kernel driver in use: ohci_hcd

	Kernel modules: ohci-hcd

00:06.1 USB Controller: nVidia Corporation MCP79 EHCI USB 2.0 Controller (rev b1)

	Kernel driver in use: ehci_hcd

00:08.0 Audio device: nVidia Corporation MCP79 High Definition Audio (rev b1)

	Kernel driver in use: HDA Intel

	Kernel modules: snd-hda-intel

00:09.0 PCI bridge: nVidia Corporation MCP79 PCI Bridge (rev b1)

00:0a.0 Ethernet controller: nVidia Corporation MCP79 Ethernet (rev b1)

	Kernel driver in use: forcedeth

	Kernel modules: forcedeth

00:0b.0 IDE interface: nVidia Corporation MCP79 SATA Controller (rev b1)

	Kernel driver in use: ahci

00:10.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)

00:15.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)

	Kernel driver in use: pcieport-driver

02:00.0 VGA compatible controller: nVidia Corporation C79 [GeForce 9400M] (rev b1)

	Kernel driver in use: nvidia

	Kernel modules: nvidia

03:00.0 Network controller: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller (rev 01)

	Kernel driver in use: wl

	Kernel modules: wl

Well, Im having the same problem here, and let me tell my story and the results of my research:

I compiled the kernel with the mbp_nvidia_bl. When I was configuring my DE (XFCE for that matter) I realized that although my fn keys were working perfectly, my backlight wasnt dmming, neither with pommed daemon nor gnome-power-manager. I first thought that the problem was with backlight kernel drivers, until I tried to dimm inside the console, and it worked. So I realized that the problem is nvidia gpu drivers + backlight kernel drivers combination (check this post: http://www.nvnews.net/vbulletin/showthread.php?t=135316). Although each of them work separately, together they dont, so I emerge nvclock utility and with the smartdimmer command, I can set my brightness with no problems. So I guess the best solution, for now, would be to map the smartdimmer command to your function keys. I hope that helped.

----------

## ercoppa

Try with nnvidia_bl module (provided by Mactel team PPA), you can find my ebuild (don't trust!) here.

Greets.

----------

