Edinburgh was named for Din Eidyn because it was probably the Castle Rock, an important place in Gododdin.
The capital of the Gododdin was Din Eidyn (the  Fort of Eidyn,  almost certainly the Castle Rock), whose name lives on in the Edin- of Edinburgh.