It's happened to me two or three times in the 40+ years I've been into photography. For me, it usually coincides with a life change - change job, divorce, death of my parents and I put it down to other, more pressing things to deal with.
When I realise it's happened, the first thing I've tended to do is look at my photos and see what I've been most interested in and then depending on the season - decide whether I can get back in the saddle (so to speak) to shoot one of my interests. Going somehere I haven't been before - but with a specific objective of checking out its history, geography, etc has also helped. The other thing I've done is gone to a good bookshop and got a book by someone I like (or someone new and interesting) and tried to work out how they shot what I like - and then have a go to see if I can get similar results.
The thing is not to worry. If I ever got to the point where I couldn't face photography anymore, I would find something else.