Page MenuHomeFreeBSD

allwinner: simplify axp81x read/write
AbandonedPublic

Authored by mhorne on Mon, Jan 11, 10:08 PM.

Details

Reviewers
manu
Summary

Use the iicdev_[read|write] helper methods. I've extended the patch from
the PR slightly, following the similar changes made to axp209 in
r322025.

PR: 239693
Submitted by: Chuhong Yuan <hslester96@gmail.com>

Test Plan

Compile tested. Unfortunately I don't have the hardware to verify.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 36121
Build 33010: arc lint + arc unit

Event Timeline

Mhm, I don't remember if there was a reason I didn't do that or if iicdev_read/write didn't exists at the time.
Looks ok but give me a few days to test.

In D28104#628657, @manu wrote:

Mhm, I don't remember if there was a reason I didn't do that or if iicdev_read/write didn't exists at the time.
Looks ok but give me a few days to test.

Sounds good, thanks. git history shows that the helper methods were added after this driver.

Yeah I remember now.
RSB isn't really i2c and we can't use those (I was sure that I tested at some point).
using this code will boot but will fail as soon as we try to change the cpu freq (when we try to talk to the PMIC)
root@pine64-lts:~ # sysctl dev.cpu.0.freq=1152
dev.cpu.0.freq: iichb0: RTA not known for address 0x23
axp8xx_pmu0: Setting vdd-cpux (dcdc2) to 1300000<->1300000
<hang here>
Since we cannot communicate with the PMIC we will hang as soon as the CPU reaches the desired freq and not have the correct needed voltage.

In D28104#629208, @manu wrote:

Yeah I remember now.
RSB isn't really i2c and we can't use those (I was sure that I tested at some point).
using this code will boot but will fail as soon as we try to change the cpu freq (when we try to talk to the PMIC)
root@pine64-lts:~ # sysctl dev.cpu.0.freq=1152
dev.cpu.0.freq: iichb0: RTA not known for address 0x23
axp8xx_pmu0: Setting vdd-cpux (dcdc2) to 1300000<->1300000
<hang here>
Since we cannot communicate with the PMIC we will hang as soon as the CPU reaches the desired freq and not have the correct needed voltage.

I see, sorry for the noise then. I will close the PR with this information.