Idle Switch
WARNING: This page is about a different car, the 1995 Mazda MX-6 and 1995 Mazda 626. However, it is still accessible from the selected car via links, so may be relevant.
Disconnect idle switch electrical connector. Check continuity between ground and switch lead. Continuity should exist with throttle valve fully closed. Continuity should not exist with throttle valve open. If continuity is not as specified, replace idle switch and throttle body as an assembly.