The writ may be granted by any judge of the circuit or criminal courts, or by any chancellor in cases of equitable cognizance.