Page MenuHomeFreeBSD

allwinner: simplify axp81x read/write
AbandonedPublic

Authored by mhorne on Jan 11 2021, 10:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 19 2023, 1:27 PM
Unknown Object (File)
Sep 30 2023, 7:09 PM
Unknown Object (File)
Sep 22 2023, 3:48 AM
Unknown Object (File)
Sep 21 2023, 10:13 PM
Unknown Object (File)
Jan 10 2023, 8:59 PM
Unknown Object (File)
Jan 3 2023, 11:01 PM
Unknown Object (File)
Nov 26 2022, 9:27 AM
Subscribers

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 Passed
Unit
No 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.