Page MenuHomeFreeBSD

arm64: rockchip: Add interface for rk_pinctrl
ClosedPublic

Authored by manu on Dec 17 2019, 11:00 AM.

Details

Summary

The gpio controller in rockchips SoC in a child of the pinctrl driver and cannot control
pullups and pulldowns. Add an interface for accessing pin capabilities and setting them.
We can now report that every pins is capable of being IN or OUT function and PULLUP PULLDOWN.
If the pin isn't in gpio mode no changes will be allowed.

Test Plan

Tested ok rk3328 and rk3399.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

manu created this revision.Dec 17 2019, 11:00 AM
manu added a reviewer: gonzo.Dec 17 2019, 2:15 PM
mmel added a comment.Dec 19 2019, 1:55 PM

imho, some bits of this should be implemented as part of generic fdt_pinctr interface.
We should have at least
FDT_PINCTRL_IS_GPIO()
FDT_PINCTRL_SWITCH_TO__GPIO()
FDT_PINCTRL_SET_GPIO_FLAGS()
FDT_PINCTRL_GET_GPIO_FLAGS()
Major issue is how to get right reference to appropriate pinctrl instance(within gpoio driver) and how to convert pin numbers from gipo nomenclature to pinctrl nomenclature. This should be covered by "gpio-range = <>" property, but world is not ideal :(

ganbold accepted this revision.Jan 8 2020, 9:11 AM
This revision is now accepted and ready to land.Jan 8 2020, 9:11 AM
manu updated this revision to Diff 66516.Jan 8 2020, 7:27 PM

Use the new fdt_pinctrl methods.

This revision now requires review to proceed.Jan 8 2020, 7:27 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 16 2020, 9:21 PM
This revision was automatically updated to reflect the committed changes.