Comment 12 for bug 285815

Revision history for this message
Alex Murray (alexmurray) wrote :

Thanks for the feedback rydberg - after looking into it some more it seems the new MBP / MBA's use the 10 byte light value from the left sensor as follows:

first 2 bytes seem to always be 01
next 2 bytes are a big endian 16-bit value of the ambient light value with a maximum value of 65535
next 2 bytes are a big endian 16-bit value of the ambient light value but is somehow scaled down from the first one and perhaps has a different dynamic range
next 2 bytes are a big endian 16-bit value of the ambient light value with a maximum value of 1023
last 2 bytes I got no idea about

So I've cooked up a patch to use the value which reports 1023 as max which just basically divides this by 4 to give us a value which we can return with a maximum of 255 like the max value on the older machines.

It also seems the right sensor doesn't ever report anything so we just return 0 for this.

Please test the attached patch and if possible can this be merged into the applesmc-dkms mactel package?