Let $f\in S_k(\Gamma_1(N),\chi)$ be a Hecke eigenform of weight $k\geq 2$, $p$ an odd prime not dividing $N$, and $K_f$ the number field generated by the Hecke eigenvalues of $f$. Fixing a prime $\lambda$ of $K_f$ over $p$, one has the continuous irreducible $p$-adic representation $\rho:G_\mathbf{Q}\rightarrow\mathrm{GL}_2(K_{f,\lambda})$ unramified outside $Np$. If $k$ is the residue field of $K_{f,\lambda}$, reducing a lattice and taking the semisimplification, we get the residual representation $\bar{\rho}:G_\mathbf{Q}\rightarrow\mathrm{GL}_2(k)$. I'm interested in the restriction of $\bar{\rho}$ to a decomposition group $D_p$ at $p$. Specifically, my question is: are there general conditions on $f$ that ensure that the restriction of $\bar{\rho}$ to $D_p$ is flat?
Definition: A finite $G_{\mathbf{Q}_p}$-module $M$ of $p$-power order is said to be flat if it is the generic fiber representation of a finite flat group scheme over $\mathbf{Z}_p$.
The only example I know of is the following when $k=2$, and $f$ corresponds to an elliptic curve $E/\mathbf{Q}$ with good reduction at $p$. In this case the residual representation is just coming from $E[p]$, which is flat at $p$ (i.e. as a $G_{\mathbf{Q}_p}$-module) because it is the generic fiber representation of the $p$-torsion of the Neron model of $E$ over $\mathbf{Z}_p$, and good reduction means the Neron model is an abelian scheme, so its $p$-torsion is finite flat.
I know that the notion of flat representations is used in Wiles' proof of the modularity of semistable elliptic curves over $\mathbf{Q}$, but I don't know if any of the flat representations that are used actually are coming from the residual representations attached to modular forms.