A pathway for ZnO p-type transformation and its performance in solar cells