This excerpt[1] from "Surely you're joking, Mr. Feynman" comes to mind. Detailing a stage where Feynman lost his passion for physics and regained it by studying things purely for the satisfaction of his curiousity and the enjoyment of the process.
He says, "Feynman, that's pretty interesting, but what's the importance of it?"
"Why are you doing it?"
"Hah!" I say.
"There's no importance whatsoever. I'm just doing it for the fun of it."
[1]: http://www.physics.ohio-state.edu/~kilcup/262/feynman.html
Fast forward few weeks, I started reading specs of MP3 format and created a reader of ID3 tag in PHP[1] and I am back to normal, the obsession about coding is back as it.
As @serji tells, find something new, try to create something about it and its just matter of some time when your passion will be back as usual. Good luck.
[1]: https://github.com/shubhamjain/PHP-ID3