In Thomas Hardy's short(ish) story "The Withered Arm", one of his descriptions of the Wessex countryside features the following cryptic allusion:
It was a long walk; thick clouds made the atmosphere dark, though it was as yet only early afternoon; and the wind howled dismally over the slopes of the heath - not improbably the same heath which had witnessed the agony of the Wessex King Ina, presented to after-ages as Lear.
A quick search showed me that there really was a King Ina of Wessex (the real Wessex of the mid-first millennium, not the "Wessex" that Thomas Hardy created as a semi-fictional setting for his nineteenth-century novels). But his Wikipedia page doesn't mention Lear at all, nor anything about agony on a heath; it seems that Ina died peacefully in Rome after abdicating his kingdom.
Presumably "Lear" refers to Shakespeare's King Lear, who was indeed in agony on a heath. But it seems that Shakespeare's story was based on that of Leir of Britain, a legendary king whose Wikipedia page again makes no mention of King Ina/Ine.
Trying to search the internet for anything mentioning King Ina and King Lear in the same breath, I found a forum thread which relates again to Thomas Hardy, but this time to the 1892 preface of his Tess of the d'Urbervilles, where he mentions "Glo’ster in Lear, otherwise Ina, king of that country". This is interpreted by the forum posters as identifying Glo'ster with Ina, which would contradict Hardy's identification in "The Withered Arm" of Ina with Lear.
Where does the identification of the historical King Ina with character(s) in Shakespeare's King Lear originate? Is there, or was there in Hardy's time, any theory among Shakespeare scholars (or Geoffrey of Monmouth scholars) that the story of King Lear/Leir was based on anything involving King Ina? Did Hardy come up with this idea himself, or was he referring to some known historical literary theory?