Optogenetic feedback control of neural activity