Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit cdc861b1 authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

iio: qcom-spmi-adc5: Handle EOC properly



Currently, when an ADC7 channel is read, there is a wait time of
10 ms where an EOC (end of conversion) interrupt should happen
thereby completing the wait for ADC conversion. However, if this
wait times out, it is not handled and stale data can be read. Add
error logs to print when this wait times out as well as if EOC
bit is not set and return an error.

Also, this 10 ms wait time for EOC after requesting for a channel
conversion is not sufficient. As per the hardware recommendation
when multiple subsystems requests PMIC HW arbiter to read same
or different channels on different PMICs simultaneously, it could
take 15 ms for a good case i.e. where all the conversion requests
went through successfully. However, for a worst case where this
conversion request times out, it could take up to 500 ms before
an EOC interrupt is sent by PBS to SW. Hence, increase conversion
wait time to 501 ms so that no other channel reads can be made in
the worst case. Also print a warning when the wait time for EOC
is more than 15 ms.

Change-Id: I69eeade3e85f740af10cd7a3d668e67f67f6617d
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent 522ef887
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment