what is the role of atp synthase in photosynthesis