Edinburgh was not named after anyone. For centuries people read it as "Edwin's burgh," the stronghold of a 7th-century Northumbrian king. The trouble is that the place already had its name.
The older form was Din Eidyn. Din means a fort, and Wikipedia describes Din Eidyn as a dun, or hillfort. Eidyn was the place name. Some scholars think it covered only the site of the city, while others think it named a wider district. The language was Brittonic, the Celtic tongue of the Gododdin, the people who held this part of southern Scotland.
Din Eidyn first appears in Y Gododdin, a poem about the Battle of Catraeth, fought around 600. Its oldest surviving copy, in the Book of Aneirin, dates from about 1265, and scholars disagree about when the poem was first composed. Even so, the form Eidyn predates Edwin. That is why modern scholarship rejects the Edwin explanation.
Only the first half of the name changed. Once English speakers controlled the area, they swapped din for their own word for a fort, Old English burh. Eidyn plus burh settled into Edinburgh. Etymonline suggests Din Eidyn may mean "fort on a slope," though it offers that reading with a "perhaps."
The Edwin version has its own paper trail. A charter of King David I, from about 1124 to 1127, calls the town "Edenesburg," and the Holyrood charter uses a form built on Edwin's name. The historian Stuart Harris called that Edwin form "a palpable fake" from the time of David I.
Scottish Gaelic stayed closer to the original. Its name for the city, Dùn Èideann, comes directly from the Brittonic Din Eidyn. That Gaelic form later traveled to the other side of the world. Dunedin in New Zealand, first called New Edinburgh, takes its name from it, and Etymonline describes it as an attempt to recreate the original form.
Poets went the other way and trimmed the name down. Robert Burns and Robert Fergusson both used Edina. Burns opened one poem with "Edina! Scotia's darling seat!"
So the capital's name is a Celtic district name with an English word for "fort" attached. Edwin's name only ever turned up as a later respelling, and it did not last.