Observational constraints on dark energy with generalized equations of state