I installed it because it didn't work with the one that PBI CE installed, so I decided to get creative and I followed that link about patching kexts on the fly.
But after following your and RehabMan's advice I was able to get it working.
I have removed the kext (sudo rm -rf S/L/E/AppleHDAIDT.kext ), and re-run PBI CE ticking the box for the 4x40s kexts. I've done Repair permissions (via Disk Utility). Boot without caches (pressing space in clover). Rebuild cache (Kext Wizard). Reboot 2x. On the second time the sound was working (The volume didn't appear in the menu bar but the sound was working, added the volume to the menu bar in the System Preferences). The buttons in the keyboard that control the volume also work (although I don't need to press the fn key to activate it, I might have to check if that is toggled in the BIOS or what)
I don't really know why it didn't work on the other times I installed via PBI CE (I've formatted the disk and followed the guide several times). But I think it might be RehabMan's trick of "Repair permissions (via Disk Utility). Boot without caches (pressing space in clover). Rebuild cache (Kext Wizard). Reboot 2x.".
Thank you very much, I think you guys are awesome. Judging by the 4540s booting OSX perfectly is very easy. I bought the 4540s because I needed a working OSX. It had it with Chameleon + Mavericks for some months and now I'm very happy that it is working with Yosemite (I needed to update XCode).
Thank You!