I have been doing some rudimentary research into kissing the tefillin while davening. This question discusses some of the traditions about when to kiss and provides some late sources (the Shulchan Aruch from the 16th century and the Ben Ish Hai from the 19th). Another site referenced the Mishna Brurah (also 19th). But I am looking for the sources for the practice that these codes are pointing to. I would like to assume that the practice was not invented by the Shulchan Aruch and has some basis in something.
If anyone can provide an early source for it, especially talmudic, that would be great.