I've heard that the "y" variants are actually pretty old, dating from the Middle Ages or something. In names such as
Martyn,
Bryan, Kevyn &c, y and i were probably interchangeable at first, but at one time, the y spelling was actually more popular/the preferred spelling. I don't know if this has anything to do with the letters i and j being interchangeable in names such as Iulia/Julia?