> Pro tip: when you reply, trim out the not relevant parts like this.

Noted.
> We could start with hard-coding the als_trans_ratio in this driver for the
> scale (and write comments explaining where it came from and what we know
> and don't know). Then at least we would have a scale. And if anyone needs
> something more accurate and reverse-engineers it we could fix it up later
> with a DT property or something like that.
> 

In arch/arm/boot/dts/qcom/libra/common-proximity.dtsi Xiaomi sets this property
to 16, and they set integration time in their driver to 160ms. Maybe
als_trans_ratio has something to do with integration time? In that case, we can
calculate the scale from a formula, like this:
scale = cm36686_als_it_times[index][1] / 10000 * 40000
val = scale / 1000000
val2 = scale % 1000000
This would allow us to preserve lux value when changing integration time.

Reply via email to