Hi, I recently made a PCB for a Teensy project that uses a linear voltage regulator to step down 12V used for some analog audio circuitry to 5V to power the teensy. This is working well, except that when I plug in the USB for programming I notice the linear regulator starts getting pretty hot. I'm assuming this is because the 5V provided by the regulator and the 5V for USB are slightly different levels, and are therefore fighting over which supplies the board.
I know the Teensy can be modded to disconnect USB power from the 5V input pin, but I'd like this project to be plug and play with new Teensys and also I occasionally would like to be able to power the digital portion of the circuit through USB only for testing purposes. Currently using a hacked data-only micro usb to program when the main 12V power supply is plugged in as a workaround.
I'm wondering if there is a good way around this in the circuit design. Would doing something like putting a 1N4001 diode in series with the regulator output prevent this voltage conflict without requiring the above workarounds?
Here's what a theoretical schematic would look like:

I know the Teensy can be modded to disconnect USB power from the 5V input pin, but I'd like this project to be plug and play with new Teensys and also I occasionally would like to be able to power the digital portion of the circuit through USB only for testing purposes. Currently using a hacked data-only micro usb to program when the main 12V power supply is plugged in as a workaround.
I'm wondering if there is a good way around this in the circuit design. Would doing something like putting a 1N4001 diode in series with the regulator output prevent this voltage conflict without requiring the above workarounds?
Here's what a theoretical schematic would look like:
