Generalized treatment of neutron-proton pairing in N = Z nuclei