Donor and acceptor competitions in phosphorus-doped ZnO