The rule is any USED vehicle which is equipped with the necessary Federal Emission Components is eligible for California registration as long as the vehicle's exhaust emissions fall within California's limits (for older vehicle; 99 & older) and the vehicle's emission system has not been tampered with. This exemption does not apply to new vehicles.
Keep in mind, your Mazda CX7 may already be California emissions certified. Checking the underhood emissions label will let you know. Look for a mention of either 49-State Emissions or 50-State (California) Emissions certification.
Either way, as mentioned above, since the vehicle is considered a USED vehicle, it is eligible for California registration as long as it passes California's smog inspection. Late model vehicle (2000 & newer) do not have the tailpipe emission portion of the smog check administered, and need to only pass an OBD-II systems check and visual inspection.