Page MenuHomeFreeBSD

Code refactoring for rk_pgio driver
ClosedPublic

Authored by ganbold on Aug 19 2022, 10:18 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 4, 2:17 PM
Unknown Object (File)
Sat, May 4, 7:54 AM
Unknown Object (File)
Sun, Apr 28, 11:18 PM
Unknown Object (File)
Mon, Apr 22, 9:54 PM
Unknown Object (File)
Sun, Apr 21, 6:57 PM
Unknown Object (File)
Mar 22 2024, 9:13 PM
Unknown Object (File)
Mar 22 2024, 9:13 PM
Unknown Object (File)
Mar 22 2024, 9:13 PM

Details

Summary

This patch does code refactoring for existing rk_gpio driver:
It supports gpio type checking. Depending on gpio type some
register addresses are different.
Submitted by: @sos

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ganbold edited the summary of this revision. (Show Details)
sys/arm64/rockchip/rk_gpio.c
184

This shouldn't be removed, this is to allow caching and thus more fast gpio switching for bit banging.

309

Same (caching).

345

Same (caching)

363

Same (caching)

379

Same (for caching)

387

Same (caching)

428

Same (caching)

sys/arm64/rockchip/rk_gpio.c
275

The problem with this approch is that we take the lock, read, release the lock, re-take the lock, read, re-release the lock.
Maybe do some unlocked version of the new functions and call those from the locked one.

404

We have to take the lock before as we don't want another call to this function that will modify swporta_ddr too.

438

Same as above, we want a lock here.

457

Same as above.

475

Same as above, we take the lock twice, add some unlocked version of those new function.

This revision is now accepted and ready to land.Aug 19 2022, 1:18 PM
This revision was automatically updated to reflect the committed changes.