  We show that the q-Heun equation and its variants appear in the linear
q-difference equations associated to some q-Painlev\'e equations by considering
the blow-up associated to their initial-value spaces. We obtain the firstly
degenerated Ruijsenaars-van Diejen operator from the linear q-difference
equation associated to the q-Painlev\'e equation of type $E_8$.
