soc/amd/common: Refactor single GPIO programming