PabloPL / linux

Linux kernel source tree
Other
17 stars 0 forks source link

gp2a #28

Closed PabloPL closed 3 years ago

PabloPL commented 5 years ago

Changes already done on brach for-upstream/gp2a, need to send them to mainline

PabloPL commented 5 years ago

Patches send to mainline for review.

xc-racer99 commented 5 years ago

Mainline review complete; in order to add light sensor part the driver needs to be converted to an IIO driver. See very similarily named gp2a020... driver as an example of the interfaces needed.

PabloPL commented 5 years ago

I wonder if existing gp2ap020a00f driver wouldn't work with our hw (maybe it's just a matter of adding new compatible to it) - didn't tested it, just a idea.

xc-racer99 commented 5 years ago

I did test it as I initially thought it was the same hardware :)

It doesn't work as the light sensor method is totally different - on the 020 it appears to have some sort of internal ADC while the 002 relies on an external ADC

xc-racer99 commented 4 years ago

IIO driver for GP2A is created at https://github.com/PabloPL/linux/tree/for-upstream/gp2a-iio

xc-racer99 commented 4 years ago

However, the IIO driver should probably have a scale added to it for the light channel - in Android at https://github.com/xc-racer99/android_device_samsung_aries-common/blob/unlegacy-4.4/libsensors/LightSensor.cpp#L120 there is a function that converts things, but this appears to be device-specific

PabloPL commented 4 years ago

For reference only - there is another work on such device driver (done by Linus Walleij) https://patchwork.kernel.org/patch/11311631/ https://patchwork.kernel.org/patch/11311635/

xc-racer99 commented 4 years ago

For reference only - there is another work on such device driver (done by Linus Walleij) https://patchwork.kernel.org/patch/11311631/ https://patchwork.kernel.org/patch/11311635/

Yes, unfortunately we will need to add to the driver as our device reads an analog voltage while the drivers conversion to lux is from the raw current. Probably just need to figure out what the resistor value that the current goes through is and add that as a DT property.

xc-racer99 commented 3 years ago

GP2A IIO driver is merged upstream, as are DTS changes.