Hi,
I had the same problem so I sent it in to HTC repair and after 2 weeks they sent me a new phone. this worked for a couple of days and then I started to see the focus problem again.
just refused to focus.
I fixed it by going into Settings > Apps > Camera > Force Stop > clear cache > clear...