linux-surface/kernel

Driver for Surface ambient light sensor

qzed opened this issue · 6 comments

qzed commented

It seems like the newer devices (SL3, SB3, maybe Pro7?) use a custom ambient light sensor. Implement support for this. CC @archseer.

I have an issue open here for SL3: linux-surface/linux-surface#121

(I'm just dumping all issues in the primary repo since I find it easier to find)

SL3 sensor should probably just work with that driver, but it was impossible to bind it dynamically at runtime for some reason. Also wasn't able to recompile just iio because I'd get loading errors. I'd need to test with the kernel fully recompiled but I haven't bothered yet.

I think the SB3 sensor is different because I couldn't find the same i2c interfaces in the dsdt (MSHW0184 / extra i2c interfaces)

qzed commented

Okay, let's keep this one open as tracking issue and collect the info on the other one.

Hello, @qzed and @archseer. How are you guys?

I am wondering if there's been any updates on this issue. Sensors are not available according to the feature matrix for SL3 (I), but
according to issue#121,

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

it seems that it may be a simple fix? I am wondering if I can apply this fix on my end. Thanks, all!

qzed commented

No update from my side, can't really do much without having a device that has such a sensor.

This seems to be implemented according to linux-surface/linux-surface#96 (comment)

qzed commented

Right, thanks for reminding me. The main part should be implemented in 23b180c and working. There's still an open PR (#74) to introduce an additional near_level attribute, but I'm not sure if that's required.