When an alternate function is used , alternate function takes priority our standard I/O programming. When signal is coming from on-chip peripheral, that pin is automatically configured in O/P mode(push-pull or open-drain) depending up on the peripheral used. So, it is not possible to change this configuration.