2014-01-21 02:15:23

by Patrik Jakobsson

[permalink] [raw]
Subject: Backlight driver for MacBook Air 6,1 and 6,2

Hi Andrew and CCs

I've put together (rather quickly) a driver for directly handling the backlight
driver chip (LM8550) on the 2013 MacBook Air. It is needed to work around a bug
(likely in firmware) that occurs after suspend/resume. See:

https://bugs.freedesktop.org/show_bug.cgi?id=67454

This seems to fall outside of what the i915 driver should handle and thus need a
separate driver. It's available at: https://github.com/patjak/mba6x_bl

The MacBook Air provides ACPI backlight methods but they also break after
suspend. I'm planning to mainline this and have a few questions.

1) I'm accessing the LP8550 on the SMBUS through ACPI methods. Should I access
the SMBUS directly instead or is this ok? I probably need to look at locking
around SMBUS accesses.

2) Is DMI the proper way of probing? Currently I'm just checking if the chip is
there and that it returns the proper contents in an identifier byte.

3) I assume the backlight type should be BACKLIGHT_PLATFORM (currently
BACKLIGHT_FIRMWARE) but do I also need to blacklist the ACPI backlight on these
devices? How do I get the proper precedence over other backlight devices?

Is there still time to get this into 3.14-rc1?

Thanks
Patrik