Some DS4 controllers are prone to USB port failure. If that's the case (troubleshoot the controller to be sure), then you can work around this issue by charging the controller with the official PS4 charging station, simply because that charging station uses the extension port of the DualShock controller to charge the controllers, as opposed to the (possibly faulty) USB port...
https://www.amazon.co.uk/Sony-PlayStation-DualShock-Charging-Station/dp/B00D781PSI







