Modifying Mega2560's 16u2

I want to customize my mega2560's 16u2 chip in order to provide USB charging.

In my case I'm using: D-,D+ & GND to provide UART connection, power wire (VCC) is not connect to Mega's USB port but on other side of USB connection is placed a charger over common GND (ends with female USB socket).

The problem is ... when phone is connected to this USB port the amperage drain is always low (~150 milliamps), when D+,D- are grounded amperage drain goes to 500 milliamps.
So! I want to reprogram 16u2 to put LOW over USB data pins after 2 minutes if USB communication is not used. Where can i find original firmware of chip to modify it?

Also is it possible to implement Quick Charge protocol over those USB pins?
(I'm still not familiar with Arduino hardware for USB communication)

The firmware for 16u2 got moved when the AVR core was split out of the IDE, it is now at:

I have no clue about USB charging.

Source code is a part of Arduino SW, in Arduino folder:
..\hardware\arduino\avr\firmwares\atmegaxxu2\arduino-usbserial

No, you cannot do quickcharge. You could probably rig it to put the static voltages on those pins (with external resistors) to tell chargers to give it the full 2A (but the PTC fuse on the arduino limits USB current to 500mA).

But actual Quickcharge negotiates with the charger to tell it to put 7.5 or 9v on the "5v" USB line. This would nuke the 16u2 (the 16u2 can be burned out by staring at it intently and imagining a voltage spike on the power rail....)

DrAzzy:
No, you cannot do quickcharge. You could probably rig it to put the static voltages on those pins (with external resistors) to tell chargers to give it the full 2A (but the PTC fuse on the arduino limits USB current to 500mA).

But actual Quickcharge negotiates with the charger to tell it to put 7.5 or 9v on the "5v" USB line. This would nuke the 16u2 (the 16u2 can be burned out by staring at it intently and imagining a voltage spike on the power rail....)

The Arduino USB 5V is not connected .... like i said D+,D- and GND are connected (on ly for communication)

ron_sutherland, Budvar10 Thanks!