-
-
Notifications
You must be signed in to change notification settings - Fork 250
SL3 Ambient light sensor driver #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The SB3 and SP7 seem to use the same device: |
|
I must have missed that, it looks like the same device as SL3 actually (also on I2C4). |
All the registers seem to line up with apds9960, and I was able to turn on the sensor and read data from the same sequence as in that driver if I remember correctly. Should be as simple as adding the device to https://github.com/torvalds/linux/blob/fffb08b37df928475fef9c7f2aafddc2f6ebfaf4/drivers/iio/light/apds9960.c#L1111-L1121 |
I think they saw the other IIO sensors and didn't notice that the ALS was missing. Those seem to also work on the SB3. |
@archseer any update here? Is adding the device all that's required? |
That's still the case, I dumped all the info here hoping someone else will pick up the issue. I haven't had the motivation to do so since my setup doesn't use the ambient sensors. I can probably give it another look this week though, now using a custom kernel config so it doesn't take forever to recompile anymore. |
@archseer I'm in the ##linuxsurface channel working on this if you'd like to talk |
Patch for detecting the device by adding an acpi match table: https://gist.github.com/MaxLeiter/800146e7fbb5abee792d1b50f6e3dcbc also for anyone investigating, on the surface pro 7 the device is under |
I believe we can close this as the patch has been merged and is upstream. If not let me know. |
Yep sorry, the patch was merged. https://lkml.org/lkml/2020/12/21/271 |
SL3 uses a custom ambient light sensor (MSHW0184) under i2c-12. By dumping some logs on windows I was able to find the correct sequence to turn the sensor on:
https://gist.github.com/archseer/3f58a74d4dd02dd0c9284b571fdbc1df
Intel(R) Serial IO I2C Host Controller 34C5 -> Surface Light Sensor (MSHW0184) -> VHF (HID, the hid-iio framework should take care of that). _SB.PCI0.I2C4.ACSD on the ACPI.
All the registers seem to line up with APDS9960 which is already upstream so we can probably just reuse the same driver. I wasn't able to get the driver to bind after boot via sysfs (I think it said something like "resource busy").
We should be able to get the driver to bind by modifying this to include MSHW0184 but I haven't had the time to do a full kernel recompile yet.
Lastly, this might also affect SP7, I'm not sure.
The text was updated successfully, but these errors were encountered: