The development of new and efficient donor-acceptor (D-A)-type π-conjugated polymers has attracted significant attention in the field of organic electronics owing to their fascinating features. Herein, we explore a new and efficient D-A-type π-conjugated polymer, poly[4,8-bis(2-(4-(2-ethylhexyloxy)phenyl)-5-thienyl)benzo[1,2-b:4,5-b′]dithiophene-alt-1,3-bis(6-octylthieno [3,2-b]thiophen-2-yl)-5-(2-hexyldecyl)-4H-thieno[3,4-c]pyrrole-4,6(5H)-dione] (P-TT-TPD) for perovskite solar cells (PSCs) and organic solar cells (OSCs). The well suited energy levels, high mobility, solution processability, high dipole moment difference between the ground and excited states and better passivation of P-TT-TPD delivered a high power conversion efficiency (PCE) of 17.10% and 17.56% in dopant-free and tris(pentafluorophenyl)borane-doped PSCs, respectively, with negligible hysteresis factor. To the best of our knowledge, this is the only polymer hole transporting material (HTM) showing negligible hysteresis factor values in both pristine and doped states. Moreover, P-TT-TPD was also used as a photoactive donor material in fullerene-based OSCs and it displayed a decent PCE of 6.19%. These study results demonstrate that the molecular engineering of a D-A-type π-conjugated polymer is an effective strategy to design multi-functional π-conjugated materials capable of working as both an HTM and a photoactive donor material.