After going through a few references on the web (here, here and here), I was finally able to connect my Nexus 4 to TV and play game using a PS3 DualShock 3 controller. To summarize, here is what you need to do :
- You need a Slimport to HDMI adapter. The currently available one is SP1002, from Analogix. I bought it from iBhejo.
- Need to have a DualShock3 controller, it comes with PS3. (or you can buy it). There are reports of other controller working also, but I didn’t check them personally.
- Need to root your phone. This has two steps – first, unlock the bootloader, second, install the actual rooting app by temporarily booting into a custom bootloader. Note that you will still retain your stock bootloader and will continue to get updates from Google (as per the details on the thread).
- Need to buy the sixaxis controller software from google play. This works only on rooted phones.
- Nexus 4 Gaming thread – http://forum.xda-developers.com/showthread.php?t=2056090
- Sixaxis controller touch profiles – http://forum.xda-developers.com/showthread.php?t=1426760
- Setting up sixaxis from Linux – http://www.blog.kaiserapps.com/2012/10/setting-up-sixaxis-controller-android.html