Синцов заворочался и проснулся с той же мыслью, с какой заснул.
My humble knowledge of Russian grammar tells me that a declension of "который" should be used, instead of a declension of "какой"; that is to say, it should be "... с которой заснул" instead of "...с какой заснул".
Also I often come across constructions like: "Я знаю того, с кем вы говорили" [instead of "... с которым"]. This one seems to be more common in spoken Russian.
My first guess is that the meanings are the same, and the difference is in the degree of formality. What are the grammatical nuances here?