Over by Kumbakonam is where you head, when your troubles are literally in your head. The Thiruvidaimarudur shrine, 9km from the town, is renowned for granting relief from mental ailments. It is also the birthplace of flautist T.R. Mahalingam, presumably no relation to the patron deity of the same name, Sri Mahalinga Swamy.
Among the interesting mythologies of this place: the original lingam is swayambhu (self apparent) in the form of a maruth tree and Shiva supposedly worshipped his own image here. Worth looking out for are the 27 nakshatras around the main shrine and the image of brahmahati (sin of slaying a brahmin) outside, supposedly left there by King Varaguna, who came here to be freed of it. It is since then, they say, that all evil spirits — and thus afflictions of the mind — can be left here in the Lord’s hands, provided the supplicant leaves by a different door than the one through which he entered. thiruvidaimarudur.com