Jamie Foxx has said he helped the fledgling Ed Sheeran by letting him stay on his sofa for several weeks to allow him to practise his craft.