In a quasi-particle model of QCD matter at finite temperature with thermal masses for quarks and gluons from hard thermal loops, the equation of state (EOS) can be described by an effective temperature dependence of the strong coupling g(T). Assuming the same effective coupling between the exchanged gluon and thermal partons, the EOS can also be related to parton energy loss. Based on the quasi-particle linear Boltzmann transport (QLBT) model coupled to a (3+1)-dimensional viscous hydrodynamic model of the quark-gluon plasma (QGP) evolution and a hybrid fragmentation-coalescence model for heavy quark hadronization, we perform a Bayesian analysis of the experimental data on D meson suppression RAA and anisotropy v2 at RHIC and the LHC. We achieve a simultaneous constraint on the QGP EOS and the heavy quark transport coefficient, both consistent with the lattice QCD results.