[Intel-gfx] Legacy backlight control with KMS and BACKLIGHT property
Mike Lothian
mike at fireburn.co.uk
Mon Aug 17 02:41:03 CEST 2009
2009/8/16 Greg KH <greg at kroah.com>:
> On Sat, Aug 15, 2009 at 01:33:13PM +0100, Mike Lothian wrote:
>> 2009/8/15 Jesse Barnes <jbarnes at virtuousgeek.org>:
>> > On Fri, 14 Aug 2009 12:28:47 -0700
>> > Greg KH <greg at kroah.com> wrote:
>> >
>> >> On Fri, Aug 14, 2009 at 12:08:21PM -0700, Greg KH wrote:
>> >> > Here's a first cut at such a driver. It works for me on this
>> >> > laptop, but note that it will try to work on _any_ Intel-based
>> >> > system. I'll figure out how to do this only for specific machines
>> >> > based on DMI data next.
>> >>
>> >> And here's one that is set for DMI data to only load on the proper
>> >> ones.
>> >>
>> >> I'll push this upstream now, if there are no objections.
>> >
>> > Yeah, looks fairly reasonable. This code should work on most pre-965
>> > chipsets too, since they share the LBB regs. There are a couple of
>> > other things to take into consideration: I think the VBIOS indicates
>> > whether the controls are inverted (i.e. a value of 0xff is minimum
>> > brightness) and there may also be some stepping info.
>> >
>> > So ultimately I'd like to see this be part of the i915 driver as one of
>> > a few different methods supported (hopefully we can autodetect them
>> > better than the 2D driver though, using the VBIOS and DMI in the
>> > kernel).
>> >
>> > The other three methods that need to export sysfs interfaces are
>> > OpRegion (already done), i2c (some machines have external controllers;
>> > the VBIOS describes how to interact with them) and PWM (the "native"
>> > power modulation regs).
>>
>> This is great news guys, hopefully I'll finally be able to control the
>> screen brightness of my GM45 in my Samsung R510
>>
>> If you want a guinea pig to test your code please feel free to forward patches
>
> A driver for other Samsung devices is below. If you think your laptop
> also works this way (by changing the brightness value by reading and
> writing the 0xf4 pci config value directly), then we can add support for
> your laptop to this driver as well, just send me the output of:
> lspci
> lspci -n
> grep . /sys/class/dmi/id/*
>
> thanks,
>
> + {
> + .ident = "NP-Q45",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
> + DMI_MATCH(DMI_PRODUCT_NAME, "SQ45S70S"),
> + DMI_MATCH(DMI_BOARD_NAME, "SQ45S70S"),
> + },
> + .callback = dmi_check_cb,
> + },
> + */
> + pci_device = pci_get_device(PCI_VENDOR_ID_INTEL, 0x27ae, NULL);
> + if (!pci_device) {
> + pci_device = pci_get_device(PCI_VENDOR_ID_INTEL, 0x2a02, NULL);
> + if (!pci_device)
> + return -ENODEV;
You are an absolute STAR Greg!!!
Finally I have brightness control for this laptop on Linux
I needed to set the DMI names to "R510/P510" and the pci device to
0x2a42 but apart from that it works!!!
Now I just have to get the keys working :D
Mike
More information about the Intel-gfx
mailing list