map of maf, its what controls start up. the test is simple, disconect and start. if your idle is better theres the issue, also once running with it conected, dis connect. it should die out. this is in turn feed to the computer when put into gear and the AiC then controls the idle. its balnce with the EGR( mazda is unquie because its used to cool the temp down) and the purge canister. The vacume switches that control that all can be an issue.
the idle is controled by the AIC. its atop the throttle body. To simply test it, remove the wire connector and use a 9 volt battery/w wire leads to leads and tap one end off and on, listen for a click from the valve opening. If its not, remove it from throttle body and repeat test to see if the plunger moves. Try cleaning it, clogs up now and agaian.If you cant get it to move agian , its gone and replace it.