Structural determinants of gating in the TRPV1 channel