Optical control of an ion channel gate