I was surprised to find out that plugging a DVI to HDMI cable into my Lenovo X220 docking station allowed me to use the audio channel of the HDMI connection. However, setting it up required a bit of trial and error.
Open your sound settings and click the "Hardware" tab. You can then choose a "Profile" from the drop down. There are lots of profiles to choose from and many of them mention HDMI. For me, somewhat inexplicably, "Digital Stereo (HDMI) nr 3 Output" is the correct one.
To verify that the chosen profile is the correct one, click the "Test Speakers" button. I found that it can take a few seconds for the profile selection to take effect. So count to ten before testing.