Also see figure 3 of https://www.onsemi.com/pub/collateral/and8074-d.pdf which gives a schematic of USB lines and says "if a 1.5 k pull up resistor is connected on either the D+ or D− line, the port is identified as upstream". Unfortunately downstream devices have pull-down to ground, so when not being driven would rest at low voltage, which I can't think of a great way to help to distinguish downstream USB from headphones.