  We constrain $f(R)$ and chameleon-type modified gravity in the framework of
the Berstchinger-Zukin parametrization using the recent released Planck data,
including both CMB temperature power spectrum and lensing potential power
spectrum. Some other external data sets are included, such as BAO measurements
from the 6dFGS, SDSS DR7 and BOSS DR9 surveys, HST $H_0$ measurement and
supernovae from Union2.1 compilation. We also use WMAP9yr data for consistency
check and comparison. For $f(R)$ gravity, WMAP9yr results can only give quite a
loose constraint on the modified gravity parameter $B_0$, which is related to
the present value of the Compton wavelength of the extra scalar degree of
freedom, $B_0<3.37$ at $95\% {\rm C.L.}$ We demonstrate that this constraint
mainly comes from the late ISW effect. With only Planck CMB temperature
power-spectrum data, we can improve the WMAP9yr result by a factor $3.7$
($B_0<0.91$ at $95\% {\rm C.L.}$). If the Planck lensing potential
power-spectrum data are also taken into account, the constraint can be further
strenghtened by a factor $5.1$ ($B_0<0.18$ at $95\% {\rm C.L.}$). This major
improvement mainly comes from the small-scale lensing signal. Furthermore, BAO,
HST and supernovae data could slightly improve the $B_0$ bound ($B_0<0.12$ at
$95\% {\rm C.L.}$).For the chameleon-type model, we find that the data set
which we used cannot constrain the Compton wavelength $B_0$ and the potential
index $s$ of chameleon field, but can give a tight constraint on the parameter
$\beta_1=1.043^{+0.163}_{-0.104}$ at $95\% {\rm C.L.}$ ($\beta_1=1$ in general
relativity), which accounts for the non-minimal coupling between the chameleon
field and the matter component. In addition, we find that both modified gravity
models we considered favor a relatively higher Hubble parameter than the
concordance LCDM model in general relativity.
