Valence manipulation and homojunction diode fabrication of chalcopyrite structure CuInSe thin films