Changing UART clock speed



I am attempting to get MIDI communication over UART4 working. I have the device enabled via the overlay, and can communicate with it via /dev/ttyS4. However, the MIDI protocol runs at 31250 baud, and that is not a baud rate that can be used. Raspberry PI’s get around this by changing the UART clock frequency to scale down 38400 baud to 31250. This is exposed in a configuration variable. Does anybody know how I could do a similar thing here? I believe this should be possible, maybe by using the device tree overlay in some fashion. Any ideas? Thanks.