I don't know how recently you've played with pinmux on Linux, but my understanding is the pinctrl subsystem should handle runtime muxing without wetting the bed. What issues did you run into?
If I remember right, that was all also very version-dependent and rapidly changing. I had two boards with two different kernel versions and everything was just a total catastrophe there (until I accidentally fried one, and then that particular problem... sorta solved itself)