Here's an accepted answer for the P1522 code on a Mazda Milennia that I found on a respected Internet site: Code P1522 is for a circut malfunction in the variable resonance induction system. This can mean the #2 solenoid is bad or it has an open or shorted circut to the #2 solenoid circut. If you test the solenoid and its ok, test the wiring between the solenoid, the relay and the computer, and if that's ok you would have a computer problem. But most likely there is a solenoid or wiring issue.
I saw another post about the P0170 code; which is translated as "Bank 1 fuel trim malfunction". This problem is usually the result of a vacuum leak in a hose or other vacuum related device connected to cylinder bank 1. So the simplest thing to check is for a vacuum leak. But on one vehicle, it ended up being corrected by checking and resetting the ignition timing. If the ignition timing on your Milennia is checked, using the proper procedure; and turns out OK, it might be worthwhile to try using premium fuel.
And please bear in mind that after repairs are made, the computer must have any stored codes cleared with a scanner; before the engine will run normally.
I hope this helps!!!